ColonConfig

Struct ColonConfig 

Source
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: f32

Total arc length of the colon in world units.

Adult human colon is approximately 150cm. Default is scaled for typical game/simulation use.

§base_radius: f32

Base 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: f32

How 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: f32

How 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: f32

Secondary wobble amplitude for organic feel.

Adds small-scale variation to the centerline path. Default is 0.1 (10% of radius).

§wobble_frequency: f32

Frequency of secondary wobble.

Higher values = more frequent small bends. Default is 8.0 (approximately 8 wobbles per segment).

Implementations§

Source§

impl ColonConfig

Source

pub fn with_seed(seed: u64) -> Self

Create a new config with a specific seed.

Source

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

Source§

fn clone(&self) -> ColonConfig

Returns a duplicate of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for ColonConfig

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Default for ColonConfig

Source§

fn default() -> Self

Returns the “default value” for a type. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

Source§

fn vzip(self) -> V