Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Release: Refactor Load Types #2241

Open
wants to merge 42 commits into
base: main
Choose a base branch
from
Open

Release: Refactor Load Types #2241

wants to merge 42 commits into from

Conversation

mikedh
Copy link
Owner

@mikedh mikedh commented Jun 13, 2024

A very common source of annoyance and confusion is that trimesh.load can return lots of different types (this fixes #2239, etc). This re-factor changes the return types to:

  • trimesh.load -> Geometry
    • this is now a thin wrapper around load_scene but with a mapping of what the old function used to do, and a deprecation warning saying you should use load_scene.
  • trimesh.load_scene -> Scene
    • the most general container which can hold any loadable type.
    • most people should probably use this
  • trimesh.load_mesh -> Trimesh
    • does the equivalent of `trimesh.load(force='mesh') which does potentially drop information.
    • the trimesh.load(..., force='mesh') will be deprecated in favor of load_mesh
  • trimesh.load_path -> Path
    • these can be Path2D or Path3D which both inherit but is still a little outside the spirit of "functions should return the same type always." Maybe a force_dimension argument could be here.

Additional changes:

This was referenced Sep 3, 2024
@mikedh mikedh changed the title [WIP] Refactor Load Types Release: Refactor Load Types Jan 2, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
3 participants