pub struct ColonConfig {
pub seed: Option<u64>,
pub total_length: f32,
pub base_radius: f32,
pub segment_params: Option<[SegmentParams; 8]>,
pub length_variation: f32,
pub angle_variation: f32,
pub wobble_amplitude: f32,
pub wobble_frequency: f32,
}Expand description
Configuration parameters for generating a colon curve.
All parameters have sensible defaults based on adult human anatomy.
Use seed to generate procedural variations while maintaining
anatomical plausibility.
§Example
use lumen_geometry::colon::ColonConfig;
// Default adult anatomy
let config = ColonConfig::default();
// Procedurally varied anatomy
let varied = ColonConfig {
seed: Some(12345),
..Default::default()
};
// Custom configuration
let custom = ColonConfig {
total_length: 120.0, // Shorter colon
base_radius: 2.5, // Narrower lumen
..Default::default()
};Fields§
§seed: Option<u64>Seed for procedural variation. None uses default geometry.
When set, the seed affects:
- Segment length ratios (within anatomical bounds)
- Flexure angles (within anatomical bounds)
- Radius variations along the length
- Secondary curve wobble
total_length: f32Total arc length of the colon in world units.
Adult human colon is approximately 150cm. Default is scaled for typical game/simulation use.
base_radius: f32Base lumen radius in world units.
This is the default radius; actual radius varies by segment.
segment_params: Option<[SegmentParams; 8]>Per-segment configuration overrides.
If None, uses default parameters for each segment.
length_variation: f32How much the seed can vary segment lengths.
Value of 0.0 = no variation, 1.0 = maximum variation. Default is 0.3 (30% variation from base lengths).
angle_variation: f32How much the seed can vary flexure angles.
Value of 0.0 = no variation, 1.0 = maximum variation. Default is 0.2 (20% variation from base angles).
wobble_amplitude: f32Secondary wobble amplitude for organic feel.
Adds small-scale variation to the centerline path. Default is 0.1 (10% of radius).
wobble_frequency: f32Frequency of secondary wobble.
Higher values = more frequent small bends. Default is 8.0 (approximately 8 wobbles per segment).
Implementations§
Source§impl ColonConfig
impl ColonConfig
Sourcepub fn params_for(&self, segment: ColonSegment) -> SegmentParams
pub fn params_for(&self, segment: ColonSegment) -> SegmentParams
Get parameters for a specific segment.
Returns custom params if set, otherwise default for that segment.
Trait Implementations§
Source§impl Clone for ColonConfig
impl Clone for ColonConfig
Source§fn clone(&self) -> ColonConfig
fn clone(&self) -> ColonConfig
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more