Give the figure real girdles, fix orbit pinning, add roller pads

Shoulder and pelvis widths grow to human-like proportions per profile
(shoulders wider than hips for neutral/male, reversed for female) and
are now drawn — bars across the attach points that read near-full-width
face-on and as a shoulder/hip nub in profile, so limbs visibly hang
from a torso instead of a point. Orbiting no longer re-solves IK pins
in the rotated view (pins are canvas targets in the authored camera):
the pose resolves first and the posed body rotates, which fixes hands
sticking to stale screen points mid-orbit (Cat-Cow, Bird Dog, Plank).
Leg Extension and Leg Curl swap their ankle bars for a machine roller
disc — a new `roller` prop riding the shin's press side. Fixtures
regenerated; both renderers updated in lockstep.

Claude-Session: https://claude.ai/code/session_01LEoff8bXGBS83tK1c55Mf7
This commit is contained in:
2026-07-06 21:00:03 -04:00
parent fd3bcb513f
commit 5e4980f0d7
106 changed files with 543 additions and 156 deletions
@@ -146,10 +146,13 @@ struct ExerciseFigureView: View {
}
private func drawSpine(_ ctx: inout GraphicsContext, _ geo: FigureGeometry) {
let color = ink("spine", shade: .near)
stroke(&ctx, geo.girdle, color: color, width: 5)
stroke(&ctx, geo.pelvisBar, color: color, width: 5)
var path = Path()
path.move(to: geo.spineStart)
path.addQuadCurve(to: geo.spineEnd, control: geo.spineControl)
ctx.stroke(path, with: .color(ink("spine", shade: .near)),
ctx.stroke(path, with: .color(color),
style: StrokeStyle(lineWidth: 6, lineCap: .round, lineJoin: .round))
}
@@ -210,6 +213,10 @@ struct ExerciseFigureView: View {
/// renderer's `resolve_props` change them in lockstep.
private func drawAttachedProps(_ ctx: inout GraphicsContext, _ geo: FigureGeometry) {
for prop in figure.props {
if prop.type == "roller" {
drawRoller(&ctx, geo, prop)
continue
}
let defaults: (halfLen: Double, width: Double, plateR: Double)
switch prop.type {
case "bar": defaults = (24, 4, 0)
@@ -239,6 +246,21 @@ struct ExerciseFigureView: View {
}
}
/// A machine roller pad seen end-on: a disc riding the limb's lower bone near the
/// joint, on the `side` (+1/1) of the bone it presses. Kept 1:1 with the reference
/// renderer's `resolve_props`.
private func drawRoller(_ ctx: inout GraphicsContext, _ geo: FigureGeometry, _ prop: MotionProp) {
guard let at = prop.at, let anchor = jointAnchor(geo, at) else { return }
let r = prop.r ?? 5
let back = prop.back ?? 0
let side = prop.side ?? 1
let px = anchor.direction.dy * side, py = -anchor.direction.dx * side
let center = CGPoint(x: anchor.point.x - anchor.direction.dx * back + px * (r + 3),
y: anchor.point.y - anchor.direction.dy * back + py * (r + 3))
let rect = CGRect(x: center.x - r, y: center.y - r, width: 2 * r, height: 2 * r)
ctx.fill(Path(ellipseIn: rect), with: .color(.figureProp))
}
private func drawSceneShape(_ ctx: inout GraphicsContext, _ shape: PropSceneShape) {
let color: Color = shape.color == "prop" ? .figureProp : .figureEquipment
switch shape.kind {