Skip to content

alexgreensh/anidoodle / skills/anidoodle

anidoodle

Flagged

Code-drawn stills, films, 3D motion graphics, explainers and web animations in 32 styles, with scores, narration and subtitles. Use when asked for an illustration, animation, video or drawing lesson.

FileKindSize
SKILL.mdskill md13.7 KB
assets/styles.jpgbinary1.6 MB
engine/SFX_VERSIONING.mdmarkdown862 B
engine/assets/brand/lantern/brand.jsonconfig1.8 KB
engine/assets/brand/lantern/brand.tsscript1.7 KB
engine/assets/brand/lantern/lanternMark.svgother687 B
engine/assets/fonts/InstrumentSans-Bold.ttfbinary66.5 KB
engine/assets/fonts/InstrumentSans-OFL.txtmarkdown4.3 KB
engine/assets/fonts/InstrumentSans-Regular.ttfbinary66.4 KB
engine/assets/fonts/Lora-Bold.ttfbinary130.7 KB
engine/assets/fonts/Lora-OFL.txtmarkdown4.3 KB
engine/assets/fonts/PROVENANCE.mdmarkdown3.2 KB
engine/assets/fonts/Poppins-Bold.ttfbinary152.3 KB
engine/assets/fonts/Poppins-OFL.txtmarkdown4.3 KB
engine/assets/fonts/poppinsBold.tsscript203.7 KB
engine/assets/narration/narrationDemo.jsonconfig700 B
engine/assets/refs/PROVENANCE.jsonconfig836 B
engine/assets/refs/vangogh-almond-blossom.jpgbinary1021.9 KB
engine/facts/launchClip.jsonconfig789 B
engine/facts/launchExample.jsonconfig708 B
engine/facts/launchExampleBrand.jsonconfig1.2 KB
engine/facts/launchExampleClean.jsonconfig1.4 KB
engine/facts/launchExampleCleanChat.jsonconfig1.1 KB
engine/package-lock.jsonmanifest122.6 KB
engine/package.jsonmanifest934 B
engine/reviews/launchClip.jsonconfig4.8 KB
engine/reviews/launchExample.jsonconfig4.4 KB
engine/reviews/launchExampleBrand.jsonconfig9.2 KB
engine/reviews/launchExampleClean.jsonconfig4.4 KB
engine/reviews/launchExampleCleanChat.jsonconfig13.3 KB
engine/src/canvas-core/adaptAlmond.tsscript15.2 KB
engine/src/canvas-core/adaptAquarelle.tsscript14.1 KB
engine/src/canvas-core/adaptScrapbook.tsscript11.5 KB
engine/src/canvas-core/assetKit.tsscript8.4 KB
engine/src/canvas-core/bake.tsscript8.0 KB
engine/src/canvas-core/bakerSheet.tsscript4.7 KB
engine/src/canvas-core/balloon.tsscript20.0 KB
engine/src/canvas-core/balloonDraw.tsscript4.7 KB
engine/src/canvas-core/banner.tsscript42.3 KB
engine/src/canvas-core/bitRig.tsscript23.9 KB
engine/src/canvas-core/blueprint.tsscript42.5 KB
engine/src/canvas-core/blueprintKit.tsscript15.1 KB
engine/src/canvas-core/brandKit.tsscript10.4 KB
engine/src/canvas-core/brickBalloon.tsscript31.1 KB
engine/src/canvas-core/brokenColour.tsscript31.2 KB
engine/src/canvas-core/brokenColourKit.tsscript9.7 KB
engine/src/canvas-core/callout.tsscript9.6 KB
engine/src/canvas-core/calloutDemo.tsscript3.6 KB
engine/src/canvas-core/camera.tsscript13.2 KB
engine/src/canvas-core/character/build.tsscript2.9 KB
engine/src/canvas-core/character/check.tsscript9.5 KB
engine/src/canvas-core/character/design.tsscript7.3 KB
engine/src/canvas-core/character/human/balance.tsscript8.2 KB
engine/src/canvas-core/character/human/canon.tsscript3.8 KB
engine/src/canvas-core/character/human/clothing.tsscript4.5 KB
engine/src/canvas-core/character/human/figure.tsscript4.0 KB
engine/src/canvas-core/character/human/hands.tsscript10.9 KB
engine/src/canvas-core/character/human/head.tsscript23.2 KB
engine/src/canvas-core/character/human/mannequin.tsscript15.7 KB
engine/src/canvas-core/character/human/skeleton.tsscript10.3 KB
engine/src/canvas-core/character/human/walk.tsscript7.9 KB
engine/src/canvas-core/character/identity.tsscript2.3 KB
engine/src/canvas-core/character/math3.tsscript5.6 KB
engine/src/canvas-core/character/render/brick.tsscript4.0 KB
engine/src/canvas-core/character/render/grid.tsscript5.2 KB
engine/src/canvas-core/character/render/marker.tsscript3.5 KB
engine/src/canvas-core/character/render/pencil.tsscript6.6 KB
engine/src/canvas-core/character/render/pixel.tsscript3.1 KB
engine/src/canvas-core/character/render/riso.tsscript7.1 KB
engine/src/canvas-core/character/render/scratch.tsscript6.2 KB
engine/src/canvas-core/character/render/storybook.tsscript5.6 KB
engine/src/canvas-core/character/render/sumi.tsscript5.3 KB
engine/src/canvas-core/character/render/woodcut.tsscript4.3 KB
engine/src/canvas-core/character/shape2d.tsscript4.7 KB
engine/src/canvas-core/character/types.tsscript3.3 KB
engine/src/canvas-core/character/view25d.tsscript2.9 KB
engine/src/canvas-core/characters/mira/drawn.tsscript5.1 KB
engine/src/canvas-core/characters/mira/index.tsscript19.1 KB
engine/src/canvas-core/characters/mira/palettes.tsscript7.0 KB
engine/src/canvas-core/characters/mira/poses.tsscript10.2 KB
engine/src/canvas-core/characters/theo/baker.tsscript15.0 KB
engine/src/canvas-core/characters/theo/index.tsscript6.1 KB
engine/src/canvas-core/characters/theo/poses.tsscript10.6 KB
engine/src/canvas-core/characters/theo/wardrobe.tsscript12.4 KB
engine/src/canvas-core/charcoalErasure.tsscript30.7 KB
engine/src/canvas-core/charcoalErasureKit.tsscript9.4 KB
engine/src/canvas-core/cheetahBody.tsscript16.5 KB
engine/src/canvas-core/cheetahDusk.tsscript20.9 KB
engine/src/canvas-core/cheetahRig.tsscript8.9 KB
engine/src/canvas-core/cheetahRun.tsscript19.0 KB
engine/src/canvas-core/cheetahRunSigned.tsscript173 B
engine/src/canvas-core/cheetahScenery.tsscript11.8 KB
engine/src/canvas-core/cheetahTurn.tsscript5.5 KB
engine/src/canvas-core/colouredPencil.tsscript45.0 KB
engine/src/canvas-core/colouredPencilCrow.tsscript13.4 KB
engine/src/canvas-core/colouredPencilKit.tsscript17.8 KB
engine/src/canvas-core/core.tsscript30.0 KB
engine/src/canvas-core/cues.tsscript7.7 KB
engine/src/canvas-core/drafting.tsscript7.4 KB
engine/src/canvas-core/drawingMarks.tsscript13.3 KB
engine/src/canvas-core/drawingScore.tsscript17.5 KB
engine/src/canvas-core/dreamGlaze.tsscript30.9 KB
engine/src/canvas-core/dreamGlazeDraw.tsscript10.4 KB
engine/src/canvas-core/dreamGlazeKit.tsscript19.1 KB
engine/src/canvas-core/embroidery.tsscript32.2 KB
engine/src/canvas-core/embroideryAlive.tsscript19.6 KB
engine/src/canvas-core/embroideryKit.tsscript14.6 KB
engine/src/canvas-core/endCard.tsscript8.8 KB
engine/src/canvas-core/figureSheet.tsscript8.2 KB
engine/src/canvas-core/film.tsscript6.4 KB
engine/src/canvas-core/fixtureDeck.tsscript165 B
engine/src/canvas-core/fixtureMotion.tsscript5.4 KB
engine/src/canvas-core/fixtureRigBrokenGrip.tsscript250 B
engine/src/canvas-core/fixtureShip.tsscript7.4 KB
engine/src/canvas-core/fixtureShipBlind.tsscript159 B
engine/src/canvas-core/fixtureShipGreen.tsscript159 B
engine/src/canvas-core/fixtureShipLocked.tsscript126 B
engine/src/canvas-core/fixtureShipRed.tsscript157 B
engine/src/canvas-core/fixtureShipTrack.tsscript125 B
engine/src/canvas-core/fixtureWorld.tsscript166 B
engine/src/canvas-core/flatVector.tsscript22.8 KB
engine/src/canvas-core/folkTale.tsscript56.9 KB
engine/src/canvas-core/folkTaleKit.tsscript42.7 KB
engine/src/canvas-core/formMascot.tsscript4.9 KB
engine/src/canvas-core/fox.tsscript15.7 KB
engine/src/canvas-core/foxDraw.tsscript5.6 KB
engine/src/canvas-core/fromPhoto.tsscript8.7 KB
engine/src/canvas-core/gallery.tsscript9.5 KB
engine/src/canvas-core/halftone.tsscript10.3 KB
engine/src/canvas-core/halftoneKit.tsscript9.7 KB
engine/src/canvas-core/halftoneScene.tsscript26.5 KB
engine/src/canvas-core/input.tsscript16.8 KB
engine/src/canvas-core/isometric.tsscript36.2 KB
engine/src/canvas-core/isometricKit.tsscript3.9 KB
engine/src/canvas-core/kinetic.tsscript42.6 KB
engine/src/canvas-core/kineticDemo.tsscript3.6 KB
engine/src/canvas-core/koi.tsscript28.9 KB
engine/src/canvas-core/koiAlive.tsscript34 B
engine/src/canvas-core/koiDraw.tsscript3.5 KB
engine/src/canvas-core/koiDrawKit.tsscript6.9 KB
engine/src/canvas-core/koiWorld.tsscript9.3 KB
engine/src/canvas-core/launch.tsscript39.5 KB
engine/src/canvas-core/launch2.tsscript27.6 KB
engine/src/canvas-core/launch3.tsscript9.2 KB
engine/src/canvas-core/launchClip.tsscript39 B
engine/src/canvas-core/launchCode.tsscript3.8 KB
engine/src/canvas-core/launchCut.tsscript6.9 KB
engine/src/canvas-core/launchExample.tsscript3.4 KB
engine/src/canvas-core/launchExampleBrand.tsscript7.7 KB
engine/src/canvas-core/launchExampleClean.tsscript6.7 KB
engine/src/canvas-core/launchExampleCleanChat.tsscript5.0 KB
engine/src/canvas-core/launchExampleCleanScore.tsscript3.4 KB
engine/src/canvas-core/launchExampleScore.tsscript3.7 KB
engine/src/canvas-core/launchGallery.tsscript9.2 KB
engine/src/canvas-core/launchKit.tsscript28.1 KB
engine/src/canvas-core/launchLayout.tsscript19.9 KB
engine/src/canvas-core/launchLook.tsscript17.7 KB
engine/src/canvas-core/launchSound.tsscript5.8 KB
engine/src/canvas-core/launchTemplate.tsscript117.8 KB
engine/src/canvas-core/lesson.tsscript9.4 KB
engine/src/canvas-core/lessonCat.tsscript22.4 KB
engine/src/canvas-core/lessonCatFinal.tsscript204 B
engine/src/canvas-core/lessonCatSheet.tsscript263 B
engine/src/canvas-core/lessonOwl.tsscript49.3 KB
engine/src/canvas-core/lessonOwlFinal.tsscript204 B
engine/src/canvas-core/lessonOwlLayout.tsscript11.0 KB
engine/src/canvas-core/lessonOwlScore.tsscript8.7 KB
engine/src/canvas-core/lessonOwlSheet.tsscript446 B
engine/src/canvas-core/lessonOwlSocial.tsscript6.2 KB
engine/src/canvas-core/lettering.tsscript5.9 KB
engine/src/canvas-core/lighthouse.tsscript12.3 KB
engine/src/canvas-core/lighthouseDraw.tsscript5.5 KB
engine/src/canvas-core/lowPoly.tsscript24.5 KB
engine/src/canvas-core/mascotHero.tsscript4.6 KB
engine/src/canvas-core/mechanism.tsscript27.9 KB
engine/src/canvas-core/mechanismBlueprint.tsscript260 B
engine/src/canvas-core/mechanismDraw.tsscript297 B
engine/src/canvas-core/mechanismExplorer.tsscript4.8 KB
engine/src/canvas-core/mechanismHands.tsscript17.1 KB
engine/src/canvas-core/mechanismKit.tsscript38.9 KB
engine/src/canvas-core/mechanismPencil.tsscript277 B
engine/src/canvas-core/mechanismStipple.tsscript250 B
engine/src/canvas-core/mellan.tsscript9.7 KB
engine/src/canvas-core/mellanUnspool.tsscript3.2 KB
engine/src/canvas-core/midCentury.tsscript24.6 KB
engine/src/canvas-core/miraComic.tsscript4.3 KB
engine/src/canvas-core/miraEveryHand.tsscript5.2 KB
engine/src/canvas-core/miraRiso.tsscript3.6 KB
engine/src/canvas-core/miraSheet.tsscript8.0 KB
engine/src/canvas-core/miraTile.tsscript5.1 KB
engine/src/canvas-core/miraTriptych.tsscript2.7 KB
engine/src/canvas-core/miraWalk.tsscript7.7 KB
engine/src/canvas-core/moonPhases.tsscript16.7 KB
engine/src/canvas-core/moonPhasesDraw.tsscript4.3 KB
engine/src/canvas-core/morph.tsscript8.8 KB
engine/src/canvas-core/morphDemo.tsscript2.4 KB
engine/src/canvas-core/motif.tsscript2.5 KB
engine/src/canvas-core/motionKit.tsscript9.3 KB
engine/src/canvas-core/motionMeta.tsscript1.1 KB
engine/src/canvas-core/music/arc.tsscript6.2 KB

engine/src/canvas-core/characters/theo/baker.ts

View on GitHub
// THEO, THE BAKER. The adult proof of the drawing layer: a specific man, not a figure model.
// Mid-forties, 1.78 m, the realistic 7.5-head canon (the rig and every gate are Theo's), built
// solid: sloping shoulders, a softening middle, a baker's forearms. Short dark hair going grey at
// the temples, a close beard and moustache, a white shirt with the sleeves rolled to mid-forearm,
// a canvas apron from the chest to below the knee, dark work trousers, brown boots. He holds a
// round loaf out toward us, weight on his left leg, head tipped, pleased with it.
//
// Everything SEEN is designed here: cross-section tables swept along gesture curves through his
// joints (character/design.ts). The skeleton only says where the curves go.
import type { P } from "../../core";
import { Blob, Camera, I3, V3, add, apply, mix3, mul, mv, norm, project, sub } from "../../character/math3";
import { type Section, type Station, jointed, station, stationU, sweep } from "../../character/design";
import { type BlobPart, toPart } from "../../character/build";
import type { Character, Mark, Part, Pose, Scene } from "../../character/types";
import { type Rig, SIDES, sgn } from "../../character/human/skeleton";
import { assemble, build, checkPose, rigFor } from "../../character/human/figure";
import { hairCap } from "../../character/human/head";
import { viewOf } from "../../character/view25d";
import { contrapposto, reach, stand } from "../../character/human/balance";
import { THEO_SPEC } from "./index";
import { THEO_DIMS } from "./poses";

// ---- the designed masses (head units: lateral, medial, front, back)
const SHIRT: Section[] = [[0, 0.62, 0.62, 0.43, 0.46], [0.24, 0.6, 0.6, 0.47, 0.39], [0.5, 0.63, 0.63, 0.45, 0.4], [0.76, 0.68, 0.68, 0.39, 0.36], [0.86, 0.64, 0.64, 0.33, 0.31], [0.93, 0.46, 0.46, 0.27, 0.27], [1, 0.24, 0.24, 0.22, 0.22]];   // the top falls away: sloping shoulders, never a shelf
const SLEEVE: Section[] = [[0, 0.12, 0.1, 0.14, 0.14], [0.12, 0.2, 0.17, 0.2, 0.19], [0.3, 0.21, 0.18, 0.21, 0.2], [0.58, 0.175, 0.165, 0.18, 0.18], [0.84, 0.17, 0.165, 0.17, 0.17], [0.9, 0.21, 0.21, 0.21, 0.21], [1, 0.21, 0.21, 0.21, 0.21]];   // the roll bulges at the end
const FOREARM: Section[] = [[0, 0.165, 0.155, 0.16, 0.165], [0.2, 0.195, 0.16, 0.165, 0.16], [0.55, 0.145, 0.13, 0.125, 0.125], [1, 0.1, 0.09, 0.075, 0.075]];   // swell high on the thumb side, flat at the wrist
const TROUSER: Section[] = [[0, 0.35, 0.31, 0.34, 0.38], [0.3, 0.31, 0.27, 0.31, 0.31], [0.5, 0.23, 0.21, 0.23, 0.21], [0.66, 0.23, 0.21, 0.21, 0.24], [0.94, 0.19, 0.19, 0.19, 0.19], [1, 0.2, 0.2, 0.2, 0.2]];
const BOOT: Section[] = [[0, 0.14, 0.14, 0.14, 0.14], [0.45, 0.175, 0.175, 0.12, 0.12], [0.85, 0.17, 0.17, 0.1, 0.1], [1, 0.13, 0.13, 0.07, 0.07]];
const SHAFT: Section[] = [[0, 0.16, 0.16, 0.16, 0.16], [1, 0.155, 0.155, 0.155, 0.155]];
const APRON: Section[] = [[0, 0.27, 0.27, 0.02, 0.02], [0.18, 0.3, 0.3, 0.02, 0.02], [0.3, 0.5, 0.5, 0.02, 0.02], [0.7, 0.52, 0.52, 0.02, 0.02], [1, 0.54, 0.54, 0.02, 0.02]];   // a plate: wide, thin

const P2 = (cam: Camera, v: V3): P => { const q = project(cam, v); return [q.x, q.y]; };
const mk = (id: string, role: string, polys: P[][], cam: Camera, at: V3, bias: number, o: Partial<Part> = {}): Part => { const q = project(cam, at); return { id, role, depth: q.z + bias, polys, size: q.s * 0.14, marks: [], ...o }; };
const faces = (cam: Camera, at: V3, n: V3) => { const v = norm(sub(cam.eye, at)); return n[0] * v[0] + n[1] * v[1] + n[2] * v[2]; };

export const drawnBaker = (r: Rig, cam: Camera): Part[] => {
  const hh = r.dims.hh, out: Part[] = [], C = r.chest;
  const shirtSt: Station[] = [station(r.pelvis, [0, -0.02 * hh, 0]), station(r.lumbar), station(C, [0, 0.45 * hh, 0]), station(C, [0, 1.0 * hh, 0]), station(C, [0, 1.24 * hh, -0.05 * hh])];
  out.push(mk("shirt", "shirt", sweep(cam, shirtSt, SHIRT, { hh, side: 1, n: 12, caps: [false, false] }), cam, r.joints.chest, 0, { over: ["legL", "legR"] }));
  for (const s of SIDES) {
    const k = sgn(s) as 1 | -1;
    const sl: Station[] = [station(r.upper[s], [-k * 0.03 * hh, -0.02 * hh, 0]), station(r.fore[s]), station(r.fore[s], [0, -0.42 * r.dims.forearm, 0])];
    out.push(mk("sleeve" + s, "shirt", jointed(cam, sl, SLEEVE, { hh, side: k, n: 10, cuts: [stationU(sl, 1)] }), cam, r.joints["elbow" + s], -0.06 * hh, { seams: [{ at: P2(cam, r.joints["shoulder" + s]), r: 0.3 * hh * project(cam, r.joints["shoulder" + s]).s, with: "shirt" }] }));
    const fa: Station[] = [station(r.fore[s], [0, -0.05 * hh, 0]), station(r.hand[s], [0, 0.02 * hh, 0])];
    out.push(mk("forearm" + s, "skin", sweep(cam, fa, FOREARM, { hh, side: k, n: 10, caps: [false, true] }), cam, apply(r.fore[s], [0, -0.6 * r.dims.forearm, 0]), -0.055 * hh, { over: [] }));
    const lg: Station[] = [station(r.thigh[s]), station(r.shin[s]), station(r.foot[s], [0, 0.04 * hh, 0])];
    out.push(mk("leg" + s, "trousers", jointed(cam, lg, TROUSER, { hh, side: k, n: 10, cuts: [stationU(lg, 1)] }), cam, r.joints["knee" + s], -0.02 * hh));
    const sh: Station[] = [station(r.shin[s], [0, -0.82 * r.dims.shin, 0]), station(r.foot[s], [0, -0.05 * hh, 0])];
    const ft: Station[] = [station(r.foot[s], [0, -0.22 * hh, -0.18 * hh]), station(r.foot[s], [0, -0.22 * hh, 0.25 * hh]), station(r.toes[s], [0, -0.03 * hh, 0.14 * hh])];
    out.push(mk("boot" + s, "boots", [...sweep(cam, sh, SHAFT, { hh, side: k, n: 6, caps: [false, false] }), ...sweep(cam, ft, BOOT, { hh, side: k, n: 8 })], cam, apply(r.foot[s], [0, 0, 0.1 * hh]), -0.03 * hh, { over: ["leg" + s] }));
  }
  // the apron: hung from the chest, tied at the waist, falling past the knees; it lies ON his front
  const knees = mix3(r.joints.kneeL, r.joints.kneeR, 0.5), fwd = norm(mv(r.pelvis.R, [0, 0, 1]));
  const apSt: Station[] = [station(C, [0, 0.95 * hh, 0.42 * hh]), station(C, [0, 0.5 * hh, 0.5 * hh]), station(r.lumbar, [0, 0.1 * hh, 0.52 * hh]), station(r.pelvis, [0, -0.3 * hh, 0.46 * hh]), { at: add(add(knees, mul(fwd, 0.28 * hh)), [0, 0.1 * hh, 0]), frame: r.pelvis }];
  // it covers the shirt only from the front: seen from behind it is under him, not painted over his back
  const front = faces(cam, apply(r.lumbar, [0, 0, 0.6 * hh]), fwd) > 0;
  const apron = mk("apron", "apron", sweep(cam, apSt, APRON, { hh, side: 1, n: 10, caps: [false, false] }), cam, apply(r.lumbar, [0, 0, 0.6 * hh]), front ? -0.2 * hh : 0.4 * hh, { over: front ? ["shirt", "legL", "legR"] : [] });
  // the apron's hem stitching, the waist ties, the neck strap, a pocket
  const px = project(cam, r.joints.lumbar).s * hh, w = Math.max(0.8, px * 0.012);
  const onApron = (loc: [V3, V3][]) => loc.map(([f0, l]) => P2(cam, add(f0, l)));
  const waistL = apply(r.lumbar, [0.5 * hh, 0.1 * hh, 0.3 * hh]), waistR = apply(r.lumbar, [-0.5 * hh, 0.1 * hh, 0.3 * hh]), bow = apply(r.lumbar, [-0.62 * hh, 0.02 * hh, 0.1 * hh]);
  if (faces(cam, apply(r.lumbar, [0, 0, 0.6 * hh]), fwd) > 0.05) {
    apron.marks.push({ kind: "line", pts: onApron([[waistL, [0, 0, 0]], [waistR, [0, 0, 0]]]), role: "apronDark", w: w * 2.2, alpha: 0.9 });
    apron.marks.push({ kind: "line", pts: [P2(cam, waistR), P2(cam, bow), P2(cam, add(bow, [0, -0.35 * hh, 0.05 * hh]))], role: "apronDark", w: w * 1.8, alpha: 0.85 });
    const pk = [[-0.22, -0.02], [0.22, -0.02], [0.22, -0.34], [-0.22, -0.34]].map(([x, y]) => P2(cam, apply(r.pelvis, [x * hh, y * hh, 0.5 * hh])));
    apron.marks.push({ kind: "line", pts: [...pk, pk[0]], role: "apronDark", w, alpha: 0.7 });
    // canvas hangs from the tie in long soft folds that open toward the hem
    const hemMid = add(add(knees, mul(fwd, 0.29 * hh)), [0, 0.1 * hh, 0]), side = norm(mv(r.pelvis.R, [1, 0, 0]));
    [-0.34, -0.12, 0.16, 0.38].forEach((x, i) => { const top = apply(r.pelvis, [x * 0.55 * hh, -0.2 * hh, 0.5 * hh]), bot = add(hemMid, mul(side, x * hh * (1 + 0.1 * i))); apron.marks.push({ kind: "line", pts: [0, 0.35, 0.7, 0.95].map((t) => P2(cam, add(mix3(top, bot, t), mul(side, Math.sin(t * Math.PI) * 0.02 * hh * (i % 2 ? 1 : -1))))), role: "apronDark", w: w * 0.9, alpha: 0.45 }); });
  }
  out.push(apron);
  return out;
};

// his head: the beard and moustache as volumes on the jaw, the hair short and greying at the sides
const beardParts = (r: Rig, cam: Camera, headM: (q: V3) => V3, headR: import("../../character/math3").M3): Part[] => {
  const hh = r.dims.hh, B = (c: V3, rr: V3): Blob => ({ c: headM(c), R: headR, r: mul(rr, hh) });
  // a CLOSE beard: it follows the jaw and chin, stops under the mouth, thins up the cheek to the sideburn
  const beard: BlobPart = { id: "beard", role: "beard", groups: [{ blobs: [B([0.265, 0.17, 0.03], [0.08, 0.1, 0.1]), B([-0.265, 0.17, 0.03], [0.08, 0.1, 0.1]), B([0.06, 0.035, 0.3], [0.08, 0.065, 0.09]), B([-0.06, 0.035, 0.3], [0.08, 0.065, 0.09]), B([0, 0.105, 0.31], [0.13, 0.055, 0.09]), B([0.21, 0.25, 0.15], [0.055, 0.075, 0.08]), B([-0.21, 0.25, 0.15], [0.055, 0.075, 0.08])], mode: "hull" }], over: ["head"], depthAt: headM([0, 0.25, 0.1]) };
  const stache: BlobPart = { id: "moustache", role: "beard", groups: [{ blobs: [B([-0.075, 0.245, 0.43], [0.05, 0.022, 0.03]), B([0, 0.262, 0.46], [0.045, 0.02, 0.03]), B([0.075, 0.245, 0.43], [0.05, 0.022, 0.03])], mode: "chain" }], over: ["head", "beard", "nose"], depthAt: headM([0, 0.26, 0.5]) };
  return [toPart(cam, beard), toPart(cam, stache)];
};

const FACE = { line: "line", pupil: "pupil", white: "white", blush: "blush", brow: "hair", mouth: "mouth", lip: "lip" };
export const bakerScene = (p: Pose, cam: Camera): Scene => {
  const b = build(THEO_SPEC, p, cam), r = b.rig, hh = r.dims.hh, h = b.head;
  const hidden = new Set(["torso", "hips", "upperArmL", "upperArmR", "foreArmL", "foreArmR", "thighL", "thighR", "shinL", "shinR", "footL", "footR"]);
  b.parts = b.parts.filter((q) => !hidden.has(q.id));
  const sc = assemble(cam, b, p, FACE, { character: "theo-baker", version: "2.0.0" }, (parts) => {
    const head = parts.find((q) => q.id === "head")!, out: Part[] = [...drawnBaker(r, cam), ...beardParts(r, cam, h.M, h.f.R)];
    // turned away, the beard is behind the head: it must not paint over the back of it
    if (Math.abs(viewOf(cam, h.f).yaw) > 100) out.filter((q) => q.id === "beard" || q.id === "moustache").forEach((q) => { q.over = []; q.depth = head.depth + 0.2 * hh; });
    // the mouth line and lips sit between the moustache and the beard: move them onto the moustache so they paint last
    const lipMarks = head.marks.filter((m) => m.kind !== "dot" && m.tag === "mouth");
    head.marks = head.marks.filter((m) => !lipMarks.includes(m)); out.find((q) => q.id === "moustache")!.marks.push(...lipMarks);
    const hair = hairCap(h, "hair", { front: 0.84, side: 0.58, back: 0.28, lift: 0.035, sideburn: 0.2 });
    // grey at the temples: short strokes where the sides turn toward us
    [-1, 1].forEach((s) => { const pts: P[] = [0, 1, 2, 3].map((i) => P2(cam, h.M([s * 0.37, 0.55 + i * 0.05, 0.12 - i * 0.02]))); const n = mv(h.f.R, [s, 0, 0.2]); if (faces(cam, h.M([s * 0.37, 0.6, 0.1]), n) > 0.15) hair.marks.push({ kind: "line", pts, role: "grey", w: Math.max(1, head.size * 0.03), alpha: 0.9 }); });
    out.push(hair);
    return out;
  });
  // the gesture the drawing was built on: spine, weight leg, arms
  const G = (pts: V3[]) => pts.map((v) => P2(cam, v));
  sc.gesture = [G([r.joints.crown, r.joints.head, r.joints.neck, r.joints.chest, r.joints.lumbar, r.joints.pelvis, r.joints.hipL, r.joints.kneeL, r.joints.ankleL]), G([r.joints.shoulderL, r.joints.elbowL, r.joints.wristL]), G([r.joints.shoulderR, r.joints.elbowR, r.joints.wristR]), G([r.joints.hipR, r.joints.kneeR, r.joints.ankleR])];
  return sc;
};

// ---- the pose: presenting a round loaf, weight on the left leg, head tipped toward it
export const LOAF_R = 0.1;
export const bakerPose = (yaw: number): { pose: Pose; loaf: V3 } => {
  const D = THEO_DIMS, AH = D.ankleH, T = (v: V3): V3 => mv([Math.cos((yaw * Math.PI) / 180), 0, Math.sin((yaw * Math.PI) / 180), 0, 1, 0, -Math.sin((yaw * Math.PI) / 180), 0, Math.cos((yaw * Math.PI) / 180)], v);
  // a gentle contrapposto, the spine bending back exactly as far as the pelvis tips, so the shoulders sit over the feet
  const cp = contrapposto("L", 0.55); cp.spineSide = -(cp.pelvisSide ?? 0) * 1.1;
  let p: Pose = { root: [0, D.root, 0], yaw, joints: { ...cp, spineBend: -3, neckBend: 6, headNod: 6, headTilt: 8, neckTwist: -6 }, expression: { smile: 0.7, cheek: 0.5, lidLower: 0.25, browRaise: 0.25, lookY: -0.2 }, hands: { L: "grip", R: "grip" }, plant: false };
  const feet = { L: T([0.06, AH, 0]), R: T([-0.09, AH, 0.15]) }, over = T([0.06, 0, 0.06]);   // the free foot a short step forward, not out: the legs stay near plumb
  p = stand(D, p, feet, [over[0], over[2]], { R: 3 });
  const loaf = add(T([0.0, 0, 0.42]), [p.root[0], 1.12, p.root[2]]);
  for (let k = 0; k < 2; k++) {
    p = reach(D, { ...p, joints: { ...p.joints, shoulderSwingL: p.joints.shoulderSwingL ?? 75, shoulderRaiseL: p.joints.shoulderRaiseL ?? 30, elbowL: p.joints.elbowL ?? 90 } }, "L", add(loaf, T([0.12, -0.05, -0.03])));
    p = reach(D, { ...p, joints: { ...p.joints, shoulderSwingR: p.joints.shoulderSwingR ?? 75, shoulderRaiseR: p.joints.shoulderRaiseR ?? 30, elbowR: p.joints.elbowR ?? 90 } }, "R", add(loaf, T([-0.12, -0.05, -0.03])));
    p = stand(D, p, feet, [over[0], over[2]], { R: 3 }, 6);
  }
  return { pose: p, loaf };
};
// the loaf: a round boule, crust scored in a cross, flour dusted on top
export const loafPart = (cam: Camera, at: V3): Part => {
  const b: BlobPart = { id: "loaf", role: "crust", groups: [{ blobs: [{ c: at, R: I3, r: [LOAF_R * 1.12, LOAF_R * 0.72, LOAF_R * 1.05] }], mode: "each" }], depthAt: add(at, [0, 0, -0.02]) };
  const part = toPart(cam, b), marks: Mark[] = [], s = project(cam, at).s;
  [[-1, 1], [1, 1]].forEach(([a, c]) => marks.push({ kind: "line", pts: [-0.7, -0.35, 0, 0.35, 0.7].map((t) => P2(cam, add(at, [t * LOAF_R * a * 0.8, LOAF_R * 0.66 * Math.sqrt(1 - t * t * 0.6), t * LOAF_R * c * 0.8 + 0.01]))), role: "crustDark", w: Math.max(1.2, s * 0.012), alpha: 0.9 }));
  for (let i = 0; i < 26; i++) { const a = i * 2.39996, rr = Math.sqrt(i / 26) * LOAF_R * 0.7; marks.push({ kind: "dot", at: P2(cam, add(at, [Math.cos(a) * rr, LOAF_R * 0.7, Math.sin(a) * rr])), rx: 1.2, ry: 1.2, rot: 0, role: "flour", alpha: 0.9 }); }
  part.marks = marks; return part;
};

export const theoBaker: Character = {
  id: "theo-baker", name: "Theo the baker", version: "2.0.0", canonId: "adult",
  description: "Baker in his forties, 7.5 heads, 1.78 m: close beard, short hair greying at the temples, white shirt with rolled sleeves, canvas apron, dark trousers, brown boots.",
  roles: {
    skin: { family: "warm skin", hue: [10, 40], note: "" }, shirt: { family: "white", hue: [0, 360], note: "" }, apron: { family: "canvas ochre", hue: [30, 55], note: "" },
    trousers: { family: "warm dark grey", hue: [0, 60], note: "" }, boots: { family: "brown", hue: [15, 35], note: "" }, hair: { family: "dark brown", hue: [0, 40], note: "" },
  },
  features: [{ id: "beard", parts: ["beard", "moustache"], note: "close beard and moustache", visible: (y) => Math.abs(y) < 150 }, { id: "apron", parts: ["apron"], note: "canvas apron", visible: (y) => Math.abs(y) < 100 }],
  pose: (p: Pose) => { checkPose(p, "theo-baker"); return p; },
  toScene: (p: Pose, cam: Camera) => bakerScene(p, cam),
};
export { rigFor };
receiving-code-reviewobra/superpowersUse when receiving code review feedback, before implementing suggestions, especially if feedback seems unclear or technically questionable - requires technical rigor and verification, not performative agreement or blind implementationStars: 322kUpdated Claude CodeCodexVerifiedInstall
requesting-code-reviewobra/superpowersUse when completing tasks, implementing major features, or before merging to verify work meets requirementsStars: 322kUpdated Claude CodeCodexVerifiedInstall
using-git-worktreesobra/superpowersUse when starting feature work that needs isolation from current workspace or before executing implementation plans - ensures an isolated workspace exists via native tools or git worktree fallbackStars: 322kUpdated Claude CodeCodexVerifiedInstall
verification-before-completionobra/superpowersUse when about to claim work is complete, fixed, or passing, before committing or creating PRs - requires running verification commands and confirming output before making any success claims; evidence before assertions alwaysStars: 322kUpdated Claude CodeCodexVerifiedInstall