@algorisys/tinyfly 0.78.0 → 0.81.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -6,6 +6,7 @@ import type { BodyPlan, Pose, Vec3 } from './rig/body-plan';
6
6
  import { type SolvedHead } from './rig/skeleton';
7
7
  import { type Look, type Pen, type PencilOptions } from './look/pen';
8
8
  import { type HumanPoseName } from './species/human';
9
+ import { type HandPose } from './hands/hand-rig';
9
10
  /**
10
11
  * Characters (v2): any body plan, posed by numbers, turned in 3D, drawn flat
11
12
  * in a look (clean, pencil, silhouette) and a figure style (fluid, stick).
@@ -59,6 +60,21 @@ export interface CharacterOptions {
59
60
  layers?: CharacterLayers;
60
61
  /** 'ground' (default) rests the lowest contact point on the ground; 'none' leaves the figure where its pose puts it */
61
62
  contact?: 'ground' | 'none';
63
+ /**
64
+ * Hands on the fluid figure: `dot` (default) a round end to each arm,
65
+ * `cartoon` posed cartoon hands (gloved in `skin`), shaped by the pose's
66
+ * `hand.left.*` / `hand.right.*` fields (any field of a hand pose, e.g.
67
+ * `hand.right.index.curl`; see {@link characterHandPose})
68
+ */
69
+ hands?: 'dot' | 'cartoon';
70
+ /**
71
+ * Cartoon hands as `glove` (default: a thumb and three plump fingers, the
72
+ * classic cartoon glove) or `natural` (five slimmer fingers, so shapes like
73
+ * mudras read finger by finger)
74
+ */
75
+ handStyle?: 'glove' | 'natural';
76
+ /** Cartoon hand length, wrist to fingertip, fraction of the height (default 0.17 for gloves, 0.14 natural) */
77
+ handSize?: number;
62
78
  }
63
79
  /** A character, with every option resolved. Plain data plus its plan. */
64
80
  export interface Character {
@@ -73,6 +89,9 @@ export interface Character {
73
89
  pencil: PencilOptions;
74
90
  layers: CharacterLayers;
75
91
  contact: 'ground' | 'none';
92
+ hands: 'dot' | 'cartoon';
93
+ handStyle: 'glove' | 'natural';
94
+ handSize: number;
76
95
  }
77
96
  export declare function character(options?: CharacterOptions): Character;
78
97
  /** Where every part of a character is, as drawn, in its drawing space (feet at 0, 0; up is -y). */
@@ -103,6 +122,13 @@ export declare function pointOnHead(head: SolvedHead, x: number, y: number, z: n
103
122
  };
104
123
  /** Where every part of a character is for a pose, as `drawCharacter` would draw it. */
105
124
  export declare function characterJoints(character: Character, pose: Pose): CharacterJoints;
125
+ /**
126
+ * The hand pose a character's pose gives one of its hands: its `hand.<side>.*`
127
+ * fields over a relaxed hand. The wrist turn starts from how a hand hangs at
128
+ * the side (thumb forward), seen from the character's view, so `hand.right.turn`
129
+ * 0 is a natural hand and 1 turns it a quarter further.
130
+ */
131
+ export declare function characterHandPose(pose: Pose, side: 'left' | 'right'): HandPose;
106
132
  /**
107
133
  * Draw a character in a pose with its feet at (0, 0). `time` (ms) picks the
108
134
  * pencil's boil frame and is passed to layer hooks.
@@ -0,0 +1,196 @@
1
+ import type { EasingType, Track } from '../engine/types';
2
+ import { type HandPose, type HandShapeName } from './hands/hand-rig';
3
+ import { type DanceFrame, type Dancer, type Expression, type ExpressionName, type StickPose } from './stick-figure';
4
+ /**
5
+ * Dancing for the stick figure, as plain data.
6
+ *
7
+ * A **move** is a short loop of poses keyed in beats (a disco point is two
8
+ * beats: arm up, arm down). A **style** is a stance, a groove (the bounce and
9
+ * sway every beat carries), its moves and a routine that strings them
10
+ * together. Everything is counted in beats, so the same dance plays at any
11
+ * tempo: `beat = time × bpm / 60000`.
12
+ *
13
+ * Every function here is pure: the same style and beat always give the same
14
+ * pose, so a dance scrubs, renders to video and syncs to music exactly.
15
+ */
16
+ /** Hands in a dance key: a shape name or a full hand pose, per side. */
17
+ export interface DanceHands {
18
+ left?: HandShapeName | MudraName | HandPose;
19
+ right?: HandShapeName | MudraName | HandPose;
20
+ }
21
+ export interface DanceKey {
22
+ /** When, in beats from the start of the move */
23
+ beat: number;
24
+ /** Joints that change from the previous key (the first key builds on the stance) */
25
+ pose?: Partial<StickPose>;
26
+ /** Start again from the stance before applying `pose`, instead of from the previous key */
27
+ reset?: boolean;
28
+ /** Hand shapes from this key on */
29
+ hands?: DanceHands;
30
+ /** Easing into this key (default: the move's, else ease-in-out) */
31
+ easing?: EasingType;
32
+ /** Parts of the feet that strike the floor at this key: the sounds of tap, a stamp */
33
+ taps?: TapName[];
34
+ }
35
+ /** Where a foot strikes the floor: its toe (the ball) or its heel. */
36
+ export type TapName = 'leftToe' | 'leftHeel' | 'rightToe' | 'rightHeel';
37
+ /** One strike of a foot, `beat` beats from the start of the dance. */
38
+ export interface DanceTap {
39
+ beat: number;
40
+ tap: TapName;
41
+ }
42
+ export interface DanceMove {
43
+ label: string;
44
+ /** Length of one loop, in beats */
45
+ beats: number;
46
+ /** Keys in beat order; after the last, the move eases back to the first */
47
+ keys: DanceKey[];
48
+ /** Easing between keys that do not name their own */
49
+ easing?: EasingType;
50
+ }
51
+ /**
52
+ * What every beat carries, whatever the move: a knee bounce (down on the beat
53
+ * for hip hop, up for a springy jazz feel) and a side-to-side sway.
54
+ */
55
+ export interface Groove {
56
+ /** Knee bend at the bottom of the bounce, degrees (0 none) */
57
+ bounce: number;
58
+ /** Where the bounce is lowest: on the beat (`down`, default) or between beats (`up`) */
59
+ accent?: 'down' | 'up';
60
+ /** Upper-body sway, degrees either side, over two beats */
61
+ sway?: number;
62
+ }
63
+ /** One step of a routine: a move, for how many beats, optionally mirrored. */
64
+ export interface RoutineStep {
65
+ move: string;
66
+ beats: number;
67
+ /** Dance it on the other side: left and right swap */
68
+ mirror?: boolean;
69
+ }
70
+ export interface DanceStyle {
71
+ label: string;
72
+ /** The tempo it is made for; any tempo plays it */
73
+ bpm: number;
74
+ /** Joints that differ from rest while dancing: the base every move builds on */
75
+ stance: Partial<StickPose>;
76
+ /** The face while dancing */
77
+ expression?: ExpressionName | Partial<Expression>;
78
+ /** Hand shapes before any key sets them (default relaxed) */
79
+ hands?: DanceHands;
80
+ groove: Groove;
81
+ moves: Record<string, DanceMove>;
82
+ /** The moves in order; it loops */
83
+ routine: RoutineStep[];
84
+ }
85
+ /**
86
+ * Hand gestures of Indian classical dance (hasta mudras), as cartoon-hand
87
+ * poses, palm toward the viewer. Use them by name in a key's `hands`.
88
+ */
89
+ export declare const MUDRAS: {
90
+ /** Flag: fingers together and straight, thumb bent in */
91
+ pataka: HandPose;
92
+ /** Pataka with the ring finger bent */
93
+ tripataka: HandPose;
94
+ /** Lotus in bloom: fingers fanned, each a little more curled than the last */
95
+ alapadma: HandPose;
96
+ /** Fist */
97
+ mushti: HandPose;
98
+ /** Fist, thumb up */
99
+ shikhara: HandPose;
100
+ /** Swan's beak: thumb and index touch, the others fanned */
101
+ hamsasya: HandPose;
102
+ /** Bracelet: thumb, index and middle meet, ring and little finger out */
103
+ katakamukha: HandPose;
104
+ };
105
+ export type MudraName = keyof typeof MUDRAS;
106
+ /**
107
+ * A pose danced on the other side. Front-on (`turn` below 0.5) left and right
108
+ * swap and leans and spins reverse, a mirror image. Side-on the figure still
109
+ * faces the same way: the other arm and leg do the same thing (swapped, and
110
+ * their angles negated, since forward is negative on the left), and leans and
111
+ * spins stay as they are.
112
+ */
113
+ export declare function mirrorPose(pose: StickPose): StickPose;
114
+ /** Bounce and sway at `beat`, on top of a pose. */
115
+ export declare function applyGroove(pose: StickPose, groove: Groove, beat: number): StickPose;
116
+ /** The stance a style dances from, with its face. */
117
+ export declare function danceStance(style: DanceStyle): StickPose;
118
+ export interface DanceOptions {
119
+ /** Dance one move on a loop instead of the style's routine */
120
+ move?: string;
121
+ /** Mirror it (with `move`) */
122
+ mirror?: boolean;
123
+ }
124
+ /**
125
+ * The figure dancing `style` at `beat` (beats from the start; it loops): the
126
+ * pose, with the groove, and the hand shapes. Moves blend into each other
127
+ * over half a beat.
128
+ */
129
+ export declare function danceFrame(style: DanceStyle | DanceStyleName, beat: number, options?: DanceOptions): DanceFrame;
130
+ /** Just the pose of {@link danceFrame}. */
131
+ export declare function dancePose(style: DanceStyle | DanceStyleName, beat: number, options?: DanceOptions): StickPose;
132
+ /** Length of a style's routine, in beats. */
133
+ export declare function routineBeats(style: DanceStyle | DanceStyleName): number;
134
+ /**
135
+ * The foot strikes between beat `from` (included) and `to` (not), in order:
136
+ * what a scene plays tap sounds or stamps on. Call it each frame with the
137
+ * previous frame's beat and this one's to get exactly the taps that just
138
+ * happened; it follows the routine (and its mirrored steps) as
139
+ * {@link danceFrame} does, looping it.
140
+ */
141
+ export declare function danceTaps(style: DanceStyle | DanceStyleName, from: number, to: number, options?: DanceOptions): DanceTap[];
142
+ /** Beats since `start` at `time` (both ms), at `bpm`. */
143
+ export declare function beatAt(time: number, bpm: number, start?: number): number;
144
+ /**
145
+ * A {@link Dancer} for `stickFigureTarget({ dance })`: the target's `beat`
146
+ * prop then plays the style (and `dancing` blends it in).
147
+ */
148
+ export declare function dancer(style: DanceStyle | DanceStyleName, options?: DanceOptions): Dancer;
149
+ export interface DanceTrackOptions {
150
+ /** Tempo (default the style's) */
151
+ bpm: number;
152
+ /** How many beats to dance */
153
+ beats: number;
154
+ /** When the dance starts, ms (default 0) */
155
+ start?: number;
156
+ /** Beats to blend in from standing and back out at the end (default 1) */
157
+ fade?: number;
158
+ }
159
+ /**
160
+ * Tracks that make a `stickFigureTarget({ dance })` dance: `beat` counts up
161
+ * at the tempo, and `dancing` blends in at the start and out at the end.
162
+ * Two small tracks, so the timeline JSON stays tiny.
163
+ */
164
+ export declare function danceTracks(target: string, options: DanceTrackOptions): Track[];
165
+ export interface DanceBakeOptions extends DanceOptions {
166
+ /** Bake the hand shapes too, as `hand.left.*` / `hand.right.*` tracks (default true) */
167
+ hands?: boolean;
168
+ bpm?: number;
169
+ /** How many beats to bake (default the routine, or the move's length) */
170
+ beats?: number;
171
+ /** When it starts, ms (default 0) */
172
+ start?: number;
173
+ /** Keyframes per beat (default 4) */
174
+ samplesPerBeat?: number;
175
+ }
176
+ /**
177
+ * The dance as plain pose keyframes, for any stick-figure target and for
178
+ * timelines that must stand alone as JSON (no `dance` option needed). Only
179
+ * joints that move get a track. Hand shapes are baked as `hand.left.*` /
180
+ * `hand.right.*` tracks, which a target drawn with `style.hands` plays.
181
+ */
182
+ export declare function bakeDanceTracks(target: string, style: DanceStyle | DanceStyleName, options?: DanceBakeOptions): Track[];
183
+ /** Ready-made dance styles. Each is plain data: copy one and change it to make your own. */
184
+ export declare const DANCE_STYLES: {
185
+ disco: DanceStyle;
186
+ hipHop: DanceStyle;
187
+ breaking: DanceStyle;
188
+ jazz: DanceStyle;
189
+ kpop: DanceStyle;
190
+ bollywood: DanceStyle;
191
+ bhangra: DanceStyle;
192
+ bharatanatyam: DanceStyle;
193
+ charleston: DanceStyle;
194
+ tap: DanceStyle;
195
+ };
196
+ export type DanceStyleName = keyof typeof DANCE_STYLES;
@@ -42,7 +42,7 @@ export interface HandStyle {
42
42
  tool?: 'pencil' | 'eraser';
43
43
  /** Lean of the tool, degrees (default -30) */
44
44
  angle?: number;
45
- /** Size, 1 is a pencil 240 px long (default 1) */
45
+ /** Size, 1 is a pencil 190 px long (default 1) */
46
46
  scale?: number;
47
47
  /** Skin colour */
48
48
  skin?: string;
@@ -50,13 +50,66 @@ export interface HandStyle {
50
50
  sleeve?: string;
51
51
  /** Outline colour (default graphite) */
52
52
  outline?: string;
53
+ /**
54
+ * Length of the forearm shown past the wrist, px before scaling (default 300).
55
+ * The sleeve fades out toward its end, so the arm never needs to reach the
56
+ * edge of the frame.
57
+ */
58
+ arm?: number;
59
+ /**
60
+ * 0 the tip is on the paper, 1 lifted: the hand rises off the page and a soft
61
+ * shadow marks the point below it (see {@link handAt}).
62
+ */
63
+ lift?: number;
53
64
  }
54
65
  /**
55
- * A hand holding a pencil or an eraser with the tool's tip at `at`, its arm
56
- * reaching in from off screen. Pass a pen to sketch it: the tools are outlined
57
- * in pencil strokes and the hand shifts with the boil.
66
+ * A right hand holding a pencil or an eraser with the tool's tip at `at`: the
67
+ * cartoon hand rig (`drawCartoonHand`) in its `pencilGrip` shape, the tool
68
+ * held between the thumb and fingers, and the forearm leaving toward the
69
+ * lower right with its sleeve fading out. Pass a pen to sketch the tool's
70
+ * outline; the hand shifts with the boil.
58
71
  */
59
72
  export declare function drawHand(ctx: CanvasRenderingContext2D, at: Point, style?: HandStyle, pen?: SketchPen): void;
73
+ /** One stroke the hand draws (or rubs out), timed in ms, for {@link handAt}. */
74
+ export interface HandStroke {
75
+ /** When the tip starts along the path, ms */
76
+ start: number;
77
+ /** When it reaches the end, ms */
78
+ end: number;
79
+ /** The stroke, in scene coordinates */
80
+ path: Point[];
81
+ /** What the hand holds for this stroke (default pencil) */
82
+ tool?: 'pencil' | 'eraser';
83
+ }
84
+ export interface HandMotionOptions {
85
+ /** Where the hand waits off the page, scene coordinates (default far lower right: 2000, 1400) */
86
+ offstage?: Point;
87
+ /** Time to come in from offstage before the first stroke of a run, ms (default 450) */
88
+ enter?: number;
89
+ /** Time to leave after the last stroke of a run, ms (default 450) */
90
+ exit?: number;
91
+ /** Strokes closer together than this (ms) are one run: the hand moves between them instead of leaving (default 1500) */
92
+ linger?: number;
93
+ }
94
+ /** Where the hand is at a moment: see {@link handAt}. */
95
+ export interface HandPosition {
96
+ /** The tool's tip, scene coordinates */
97
+ at: Point;
98
+ tool: 'pencil' | 'eraser';
99
+ /** 0 on the paper (drawing), 1 lifted (travelling); pass it to {@link drawHand} as `lift` */
100
+ lift: number;
101
+ /** Whether the tip is drawing a stroke right now */
102
+ drawing: boolean;
103
+ }
104
+ /**
105
+ * Where the animator's hand is at `time` (ms), given the strokes it draws.
106
+ * During a stroke the tip follows it. Between strokes of a run it lifts and
107
+ * glides from where one ended to where the next begins, eased in and out; it
108
+ * comes in from `offstage` before a run and goes back after one. Returns null
109
+ * while the hand is off the page. Pure: the same strokes and time always give
110
+ * the same answer, so a scene can be scrubbed.
111
+ */
112
+ export declare function handAt(strokes: HandStroke[], time: number, options?: HandMotionOptions): HandPosition | null;
60
113
  /** A circle as points, starting at the top and running a little past a full turn, to draw on. */
61
114
  export declare function circlePath(cx: number, cy: number, r: number, overshoot?: number, segments?: number): Point[];
62
115
  export interface DrawnPathOptions {
@@ -0,0 +1,39 @@
1
+ import type { Point } from '../../adapters/canvas/sketch';
2
+ import { type Look, type Pen, type PencilOptions } from '../look/pen';
3
+ import { type HandJoints, type HandPose, type HandRigStyle } from './hand-rig';
4
+ /**
5
+ * Drawing a posed hand: the palm and each finger are parts, drawn far to near
6
+ * through a {@link Pen}, so a hand matches any look (clean, pencil,
7
+ * silhouette) and boils with a pencil figure.
8
+ */
9
+ export interface CartoonHandStyle extends HandRigStyle {
10
+ /** Skin fill (default a warm tan); a glove is just another colour */
11
+ skin?: string;
12
+ /** Outline colour (default graphite) */
13
+ ink?: string;
14
+ /** Outline width, px (default 3.5% of the size) */
15
+ lineWidth?: number;
16
+ /** Look, when no `pen` is given (default clean) */
17
+ look?: Look;
18
+ /** Pencil wobble seed (default 1) */
19
+ seed?: number;
20
+ pencil?: PencilOptions;
21
+ /** Draw with this pen instead of making one: share a character's pen so the hand matches it */
22
+ pen?: Pen;
23
+ /** Nails on fingertips that face the viewer (default true) */
24
+ nails?: boolean;
25
+ /**
26
+ * Something held, drawn among the hand's parts at `depth` (px toward the
27
+ * viewer, the palm being about 0): a pencil between the thumb and fingers,
28
+ * a cup behind them. Drawn in the same space as the hand.
29
+ */
30
+ prop?: {
31
+ depth: number;
32
+ draw: (pen: Pen) => void;
33
+ };
34
+ }
35
+ /**
36
+ * Draw a hand in a pose with its wrist at `at`. `time` (ms) picks the
37
+ * pencil's boil frame. Returns the joints as drawn, for attaching props.
38
+ */
39
+ export declare function drawCartoonHand(ctx: CanvasRenderingContext2D, at: Point, pose: HandPose, style?: CartoonHandStyle, time?: number): HandJoints;
@@ -0,0 +1,116 @@
1
+ import type { Point } from '../../adapters/canvas/sketch';
2
+ import type { Vec3 } from '../rig/body-plan';
3
+ /**
4
+ * Cartoon hands: a palm and five fingers built in the hand's own 3D space,
5
+ * posed by a flat record of numbers, turned and drawn flat. Because the hand
6
+ * is 3D, turning the wrist (back, side, palm toward us) needs no extra
7
+ * drawing code, and fingers behind the palm are drawn behind it.
8
+ *
9
+ * Hand space, for a right hand, in units of the hand's length (wrist to the
10
+ * tip of the middle finger):
11
+ * - **+y** runs from the wrist toward the fingers,
12
+ * - **+x** toward the little finger (the thumb is on the -x side),
13
+ * - **+z** out of the back of the hand (the palm faces -z).
14
+ *
15
+ * At `turn` 0 the back of the hand faces the viewer with the fingers up; a
16
+ * left hand is the right hand mirrored on screen. Pure: the same pose and
17
+ * style always give the same points.
18
+ */
19
+ export type FingerName = 'thumb' | 'index' | 'middle' | 'ring' | 'pinky';
20
+ export declare const FINGERS: readonly FingerName[];
21
+ /**
22
+ * A hand pose: every field a number, so poses blend and each field can be a
23
+ * timeline track.
24
+ *
25
+ * | Field | Meaning |
26
+ * |---|---|
27
+ * | `index.curl` … `pinky.curl` | 0 straight, 1 curled into the palm |
28
+ * | `thumb.curl` | 0 straight, 1 bent at both knuckles |
29
+ * | `thumb.across` | 0 out to the side, 1 across the palm |
30
+ * | `spread` | 0 fingers together, 1 fanned wide |
31
+ * | `turn` | Wrist turn: 0 back of the hand toward the viewer, 1 thumb side, 2 palm, -1 little-finger side |
32
+ * | `bend` | Wrist bend, degrees: + toward the palm |
33
+ * | `tilt` | Wrist tilt, degrees: + toward the little finger |
34
+ * | `roll` | The whole hand turned in the picture, degrees clockwise (a left hand turns the mirror way) |
35
+ */
36
+ export type HandPose = Record<string, number>;
37
+ export declare const HAND_REST: HandPose;
38
+ /** A full hand pose from the fields that differ from rest. */
39
+ export declare function handPose(changes?: Partial<HandPose>): HandPose;
40
+ /** Ready-made hand shapes. Blend between them with {@link mixHandPoses}, or change single fields. */
41
+ export declare const HAND_SHAPES: {
42
+ relaxed: HandPose;
43
+ open: HandPose;
44
+ spread: HandPose;
45
+ flat: HandPose;
46
+ fist: HandPose;
47
+ point: HandPose;
48
+ /** The fist on its side, knuckles toward the viewer, the thumb up */
49
+ thumbsUp: HandPose;
50
+ peace: HandPose;
51
+ ok: HandPose;
52
+ pinch: HandPose;
53
+ cupped: HandPose;
54
+ wave: HandPose;
55
+ /** Holding a pencil to write: thumb and middle finger pinch it, the index finger rests on top */
56
+ pencilGrip: HandPose;
57
+ /** Holding a handle, a cup or a bar: every finger wrapped round it */
58
+ hold: HandPose;
59
+ };
60
+ export type HandShapeName = keyof typeof HAND_SHAPES;
61
+ /** A blend of two hand poses: `t` 0 is `from`, 1 is `to`. */
62
+ export declare function mixHandPoses(from: HandPose, to: HandPose, t: number): HandPose;
63
+ export interface HandRigStyle {
64
+ /** Wrist to the tip of the middle finger, px (default 100) */
65
+ size?: number;
66
+ /** Which hand (default right) */
67
+ side?: 'right' | 'left';
68
+ /** Which way the fingers point on screen, degrees clockwise from straight up (default 0) */
69
+ angle?: number;
70
+ /** Four fingers (a thumb and three, the classic cartoon hand) or five (default 5) */
71
+ fingers?: 4 | 5;
72
+ /** Chunkiness: 1 is a natural hand (default); 1.5 is a fat cartoon glove, its fingers and palm wider */
73
+ plump?: number;
74
+ }
75
+ /** One finger as drawn: joints from the knuckle (the thumb: its base in the palm) to the tip. */
76
+ export interface FingerJoints {
77
+ points: Point[];
78
+ /** Each joint's depth toward the viewer, px */
79
+ depths: number[];
80
+ /** Width of the finger at each joint, px */
81
+ widths: number[];
82
+ /** How squarely the nail faces the viewer: 1 straight on, 0 edge on, negative hidden */
83
+ nail: number;
84
+ /** The direction the back of the fingertip faces, on screen (unit, or zero when it faces the viewer) */
85
+ back: Point;
86
+ }
87
+ /** Where every part of a hand is, as drawn. */
88
+ export interface HandJoints {
89
+ size: number;
90
+ side: 'right' | 'left';
91
+ wrist: Point;
92
+ /** Outline of the palm (the back of the hand and its edges), around */
93
+ palm: Point[];
94
+ /** The palm's depth toward the viewer, px */
95
+ palmDepth: number;
96
+ /** How squarely the inside of the palm faces the viewer: 1 straight on, negative when the back does */
97
+ palmFacing: number;
98
+ fingers: Partial<Record<FingerName, FingerJoints>>;
99
+ /** The hand's own axes on screen (unit vectors): toward the fingers, toward the little finger, out of the back */
100
+ axes: {
101
+ up: Point;
102
+ across: Point;
103
+ out: Point;
104
+ };
105
+ /** Each finger's curl, as posed (the thumb's included) */
106
+ curls: Partial<Record<FingerName, number>>;
107
+ }
108
+ /** Turn `v` about the unit `axis` by `angle` radians, right-handed (Rodrigues). */
109
+ export declare function rotateAbout(v: Vec3, axis: Vec3, angle: number): Vec3;
110
+ /**
111
+ * Solve a hand pose: every finger's joints on screen, with depths, for a
112
+ * hand whose wrist is at (0, 0). Move the result with {@link handJointsAt}.
113
+ */
114
+ export declare function handJoints(pose: HandPose, style?: HandRigStyle): HandJoints;
115
+ /** Hand joints moved so the wrist is at `at`. */
116
+ export declare function handJointsAt(joints: HandJoints, at: Point): HandJoints;
@@ -0,0 +1,3 @@
1
+ /** Cartoon hands: a small 3D hand rig, posed by numbers, drawn through a look's pen. */
2
+ export * from './hand-rig';
3
+ export * from './draw-cartoon-hand';
@@ -5,6 +5,9 @@
5
5
  * here.
6
6
  */
7
7
  export * from './stick-figure';
8
+ export * from './dance';
9
+ export * from './acrobatics';
10
+ export { stickToHuman } from './stick-to-human';
8
11
  export * from '../adapters/canvas/sketch';
9
12
  export * from './erase';
10
13
  export * from '../adapters/canvas/polyline';
@@ -14,3 +17,4 @@ export { humanPlan, humanPose, humanFieldLabel, HUMAN_REST, HUMAN_POSES, HUMAN_E
14
17
  export type { BodyPlan, ChainSpec, BoneSpec, BoneAngles, ContactSpec, HeadSpec, Pose as CharacterPose, Vec3 } from './rig/body-plan';
15
18
  export { createPen, ellipsePoints, type Pen, type Look, type PencilOptions, type PenOptions } from './look/pen';
16
19
  export { basicOutfit, type BasicOutfitOptions } from './wardrobe/basic-outfit';
20
+ export * from './hands';
@@ -11,7 +11,10 @@ import { type ExpressionName } from '../stick-figure';
11
11
  * - `arm.left.swing` (forward +), `arm.left.spread` (out +), `arm.left.elbow`
12
12
  * (forearm forward +), `arm.left.bend` (forearm out +), and the same for `.right`
13
13
  * - `leg.left.swing` (forward +), `leg.left.spread` (out +), `leg.left.knee`
14
- * (shin back +), `leg.left.ankle` (toes up +), and the same for `.right`
14
+ * (shin back +), `leg.left.ankle` (toes up +), `leg.left.toeOut` (the foot
15
+ * turned out from its natural angle +, in −), `leg.left.rotate` (the whole
16
+ * leg turned out at the hip +: at 90 a bent knee points sideways, as in a
17
+ * turned-out plié), and the same for `.right`
15
18
  * - `stretch` (1 normal), `lift` (fraction of height above the ground), `roll` (whole-figure roll, degrees)
16
19
  * - the face: `mouth`, `smile`, `mouthWidth`, `blink`, `eye.left`, `eye.right`,
17
20
  * `brow.left`, `brow.right`, `browTilt`, `lookX`, `lookY` (as the v1 stick figure)