dart_stl 0.0.4 copy "dart_stl: ^0.0.4" to clipboard
dart_stl: ^0.0.4 copied to clipboard

A package for reading and writing STL files using structures from the vector_math package

example/dart_stl_example.dart

import 'dart:io';

import 'package:dart_stl/stl_reader.dart';
import 'package:dart_stl/stl_writer.dart';
import 'package:vector_math/vector_math_64.dart' show Triangle;

void main() {
  /// Read STL file, returning a list of Triangle
  File bunnyFile = File('bunny.stl');
  List<Triangle>? tris = StlReader.loadSTLFile(bunnyFile);

  /// Write a list of Triangles to an STL file
  StlWriter.writeSTL("bunny2.stl","bunny",tris!);

  /// Write a list of Triangles to a string
  String bunnySTL = StlWriter.toSTL("bunny",tris);

  // Convert string back into list of Triangle
  List<Triangle>? bunnyTriangles2 = StlReader.fromSTL(bunnySTL);
}
0
likes
150
points
168
downloads

Publisher

verified publishernosupports.com

Weekly Downloads

A package for reading and writing STL files using structures from the vector_math package

Homepage

Documentation

API reference

License

BSD-3-Clause (license)

Dependencies

flutter, vector_math

More

Packages that depend on dart_stl