feat(cad): Corey shape factor (c/sqrt(ab))#394
Merged
Conversation
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.
This was referenced Jun 8, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
Adds
measure::solid_bounding_box_corey_shape_factorand_tol— the Corey shape factor of a solid:Why
The AABB shape family has the Zingg pair (elongation
b/a#375, flatnessc/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 = 1for an equant cube or sphere and tends to0for a flat plate or thin rod. It compounds the two Zingg axes:CSF = flatness * sqrt(elongation). A degenerate solid (zero intermediate or longest extent) returnsCadError::Tessellation.Test
solid_bounding_box_corey_shape_factor_is_c_over_sqrt_ab:box(2,4,6)->2/sqrt(24) ~= 0.40825;solid_bounding_box_extents(feat(cad): add solid_bounding_box_extents (raw AABB dimensions) #363) —s0/sqrt(s1*s2);CSF = flatness*sqrt(elongation);0 < CSF <= 1; cube and sphere ->1;_tolwrapper agrees with the default.Both fns re-exported from
lib.rsalphabetically.valenx-cad66 lib tests (was 65);cargo clippy -p valenx-cad --all-targets -- -D warningsclean. Research-grade particle-shape descriptor.