Skip to content

Commit

Permalink
Remove rescalling for 3dxml. (#321)
Browse files Browse the repository at this point in the history
  • Loading branch information
iory authored Dec 3, 2023
1 parent bc1f99d commit 7752de8
Showing 1 changed file with 3 additions and 5 deletions.
8 changes: 3 additions & 5 deletions skrobot/utils/urdf.py
Original file line number Diff line number Diff line change
Expand Up @@ -252,11 +252,9 @@ def _load_meshes(filename):
_, ext = os.path.splitext(filename)
# It seems that .3DXML files assume [mm] unit.
# Convert the mesh unit from [mm] to [m].
if ext.lower() in ['.3dxml']:
meshes = trimesh.load(filename)
meshes = meshes.scaled(0.001)
else:
meshes = trimesh.load(filename)
# To convert the mesh unit from millimeters to meters,
# use the function meshes.convert_units('meter').
meshes = trimesh.load(filename)
if meshes.units is not None and meshes.units != 'meter':
meshes = meshes.convert_units('meter')
except Exception as e:
Expand Down

0 comments on commit 7752de8

Please sign in to comment.