STL is a very simple format, which supports only triangular geometry (positions + normals), without any color / uv / texture information.
It is supported as an output format by most CAD software.
bevy_stl
to your Cargo.toml
bevy_stl::StlPlugin
plugin to the bevy App
asset_server.load(..)
```rust fn main() { App::new() .addplugin(bevystl::StlPlugin) .addstartupsystem(setup) // ... .run(); }
fn setup(commands: &mut Commands, assetserver: Res
You can find a more complete example in examples/spinning_disc.rs
- use cargo run --example spinning_disc --release
to run it.
By default bevy_stl
produces a triangle mesh (PrimitiveTopology::TriangleList
).
When the optional wireframe
feature is enabled, an additional line mesh is produced (PrimitiveTopology::LineList
).
The feature can be enabled via Cargo.toml:
[dependencies.bevy_stl]
features = ["wireframe"]
When enabled, the mesh can be accessed by appending the wireframe label to the path passed to the asset loader: ``` // This returns the triangle mesh (the default): asset_server.load("disc.stl")
// This returns the wireframe mesh: asset_server.load("disc.stl#wireframe") ```