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

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

Introduction #

A 100% dart library for reading and writing STL files, a 3D file format widely used in 3D printing.

Features #

The initial release only supports reading and writing ASCII STL files. Binary support will be added in a future release.

Getting started #

This package requires the vector_math package. Install it first.

 $ flutter pub add vector_math

Examples #

1. Read an STL file from a File into a List of Triangles

import 'package:dart_stl/stl_reader.dart';

File bunnyFile = File('bunny.stl');
List<Triangle>? tris = StlReader.loadSTL(bunnyFile);

2. Write a List of Triangles to an STL file

import 'package:dart_stl/stl_writer.dart';

List<Triangle> bunnyTriangles = ...
File bunnyFile = File('bunny.stl');

StlWriter.writeSTL(bunnyTriangles,"bunny",bunnyFile);

3. Write/read STL data to/from a String

List<Triangle> bunnyTriangles = ...
String bunnySTL = StlWriter.toSTL(bunnyTriangles,"bunny");
List<Triangles> 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