OnlyCSharp 1.9 · ComputerGraphics.Media3D.CompliantAttach

MotionBench

First find out what actually moves — with no manual tagging, across every model the library ships. Then attach anything to that motion, made of a real, cited material: aluminum foil, spring steel, copper wire, a pine dowel, a rubber band, a slinky.

1,719ObjectKit/ParametricKit sources swept
7cited materials, stiffness to floppy
3real spring/coil presets (Wahl's formula)
0hand-authored per-model animation
01

Find the moving partsAuto-detected motion hooks

Every AnimatedKit gait clip rebuilds its whole scene from the same code path at every phase, and every ParametricKit model rebuilds from the same code path at every slider value — so ShapeScene.Parts[i] at one sample and at another sample is the same logical part, just moved. Sample a handful of points along that axis, track each part's world-space bounding-box centre, and any part whose position spreads out past a small threshold is a candidate attachment point — a hook — found automatically, with zero changes to the recipe that built it.

The same detector works whether the axis is a gait phase (a walk cycle) or a full slider sweep (min→max on a bestiary monster's every knob at once) — which is how a technique built for 99 locomotion clips ended up covering all 1,719 sources the library has: every daemon, dragon, fiend, undead, aberration, outsider, fey and elemental in the bestiary that never got a hand-authored animation still has parts that move when its sliders move.

A 56 by 31 grid of small renders, one per swept source, each with pink motion-hook markers and grey trail dots on the parts detected as moving.
1,719 sources, one grid — 99 AnimatedKit gait clips + 1,620 sweepable ParametricKit models, sorted by family. Static frame shown here for weight; the full animated version plays every source's own sweep (~11 MB).
Three animals shown two ways: full mesh with pink hook markers on the left, versus markers alone with the mesh hidden on the right.
Two visualization styles tried side by side — full mesh + marker/trail overlay (left column) versus markers alone with the mesh hidden (right column). Skeleton-only reads as noise without a silhouette to anchor it; full-mesh-plus-overlay won and is what the grid above uses.
02

Attach something realMaterial physics: stiffness, weight, memory

A detected hook — or any point on any model — can now be a mount for a real, weighted, bendable attachment instead of a rigid transform. MaterialPreset combines a cited density and Young's modulus (this repo's own Chemistry.Materials and building-materials catalogs) with an everyday-object cross-section to get a real flexural rigidity E·I — the actual reason aluminum foil is floppy despite aluminum being a structurally stiff metal: same E as a solid rod, but I ∝ thickness³ collapses at foil gauge. FlexibleAttachment then clamps a chain of real PhysicsAndAstronomy.Physics.SoftBody (XPBD) particles to a live parent position every step, each one pulled toward its "straight rod" position by a spring sized from that E·I, weighted by real mass, and — the "memory" dial — creeping its own rest target toward wherever gravity or a knock left it, at a rate set by the material's plasticity.

Seven identical rods clamped at the same point, sagging by very different amounts depending on material.
Seven materials, one clamp, real gravity: pine dowel and spring steel barely sag; copper wire and cotton string curve moderately; pipe cleaner droops further; foil and rubber hang fully vertical.
The same seven rods after being flicked sideways and released.
After an identical sideways flick and release: the pipe cleaner (plasticity 0.65) visibly keeps a kink the others don't — the memory dial, not a hand-scripted pose. Full animation.
Seven presets, all cited
MaterialSourceGaugeE·I (N·m²)Plasticity
Pine DowelBuildingMaterialsCatalog['Pine timber']5 mm rod2.8×10⁻¹0.05
Spring Steel WireMaterialCatalog.SteelA361 mm rod9.8×10⁻³0.02
Copper WireMaterialCatalog.CopperC110001.6 mm rod3.8×10⁻²0.55
Pipe CleanerMaterialCatalog.SteelA36 (bare core)0.5 mm rod6.1×10⁻⁴0.65
Cotton Stringuncited (flagged in source)0.8 mm rod1.2×10⁻⁴0.00
Rubber Banduncited (flagged in source)1 mm strip4.9×10⁻¹⁰0.00
Aluminum FoilMaterialCatalog.Aluminum6061T616 μm strip7.3×10⁻¹³0.90
03

Springs, coils, slinkies — and anything elseReal helical-spring mechanics

Shapes.Coil sweeps a wire along a sampled helix — a tight spring, a wide slinky, a long coil, or a chunky bedspring, all from the same four sliders. SpringPreset derives a shear modulus G = E/(2(1+ν)) from a cited material's Young's modulus and Poisson's ratio (no repo catalog has shear modulus directly — this is the standard isotropic- elasticity relation, not an invented number), then the classic helical-spring formula k = G·d⁴/(8·D³·N) for the actual spring constant. A mass hung on one of these springs settles at the textbook Hooke's-law equilibrium — proven, not assumed.

Mounting an existing catalog model on a material needed no new code at all — FlexibleAttachment's tip position was already public, so any of the 1,719 sources swept above can hang, sway, or spring from a chosen material the same way a synthetic rod does.

Four coil shapes side by side: a tight spring, a wide slinky, a long coil, and a chunky bedspring.
One primitive, four everyday reads — tight spring, wide slinky, long coil, chunky bedspring — all Shapes.Coil(coilRadius, wireRadius, height, turns).
Three coil springs of different materials, each holding a hanging mass, bouncing and settling at different lengths.
Three SpringPreset materials, one hanging mass each — the coil mesh itself re-generates every frame at the live simulated length, so it visibly stretches and compresses in sync with the physics.
An apple model hanging from two different material mounts, one rubber and one wood, being flicked sideways.
An ordinary ObjectKit.Build("Apple") hanging from a rubber-band mount (left, sags to near-vertical under its own weight) versus a pine-dowel mount (right, stays extended) — the generalization proof: any model, any material.
A walking quadruped with two flexible chains hanging from its tagged front-left leg, whipping around with the gait.
The synthesis: sections 01 and 02 in one frame. The walking horse's tagged leg.FL hook drives two FlexibleAttachment chains (copper wire vs. cotton string) through their base every physics step — the attached material whips around with the gait purely from simulation, no hand-authored animation. The exact "attach pieces onto each moving segment" ask, with materials.
Spring constants (Wahl's formula), hand-verified in the KATs
SpringMaterialWireCoil ØCoilsk (N/m)
Soft Steel CoilSteelA361.5 mm30 mm40~465
Stiff Steel SpringSteelA364 mm20 mm10~31,747
Copper SpringCopperC110004 mm20 mm10~17,462
04

Build it, stage it, ride itThe Craft framework: KSP-style editing, actions, save/load

Everything above composes into an editable system: a Craft is a KSP-style part tree — pick a core, slap on an evenly-spaced ring or freehand slots, link parts onto parts to any depth, re-parent, remove subtrees — with every edit validated the moment it's made (duplicate ids, dangling parents, and re-parent cycles all throw). Parts carry time-driven actions: spin, oscillate, pulse, and Detach — real staging, where a booster and its whole subtree freeze their pose at the staging instant and fall ballistically (y = h − gt²/2, verified against hand-derived numbers in the KATs). A craft saves to a ~2 KB plain-text .craft file you can read, diff, and hand-edit — and loading goes through the same validated editing API, so a corrupt file fails loud at load, never as a silently-wrong render.

Six editor stages of a lander being assembled: a capsule core, then a ring of boosters, then nose cones, then dish and legs, then edits.
One build session, six stages: core → booster ring (AddRing) → nose cones linked onto the boosters → dish/antenna/legs freehand → the edit pass (one booster removed recursively, dish recolored, antenna re-slotted) → actions armed.
The lander with a spinning dish as two boosters detach and fall away.
Actions on a 6-second timeline: the dish spins, the antenna waves, and two boosters stage off at different instants — each falling ballistically with its nose cone riding its detached parent down. Pure functions of time: same t in, bit-equal geometry out.
The whole lander craft riding a walking creature's leg like a saddlebag, dish still spinning, with a copper wire streamer trailing.
The full stack in one frame: the reloaded .craft file anchored to the walking horse's tagged leg hook — the entire part tree rides the gait with its actions still running, plus a copper-wire physics streamer mounted on the craft's own mast tip. Animated hook → craft tree → actions → material physics.
A radar turret riding a galloping horse's back, its solar panels sliding outward as two pods kick away sideways.
Route B — a second craft on a second gait: a turret howdah on the galloping horse's torso hook. Twin panels Extend outward on a smoothstep deploy while the radar spins, then two pods sepratron-kick off sideways with real initial velocities — full projectile motion, hand-verified in the KATs.
A windmill with four blades orbiting its spinning hub and a rope swaying beneath the nacelle.
Route C — a static anchor and the stateful layer: the windmill's blades are children of the spinning hub, so they orbit purely through link composition, and the rope under the nacelle is a first-class flex:cottonstring,6,0.5 node — material physics living inside the same .craft file, run by CraftRuntime.
Two pendant chains take the same sideways jolt; the left one snaps off its post and falls while the right one swings and recovers.
Route D — the toughness axis, live: the same violent 0.3 m jolt puts a hand-derived 101 MPa through the pine-dowel mount (over its cited 80 MPa tensile strength — the brittle MaterialFracture accumulator latches and the chain lets go) and 90 MPa through the spring-steel one (under the endurance fraction of its cited 250 MPa yield — no fatigue dose at all, it springs back). Same jolt, different materials, different fates.