waxmorph.data.sample_mesh_sequence#
- waxmorph.data.sample_mesh_sequence(source_path, target_specs, n_points=2000, *, target_extent=10.0, source_extent=None, seed=0)[source]#
Sample a source cloud and frame-tagged target clouds at exact equal counts.
Each repaired, normalized mesh starts from its own volume-derived radius and spacing:
\[r = \left(\frac{3V}{4\pi N}\right)^{1/3}, \qquad d_{\min} = 1.2\,r.\]Exact-count sampling may lower each
randd_mintogether; returned radius fields hold the effective values. Frames are unique, nonnegative, and sorted in the result; trainers interpret them as zero-based post-update rollout steps. Extent sequences match inputtarget_specsbefore sorting. A scalar orNoneextent applies to every target, withNonemeaning 10; per-target extents requiresource_extent. The source usesseedand sorted targetkusesseed+1+k, producing independent reproducible clouds.- Returns:
"source_pos"– source agent centers, float32, shape[N, 3]."targets": list of per-target dicts sorted by frame, each with"frame"(int rollout step),"pos"(float32[N, 3]centers),"mesh"(normalizedtrimesh.Trimesh),"extent"(float), and"radius"(that target’s effective particle radius, float)."radius": effective source radius (alias of"source_radius")."R_init": initial uniform radius for the rollout (equals the source radius)."n_points": requested countN."source_extent": source normalization extent (float)."target_extent": per-target extent list if a sequence was given, else the single shared extent (float); ordered by sorted frame."target_extents": list of per-target extents in sorted-frame order."source_radius": effective source particle radius (float)."target_radii": effective target radii in sorted-frame order.
- Parameters:
- Return type:
Invalid specs, frames, extents, or counts raise
ValueError. Exact-count sampling failure raisesRuntimeError.