dart_stl 0.0.6 copy "dart_stl: ^0.0.6" to clipboard
dart_stl: ^0.0.6 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);
}
1
likes
160
points
46
downloads

Documentation

API reference

Publisher

verified publishernosupports.com

Weekly Downloads

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

Homepage

License

BSD-3-Clause (license)

Dependencies

flutter, vector_math

More

Packages that depend on dart_stl