Skip to content

Implementation

Dave Walker edited this page Jun 5, 2026 · 2 revisions

Shell Mesh Builder

build_shell_mesh()

The shell is treated as a record of growth:

  1. A sequence of elliptical apertures is generated along the logarithmic spiral
  2. The apertures scale progressively as the shell grows
  3. Aperture size can be periodically modulated to produce growth ribs
  4. The final aperture can be enlarged to simulate a mature shell lip flare
  5. An inner shell surface can be generated to create visible shell wall thickness
  6. Outer and inner shell surfaces are stitched together into continuous triangular meshes
  7. Per-vertex colour values are generated to simulate shell pigmentation banding

Each aperture ring represents a moment in the shell’s developmental history.

The shell mesh builder has this structure:

build_shell_mesh()
    ├── build_aperture_rings()
    │       ├── compute_ribbing_factor()
    │       ├── compute_lip_factor()
    │       ├── compute_inner_axes()
    │       ├── pigmentation_band()
    │       └── aperture_point()
    │
    ├── stitch_ring_surface()
    └── stitch_wall_rim()

Chamber Septa Builder

build_chamber_septa()

Builds curved internal chamber walls (septa) inside the shell.

At intervals along the growth path:

  1. An existing aperture ring is selected
  2. Nested interpolated rings are generated inward from the aperture edge
  3. The centre of the surface is displaced backward along the growth direction
  4. The resulting geometry forms a shallow concave chamber wall

Older chambers can optionally be rendered darker than newer chambers to emphasise shell growth history.

The septa builder has this structure:

build_chamber_septa()
    ├── get_aperture_ring()
    ├── estimate_growth_direction()
    ├── build_single_septum()
    └── stitch_septum_surface()

Siphuncle Builder

build_siphuncle_mesh()

Builds a simplified siphuncle running through the shell chambers.

The siphuncle is modelled as a small tube that follows the shell’s growth path through the chambered interior.

At each growth stage:

  1. The centre of an aperture ring is estimated
  2. The siphuncle position is offset slightly from the chamber centre
  3. A small circular tube section is generated
  4. Neighbouring tube sections are stitched into a continuous mesh

This provides a simplified representation of the tube-like structure that connects chambered cephalopod shell compartments.

The siphuncle builder has this structure:

build_siphuncle_mesh()
    ├── choose_siphuncle_indices()
    ├── siphuncle_centre_for_ring()
    ├── build_siphuncle_ring()
    └── stitch_tube_rings()

Rendering

The meshes are rendered using Plotly Mesh3d, allowing:

  • Interactive rotation and zooming
  • Translucent shell rendering
  • Chamber visualisation
  • Procedural colour banding
  • Shell-like lighting and shading

Clone this wiki locally