@franzenzenhofer/asanakit 0.1.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.
- package/LICENSE +21 -0
- package/README.md +153 -0
- package/dist/anatomy/muscles.d.ts +55 -0
- package/dist/anatomy/muscles.d.ts.map +1 -0
- package/dist/anatomy/muscles.js +79 -0
- package/dist/anatomy/muscles.js.map +1 -0
- package/dist/anatomy/validate.d.ts +11 -0
- package/dist/anatomy/validate.d.ts.map +1 -0
- package/dist/anatomy/validate.js +94 -0
- package/dist/anatomy/validate.js.map +1 -0
- package/dist/cli/commands/export.d.ts +3 -0
- package/dist/cli/commands/export.d.ts.map +1 -0
- package/dist/cli/commands/export.js +45 -0
- package/dist/cli/commands/export.js.map +1 -0
- package/dist/cli/commands/info.d.ts +3 -0
- package/dist/cli/commands/info.d.ts.map +1 -0
- package/dist/cli/commands/info.js +101 -0
- package/dist/cli/commands/info.js.map +1 -0
- package/dist/cli/commands/render.d.ts +3 -0
- package/dist/cli/commands/render.d.ts.map +1 -0
- package/dist/cli/commands/render.js +103 -0
- package/dist/cli/commands/render.js.map +1 -0
- package/dist/cli/index.d.ts +3 -0
- package/dist/cli/index.d.ts.map +1 -0
- package/dist/cli/index.js +31 -0
- package/dist/cli/index.js.map +1 -0
- package/dist/cli/resolve.d.ts +12 -0
- package/dist/cli/resolve.d.ts.map +1 -0
- package/dist/cli/resolve.js +46 -0
- package/dist/cli/resolve.js.map +1 -0
- package/dist/core/angles.d.ts +12 -0
- package/dist/core/angles.d.ts.map +1 -0
- package/dist/core/angles.js +27 -0
- package/dist/core/angles.js.map +1 -0
- package/dist/core/rig.d.ts +8 -0
- package/dist/core/rig.d.ts.map +1 -0
- package/dist/core/rig.js +97 -0
- package/dist/core/rig.js.map +1 -0
- package/dist/core/skeleton.d.ts +17 -0
- package/dist/core/skeleton.d.ts.map +1 -0
- package/dist/core/skeleton.js +144 -0
- package/dist/core/skeleton.js.map +1 -0
- package/dist/core/types.d.ts +105 -0
- package/dist/core/types.d.ts.map +1 -0
- package/dist/core/types.js +47 -0
- package/dist/core/types.js.map +1 -0
- package/dist/core/vec2.d.ts +19 -0
- package/dist/core/vec2.d.ts.map +1 -0
- package/dist/core/vec2.js +41 -0
- package/dist/core/vec2.js.map +1 -0
- package/dist/index.d.ts +11 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +11 -0
- package/dist/index.js.map +1 -0
- package/dist/library/index.d.ts +27 -0
- package/dist/library/index.d.ts.map +1 -0
- package/dist/library/index.js +75 -0
- package/dist/library/index.js.map +1 -0
- package/dist/model/index.d.ts +4 -0
- package/dist/model/index.d.ts.map +1 -0
- package/dist/model/index.js +4 -0
- package/dist/model/index.js.map +1 -0
- package/dist/model/parse.d.ts +12 -0
- package/dist/model/parse.d.ts.map +1 -0
- package/dist/model/parse.js +43 -0
- package/dist/model/parse.js.map +1 -0
- package/dist/model/pose.d.ts +11 -0
- package/dist/model/pose.d.ts.map +1 -0
- package/dist/model/pose.js +26 -0
- package/dist/model/pose.js.map +1 -0
- package/dist/model/schema.d.ts +1122 -0
- package/dist/model/schema.d.ts.map +1 -0
- package/dist/model/schema.js +178 -0
- package/dist/model/schema.js.map +1 -0
- package/dist/render/anatomy.d.ts +10 -0
- package/dist/render/anatomy.d.ts.map +1 -0
- package/dist/render/anatomy.js +77 -0
- package/dist/render/anatomy.js.map +1 -0
- package/dist/render/annotations.d.ts +9 -0
- package/dist/render/annotations.d.ts.map +1 -0
- package/dist/render/annotations.js +185 -0
- package/dist/render/annotations.js.map +1 -0
- package/dist/render/context.d.ts +16 -0
- package/dist/render/context.d.ts.map +1 -0
- package/dist/render/context.js +2 -0
- package/dist/render/context.js.map +1 -0
- package/dist/render/figure.d.ts +8 -0
- package/dist/render/figure.d.ts.map +1 -0
- package/dist/render/figure.js +138 -0
- package/dist/render/figure.js.map +1 -0
- package/dist/render/index.d.ts +7 -0
- package/dist/render/index.d.ts.map +1 -0
- package/dist/render/index.js +7 -0
- package/dist/render/index.js.map +1 -0
- package/dist/render/project.d.ts +18 -0
- package/dist/render/project.d.ts.map +1 -0
- package/dist/render/project.js +35 -0
- package/dist/render/project.js.map +1 -0
- package/dist/render/props.d.ts +9 -0
- package/dist/render/props.d.ts.map +1 -0
- package/dist/render/props.js +178 -0
- package/dist/render/props.js.map +1 -0
- package/dist/render/raster.d.ts +19 -0
- package/dist/render/raster.d.ts.map +1 -0
- package/dist/render/raster.js +39 -0
- package/dist/render/raster.js.map +1 -0
- package/dist/render/scene.d.ts +26 -0
- package/dist/render/scene.d.ts.map +1 -0
- package/dist/render/scene.js +144 -0
- package/dist/render/scene.js.map +1 -0
- package/dist/render/sheet.d.ts +20 -0
- package/dist/render/sheet.d.ts.map +1 -0
- package/dist/render/sheet.js +74 -0
- package/dist/render/sheet.js.map +1 -0
- package/dist/render/styles.d.ts +77 -0
- package/dist/render/styles.d.ts.map +1 -0
- package/dist/render/styles.js +122 -0
- package/dist/render/styles.js.map +1 -0
- package/dist/render/svg.d.ts +19 -0
- package/dist/render/svg.d.ts.map +1 -0
- package/dist/render/svg.js +40 -0
- package/dist/render/svg.js.map +1 -0
- package/dist/standards/keypoints.d.ts +31 -0
- package/dist/standards/keypoints.d.ts.map +1 -0
- package/dist/standards/keypoints.js +118 -0
- package/dist/standards/keypoints.js.map +1 -0
- package/docs/AUTHORING.md +144 -0
- package/package.json +94 -0
- package/poses/surf/bottom-turn.pose.yaml +47 -0
- package/poses/surf/cutback.pose.yaml +47 -0
- package/poses/surf/duck-dive.pose.yaml +47 -0
- package/poses/surf/noseride.pose.yaml +48 -0
- package/poses/surf/paddling.pose.yaml +48 -0
- package/poses/surf/pop-up.pose.yaml +47 -0
- package/poses/surf/takeoff.pose.yaml +47 -0
- package/poses/surf/tube-stance.pose.yaml +47 -0
- package/poses/yoga/ashtanga/adho-mukha-svanasana.pose.yaml +42 -0
- package/poses/yoga/ashtanga/ardha-uttanasana.pose.yaml +42 -0
- package/poses/yoga/ashtanga/baddha-konasana.pose.yaml +42 -0
- package/poses/yoga/ashtanga/balasana.pose.yaml +43 -0
- package/poses/yoga/ashtanga/chaturanga-dandasana.pose.yaml +41 -0
- package/poses/yoga/ashtanga/dandasana.pose.yaml +42 -0
- package/poses/yoga/ashtanga/halasana.pose.yaml +43 -0
- package/poses/yoga/ashtanga/janu-sirsasana-a.pose.yaml +42 -0
- package/poses/yoga/ashtanga/karnapidasana.pose.yaml +43 -0
- package/poses/yoga/ashtanga/marichyasana-a.pose.yaml +42 -0
- package/poses/yoga/ashtanga/marichyasana-c.pose.yaml +42 -0
- package/poses/yoga/ashtanga/matsyasana.pose.yaml +43 -0
- package/poses/yoga/ashtanga/navasana.pose.yaml +42 -0
- package/poses/yoga/ashtanga/padahastasana.pose.yaml +42 -0
- package/poses/yoga/ashtanga/padangusthasana.pose.yaml +42 -0
- package/poses/yoga/ashtanga/padmasana.pose.yaml +43 -0
- package/poses/yoga/ashtanga/parsvottanasana.pose.yaml +42 -0
- package/poses/yoga/ashtanga/paschimottanasana.pose.yaml +42 -0
- package/poses/yoga/ashtanga/prasarita-padottanasana-a.pose.yaml +46 -0
- package/poses/yoga/ashtanga/prasarita-padottanasana-c.pose.yaml +46 -0
- package/poses/yoga/ashtanga/primary.seq.yaml +74 -0
- package/poses/yoga/ashtanga/purvottanasana.pose.yaml +42 -0
- package/poses/yoga/ashtanga/salamba-sarvangasana.pose.yaml +43 -0
- package/poses/yoga/ashtanga/samasthiti.pose.yaml +29 -0
- package/poses/yoga/ashtanga/savasana.pose.yaml +43 -0
- package/poses/yoga/ashtanga/setu-bandhasana.pose.yaml +42 -0
- package/poses/yoga/ashtanga/sirsasana.pose.yaml +43 -0
- package/poses/yoga/ashtanga/supta-padangusthasana.pose.yaml +42 -0
- package/poses/yoga/ashtanga/upavistha-konasana.pose.yaml +42 -0
- package/poses/yoga/ashtanga/urdhva-dhanurasana.pose.yaml +43 -0
- package/poses/yoga/ashtanga/urdhva-hastasana.pose.yaml +42 -0
- package/poses/yoga/ashtanga/urdhva-mukha-svanasana.pose.yaml +42 -0
- package/poses/yoga/ashtanga/utkatasana.pose.yaml +42 -0
- package/poses/yoga/ashtanga/uttanasana.pose.yaml +42 -0
- package/poses/yoga/ashtanga/utthita-parsvakonasana.pose.yaml +44 -0
- package/poses/yoga/ashtanga/utthita-trikonasana.pose.yaml +44 -0
- package/poses/yoga/ashtanga/virabhadrasana-a.pose.yaml +42 -0
- package/poses/yoga/ashtanga/virabhadrasana-b.pose.yaml +42 -0
|
@@ -0,0 +1,105 @@
|
|
|
1
|
+
import type { Vec2 } from './vec2.js';
|
|
2
|
+
export type Side = 'left' | 'right' | 'center';
|
|
3
|
+
export type BoneGroup = 'torso' | 'head' | 'arm' | 'leg';
|
|
4
|
+
export declare const BONE_IDS: readonly ["pelvis", "spine", "neck", "head", "clavicleL", "upperArmL", "forearmL", "handL", "clavicleR", "upperArmR", "forearmR", "handR", "hipL", "thighL", "shinL", "footL", "hipR", "thighR", "shinR", "footR"];
|
|
5
|
+
export type BoneId = (typeof BONE_IDS)[number];
|
|
6
|
+
/** A joint is named after the bone it rotates: rotating `forearmL` bends the left elbow. */
|
|
7
|
+
export type JointId = BoneId;
|
|
8
|
+
export declare const LANDMARK_IDS: readonly ["hipCenter", "waist", "chest", "neckBase", "headCenter", "headTop", "shoulderL", "elbowL", "wristL", "handTipL", "shoulderR", "elbowR", "wristR", "handTipR", "hipJointL", "kneeL", "ankleL", "toeL", "hipJointR", "kneeR", "ankleR", "toeR"];
|
|
9
|
+
export type LandmarkId = (typeof LANDMARK_IDS)[number];
|
|
10
|
+
export interface BoneDef {
|
|
11
|
+
readonly id: BoneId;
|
|
12
|
+
readonly parent: BoneId | null;
|
|
13
|
+
/** Which end of the parent bone this bone hangs off. */
|
|
14
|
+
readonly attach: 'start' | 'end';
|
|
15
|
+
/**
|
|
16
|
+
* The bone whose direction this bone's rest angle is measured against, when
|
|
17
|
+
* that differs from the bone it hangs off. An upper arm *attaches* to the
|
|
18
|
+
* clavicle (which points sideways) but *aims* relative to the spine - keeping
|
|
19
|
+
* the two apart is what stops a profile figure's right arm pointing skyward.
|
|
20
|
+
*/
|
|
21
|
+
readonly angleParent?: BoneId;
|
|
22
|
+
/** Bone length as a fraction of the figure's stature (1.0 = full height). */
|
|
23
|
+
readonly length: number;
|
|
24
|
+
/** Angle in degrees relative to the parent bone's direction, in the neutral standing pose. */
|
|
25
|
+
readonly restAngle: number;
|
|
26
|
+
readonly side: Side;
|
|
27
|
+
readonly group: BoneGroup;
|
|
28
|
+
/** Lateral bones (clavicle, hip) foreshorten as the figure turns away from the viewer. */
|
|
29
|
+
readonly lateral?: boolean;
|
|
30
|
+
/** Foot bones foreshorten in front/back views. */
|
|
31
|
+
readonly foot?: boolean;
|
|
32
|
+
/**
|
|
33
|
+
* Which way a positive joint value bends this bone. -1 for the shin, so that
|
|
34
|
+
* "shinL: 90" means the knee is flexed 90 degrees - the way a knee actually
|
|
35
|
+
* bends - rather than hyperextended by 90.
|
|
36
|
+
*/
|
|
37
|
+
readonly flexSign?: number;
|
|
38
|
+
}
|
|
39
|
+
export interface Rig {
|
|
40
|
+
readonly name: string;
|
|
41
|
+
readonly bones: readonly BoneDef[];
|
|
42
|
+
}
|
|
43
|
+
export type ViewId = 'front' | 'back' | 'side' | 'three-quarter';
|
|
44
|
+
export interface ViewConfig {
|
|
45
|
+
/** Foreshortening applied to lateral bones: 1 = full width, 0 = perfectly edge-on. */
|
|
46
|
+
readonly lateralScale: number;
|
|
47
|
+
/** Foreshortening applied to feet. */
|
|
48
|
+
readonly footScale: number;
|
|
49
|
+
/**
|
|
50
|
+
* Whether the right limbs mirror the left ones.
|
|
51
|
+
*
|
|
52
|
+
* Facing the viewer, they do: a raised right arm goes one way and a raised
|
|
53
|
+
* left arm goes the other. Seen from the side, they do not - both arms swing
|
|
54
|
+
* the same way, because you are looking at both of them from the same side.
|
|
55
|
+
*/
|
|
56
|
+
readonly mirrorLimbs: boolean;
|
|
57
|
+
}
|
|
58
|
+
export interface KinematicPose {
|
|
59
|
+
readonly view: ViewId;
|
|
60
|
+
readonly root: {
|
|
61
|
+
readonly position: Vec2;
|
|
62
|
+
/** World angle of the pelvis in degrees; 90 = upright. */
|
|
63
|
+
readonly rotation: number;
|
|
64
|
+
readonly scale: number;
|
|
65
|
+
};
|
|
66
|
+
readonly joints: Partial<Record<JointId, number>>;
|
|
67
|
+
/**
|
|
68
|
+
* Absolute bone directions in degrees. A bone listed here points exactly this
|
|
69
|
+
* way in world space, whatever its parent does - which is how a human (or a
|
|
70
|
+
* model) actually thinks about a posture: "the front thigh points down-left at
|
|
71
|
+
* -150 degrees", not "rotate the hip 60 degrees from neutral".
|
|
72
|
+
*/
|
|
73
|
+
readonly world?: Partial<Record<JointId, number>>;
|
|
74
|
+
/** Translate the solved figure so its lowest point sits on y = 0. */
|
|
75
|
+
readonly grounded: boolean;
|
|
76
|
+
/** Mirror the solved figure across the vertical axis (a figure facing the other way). */
|
|
77
|
+
readonly flip?: boolean;
|
|
78
|
+
}
|
|
79
|
+
export interface BoneSegment {
|
|
80
|
+
readonly id: BoneId;
|
|
81
|
+
readonly start: Vec2;
|
|
82
|
+
readonly end: Vec2;
|
|
83
|
+
/** Absolute direction of the bone in degrees. */
|
|
84
|
+
readonly worldAngle: number;
|
|
85
|
+
readonly length: number;
|
|
86
|
+
readonly side: Side;
|
|
87
|
+
readonly group: BoneGroup;
|
|
88
|
+
}
|
|
89
|
+
export interface Bounds {
|
|
90
|
+
readonly minX: number;
|
|
91
|
+
readonly minY: number;
|
|
92
|
+
readonly maxX: number;
|
|
93
|
+
readonly maxY: number;
|
|
94
|
+
}
|
|
95
|
+
export interface Skeleton {
|
|
96
|
+
readonly rig: Rig;
|
|
97
|
+
readonly view: ViewId;
|
|
98
|
+
readonly scale: number;
|
|
99
|
+
readonly bones: Record<BoneId, BoneSegment>;
|
|
100
|
+
readonly landmarks: Record<LandmarkId, Vec2>;
|
|
101
|
+
readonly bounds: Bounds;
|
|
102
|
+
/** Sole-to-crown extent of the solved figure. */
|
|
103
|
+
readonly height: number;
|
|
104
|
+
}
|
|
105
|
+
//# sourceMappingURL=types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/core/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AAEtC,MAAM,MAAM,IAAI,GAAG,MAAM,GAAG,OAAO,GAAG,QAAQ,CAAC;AAE/C,MAAM,MAAM,SAAS,GAAG,OAAO,GAAG,MAAM,GAAG,KAAK,GAAG,KAAK,CAAC;AAEzD,eAAO,MAAM,QAAQ,oNAqBX,CAAC;AAEX,MAAM,MAAM,MAAM,GAAG,CAAC,OAAO,QAAQ,CAAC,CAAC,MAAM,CAAC,CAAC;AAE/C,4FAA4F;AAC5F,MAAM,MAAM,OAAO,GAAG,MAAM,CAAC;AAE7B,eAAO,MAAM,YAAY,yPAuBf,CAAC;AAEX,MAAM,MAAM,UAAU,GAAG,CAAC,OAAO,YAAY,CAAC,CAAC,MAAM,CAAC,CAAC;AAEvD,MAAM,WAAW,OAAO;IACtB,QAAQ,CAAC,EAAE,EAAE,MAAM,CAAC;IACpB,QAAQ,CAAC,MAAM,EAAE,MAAM,GAAG,IAAI,CAAC;IAC/B,wDAAwD;IACxD,QAAQ,CAAC,MAAM,EAAE,OAAO,GAAG,KAAK,CAAC;IACjC;;;;;OAKG;IACH,QAAQ,CAAC,WAAW,CAAC,EAAE,MAAM,CAAC;IAC9B,6EAA6E;IAC7E,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;IACxB,8FAA8F;IAC9F,QAAQ,CAAC,SAAS,EAAE,MAAM,CAAC;IAC3B,QAAQ,CAAC,IAAI,EAAE,IAAI,CAAC;IACpB,QAAQ,CAAC,KAAK,EAAE,SAAS,CAAC;IAC1B,0FAA0F;IAC1F,QAAQ,CAAC,OAAO,CAAC,EAAE,OAAO,CAAC;IAC3B,kDAAkD;IA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|
+
'hipR',
|
|
19
|
+
'thighR',
|
|
20
|
+
'shinR',
|
|
21
|
+
'footR',
|
|
22
|
+
];
|
|
23
|
+
export const LANDMARK_IDS = [
|
|
24
|
+
'hipCenter',
|
|
25
|
+
'waist',
|
|
26
|
+
'chest',
|
|
27
|
+
'neckBase',
|
|
28
|
+
'headCenter',
|
|
29
|
+
'headTop',
|
|
30
|
+
'shoulderL',
|
|
31
|
+
'elbowL',
|
|
32
|
+
'wristL',
|
|
33
|
+
'handTipL',
|
|
34
|
+
'shoulderR',
|
|
35
|
+
'elbowR',
|
|
36
|
+
'wristR',
|
|
37
|
+
'handTipR',
|
|
38
|
+
'hipJointL',
|
|
39
|
+
'kneeL',
|
|
40
|
+
'ankleL',
|
|
41
|
+
'toeL',
|
|
42
|
+
'hipJointR',
|
|
43
|
+
'kneeR',
|
|
44
|
+
'ankleR',
|
|
45
|
+
'toeR',
|
|
46
|
+
];
|
|
47
|
+
//# sourceMappingURL=types.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../src/core/types.ts"],"names":[],"mappings":"AAMA,MAAM,CAAC,MAAM,QAAQ,GAAG;IACtB,QAAQ;IACR,OAAO;IACP,MAAM;IACN,MAAM;IACN,WAAW;IACX,WAAW;IACX,UAAU;IACV,OAAO;IACP,WAAW;IACX,WAAW;IACX,UAAU;IACV,OAAO;IACP,MAAM;IACN,QAAQ;IACR,OAAO;IACP,OAAO;IACP,MAAM;IACN,QAAQ;IACR,OAAO;IACP,OAAO;CACC,CAAC;AAOX,MAAM,CAAC,MAAM,YAAY,GAAG;IAC1B,WAAW;IACX,OAAO;IACP,OAAO;IACP,UAAU;IACV,YAAY;IACZ,SAAS;IACT,WAAW;IACX,QAAQ;IACR,QAAQ;IACR,UAAU;IACV,WAAW;IACX,QAAQ;IACR,QAAQ;IACR,UAAU;IACV,WAAW;IACX,OAAO;IACP,QAAQ;IACR,MAAM;IACN,WAAW;IACX,OAAO;IACP,QAAQ;IACR,MAAM;CACE,CAAC"}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
export type Vec2 = readonly [number, number];
|
|
2
|
+
export declare const vec: (x: number, y: number) => Vec2;
|
|
3
|
+
export declare const x: (v: Vec2) => number;
|
|
4
|
+
export declare const y: (v: Vec2) => number;
|
|
5
|
+
export declare const add: (a: Vec2, b: Vec2) => Vec2;
|
|
6
|
+
export declare const sub: (a: Vec2, b: Vec2) => Vec2;
|
|
7
|
+
export declare const scale: (a: Vec2, k: number) => Vec2;
|
|
8
|
+
export declare const len: (a: Vec2) => number;
|
|
9
|
+
export declare const dist: (a: Vec2, b: Vec2) => number;
|
|
10
|
+
export declare const lerp: (a: Vec2, b: Vec2, t: number) => Vec2;
|
|
11
|
+
export declare const midpoint: (a: Vec2, b: Vec2) => Vec2;
|
|
12
|
+
export declare const rotate: (a: Vec2, angleDeg: number, origin?: Vec2) => Vec2;
|
|
13
|
+
export declare const fromPolar: (angleDeg: number, length: number) => Vec2;
|
|
14
|
+
export declare const angleOf: (a: Vec2) => number;
|
|
15
|
+
/** Unit vector perpendicular to a->b, rotated +90 degrees (to its left). */
|
|
16
|
+
export declare const normalLeft: (a: Vec2, b: Vec2) => Vec2;
|
|
17
|
+
/** Point at `t` along a->b, offset sideways by `offset` (left-positive). */
|
|
18
|
+
export declare const along: (a: Vec2, b: Vec2, t: number, offset?: number) => Vec2;
|
|
19
|
+
//# sourceMappingURL=vec2.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"vec2.d.ts","sourceRoot":"","sources":["../../src/core/vec2.ts"],"names":[],"mappings":"AAeA,MAAM,MAAM,IAAI,GAAG,SAAS,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;AAI7C,eAAO,MAAM,GAAG,GAAI,GAAG,MAAM,EAAE,GAAG,MAAM,KAAG,IAAc,CAAC;AAE1D,eAAO,MAAM,CAAC,GAAI,GAAG,IAAI,KAAG,MAAc,CAAC;AA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y up, angles in degrees CCW from +x
|
|
6
|
+
* - points are plain `[x, y]` tuples, which d3-shape path generators consume directly
|
|
7
|
+
* - the single y-flip into SVG space happens in the renderer's projection step
|
|
8
|
+
*/
|
|
9
|
+
import { glMatrix, vec2 as gl } from 'gl-matrix';
|
|
10
|
+
import { degToRad, radToDeg } from './angles.js';
|
|
11
|
+
// Float64 instead of gl-matrix's default Float32: poses are authored in degrees
|
|
12
|
+
// and small rounding drift is visible once a limb chain is five bones deep.
|
|
13
|
+
glMatrix.setMatrixArrayType(Array);
|
|
14
|
+
const out = () => [0, 0];
|
|
15
|
+
export const vec = (x, y) => [x, y];
|
|
16
|
+
export const x = (v) => v[0];
|
|
17
|
+
export const y = (v) => v[1];
|
|
18
|
+
export const add = (a, b) => gl.add(out(), a, b);
|
|
19
|
+
export const sub = (a, b) => gl.sub(out(), a, b);
|
|
20
|
+
export const scale = (a, k) => gl.scale(out(), a, k);
|
|
21
|
+
export const len = (a) => gl.length(a);
|
|
22
|
+
export const dist = (a, b) => gl.dist(a, b);
|
|
23
|
+
export const lerp = (a, b, t) => gl.lerp(out(), a, b, t);
|
|
24
|
+
export const midpoint = (a, b) => lerp(a, b, 0.5);
|
|
25
|
+
export const rotate = (a, angleDeg, origin = [0, 0]) => gl.rotate(out(), a, origin, degToRad(angleDeg));
|
|
26
|
+
export const fromPolar = (angleDeg, length) => {
|
|
27
|
+
const r = degToRad(angleDeg);
|
|
28
|
+
return [Math.cos(r) * length, Math.sin(r) * length];
|
|
29
|
+
};
|
|
30
|
+
export const angleOf = (a) => radToDeg(Math.atan2(a[1], a[0]));
|
|
31
|
+
/** Unit vector perpendicular to a->b, rotated +90 degrees (to its left). */
|
|
32
|
+
export const normalLeft = (a, b) => {
|
|
33
|
+
const d = sub(b, a);
|
|
34
|
+
const l = len(d);
|
|
35
|
+
if (l === 0)
|
|
36
|
+
return [0, 0];
|
|
37
|
+
return [-d[1] / l, d[0] / l];
|
|
38
|
+
};
|
|
39
|
+
/** Point at `t` along a->b, offset sideways by `offset` (left-positive). */
|
|
40
|
+
export const along = (a, b, t, offset = 0) => offset === 0 ? lerp(a, b, t) : add(lerp(a, b, t), scale(normalLeft(a, b), offset));
|
|
41
|
+
//# sourceMappingURL=vec2.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"vec2.js","sourceRoot":"","sources":["../../src/core/vec2.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AACH,OAAO,EAAE,QAAQ,EAAE,IAAI,IAAI,EAAE,EAAE,MAAM,WAAW,CAAC;AACjD,OAAO,EAAE,QAAQ,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAC;AAEjD,gFAAgF;AAChF,4EAA4E;AAC5E,QAAQ,CAAC,kBAAkB,CAAC,KAAK,CAAC,CAAC;AAInC,MAAM,GAAG,GAAG,GAAqB,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC;AAE3C,MAAM,CAAC,MAAM,GAAG,GAAG,CAAC,CAAS,EAAE,CAAS,EAAQ,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC;AAE1D,MAAM,CAAC,MAAM,CAAC,GAAG,CAAC,CAAO,EAAU,EAAE,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;AAC3C,MAAM,CAAC,MAAM,CAAC,GAAG,CAAC,CAAO,EAAU,EAAE,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;AAE3C,MAAM,CAAC,MAAM,GAAG,GAAG,CAAC,CAAO,EAAE,CAAO,EAAQ,EAAE,CAAC,EAAE,CAAC,GAAG,CAAC,GAAG,EAAE,EAAE,CAAC,EAAE,CAAC,CAAqB,CAAC;AAEvF,MAAM,CAAC,MAAM,GAAG,GAAG,CAAC,CAAO,EAAE,CAAO,EAAQ,EAAE,CAAC,EAAE,CAAC,GAAG,CAAC,GAAG,EAAE,EAAE,CAAC,EAAE,CAAC,CAAqB,CAAC;AAEvF,MAAM,CAAC,MAAM,KAAK,GAAG,CAAC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AAU,EAAE,CAAC,QAAQ,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;AAE7E,4EAA4E;AAC5E,MAAM,CAAC,MAAM,UAAU,GAAG,CAAC,CAAO,EAAE,CAAO,EAAQ,EAAE;IACnD,MAAM,CAAC,GAAG,GAAG,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC;IACpB,MAAM,CAAC,GAAG,GAAG,CAAC,CAAC,CAAC,CAAC;IACjB,IAAI,CAAC,KAAK,CAAC;QAAE,OAAO,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC;IAC3B,OAAO,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC;AAC/B,CAAC,CAAC;AAEF,4EAA4E;AAC5E,MAAM,CAAC,MAAM,KAAK,GAAG,CAAC,CAAO,EAAE,CAAO,EAAE,CAAS,EAAE,MAAM,GAAG,CAAC,EAAQ,EAAE,CACrE,MAAM,KAAK,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC,EAAE,KAAK,CAAC,UAAU,CAAC,CAAC,EAAE,CAAC,CAAC,EAAE,MAAM,CAAC,CAAC,CAAC"}
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
export * from './core/types.js';
|
|
2
|
+
export * from './core/rig.js';
|
|
3
|
+
export * from './core/skeleton.js';
|
|
4
|
+
export * from './core/vec2.js';
|
|
5
|
+
export * from './core/angles.js';
|
|
6
|
+
export * from './anatomy/muscles.js';
|
|
7
|
+
export * from './model/index.js';
|
|
8
|
+
export * from './render/index.js';
|
|
9
|
+
export * from './library/index.js';
|
|
10
|
+
export * from './standards/keypoints.js';
|
|
11
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,iBAAiB,CAAC;AAChC,cAAc,eAAe,CAAC;AAC9B,cAAc,oBAAoB,CAAC;AACnC,cAAc,gBAAgB,CAAC;AAC/B,cAAc,kBAAkB,CAAC;AACjC,cAAc,sBAAsB,CAAC;AACrC,cAAc,kBAAkB,CAAC;AACjC,cAAc,mBAAmB,CAAC;AAClC,cAAc,oBAAoB,CAAC;AACnC,cAAc,0BAA0B,CAAC"}
|
package/dist/index.js
ADDED
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
export * from './core/types.js';
|
|
2
|
+
export * from './core/rig.js';
|
|
3
|
+
export * from './core/skeleton.js';
|
|
4
|
+
export * from './core/vec2.js';
|
|
5
|
+
export * from './core/angles.js';
|
|
6
|
+
export * from './anatomy/muscles.js';
|
|
7
|
+
export * from './model/index.js';
|
|
8
|
+
export * from './render/index.js';
|
|
9
|
+
export * from './library/index.js';
|
|
10
|
+
export * from './standards/keypoints.js';
|
|
11
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,iBAAiB,CAAC;AAChC,cAAc,eAAe,CAAC;AAC9B,cAAc,oBAAoB,CAAC;AACnC,cAAc,gBAAgB,CAAC;AAC/B,cAAc,kBAAkB,CAAC;AACjC,cAAc,sBAAsB,CAAC;AACrC,cAAc,kBAAkB,CAAC;AACjC,cAAc,mBAAmB,CAAC;AAClC,cAAc,oBAAoB,CAAC;AACnC,cAAc,0BAA0B,CAAC"}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { type PoseSpec, type SequenceSpec } from '../model/index.js';
|
|
2
|
+
export interface Library {
|
|
3
|
+
readonly poses: ReadonlyMap<string, PoseSpec>;
|
|
4
|
+
readonly sequences: ReadonlyMap<string, SequenceSpec>;
|
|
5
|
+
readonly root: string;
|
|
6
|
+
}
|
|
7
|
+
/** The pose data shipped with the package lives next to the source, not inside dist. */
|
|
8
|
+
export declare const bundledLibraryPath: () => string;
|
|
9
|
+
/**
|
|
10
|
+
* Load every pose and sequence under a directory. Duplicate ids are a hard
|
|
11
|
+
* error: a library with two `trikonasana` entries is a library you cannot trust.
|
|
12
|
+
*/
|
|
13
|
+
export declare const loadLibrary: (root?: string) => Promise<Library>;
|
|
14
|
+
export interface SequenceStep {
|
|
15
|
+
readonly pose: PoseSpec;
|
|
16
|
+
readonly label: string;
|
|
17
|
+
readonly section: string;
|
|
18
|
+
readonly breath?: 'inhale' | 'exhale' | 'hold' | 'free';
|
|
19
|
+
readonly count: number;
|
|
20
|
+
readonly side: 'left' | 'right' | 'both' | 'none';
|
|
21
|
+
}
|
|
22
|
+
/**
|
|
23
|
+
* Flatten a sequence into the poses it actually renders, expanding `side: both`
|
|
24
|
+
* into a left and a mirrored right repetition - which is how the practice runs.
|
|
25
|
+
*/
|
|
26
|
+
export declare const expandSequence: (sequence: SequenceSpec, library: Library) => SequenceStep[];
|
|
27
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/library/index.ts"],"names":[],"mappings":"AAGA,OAAO,EAA4B,KAAK,QAAQ,EAAE,KAAK,YAAY,EAAE,MAAM,mBAAmB,CAAC;AAE/F,MAAM,WAAW,OAAO;IACtB,QAAQ,CAAC,KAAK,EAAE,WAAW,CAAC,MAAM,EAAE,QAAQ,CAAC,CAAC;IAC9C,QAAQ,CAAC,SAAS,EAAE,WAAW,CAAC,MAAM,EAAE,YAAY,CAAC,CAAC;IACtD,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;CACvB;AAED,wFAAwF;AACxF,eAAO,MAAM,kBAAkB,QAAO,MAAyE,CAAC;AAiBhH;;;GAGG;AACH,eAAO,MAAM,WAAW,GAAU,OAAM,MAA6B,KAAG,OAAO,CAAC,OAAO,CAmBtF,CAAC;AAEF,MAAM,WAAW,YAAY;IAC3B,QAAQ,CAAC,IAAI,EAAE,QAAQ,CAAC;IACxB,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;IACvB,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAC;IACzB,QAAQ,CAAC,MAAM,CAAC,EAAE,QAAQ,GAAG,QAAQ,GAAG,MAAM,GAAG,MAAM,CAAC;IACxD,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;IACvB,QAAQ,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,GAAG,MAAM,GAAG,MAAM,CAAC;CACnD;AAED;;;GAGG;AACH,eAAO,MAAM,cAAc,GAAI,UAAU,YAAY,EAAE,SAAS,OAAO,KAAG,YAAY,EA6BrF,CAAC"}
|
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
import { readdir, readFile } from 'node:fs/promises';
|
|
2
|
+
import { dirname, extname, join, resolve } from 'node:path';
|
|
3
|
+
import { fileURLToPath } from 'node:url';
|
|
4
|
+
import { parsePose, parseSequence } from '../model/index.js';
|
|
5
|
+
/** The pose data shipped with the package lives next to the source, not inside dist. */
|
|
6
|
+
export const bundledLibraryPath = () => resolve(dirname(fileURLToPath(import.meta.url)), '../../poses');
|
|
7
|
+
const POSE_EXT = /\.pose\.(ya?ml|json)$/;
|
|
8
|
+
const SEQUENCE_EXT = /\.seq\.(ya?ml|json)$/;
|
|
9
|
+
const walk = async (dir) => {
|
|
10
|
+
const entries = await readdir(dir, { withFileTypes: true });
|
|
11
|
+
const files = await Promise.all(entries.map(async (entry) => {
|
|
12
|
+
const full = join(dir, entry.name);
|
|
13
|
+
if (entry.isDirectory())
|
|
14
|
+
return walk(full);
|
|
15
|
+
return extname(entry.name) === '' ? [] : [full];
|
|
16
|
+
}));
|
|
17
|
+
return files.flat();
|
|
18
|
+
};
|
|
19
|
+
/**
|
|
20
|
+
* Load every pose and sequence under a directory. Duplicate ids are a hard
|
|
21
|
+
* error: a library with two `trikonasana` entries is a library you cannot trust.
|
|
22
|
+
*/
|
|
23
|
+
export const loadLibrary = async (root = bundledLibraryPath()) => {
|
|
24
|
+
const files = await walk(root);
|
|
25
|
+
const poses = new Map();
|
|
26
|
+
const sequences = new Map();
|
|
27
|
+
for (const file of files.sort()) {
|
|
28
|
+
if (POSE_EXT.test(file)) {
|
|
29
|
+
const pose = parsePose(await readFile(file, 'utf8'), file);
|
|
30
|
+
const existing = poses.get(pose.id);
|
|
31
|
+
if (existing !== undefined)
|
|
32
|
+
throw new Error(`Duplicate pose id "${pose.id}" in ${file}`);
|
|
33
|
+
poses.set(pose.id, pose);
|
|
34
|
+
}
|
|
35
|
+
else if (SEQUENCE_EXT.test(file)) {
|
|
36
|
+
const seq = parseSequence(await readFile(file, 'utf8'), file);
|
|
37
|
+
if (sequences.has(seq.id))
|
|
38
|
+
throw new Error(`Duplicate sequence id "${seq.id}" in ${file}`);
|
|
39
|
+
sequences.set(seq.id, seq);
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
return { poses, sequences, root };
|
|
43
|
+
};
|
|
44
|
+
/**
|
|
45
|
+
* Flatten a sequence into the poses it actually renders, expanding `side: both`
|
|
46
|
+
* into a left and a mirrored right repetition - which is how the practice runs.
|
|
47
|
+
*/
|
|
48
|
+
export const expandSequence = (sequence, library) => {
|
|
49
|
+
const steps = [];
|
|
50
|
+
for (const section of sequence.sections) {
|
|
51
|
+
for (const step of section.steps) {
|
|
52
|
+
const pose = library.poses.get(step.pose);
|
|
53
|
+
if (pose === undefined) {
|
|
54
|
+
throw new Error(`Sequence "${sequence.id}" references unknown pose "${step.pose}"`);
|
|
55
|
+
}
|
|
56
|
+
const sides = step.side === 'both' ? ['left', 'right'] : [step.side];
|
|
57
|
+
for (const side of sides) {
|
|
58
|
+
// The second side is the mirror image, and reflecting the picture is all
|
|
59
|
+
// that takes. Swapping the joints as well would reflect it twice and hand
|
|
60
|
+
// you back the pose you started with.
|
|
61
|
+
const mirrored = side === 'right';
|
|
62
|
+
steps.push({
|
|
63
|
+
pose: mirrored ? { ...pose, figure: { ...pose.figure, flip: !pose.figure.flip } } : pose,
|
|
64
|
+
label: step.label ?? pose.name,
|
|
65
|
+
section: section.name,
|
|
66
|
+
...(step.breath === undefined ? {} : { breath: step.breath }),
|
|
67
|
+
count: step.count,
|
|
68
|
+
side,
|
|
69
|
+
});
|
|
70
|
+
}
|
|
71
|
+
}
|
|
72
|
+
}
|
|
73
|
+
return steps;
|
|
74
|
+
};
|
|
75
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/library/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,QAAQ,EAAE,MAAM,kBAAkB,CAAC;AACrD,OAAO,EAAE,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAC5D,OAAO,EAAE,aAAa,EAAE,MAAM,UAAU,CAAC;AACzC,OAAO,EAAE,SAAS,EAAE,aAAa,EAAoC,MAAM,mBAAmB,CAAC;AAQ/F,wFAAwF;AACxF,MAAM,CAAC,MAAM,kBAAkB,GAAG,GAAW,EAAE,CAAC,OAAO,CAAC,OAAO,CAAC,aAAa,CAAC,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,EAAE,aAAa,CAAC,CAAC;AAEhH,MAAM,QAAQ,GAAG,uBAAuB,CAAC;AACzC,MAAM,YAAY,GAAG,sBAAsB,CAAC;AAE5C,MAAM,IAAI,GAAG,KAAK,EAAE,GAAW,EAAqB,EAAE;IACpD,MAAM,OAAO,GAAG,MAAM,OAAO,CAAC,GAAG,EAAE,EAAE,aAAa,EAAE,IAAI,EAAE,CAAC,CAAC;IAC5D,MAAM,KAAK,GAAG,MAAM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;gBACtC,MAAM,QAAQ,GAAG,IAAI,KAAK,OAAO,CAAC;gBAClC,KAAK,CAAC,IAAI,CAAC;oBACT,IAAI,EAAE,QAAQ,CAAC,CAAC,CAAC,EAAE,GAAG,IAAI,EAAE,MAAM,EAAE,EAAE,GAAG,IAAI,CAAC,MAAM,EAAE,IAAI,EAAE,CAAC,IAAI,CAAC,MAAM,CAAC,IAAI,EAAE,EAAE,CAAC,CAAC,CAAC,IAAI;oBACxF,KAAK,EAAE,IAAI,CAAC,KAAK,IAAI,IAAI,CAAC,IAAI;oBAC9B,OAAO,EAAE,OAAO,CAAC,IAAI;oBACrB,GAAG,CAAC,IAAI,CAAC,MAAM,KAAK,SAAS,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,EAAE,MAAM,EAAE,IAAI,CAAC,MAAM,EAAE,CAAC;oBAC7D,KAAK,EAAE,IAAI,CAAC,KAAK;oBACjB,IAAI;iBACL,CAAC,CAAC;YACL,CAAC;QACH,CAAC;IACH,CAAC;IAED,OAAO,KAAK,CAAC;AACf,CAAC,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/model/index.ts"],"names":[],"mappings":"AAAA,cAAc,aAAa,CAAC;AAC5B,cAAc,YAAY,CAAC;AAC3B,cAAc,WAAW,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/model/index.ts"],"names":[],"mappings":"AAAA,cAAc,aAAa,CAAC;AAC5B,cAAc,YAAY,CAAC;AAC3B,cAAc,WAAW,CAAC"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { type PoseSpec, type SequenceSpec } from './schema.js';
|
|
2
|
+
/** Every failure asanakit raises on bad input, so a CLI can print it without a stack trace. */
|
|
3
|
+
export declare class PoseParseError extends Error {
|
|
4
|
+
readonly file: string;
|
|
5
|
+
readonly problems: readonly string[];
|
|
6
|
+
constructor(file: string, problems: readonly string[]);
|
|
7
|
+
}
|
|
8
|
+
export declare const parsePose: (text: string, file?: string) => PoseSpec;
|
|
9
|
+
export declare const parseSequence: (text: string, file?: string) => SequenceSpec;
|
|
10
|
+
export declare const loadPoseFile: (path: string) => Promise<PoseSpec>;
|
|
11
|
+
export declare const loadSequenceFile: (path: string) => Promise<SequenceSpec>;
|
|
12
|
+
//# sourceMappingURL=parse.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"parse.d.ts","sourceRoot":"","sources":["../../src/model/parse.ts"],"names":[],"mappings":"AAIA,OAAO,EAA8B,KAAK,QAAQ,EAAE,KAAK,YAAY,EAAE,MAAM,aAAa,CAAC;AAE3F,+FAA+F;AAC/F,qBAAa,cAAe,SAAQ,KAAK;IAErC,QAAQ,CAAC,IAAI,EAAE,MAAM;IACrB,QAAQ,CAAC,QAAQ,EAAE,SAAS,MAAM,EAAE;gBAD3B,IAAI,EAAE,MAAM,EACZ,QAAQ,EAAE,SAAS,MAAM,EAAE;CAKvC;AA2BD,eAAO,MAAM,SAAS,GAAI,MAAM,MAAM,EAAE,aAAiB,KAAG,QAA6C,CAAC;AAE1G,eAAO,MAAM,aAAa,GAAI,MAAM,MAAM,EAAE,aAAiB,KAAG,YAAqD,CAAC;AAEtH,eAAO,MAAM,YAAY,GAAU,MAAM,MAAM,KAAG,OAAO,CAAC,QAAQ,CACT,CAAC;AAE1D,eAAO,MAAM,gBAAgB,GAAU,MAAM,MAAM,KAAG,OAAO,CAAC,YAAY,CACb,CAAC"}
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
import { readFile } from 'node:fs/promises';
|
|
2
|
+
import { basename } from 'node:path';
|
|
3
|
+
import { parse as parseYaml } from 'yaml';
|
|
4
|
+
import { poseSchema, sequenceSchema } from './schema.js';
|
|
5
|
+
/** Every failure asanakit raises on bad input, so a CLI can print it without a stack trace. */
|
|
6
|
+
export class PoseParseError extends Error {
|
|
7
|
+
file;
|
|
8
|
+
problems;
|
|
9
|
+
constructor(file, problems) {
|
|
10
|
+
super(`${file}: ${problems.length} problem(s)\n - ${problems.join('\n - ')}`);
|
|
11
|
+
this.file = file;
|
|
12
|
+
this.problems = problems;
|
|
13
|
+
this.name = 'PoseParseError';
|
|
14
|
+
}
|
|
15
|
+
}
|
|
16
|
+
const describeIssue = (issue) => {
|
|
17
|
+
const path = issue.path.length > 0 ? issue.path.join('.') : '(root)';
|
|
18
|
+
return `${path}: ${issue.message}`;
|
|
19
|
+
};
|
|
20
|
+
/**
|
|
21
|
+
* YAML is a superset of JSON, so one parser handles both `.pose.yaml` and
|
|
22
|
+
* `.pose.json`. Fail loudly, listing every problem at once - an AI or a human
|
|
23
|
+
* editing a pose file wants the whole list, not the first error.
|
|
24
|
+
*/
|
|
25
|
+
const parseWith = (schema, text, file) => {
|
|
26
|
+
let raw;
|
|
27
|
+
try {
|
|
28
|
+
raw = parseYaml(text);
|
|
29
|
+
}
|
|
30
|
+
catch (error) {
|
|
31
|
+
throw new PoseParseError(file, [error instanceof Error ? error.message : String(error)]);
|
|
32
|
+
}
|
|
33
|
+
const result = schema.safeParse(raw);
|
|
34
|
+
if (!result.success) {
|
|
35
|
+
throw new PoseParseError(file, result.error.issues.map(describeIssue));
|
|
36
|
+
}
|
|
37
|
+
return result.data;
|
|
38
|
+
};
|
|
39
|
+
export const parsePose = (text, file = '<inline>') => parseWith(poseSchema, text, file);
|
|
40
|
+
export const parseSequence = (text, file = '<inline>') => parseWith(sequenceSchema, text, file);
|
|
41
|
+
export const loadPoseFile = async (path) => parsePose(await readFile(path, 'utf8'), basename(path));
|
|
42
|
+
export const loadSequenceFile = async (path) => parseSequence(await readFile(path, 'utf8'), basename(path));
|
|
43
|
+
//# sourceMappingURL=parse.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"parse.js","sourceRoot":"","sources":["../../src/model/parse.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAA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M,MAAM,GAAG,MAAM,CAAC,SAAS,CAAC,GAAG,CAAC,CAAC;IACrC,IAAI,CAAC,MAAM,CAAC,OAAO,EAAE,CAAC;QACpB,MAAM,IAAI,cAAc,CAAC,IAAI,EAAE,MAAM,CAAC,KAAK,CAAC,MAAM,CAAC,GAAG,CAAC,aAAa,CAAC,CAAC,CAAC;IACzE,CAAC;IACD,OAAO,MAAM,CAAC,IAAI,CAAC;AACrB,CAAC,CAAC;AAEF,MAAM,CAAC,MAAM,SAAS,GAAG,CAAC,IAAY,EAAE,IAAI,GAAG,UAAU,EAAY,EAAE,CAAC,SAAS,CAAC,UAAU,EAAE,IAAI,EAAE,IAAI,CAAC,CAAC;AAE1G,MAAM,CAAC,MAAM,aAAa,GAAG,CAAC,IAAY,EAAE,IAAI,GAAG,UAAU,EAAgB,EAAE,CAAC,SAAS,CAAC,cAAc,EAAE,IAAI,EAAE,IAAI,CAAC,CAAC;AAEtH,MAAM,CAAC,MAAM,YAAY,GAAG,KAAK,EAAE,IAAY,EAAqB,EAAE,CACpE,SAAS,CAAC,MAAM,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC,EAAE,QAAQ,CAAC,IAAI,CAAC,CAAC,CAAC;AAE1D,MAAM,CAAC,MAAM,gBAAgB,GAAG,KAAK,EAAE,IAAY,EAAyB,EAAE,CAC5E,aAAa,CAAC,MAAM,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC,EAAE,QAAQ,CAAC,IAAI,CAAC,CAAC,CAAC"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import type { JointId, KinematicPose } from '../core/types.js';
|
|
2
|
+
import type { FigureSpec } from './schema.js';
|
|
3
|
+
/**
|
|
4
|
+
* Swap every left angle with its right counterpart; centre bones stay put.
|
|
5
|
+
* `mirror` swaps which limb plays which role. Reflecting the picture is `flip`'s
|
|
6
|
+
* job - together they give you the other side of an asymmetric asana.
|
|
7
|
+
*/
|
|
8
|
+
export declare const mirrorAngles: <T extends Partial<Record<JointId, number>>>(angles: T) => T;
|
|
9
|
+
/** Turn the declarative figure block of a pose file into a solvable kinematic pose. */
|
|
10
|
+
export declare const resolveFigure: (figure: FigureSpec) => KinematicPose;
|
|
11
|
+
//# sourceMappingURL=pose.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"pose.d.ts","sourceRoot":"","sources":["../../src/model/pose.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAC;AAC/D,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AAU9C;;;;GAIG;AACH,eAAO,MAAM,YAAY,GAAI,CAAC,SAAS,OAAO,CAAC,MAAM,CAAC,OAAO,EAAE,MAAM,CAAC,CAAC,EAAE,QAAQ,CAAC,KAAG,CACa,CAAC;AAEnG,uFAAuF;AACvF,eAAO,MAAM,aAAa,GAAI,QAAQ,UAAU,KAAG,aAWjD,CAAC"}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
const OTHER_SIDE = { L: 'R', R: 'L' };
|
|
2
|
+
const mirrorJointId = (id) => {
|
|
3
|
+
const last = id.slice(-1);
|
|
4
|
+
const swapped = OTHER_SIDE[last];
|
|
5
|
+
return swapped === undefined ? id : `${id.slice(0, -1)}${swapped}`;
|
|
6
|
+
};
|
|
7
|
+
/**
|
|
8
|
+
* Swap every left angle with its right counterpart; centre bones stay put.
|
|
9
|
+
* `mirror` swaps which limb plays which role. Reflecting the picture is `flip`'s
|
|
10
|
+
* job - together they give you the other side of an asymmetric asana.
|
|
11
|
+
*/
|
|
12
|
+
export const mirrorAngles = (angles) => Object.fromEntries(Object.entries(angles).map(([id, angle]) => [mirrorJointId(id), angle]));
|
|
13
|
+
/** Turn the declarative figure block of a pose file into a solvable kinematic pose. */
|
|
14
|
+
export const resolveFigure = (figure) => ({
|
|
15
|
+
view: figure.view,
|
|
16
|
+
root: {
|
|
17
|
+
position: figure.root.position,
|
|
18
|
+
rotation: figure.root.rotation,
|
|
19
|
+
scale: figure.root.scale,
|
|
20
|
+
},
|
|
21
|
+
joints: figure.mirror ? mirrorAngles(figure.joints) : figure.joints,
|
|
22
|
+
world: figure.mirror ? mirrorAngles(figure.world) : figure.world,
|
|
23
|
+
grounded: figure.grounded,
|
|
24
|
+
flip: figure.flip,
|
|
25
|
+
});
|
|
26
|
+
//# sourceMappingURL=pose.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"pose.js","sourceRoot":"","sources":["../../src/model/pose.ts"],"names":[],"mappings":"AAGA,MAAM,UAAU,GAA2B,EAAE,CAAC,EAAE,GAAG,EAAE,CAAC,EAAE,GAAG,EAAE,CAAC;AAE9D,MAAM,aAAa,GAAG,CAAC,EAAU,EAAU,EAAE;IAC3C,MAAM,IAAI,GAAG,EAAE,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC;IAC1B,MAAM,OAAO,GAAG,UAAU,CAAC,IAAI,CAAC,CAAC;IACjC,OAAO,OAAO,KAAK,SAAS,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,GAAG,EAAE,CAAC,KAAK,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,GAAG,OAAO,EAAE,CAAC;AACrE,CAAC,CAAC;AAEF;;;;GAIG;AACH,MAAM,CAAC,MAAM,YAAY,GAAG,CAA6C,MAAS,EAAK,EAAE,CACvF,MAAM,CAAC,WAAW,CAAC,MAAM,CAAC,OAAO,CAAC,MAAM,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,KAAK,CAAC,EAAE,EAAE,CAAC,CAAC,aAAa,CAAC,EAAE,CAAC,EAAE,KAAK,CAAC,CAAC,CAAM,CAAC;AAEnG,uFAAuF;AACvF,MAAM,CAAC,MAAM,aAAa,GAAG,CAAC,MAAkB,EAAiB,EAAE,CAAC,CAAC;IACnE,IAAI,EAAE,MAAM,CAAC,IAAI;IACjB,IAAI,EAAE;QACJ,Q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