Repository navigation
Integument
skin_mesh fits skin around every modeled leg system. hair_mesh places representative shafts directly on that derived surface.

The skin solid lives in extensions/humanoid/skeleton/leg/skin/. The hair solids live in extensions/humanoid/skeleton/leg/hair/. add_leg can draw them with SKIN, HAIR or INTEGUMENT. See Leg.
This is not a three.js port. See Extensions.
from extensions.humanoid.sex import MALE
from extensions.humanoid.spec import HumanoidSpec
from extensions.humanoid.skeleton.leg.contents import INTEGUMENT
from extensions.humanoid.skeleton.leg.hair.dimensions import THIGH_HAIR
from extensions.humanoid.skeleton.leg.hair.geometry import hair_mesh
from extensions.humanoid.skeleton.leg.skin.geometry import skin_mesh
from units.si import FOOT, Length
var person = HumanoidSpec(Length(6.0, FOOT), MALE)
var envelope = skin_mesh(person)
var shafts = hair_mesh(person, THIGH_HAIR)side picks RIGHT or LEFT. A right leg is the default.
The solids live in the leg frame. The origin is the tibiofemoral joint line. Plus y is proximal. Plus x is body-right. Plus z is anterior.
SkinField fits the skin directly to the bones, knee tissues, muscles, vessels, lymphatics and nerves. It does not use an independent stocking silhouette.
Sixty transverse sections run from just below the tibial plafond to the iliac landmark, about a centimeter and a half apart. Each section slices every structure at its height, at its middle and at either edge of its window. A slanted structure is sliced along its length, so its cut is an ellipse or a strip. A section reads only the structures whose extent along the limb reaches its window.
Each slice outline is closed as a convex hull. Fat fills the gaps between muscles, so the hull is the outline you feel through the skin. LOFT_RAYS rays measure the hull's reach in each direction exactly. The polygon of those tangent lines exceeds the hull by less than half a percent.
The section's cover goes outside the hull. The male template adds 7.3 mm of fat over the thigh and 5.5 mm over the calf. The female template adds 15.0 mm and 11.1 mm. The knee blends the two over a band three percent of stature either side of the joint line. The dermis, 1.8 mm, is part of the cover.
A Catmull-Rom spline joins the sections and the rays. Three passes fill a groove up to three sections long, as the fat over two muscle bellies does. Radii only grow, so every structure stays inside.
Below the plafond every structure belongs to the foot. The leg drops those stations, and its skin tapers inside the foot's skin. See One skin for a limb.
Tests require every vessel, lymphatic route and nerve station above the plafond to lie below the skin. Hair roots use ray projection onto the final surface.
The fit is in extensions/humanoid/skeleton/loft.mojo. The foot uses the same code. See Foot.
A leg and its foot each fit their own skin. Drawn together, the two surfaces cross at the ankle. add_limb_skin draws their smooth union as one surface instead.
from extensions.humanoid.skeleton.limb.skin import add_limb_skin
from extensions.humanoid.skeleton.look import skin_physical
var paint = assets.materials.add(skin_physical())
_ = add_limb_skin(scene, assets, parent, person, paint)Draw the leg and the foot without their SKIN layers, then call add_limb_skin once. The solid lives in the leg frame. limb_skin_mesh returns the geometry. LimbSkinField is the field.

THIGH_HAIR spans the hip-to-knee axis. CALF_HAIR spans the knee-to-ankle axis.
Each group samples six circumferential directions. This avoids treating one strip of skin as the normal distribution.
The physical field uses a 29 μm thigh diameter and a 42 μm calf diameter. Hair mass uses analytic capsule volume at these dimensions.
The mesh uses an explicitly diagrammatic radius because a 320 by 240 raster cannot show a 29 μm shaft. The six shafts do not represent density.
Lower-limb hair distribution varies between people. The groups demonstrate rooted geometry and do not define a population pattern.
skin_tissue() holds wet density 1.10 g/cm³ as a named dermis template. Water fraction is 0.70. Compressive modulus is 0.20 MPa. Poisson's ratio is 0.45.
hair_tissue() holds wet density 1.32 g/cm³ as a named keratin template. Water fraction is 0.12. Longitudinal modulus is 2000 MPa. Poisson's ratio is 0.35.
The dermal shell is 1.8 mm thick. Skin mass samples only that shell, not the full volume inside the leg.
Water fraction is metadata. Mass uses wet density times tissue volume. Do not scale by one minus water fraction again.
These values are named research metadata. This extension does not implement a constitutive model.
- Extremity skin, fat and muscle reference data
- Anterior-thigh subcutaneous and fascia thickness
- Sex-specific thigh and calf fat thickness
- Healthy-adult skin thickness by body site
- Hair follicle size by body site
- Lower-limb terminal-hair patterns
from extensions.humanoid.skeleton.leg.hair.mass import hair_mass
from extensions.humanoid.skeleton.leg.skin.mass import skin_mass
from units.si import GRAM
var skin_report = skin_mass(person)
var hair_report = hair_mass(person, THIGH_HAIR)
skin_report.mass.to(GRAM)examples/integument.mojo draws one six foot male right leg. The layers are skin and hair. It writes out/integument.png. Run it with:
.venv/bin/mojo run -I . examples/integument.mojo out/integument.pngTutorials
How-to
Reference
- Scene graph
- Rotations
- Cameras
- Geometry
- Geometry addons
- Lofts and clipping groups
- Sculptor
- Procedural generators
- Meshes and assets
- Lines
- Points and sprites
- Helpers
- Scene objects
- Animated objects
- Raycasting
- Curves and paths
- Animation
- Skinning
- Materials
- Node materials
- TSL functions
- Lights
- Lighting addons
- Fog
- Textures
- Renderer
- Renderer hooks and material flags
- Rasterization
- GPU backend
- Render target
- Post-processing
- GPU computation
- Compute nodes
- Progressive light map
- Gaussian splats
- Voxel global illumination
- SVG renderer
- Image files
- Image decode queue
- Model files
- More model files
- Exporters
- Scene JSON
- Windowing and controls
- Math
- Norm consumers
- Math addons
- Units
- Coverage tool
- Commands
- Examples
- Benchmarks
- Extensions
- Shared physics
- Physics query snapshots
- Continuous collision
- Tick force restoration
- Water
- Animals
- Buildings
- CARLA
- Femur
- Tibia
- Fibula
- Patella
- Knee
- Muscles
- Vessels
- Lymph
- Nerves
- Integument
- Leg
- Foot
- Pelvis
- Torso
- Arm
- Hand
- Head
- Genome
- Game humanoid
- Humanoid fidelity
- Audio-aligned game faces
- Converted assets
- Mesh quality
- Segment inertia
Explanation
- Software rasterizer
- Scene graph as an array
- Linear color
- Normals are not colors
- Perspective correction
- Fixed-point coverage
- Per-fragment shading
- Mipmaps
- Sorted transparency
- Types and checks
- Render hooks as a trait
- Shared CPU and GPU code
- Bands and threads
- PNG structure
- Extensions beside the port
- CUDA teardown hang
- Mojo compiler hang