Crate lumen_geometry

Crate lumen_geometry 

Source
Expand description

§Lumen Geometry

Mathematical models for tubular anatomical structures.

This crate provides pure math primitives for generating and querying the geometry of hollow organs like the colon, bronchi, and intestines. It has no game engine dependencies and can be used for:

  • Medical education and visualization
  • Surgical simulation
  • Anatomy research tools
  • Game development

§Core Concepts

  • Lumen: The interior space of a tubular organ (from Latin “light” or “opening”)
  • Centerline: A parametric curve defining the path through the organ
  • t-parameter: Position along the curve, normalized to [0.0, 1.0]
  • Haustra: Pouch-like segments in the colon wall

§Quick Start

use lumen_geometry::colon::{ColonCurve, ColonConfig};
use lumen_geometry::TubularCurve; // Trait for position_at, tangent_at, etc.

// Create a colon with default anatomical parameters
let config = ColonConfig::default();
let colon = ColonCurve::new(&config);

// Query positions along the centerline
let rectum = colon.position_at(0.0);      // Entry point
let mid_transverse = colon.position_at(0.5);
let cecum = colon.position_at(1.0);       // End (appendix area)

// Get wall position including haustra bulges
let wall_point = colon.wall_position_at(0.3, std::f32::consts::PI);

§Anatomical Accuracy

The colon model follows real anatomy:

    Hepatic Flexure ─┐     ┌─ Splenic Flexure
                     │     │
    Ascending ───────┤     ├─── Descending
                     │     │
    Cecum ───────────┘     │
                           │
              Transverse ──┴─── Sigmoid ─── Rectum

Each segment has characteristic:

  • Length: How much of the total path it occupies
  • Radius: Lumen diameter varies by section
  • Curvature: Flexures are sharp bends; other sections are gentler
  • Haustra: Pouch frequency and depth vary by region

Modules§

colon
Colon (large intestine) geometry.
math
Re-export glam types for convenience.

Traits§

AnatomicalSegment
A named region of a tubular organ.
TubularCurve
A parametric curve representing the centerline of a tubular organ.