upxo.pxtal.fm_steel_3d.steps.steps_transformations module

Transformations – Part D of the FM Steel 3D walkthrough (OPTIONAL).

Two independent, order-dependent operations, both defaulting to the identity (no change): an isotropic rescale/anisotropic stretch, and a “Sweep Clean” resolution round-trip (majority-vote downscale then nearest-neighbour upscale back to the original resolution) intended to smooth a structure for later conformal meshing. Neither function has a skip flag – simply don’t call the one(s) you want to omit; downstream stages (PAG Clustering) just take whichever FMSteel3DBase you hand them.

upxo.pxtal.fm_steel_3d.steps.steps_transformations.apply_transform(fm_base, scale_factor=1.0, sf_x=1.0, sf_y=1.0, sf_z=1.0, cleanup_threshold=0)[source]

Isotropic rescale (scale_factor, nearest-neighbour resampling, RVE physical size held constant) followed by an anisotropic stretch (sf_x/sf_y/sf_z, each axis independently). Both default to 1.0 (no change). cleanup_threshold > 0 additionally dissolves any grain below that many voxels into its largest neighbour after resampling (see transform_shared.build_clean_structure).

Return type:

FMSteel3DBase

upxo.pxtal.fm_steel_3d.steps.steps_transformations.sweep_clean(fm_base, factor=2.0, cleanup_threshold=0)[source]

Resolution round-trip: downscale all three dimensions by factor with majority-vote resampling (minimizes small-feature loss), then upscale back to the ORIGINAL voxel resolution with nearest-neighbour resampling. Net effect: same resolution as fm_base, boundary detail coarsened by the round trip. cleanup_threshold > 0 additionally dissolves any grain below that many voxels into its largest neighbour.

Return type:

FMSteel3DBase