Commit 7523ff3
authored
ENH:VTK_To_USD and ConvertVTKToUSD consolidation (#44)
* Consolidate VTK-to-USD conversion under ConvertVTKToUSD as single API
- Add from_files() classmethod to ConvertVTKToUSD, accepting file paths and
loading via pv.read(); adds separate_by, solid_color, static_merge, time_codes
- Add _convert_static_merge() method for multi-file static scenes
- Add _convert_unified() splitting logic via split_mesh_data_by_connectivity /
split_mesh_data_by_cell_type imported from vtk_to_usd internals
- Rewrite WorkflowConvertVTKToUSD.run() to call ConvertVTKToUSD.from_files()
exclusively; update post-processing scan path from /World/Meshes to
/World/{mesh_name}
- Delete vtk_to_usd/converter.py (VTKToUSDConverter and helpers removed)
- Remove VTKToUSDConverter / convert_vtk_file / convert_vtk_sequence from
vtk_to_usd/__init__.py exports; update module docstring
- Remove vtk_to_usd from physiomotion4d top-level __init__.py public API
- Update three experiment scripts to use ConvertVTKToUSD.from_files()
- Rewrite test_vtk_to_usd_library.py tests to use ConvertVTKToUSD; update
all prim-path assertions from /World/Meshes/X to /World/X/Mesh
- Regenerate docs/API_MAP.md
https://claude.ai/code/session_01B16tgwah5XemvxzrGpzUZj
* STYLE: Fix ruff formatting
* FIX: Harden ConvertVTKToUSD input validation and label time-code alignment
Validate time_codes length and non-decreasing order in from_files(); propagate extract_surface to convert_to_surface so surfaces are not extracted twice; align per-label time codes to the frames actually present rather than using the full series; use data_basename in static-merge prim names; remove dead up_axis/triangulate from WorkflowConvertVTKToUSD and its CLI; discover vessel prim dynamically in experiment scripts; add diffuseColor assertion to material test.
* ENH: Cache topology-validation mesh data; always author time-varying prims
Populate _cached_mesh_data in from_files() so _convert_unified() reuses
the MeshData built during topology validation instead of converting VTK a
second time. Remove the single-frame shortcut that called create_mesh();
create_time_varying_mesh() is now used unconditionally so every prim
carries explicit time samples. Add 12 synthetic tests covering the cache
(Gap B), time-codes validation (Gap A), single-frame time samples (Gap C),
static-merge prim naming (Gap E), and mask_ids label filtering (Gap D).1 parent debdcb0 commit 7523ff3
12 files changed
Lines changed: 770 additions & 1197 deletions
File tree
- docs
- experiments/Convert_VTK_To_USD
- src/physiomotion4d
- cli
- vtk_to_usd
- tests
Large diffs are not rendered by default.
Lines changed: 36 additions & 58 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
37 | 37 | | |
38 | 38 | | |
39 | 39 | | |
40 | | - | |
41 | | - | |
42 | | - | |
43 | | - | |
44 | | - | |
45 | | - | |
46 | | - | |
47 | | - | |
48 | | - | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
49 | 45 | | |
50 | 46 | | |
51 | 47 | | |
| |||
71 | 67 | | |
72 | 68 | | |
73 | 69 | | |
74 | | - | |
75 | | - | |
76 | | - | |
77 | | - | |
78 | | - | |
79 | | - | |
80 | | - | |
81 | | - | |
82 | | - | |
83 | | - | |
84 | | - | |
85 | | - | |
86 | | - | |
87 | | - | |
88 | | - | |
89 | | - | |
90 | | - | |
91 | | - | |
92 | | - | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
93 | 74 | | |
94 | 75 | | |
95 | 76 | | |
| |||
155 | 136 | | |
156 | 137 | | |
157 | 138 | | |
158 | | - | |
159 | | - | |
160 | 139 | | |
161 | 140 | | |
162 | 141 | | |
| |||
168 | 147 | | |
169 | 148 | | |
170 | 149 | | |
171 | | - | |
172 | | - | |
173 | | - | |
174 | | - | |
175 | | - | |
176 | | - | |
177 | | - | |
178 | | - | |
179 | | - | |
180 | | - | |
181 | | - | |
182 | | - | |
183 | | - | |
184 | | - | |
185 | | - | |
186 | | - | |
187 | | - | |
188 | | - | |
189 | | - | |
190 | | - | |
191 | | - | |
| 150 | + | |
| 151 | + | |
| 152 | + | |
| 153 | + | |
| 154 | + | |
| 155 | + | |
| 156 | + | |
| 157 | + | |
192 | 158 | | |
193 | | - | |
194 | | - | |
| 159 | + | |
195 | 160 | | |
196 | 161 | | |
197 | 162 | | |
198 | | - | |
199 | | - | |
200 | | - | |
201 | | - | |
| 163 | + | |
| 164 | + | |
| 165 | + | |
| 166 | + | |
| 167 | + | |
| 168 | + | |
| 169 | + | |
| 170 | + | |
| 171 | + | |
| 172 | + | |
| 173 | + | |
| 174 | + | |
| 175 | + | |
| 176 | + | |
| 177 | + | |
| 178 | + | |
| 179 | + | |
202 | 180 | | |
203 | | - | |
| 181 | + | |
204 | 182 | | |
205 | 183 | | |
206 | 184 | | |
| |||
Lines changed: 32 additions & 58 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
36 | 36 | | |
37 | 37 | | |
38 | 38 | | |
39 | | - | |
40 | | - | |
41 | | - | |
42 | | - | |
43 | | - | |
44 | | - | |
45 | | - | |
46 | | - | |
47 | | - | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
48 | 44 | | |
49 | 45 | | |
50 | 46 | | |
| |||
70 | 66 | | |
71 | 67 | | |
72 | 68 | | |
73 | | - | |
74 | | - | |
75 | | - | |
76 | | - | |
77 | | - | |
78 | | - | |
79 | | - | |
80 | | - | |
81 | | - | |
82 | | - | |
83 | | - | |
84 | | - | |
85 | | - | |
86 | | - | |
87 | | - | |
88 | | - | |
89 | | - | |
90 | | - | |
91 | | - | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
92 | 73 | | |
93 | 74 | | |
94 | 75 | | |
| |||
154 | 135 | | |
155 | 136 | | |
156 | 137 | | |
157 | | - | |
158 | | - | |
159 | 138 | | |
160 | 139 | | |
161 | 140 | | |
| |||
167 | 146 | | |
168 | 147 | | |
169 | 148 | | |
170 | | - | |
171 | | - | |
172 | | - | |
173 | | - | |
174 | | - | |
175 | | - | |
176 | | - | |
177 | | - | |
178 | | - | |
179 | | - | |
180 | | - | |
181 | | - | |
182 | | - | |
183 | | - | |
184 | | - | |
185 | | - | |
186 | | - | |
187 | | - | |
188 | | - | |
189 | | - | |
190 | | - | |
| 149 | + | |
| 150 | + | |
| 151 | + | |
| 152 | + | |
| 153 | + | |
| 154 | + | |
| 155 | + | |
| 156 | + | |
191 | 157 | | |
192 | | - | |
193 | | - | |
| 158 | + | |
194 | 159 | | |
195 | 160 | | |
196 | 161 | | |
197 | | - | |
198 | | - | |
199 | | - | |
200 | | - | |
| 162 | + | |
| 163 | + | |
| 164 | + | |
| 165 | + | |
| 166 | + | |
| 167 | + | |
| 168 | + | |
| 169 | + | |
| 170 | + | |
| 171 | + | |
| 172 | + | |
| 173 | + | |
| 174 | + | |
201 | 175 | | |
202 | | - | |
| 176 | + | |
203 | 177 | | |
204 | 178 | | |
205 | 179 | | |
| |||
0 commit comments