Conversation
3dbe537 to
b3e3e65
Compare
examples/raw_mesh/src/main.rs
Outdated
| // TODO(cmc): This should probably just be a compile flag of the SDK; if it's enabled, then the | ||
| // global allocator is properly set by the SDK directly. | ||
| #[global_allocator] | ||
| static GLOBAL: AccountingAllocator<mimalloc::MiMalloc> = | ||
| AccountingAllocator::new(mimalloc::MiMalloc); |
There was a problem hiding this comment.
Eeeeh then again in python it works nicely because it really only affects the SDK and not the user code (by virtue of the user code not being Rust to begin with), but in Rust it will affect everything, user code included, which seems too magical for Rust...
Scratch it.
There was a problem hiding this comment.
(Though we will of course reexports all the needed libraries and types to make it easier for the user)
| fn node_name(node: &gltf::Node<'_>) -> String { | ||
| node.name() | ||
| // TODO(cmc): now that index-paths and instance-keys are decorrelated, maybe we can use | ||
| // those here. | ||
| .map_or_else(|| format!("node_#{}", node.index()), ToOwned::to_owned) | ||
| } |
There was a problem hiding this comment.
Note: for e.g. Buggy.glb I'm able to find names for the nodes when going through trimesh, contrary to the current rust version which finds nothing... there's probably some missing logic here.
|
|
||
| let mut slf = Self::load_raw(name, *format, bytes, render_ctx)?; | ||
|
|
||
| // TODO(cmc): Why are we creating the matrix twice here? |
There was a problem hiding this comment.
looks like some attempt to avoid shearing? But I really don't see the point.
|
For another PR: I think we should split Python examples from Rust examples, and not have them in the same folder.
|
| let mesh_in = vec![Mesh3D::Encoded(EncodedMesh3D { | ||
| mesh_id: MeshId::random(), | ||
| format: MeshFormat::Glb, | ||
| bytes: std::sync::Arc::new([5, 9, 13, 95, 38, 42, 98, 17]), |
There was a problem hiding this comment.
Maybe leave a note about the source of this data? Or is it random junk?
Co-authored-by: Emil Ernerfeldt <[email protected]>


This implements triangle soups, but most importantly it identifies a lot of the pain points in our current Rust SDK, which I'll address in a PR that'll follow shortly.
Fixes #749 and fixes #809.
Test it with
cargo r -p raw_mesh