trimesh icon indicating copy to clipboard operation
trimesh copied to clipboard

[WIP] Refactor Load Types

Open mikedh opened this issue 1 year ago • 0 comments

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.

mikedh avatar Jun 13 '24 21:06 mikedh