Skip to content

Replace tinystl with stl_io to support more stl files#9997

Merged
Wumpf merged 6 commits intomainfrom
gijs/binary-stl
May 21, 2025
Merged

Replace tinystl with stl_io to support more stl files#9997
Wumpf merged 6 commits intomainfrom
gijs/binary-stl

Conversation

@oxkitsune
Copy link
Member

@oxkitsune oxkitsune commented May 19, 2025

What

This replaces tinystl with stl_io in our stl parser, because some binary stl files (e.g. g1 right_wrist_yaw_link.STL) could not be parsed, resulting in a warning:

 Failed to load mesh "../unitree_ros/robots/g1_description/meshes/right_wrist_yaw_link.STL": Error loading STL mesh: Error { kind: InvalidData, message: "stream did not contain valid UTF-8" }

Using stl_io this mesh is parsed correctly.

TODO:

  • Currently this uses an empty string for the mesh name as debug label, as stl_io does not expose this field. This is in line with the behavior of tinystl for meshes without a name. I opened a PR that exposes the mesh name: Add optional mesh name hmeyer/stl_io#26

@oxkitsune oxkitsune added enhancement New feature or request 📺 re_viewer affects re_viewer itself dependencies concerning crates, pip packages etc include in changelog labels May 19, 2025
@github-actions
Copy link

github-actions bot commented May 19, 2025

Web viewer built successfully. If applicable, you should also test it:

  • I have tested the web viewer
Result Commit Link Manifest
7f0d9b9 https://rerun.io/viewer/pr/9997 +nightly +main

Note: This comment is updated whenever you push a commit.

@Wumpf
Copy link
Member

Wumpf commented May 20, 2025

please make sure to test this with a wide variety of STL files

Copy link
Member

@Wumpf Wumpf left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

See comments above. Thanks for the manual testing earlier (Slack message pointed out testing done!), but a bit of that has to be redone with the proposed improvements

Copy link
Member

@Wumpf Wumpf left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This library makes me unhappy since I don't think its datastructures make any sense in the context of STL. But whatever, if we ever care deeply about loading performance here, we can fork it proper later. It loading more files is obviously more important!

good to land if collect issue & crate question are addressed!

@oxkitsune oxkitsune requested a review from Wumpf May 21, 2025 12:53
@Wumpf Wumpf merged commit d3e6abb into main May 21, 2025
39 checks passed
@Wumpf Wumpf deleted the gijs/binary-stl branch May 21, 2025 20:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

dependencies concerning crates, pip packages etc enhancement New feature or request include in changelog 📺 re_viewer affects re_viewer itself

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants