You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
fix: scale VTK mm coordinates to meters when exporting to OpenUSD (#45)
* fix: scale VTK mm coordinates to meters when exporting to OpenUSD
VTK/medical imaging uses millimeters; OpenUSD stages declaring
metersPerUnit=1.0 require meter-scale geometry. Previously ras_points_to_usd()
performed only a RAS→Y-up axis swap, writing raw mm values into USD while the
stage metadata claimed they were meters — making a 100 mm structure appear as
100 meters in viewers.
Changes:
- ras_to_usd() and ras_points_to_usd(): apply * 0.001 (mm → m) during the
axis-swap so all point coordinates in USD are in meters.
- ras_normals_to_usd(): decoupled from ras_points_to_usd(); performs axis swap
only with no unit scaling (normals are unit direction vectors).
- usd_tools.py merge_usd_files / merge_usd_files_flattened: fix inconsistent
metersPerUnit from 0.01 (centimeters) to 1.0 (meters) to match converter output.
- save_usd_file_arrangement: update grid spacing from 400.0 mm to 0.4 m.
- Add TestUnitScaling tests verifying point scaling, normal length preservation,
and stage metersPerUnit metadata.
Breaking change: all generated USD files will have coordinates 1000× smaller
than before (meter scale instead of millimeter scale).
https://claude.ai/code/session_01L8zowmsyVqXNkZaQivxgc8
* FIX:Fix USD meter scaling and default geometry samples
Author default values for time-sampled mesh points, extents, and normals so
Omniverse/default-time readers can load single-frame and mixed static/animated
USD content correctly.
Allocate float arrays during RAS-to-USD coordinate conversion to avoid
truncating meter-scaled integer inputs, and update USD merge documentation to
match metersPerUnit=1.0.
* DOC: Minor doc update
* COMP: Eliminate copying large array that isn't needed.
---------
Co-authored-by: Claude <noreply@anthropic.com>
0 commit comments