-
Notifications
You must be signed in to change notification settings - Fork 591
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
mikedh
wants to merge
73
commits into
main
Choose a base branch
from
refactor/loadtype
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This was referenced Sep 3, 2024
Updated use of weights in procrustes analysis (update to #1647)
Fix nearest.ipynb Typo
Updates the GLTF/GLB reader to include point cloud colors if available.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
A very common source of annoyance and confusion is that
trimesh.load
can return lots of different types depending on what type of file was passed (i.e. #2239). This refactor changes the return types for the loading functions to:trimesh.load_scene -> Scene
Scene
, the most general container which can hold any loadable type. Most people should probably use this to load geometry.trimesh.load_mesh -> Trimesh
Trimesh
object. This potentially has to drop information and irreversibly concatenate multiple meshes.Scene.to_mesh
rather than load.trimesh.load_path -> Path
Path2D
orPath3D
which both inherit fromPath
trimesh.load -> Geometry
load_scene
that attempts to match the behavior of the previous loader for backwards compatibility. In my testing against the currentmain
branch it was returning the same types 99.8% of the time although there may be other subtle differences.trimesh.load(..., force='mesh')
will emit a deprecation warning in favor ofload_mesh
trimesh.load(..., force='scene')
will emit a deprecation warning in favor ofload_scene
Additional changes:
Geometry.metadata['file_path']
in favor ofGeometry.source.file_path
. Everything that inherits fromGeometry
should now have a.source
attribute which is a typed dataclass. This was something of a struggle asfile_path
was populated into metadata on load, but we also try to make suremetadata
is preserved through round-trips if at all possible. And so theload
inserted different keys into the metadata. Making it first-class information rather than a loose key seems like an improvement, but users will have to replacemesh.metadata["file_name"]
withmesh.source.file_name
.WebResolver
so it can be more easily gated byallow_remote
.trimesh.resources.get
in favor of the typed alternatives (get_json
,get_bytes
, etc).trimesh.graph.smoothed
in favor oftrimesh.graph.smooth_shaded
.Path3D.to_planar
->Path3D.to_2D
to be consistent withPath2D.to_3D
.