@franzenzenhofer/asanakit 0.2.0 → 0.4.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.
Files changed (62) hide show
  1. package/README.md +16 -3
  2. package/dist/cli/commands/export.js +1 -1
  3. package/dist/cli/commands/export.js.map +1 -1
  4. package/dist/cli/commands/info.js +1 -1
  5. package/dist/cli/commands/info.js.map +1 -1
  6. package/dist/cli/commands/render.d.ts.map +1 -1
  7. package/dist/cli/commands/render.js +34 -11
  8. package/dist/cli/commands/render.js.map +1 -1
  9. package/dist/cli/commands/view.d.ts.map +1 -1
  10. package/dist/cli/commands/view.js +51 -2
  11. package/dist/cli/commands/view.js.map +1 -1
  12. package/dist/core/joints.d.ts +5 -1
  13. package/dist/core/joints.d.ts.map +1 -1
  14. package/dist/core/joints.js +14 -2
  15. package/dist/core/joints.js.map +1 -1
  16. package/dist/core/types.d.ts +17 -1
  17. package/dist/core/types.d.ts.map +1 -1
  18. package/dist/model/schema.d.ts +29 -11
  19. package/dist/model/schema.d.ts.map +1 -1
  20. package/dist/model/schema.js +33 -10
  21. package/dist/model/schema.js.map +1 -1
  22. package/dist/props/geometry.d.ts +44 -0
  23. package/dist/props/geometry.d.ts.map +1 -0
  24. package/dist/props/geometry.js +85 -0
  25. package/dist/props/geometry.js.map +1 -0
  26. package/dist/render/camera.d.ts +2 -0
  27. package/dist/render/camera.d.ts.map +1 -1
  28. package/dist/render/camera.js +1 -0
  29. package/dist/render/camera.js.map +1 -1
  30. package/dist/render/figure.d.ts.map +1 -1
  31. package/dist/render/figure.js +3 -2
  32. package/dist/render/figure.js.map +1 -1
  33. package/dist/render/props.d.ts +1 -1
  34. package/dist/render/props.d.ts.map +1 -1
  35. package/dist/render/props.js +25 -10
  36. package/dist/render/props.js.map +1 -1
  37. package/dist/render/styles.d.ts +2 -0
  38. package/dist/render/styles.d.ts.map +1 -1
  39. package/dist/render/styles.js +7 -5
  40. package/dist/render/styles.js.map +1 -1
  41. package/dist/three/props.d.ts +11 -0
  42. package/dist/three/props.d.ts.map +1 -0
  43. package/dist/three/props.js +56 -0
  44. package/dist/three/props.js.map +1 -0
  45. package/dist/three/scene.d.ts +6 -1
  46. package/dist/three/scene.d.ts.map +1 -1
  47. package/dist/three/scene.js +23 -11
  48. package/dist/three/scene.js.map +1 -1
  49. package/dist/viewer/html.d.ts +21 -4
  50. package/dist/viewer/html.d.ts.map +1 -1
  51. package/dist/viewer/html.js +119 -7
  52. package/dist/viewer/html.js.map +1 -1
  53. package/dist/viewer/viewer.bundle.js +177 -177
  54. package/docs/AUTHORING.md +35 -9
  55. package/package.json +1 -2
  56. package/poses/yoga/ashtanga/prasarita-padottanasana-a.pose.yaml +1 -0
  57. package/poses/yoga/ashtanga/prasarita-padottanasana-c.pose.yaml +1 -0
  58. package/poses/yoga/ashtanga/samasthiti.pose.yaml +1 -1
  59. package/poses/yoga/ashtanga/urdhva-hastasana.pose.yaml +1 -1
  60. package/poses/yoga/ashtanga/utthita-parsvakonasana.pose.yaml +1 -0
  61. package/poses/yoga/ashtanga/utthita-trikonasana.pose.yaml +1 -0
  62. package/poses/yoga/ashtanga/virabhadrasana-b.pose.yaml +1 -0
package/docs/AUTHORING.md CHANGED
@@ -53,21 +53,47 @@ joints:
53
53
  shinR: 60 # knee bends 60° (backward - the only way a knee goes)
54
54
  ```
55
55
 
56
- The object form adds the other two anatomical axes:
56
+ The object form speaks the full anatomical vocabulary - every axis by both of its names:
57
57
 
58
58
  ```yaml
59
59
  joints:
60
- upperArmL: { abduct: 90 } # arm straight out to the side
60
+ upperArmL: { abduct: 90 } # arm straight out to the side
61
61
  thighR: { flex: 45, abduct: 30, twist: 20 }
62
+ upperArmR: { extend: 30 } # arm reaches behind the body
63
+ thighL: { adduct: 15, internalRotation: 10 }
62
64
  ```
63
65
 
64
- - `flex` - forward bend for hips/arms/spine, backward for knees, toes-up for ankles.
65
- - `abduct` - away from the midline, on either side. Center bones lean toward the figure's left.
66
- - `twist` - about the bone: positive is **external rotation** (toes/palms turn outward);
67
- for center bones, turning toward the figure's left.
68
-
69
- The signs are per-side anatomical, so a mirrored pose is literally the same numbers with
70
- L and R swapped - which is what `mirror: true` does.
66
+ - `flex` / `extend` - flexion and extension. Flexion is forward bend for hips/arms/spine,
67
+ backward for knees, toes-up (dorsiflexion) for ankles; extension is its opposite.
68
+ - `abduct` / `adduct` - away from / toward the midline, on either side. Center bones lean
69
+ toward the figure's left on positive `abduct` (lateral flexion).
70
+ - `twist`, or `externalRotation` / `internalRotation` by name - rotation about the bone.
71
+ Positive `twist` is external rotation (toes/palms turn outward); for center bones,
72
+ turning toward the figure's left (axial rotation).
73
+
74
+ Naming both directions of one axis (`flex` AND `extend`) is a contradiction and fails
75
+ loudly. The signs are per-side anatomical, so a mirrored pose is literally the same
76
+ numbers with L and R swapped - which is what `mirror: true` does.
77
+
78
+ ### How classic movement terms map onto the format
79
+
80
+ | You say | You write |
81
+ |---|---|
82
+ | hip flexion / extension | `thighL: { flex: … }` / `{ extend: … }` |
83
+ | knee flexion | `shinL: 60` (knees only flex; the validator rejects the other way) |
84
+ | ankle dorsiflexion / plantarflexion | `footL: { flex: … }` / `{ extend: … }` |
85
+ | foot turnout (out-toeing) | `footL: { abduct: … }` or `thighL: { externalRotation: … }` |
86
+ | shoulder flexion (arm forward-up) | `upperArmL: { flex: … }` |
87
+ | shoulder abduction (arm sideways-up) | `upperArmL: { abduct: … }` |
88
+ | shoulder internal/external rotation | `upperArmL: { internalRotation: … }` / `{ externalRotation: … }` |
89
+ | elbow flexion | `forearmL: 90` |
90
+ | forearm pronation / supination | `forearmL: { internalRotation: … }` / `{ externalRotation: … }` |
91
+ | scapular elevation (shrug) | `clavicleL: { abduct: … }` |
92
+ | scapular protraction / retraction | `clavicleL: { flex: … }` / `{ extend: … }` |
93
+ | spinal flexion (forward fold) / extension (backbend) | `spine: { flex: … }` / `{ extend: … }` |
94
+ | spinal lateral flexion (side bend) | `spine: { abduct: … }` (positive = toward the figure's left) |
95
+ | spinal / cervical rotation (twist) | `spine: { twist: … }`, `neck: { twist: … }` |
96
+ | hip abduction / adduction | `thighL: { abduct: … }` / `{ adduct: … }` |
71
97
 
72
98
  ### The root
73
99
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@franzenzenhofer/asanakit",
3
- "version": "0.2.0",
3
+ "version": "0.4.0",
4
4
  "description": "Programmatic stick-figure and body-posture visualization engine for yoga and surf. Declarative 3D pose format, deterministic any-angle SVG/PNG, interactive three.js viewer, GLB export, Rapier physics settling. CLI-first, AI-driveable.",
5
5
  "keywords": [
6
6
  "yoga",
@@ -102,7 +102,6 @@
102
102
  "vitest": "^3.2.4"
103
103
  },
104
104
  "allowScripts": {
105
- "sharp@0.34.5": true,
106
105
  "esbuild@0.28.1": true,
107
106
  "@resvg/resvg-js@2.6.2": true
108
107
  }
@@ -40,6 +40,7 @@ figure:
40
40
  handR: { azimuth: -90, elevation: -8 }
41
41
  props:
42
42
  - type: mat
43
+ yaw: 90
43
44
  muscles:
44
45
  engaged: [ quadriceps, rectusAbdominis, deltoid ]
45
46
  stretched: [ hamstrings, adductors, erectorSpinae, gastrocnemius ]
@@ -40,6 +40,7 @@ figure:
40
40
  handR: { azimuth: 90, elevation: 75 }
41
41
  props:
42
42
  - type: mat
43
+ yaw: 90
43
44
  muscles:
44
45
  engaged: [ quadriceps, deltoid, trapezius ]
45
46
  stretched: [ hamstrings, adductors, pectoralis, deltoid ]
@@ -26,4 +26,4 @@ props:
26
26
  - type: mat
27
27
  muscles:
28
28
  engaged: [ quadriceps, erectorSpinae ]
29
- camera: side
29
+ camera: front
@@ -39,4 +39,4 @@ props:
39
39
  muscles:
40
40
  engaged: [ deltoid, erectorSpinae, quadriceps ]
41
41
  stretched: [ rectusAbdominis, latissimus ]
42
- camera: side
42
+ camera: front
@@ -38,6 +38,7 @@ figure:
38
38
  handR: { azimuth: 90, elevation: 30 }
39
39
  props:
40
40
  - type: mat
41
+ yaw: 90
41
42
  muscles:
42
43
  engaged: [ quadriceps, gluteus, obliques, deltoid ]
43
44
  stretched: [ adductors, latissimus, obliques, hipFlexors ]
@@ -38,6 +38,7 @@ figure:
38
38
  handR: { azimuth: -90, elevation: 80 }
39
39
  props:
40
40
  - type: mat
41
+ yaw: 90
41
42
  muscles:
42
43
  engaged: [ quadriceps, obliques, deltoid, erectorSpinae ]
43
44
  stretched: [ hamstrings, adductors, obliques, latissimus ]
@@ -34,6 +34,7 @@ figure:
34
34
  handR: { azimuth: -90, elevation: 0 }
35
35
  props:
36
36
  - type: mat
37
+ yaw: 90
37
38
  muscles:
38
39
  engaged: [ quadriceps, gluteus, adductors, deltoid ]
39
40
  stretched: [ adductors, hipFlexors, pectoralis ]