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

[WIP] Refactor Load Types #2241

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

[WIP] Refactor Load Types #2241

wants to merge 5 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 (i.e. #2239, etc). This re-factor changes the return types to:

  • trimesh.load -> Geometry
    • stays mostly as-is but use is discouraged
  • 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.

This requires some deprecation notices and careful thinking so I'll leave it open for a while.

This was referenced Sep 3, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant