upxo.pxtal.fm_steel_3d.mesh_rescaling module

Rescaled views of a pipeline state, for meshing at another resolution.

mesh_state_for_scale returns the state itself for a factor of 1 and a read-through RescaledMeshState otherwise. The source state is never modified, so a series of exports at different factors always starts from the same stored grid.

class upxo.pxtal.fm_steel_3d.mesh_rescaling.RescaledMeshState(source, scale_factor: float)[source]

Bases: object

Read-through view of a pipeline state with rescaled spatial data.

The source state is never modified. Non-spatial hierarchy/orientation attributes are delegated to it, while the voxel grid and every voxel- location dictionary consumed by the mesh exporter are rebuilt at the requested resolution.

upxo.pxtal.fm_steel_3d.mesh_rescaling.scaled_grid_shape(shape, scale_factor: float) → tuple[source]

Grid shape after rescaling by scale_factor.

Raises ValueError if the factor is not a finite number greater than zero or if any dimension would hold less than one voxel.

upxo.pxtal.fm_steel_3d.mesh_rescaling.mesh_state_for_scale(fm_state, scale_factor: float)[source]

Return an export state derived afresh from the stored pipeline state.