Skip to content

feat(cad): Corey shape factor (c/sqrt(ab))#394

Merged
nochallenge merged 1 commit into
masterfrom
feat/cad-corey-shape-factor
Jun 8, 2026
Merged

feat(cad): Corey shape factor (c/sqrt(ab))#394
nochallenge merged 1 commit into
masterfrom
feat/cad-corey-shape-factor

Conversation

@nochallenge

Copy link
Copy Markdown
Owner

What

Adds measure::solid_bounding_box_corey_shape_factor and _tol — the Corey shape factor of a solid:

// CSF = c / sqrt(a*b)   (dimensionless, in (0, 1]),  a >= b >= c sorted AABB extents
pub fn solid_bounding_box_corey_shape_factor_tol(solid: &Solid, tol: f64) -> Result<f64, CadError>
pub fn solid_bounding_box_corey_shape_factor(solid: &Solid) -> Result<f64, CadError>

Why

The AABB shape family has the Zingg pair (elongation b/a #375, flatness c/b #381) but not the Corey shape factor — the standard sedimentology / hydraulics particle-shape descriptor that governs the drag and settling velocity of a non-spherical grain. CSF = 1 for an equant cube or sphere and tends to 0 for a flat plate or thin rod. It compounds the two Zingg axes: CSF = flatness * sqrt(elongation). A degenerate solid (zero intermediate or longest extent) returns CadError::Tessellation.

Test

solid_bounding_box_corey_shape_factor_is_c_over_sqrt_ab:

Both fns re-exported from lib.rs alphabetically. valenx-cad 66 lib tests (was 65); cargo clippy -p valenx-cad --all-targets -- -D warnings clean. Research-grade particle-shape descriptor.

Add measure::solid_bounding_box_corey_shape_factor[_tol], the Corey shape
factor of a solid:

  CSF = c / sqrt(a*b)   (dimensionless, in (0, 1])

where a >= b >= c are the sorted AABB extents -- the standard
sedimentology / hydraulics particle-shape descriptor (it governs the drag
and settling velocity of a non-spherical grain): 1 for an equant cube or
sphere, small for a flat plate or thin rod. It compounds the two Zingg
axes, CSF = flatness * sqrt(elongation) (#381 * #375). Degenerate (zero
intermediate or longest extent) -> CadError::Tessellation.

Analytic test solid_bounding_box_corey_shape_factor_is_c_over_sqrt_ab:
(a) worked box(2,4,6) -> 2/sqrt(24) ~= 0.40825;
(b) threads solid_bounding_box_extents (#363): s0/sqrt(s1*s2);
(c) cross-check threading flatness (#381) + elongation (#375)
    (non-tautological): CSF = flatness*sqrt(elongation);
(d) range 0 < CSF <= 1; cube and sphere -> 1 (equant);
(e) _tol wrapper agrees with the default.

Both fns re-exported from lib.rs alphabetically. valenx-cad 66 lib tests
(was 65), cargo clippy --all-targets -D warnings clean.
@nochallenge nochallenge merged commit 6d6c036 into master Jun 8, 2026
@nochallenge nochallenge deleted the feat/cad-corey-shape-factor branch June 8, 2026 17:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant