@automovie/human 0.1.0 → 0.2.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 (162) hide show
  1. package/README.md +18 -3
  2. package/lib/generation/AutoMovieHumanDigitJoints.d.ts +8 -26
  3. package/lib/generation/AutoMovieHumanDigitJoints.js +9 -37
  4. package/lib/generation/AutoMovieHumanDigitJoints.js.map +1 -1
  5. package/lib/generation/conic/AutoMovieHumanConicLoft.d.ts +154 -0
  6. package/lib/generation/conic/AutoMovieHumanConicLoft.js +430 -0
  7. package/lib/generation/conic/AutoMovieHumanConicLoft.js.map +1 -0
  8. package/lib/generation/conic/AutoMovieHumanConicPose.d.ts +92 -0
  9. package/lib/generation/conic/AutoMovieHumanConicPose.js +202 -0
  10. package/lib/generation/conic/AutoMovieHumanConicPose.js.map +1 -0
  11. package/lib/generation/conic/AutoMovieHumanConicRelief.d.ts +52 -0
  12. package/lib/generation/conic/AutoMovieHumanConicRelief.js +88 -0
  13. package/lib/generation/conic/AutoMovieHumanConicRelief.js.map +1 -0
  14. package/lib/generation/conic/AutoMovieHumanConicSection.d.ts +252 -0
  15. package/lib/generation/conic/AutoMovieHumanConicSection.js +567 -0
  16. package/lib/generation/conic/AutoMovieHumanConicSection.js.map +1 -0
  17. package/lib/generation/f1/AutoMovieHumanF1.d.ts +265 -0
  18. package/lib/generation/f1/AutoMovieHumanF1.js +1254 -0
  19. package/lib/generation/f1/AutoMovieHumanF1.js.map +1 -0
  20. package/lib/generation/f1/AutoMovieHumanF1Antihelix.d.ts +23 -0
  21. package/lib/generation/f1/AutoMovieHumanF1Antihelix.js +65 -0
  22. package/lib/generation/f1/AutoMovieHumanF1Antihelix.js.map +1 -0
  23. package/lib/generation/f1/AutoMovieHumanF1Arm.d.ts +18 -0
  24. package/lib/generation/f1/AutoMovieHumanF1Arm.js +82 -0
  25. package/lib/generation/f1/AutoMovieHumanF1Arm.js.map +1 -0
  26. package/lib/generation/f1/AutoMovieHumanF1Axilla.d.ts +18 -0
  27. package/lib/generation/f1/AutoMovieHumanF1Axilla.js +91 -0
  28. package/lib/generation/f1/AutoMovieHumanF1Axilla.js.map +1 -0
  29. package/lib/generation/f1/AutoMovieHumanF1Breast.d.ts +18 -0
  30. package/lib/generation/f1/AutoMovieHumanF1Breast.js +75 -0
  31. package/lib/generation/f1/AutoMovieHumanF1Breast.js.map +1 -0
  32. package/lib/generation/f1/AutoMovieHumanF1Concha.d.ts +40 -0
  33. package/lib/generation/f1/AutoMovieHumanF1Concha.js +81 -0
  34. package/lib/generation/f1/AutoMovieHumanF1Concha.js.map +1 -0
  35. package/lib/generation/f1/AutoMovieHumanF1FingerIndex.d.ts +18 -0
  36. package/lib/generation/f1/AutoMovieHumanF1FingerIndex.js +59 -0
  37. package/lib/generation/f1/AutoMovieHumanF1FingerIndex.js.map +1 -0
  38. package/lib/generation/f1/AutoMovieHumanF1FingerMiddle.d.ts +18 -0
  39. package/lib/generation/f1/AutoMovieHumanF1FingerMiddle.js +59 -0
  40. package/lib/generation/f1/AutoMovieHumanF1FingerMiddle.js.map +1 -0
  41. package/lib/generation/f1/AutoMovieHumanF1FingerPinky.d.ts +18 -0
  42. package/lib/generation/f1/AutoMovieHumanF1FingerPinky.js +75 -0
  43. package/lib/generation/f1/AutoMovieHumanF1FingerPinky.js.map +1 -0
  44. package/lib/generation/f1/AutoMovieHumanF1FingerRing.d.ts +18 -0
  45. package/lib/generation/f1/AutoMovieHumanF1FingerRing.js +75 -0
  46. package/lib/generation/f1/AutoMovieHumanF1FingerRing.js.map +1 -0
  47. package/lib/generation/f1/AutoMovieHumanF1FingerThumb.d.ts +18 -0
  48. package/lib/generation/f1/AutoMovieHumanF1FingerThumb.js +59 -0
  49. package/lib/generation/f1/AutoMovieHumanF1FingerThumb.js.map +1 -0
  50. package/lib/generation/f1/AutoMovieHumanF1Frames.d.ts +97 -0
  51. package/lib/generation/f1/AutoMovieHumanF1Frames.js +160 -0
  52. package/lib/generation/f1/AutoMovieHumanF1Frames.js.map +1 -0
  53. package/lib/generation/f1/AutoMovieHumanF1Hand.d.ts +18 -0
  54. package/lib/generation/f1/AutoMovieHumanF1Hand.js +81 -0
  55. package/lib/generation/f1/AutoMovieHumanF1Hand.js.map +1 -0
  56. package/lib/generation/f1/AutoMovieHumanF1Helix.d.ts +20 -0
  57. package/lib/generation/f1/AutoMovieHumanF1Helix.js +64 -0
  58. package/lib/generation/f1/AutoMovieHumanF1Helix.js.map +1 -0
  59. package/lib/generation/f1/AutoMovieHumanF1Joints.d.ts +231 -0
  60. package/lib/generation/f1/AutoMovieHumanF1Joints.js +249 -0
  61. package/lib/generation/f1/AutoMovieHumanF1Joints.js.map +1 -0
  62. package/lib/generation/f1/AutoMovieHumanF1Landmarks.d.ts +86 -0
  63. package/lib/generation/f1/AutoMovieHumanF1Landmarks.js +89 -0
  64. package/lib/generation/f1/AutoMovieHumanF1Landmarks.js.map +1 -0
  65. package/lib/generation/f1/AutoMovieHumanF1Leg.d.ts +18 -0
  66. package/lib/generation/f1/AutoMovieHumanF1Leg.js +82 -0
  67. package/lib/generation/f1/AutoMovieHumanF1Leg.js.map +1 -0
  68. package/lib/generation/f1/AutoMovieHumanF1Nose.d.ts +18 -0
  69. package/lib/generation/f1/AutoMovieHumanF1Nose.js +82 -0
  70. package/lib/generation/f1/AutoMovieHumanF1Nose.js.map +1 -0
  71. package/lib/generation/f1/AutoMovieHumanF1Nostril.d.ts +18 -0
  72. package/lib/generation/f1/AutoMovieHumanF1Nostril.js +59 -0
  73. package/lib/generation/f1/AutoMovieHumanF1Nostril.js.map +1 -0
  74. package/lib/generation/f1/AutoMovieHumanF1Placement.d.ts +75 -0
  75. package/lib/generation/f1/AutoMovieHumanF1Placement.js +151 -0
  76. package/lib/generation/f1/AutoMovieHumanF1Placement.js.map +1 -0
  77. package/lib/generation/f1/AutoMovieHumanF1Placing.d.ts +45 -0
  78. package/lib/generation/f1/AutoMovieHumanF1Placing.js +301 -0
  79. package/lib/generation/f1/AutoMovieHumanF1Placing.js.map +1 -0
  80. package/lib/generation/f1/AutoMovieHumanF1Plate.d.ts +18 -0
  81. package/lib/generation/f1/AutoMovieHumanF1Plate.js +59 -0
  82. package/lib/generation/f1/AutoMovieHumanF1Plate.js.map +1 -0
  83. package/lib/generation/f1/AutoMovieHumanF1ToeBig.d.ts +18 -0
  84. package/lib/generation/f1/AutoMovieHumanF1ToeBig.js +59 -0
  85. package/lib/generation/f1/AutoMovieHumanF1ToeBig.js.map +1 -0
  86. package/lib/generation/f1/AutoMovieHumanF1ToeIndex.d.ts +18 -0
  87. package/lib/generation/f1/AutoMovieHumanF1ToeIndex.js +59 -0
  88. package/lib/generation/f1/AutoMovieHumanF1ToeIndex.js.map +1 -0
  89. package/lib/generation/f1/AutoMovieHumanF1ToeLittle.d.ts +18 -0
  90. package/lib/generation/f1/AutoMovieHumanF1ToeLittle.js +75 -0
  91. package/lib/generation/f1/AutoMovieHumanF1ToeLittle.js.map +1 -0
  92. package/lib/generation/f1/AutoMovieHumanF1ToeMiddle.d.ts +18 -0
  93. package/lib/generation/f1/AutoMovieHumanF1ToeMiddle.js +75 -0
  94. package/lib/generation/f1/AutoMovieHumanF1ToeMiddle.js.map +1 -0
  95. package/lib/generation/f1/AutoMovieHumanF1ToeRing.d.ts +18 -0
  96. package/lib/generation/f1/AutoMovieHumanF1ToeRing.js +75 -0
  97. package/lib/generation/f1/AutoMovieHumanF1ToeRing.js.map +1 -0
  98. package/lib/generation/f1/AutoMovieHumanF1Trunk.d.ts +18 -0
  99. package/lib/generation/f1/AutoMovieHumanF1Trunk.js +79 -0
  100. package/lib/generation/f1/AutoMovieHumanF1Trunk.js.map +1 -0
  101. package/lib/generation/f1/AutoMovieHumanF1Vault.d.ts +18 -0
  102. package/lib/generation/f1/AutoMovieHumanF1Vault.js +75 -0
  103. package/lib/generation/f1/AutoMovieHumanF1Vault.js.map +1 -0
  104. package/lib/generation/frame/AutoMovieHumanSegmentFrame.d.ts +149 -0
  105. package/lib/generation/frame/AutoMovieHumanSegmentFrame.js +290 -0
  106. package/lib/generation/frame/AutoMovieHumanSegmentFrame.js.map +1 -0
  107. package/lib/index.d.ts +11 -0
  108. package/lib/index.js +11 -0
  109. package/lib/index.js.map +1 -1
  110. package/lib/skeleton/AutoMovieHumanCanonicalBody.d.ts +7 -3
  111. package/lib/skeleton/AutoMovieHumanCanonicalBody.js +31 -3
  112. package/lib/skeleton/AutoMovieHumanCanonicalBody.js.map +1 -1
  113. package/lib/skeleton/AutoMovieHumanCanonicalProfile.d.ts +22 -31
  114. package/lib/skeleton/AutoMovieHumanCanonicalProfile.js +112 -172
  115. package/lib/skeleton/AutoMovieHumanCanonicalProfile.js.map +1 -1
  116. package/lib/skeleton/AutoMovieHumanCanonicalSolids.d.ts +65 -0
  117. package/lib/skeleton/AutoMovieHumanCanonicalSolids.js +105 -0
  118. package/lib/skeleton/AutoMovieHumanCanonicalSolids.js.map +1 -0
  119. package/lib/skeleton/index.d.ts +1 -0
  120. package/lib/skeleton/index.js +1 -0
  121. package/lib/skeleton/index.js.map +1 -1
  122. package/package.json +21 -13
  123. package/src/generation/AutoMovieHumanDigitJoints.ts +12 -47
  124. package/src/generation/conic/AutoMovieHumanConicLoft.ts +566 -0
  125. package/src/generation/conic/AutoMovieHumanConicPose.ts +213 -0
  126. package/src/generation/conic/AutoMovieHumanConicRelief.ts +94 -0
  127. package/src/generation/conic/AutoMovieHumanConicSection.ts +609 -0
  128. package/src/generation/f1/AutoMovieHumanF1.ts +1448 -0
  129. package/src/generation/f1/AutoMovieHumanF1Antihelix.ts +64 -0
  130. package/src/generation/f1/AutoMovieHumanF1Arm.ts +82 -0
  131. package/src/generation/f1/AutoMovieHumanF1Axilla.ts +90 -0
  132. package/src/generation/f1/AutoMovieHumanF1Breast.ts +74 -0
  133. package/src/generation/f1/AutoMovieHumanF1Concha.ts +80 -0
  134. package/src/generation/f1/AutoMovieHumanF1FingerIndex.ts +58 -0
  135. package/src/generation/f1/AutoMovieHumanF1FingerMiddle.ts +58 -0
  136. package/src/generation/f1/AutoMovieHumanF1FingerPinky.ts +74 -0
  137. package/src/generation/f1/AutoMovieHumanF1FingerRing.ts +74 -0
  138. package/src/generation/f1/AutoMovieHumanF1FingerThumb.ts +58 -0
  139. package/src/generation/f1/AutoMovieHumanF1Frames.ts +191 -0
  140. package/src/generation/f1/AutoMovieHumanF1Hand.ts +81 -0
  141. package/src/generation/f1/AutoMovieHumanF1Helix.ts +63 -0
  142. package/src/generation/f1/AutoMovieHumanF1Joints.ts +319 -0
  143. package/src/generation/f1/AutoMovieHumanF1Landmarks.ts +101 -0
  144. package/src/generation/f1/AutoMovieHumanF1Leg.ts +82 -0
  145. package/src/generation/f1/AutoMovieHumanF1Nose.ts +82 -0
  146. package/src/generation/f1/AutoMovieHumanF1Nostril.ts +58 -0
  147. package/src/generation/f1/AutoMovieHumanF1Placement.ts +148 -0
  148. package/src/generation/f1/AutoMovieHumanF1Placing.ts +313 -0
  149. package/src/generation/f1/AutoMovieHumanF1Plate.ts +59 -0
  150. package/src/generation/f1/AutoMovieHumanF1ToeBig.ts +58 -0
  151. package/src/generation/f1/AutoMovieHumanF1ToeIndex.ts +58 -0
  152. package/src/generation/f1/AutoMovieHumanF1ToeLittle.ts +74 -0
  153. package/src/generation/f1/AutoMovieHumanF1ToeMiddle.ts +74 -0
  154. package/src/generation/f1/AutoMovieHumanF1ToeRing.ts +74 -0
  155. package/src/generation/f1/AutoMovieHumanF1Trunk.ts +79 -0
  156. package/src/generation/f1/AutoMovieHumanF1Vault.ts +74 -0
  157. package/src/generation/frame/AutoMovieHumanSegmentFrame.ts +309 -0
  158. package/src/index.ts +11 -0
  159. package/src/skeleton/AutoMovieHumanCanonicalBody.ts +53 -3
  160. package/src/skeleton/AutoMovieHumanCanonicalProfile.ts +153 -358
  161. package/src/skeleton/AutoMovieHumanCanonicalSolids.ts +175 -0
  162. package/src/skeleton/index.ts +1 -0
@@ -0,0 +1,1254 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.AutoMovieHumanF1 = void 0;
4
+ const engine_1 = require("@automovie/engine");
5
+ const AutoMovieHumanConicLoft_1 = require("../conic/AutoMovieHumanConicLoft");
6
+ const AutoMovieHumanConicSection_1 = require("../conic/AutoMovieHumanConicSection");
7
+ const AutoMovieHumanSegmentFrame_1 = require("../frame/AutoMovieHumanSegmentFrame");
8
+ const AutoMovieHumanF1Antihelix_1 = require("./AutoMovieHumanF1Antihelix");
9
+ const AutoMovieHumanF1Arm_1 = require("./AutoMovieHumanF1Arm");
10
+ const AutoMovieHumanF1Hand_1 = require("./AutoMovieHumanF1Hand");
11
+ const AutoMovieHumanF1Axilla_1 = require("./AutoMovieHumanF1Axilla");
12
+ const AutoMovieHumanF1Breast_1 = require("./AutoMovieHumanF1Breast");
13
+ const AutoMovieHumanF1Concha_1 = require("./AutoMovieHumanF1Concha");
14
+ const AutoMovieHumanF1Helix_1 = require("./AutoMovieHumanF1Helix");
15
+ const AutoMovieHumanF1FingerIndex_1 = require("./AutoMovieHumanF1FingerIndex");
16
+ const AutoMovieHumanF1FingerMiddle_1 = require("./AutoMovieHumanF1FingerMiddle");
17
+ const AutoMovieHumanF1FingerPinky_1 = require("./AutoMovieHumanF1FingerPinky");
18
+ const AutoMovieHumanF1FingerRing_1 = require("./AutoMovieHumanF1FingerRing");
19
+ const AutoMovieHumanF1FingerThumb_1 = require("./AutoMovieHumanF1FingerThumb");
20
+ const AutoMovieHumanF1Leg_1 = require("./AutoMovieHumanF1Leg");
21
+ const AutoMovieHumanF1Nose_1 = require("./AutoMovieHumanF1Nose");
22
+ const AutoMovieHumanF1Nostril_1 = require("./AutoMovieHumanF1Nostril");
23
+ const AutoMovieHumanF1Placement_1 = require("./AutoMovieHumanF1Placement");
24
+ const AutoMovieHumanF1Plate_1 = require("./AutoMovieHumanF1Plate");
25
+ const AutoMovieHumanF1ToeBig_1 = require("./AutoMovieHumanF1ToeBig");
26
+ const AutoMovieHumanF1ToeIndex_1 = require("./AutoMovieHumanF1ToeIndex");
27
+ const AutoMovieHumanF1ToeLittle_1 = require("./AutoMovieHumanF1ToeLittle");
28
+ const AutoMovieHumanF1ToeMiddle_1 = require("./AutoMovieHumanF1ToeMiddle");
29
+ const AutoMovieHumanF1ToeRing_1 = require("./AutoMovieHumanF1ToeRing");
30
+ const AutoMovieHumanF1Trunk_1 = require("./AutoMovieHumanF1Trunk");
31
+ /**
32
+ * The f1 figure in its reference pose, generated from its authored conic
33
+ * families alone: no reference mesh, recovered curve or observation file is
34
+ * read anywhere on this path.
35
+ *
36
+ * The body is one sewn skin, built by the engine's construction operators:
37
+ * the trunk from the crotch to the crown, the nose's free end, and on each
38
+ * side an arm that runs from the armpit's sagittal plane round the shoulder
39
+ * and through the wrist to the finger webs, a leg that runs from below the
40
+ * crotch round the ankle to the toe webs, an ear, five fingers and five toes.
41
+ * The trunk's open lower end is split into the two legs along the midsagittal
42
+ * chord, and each arm, each breast and the nose is attached at a port on the
43
+ * trunk; those bands span from a curve on the trunk to a ring of the part and
44
+ * meet both G2 without a traced intersection. Each finger and toe is a
45
+ * capsule merged onto its limb's cap along the curve where it comes out, and
46
+ * each ear is its plate with the helix and the antihelix merged on it as
47
+ * tubes, merged onto the head along the curve round the plate's root. The
48
+ * crown, each hand, each foot, each ear, the nose and each digit close in a
49
+ * pole.
50
+ *
51
+ * The hand's sections leave out the thumb past where it stands free, as the
52
+ * trunk's leave out the arms, the ears and the nose. The face's eyes and
53
+ * mouth are height fields over the trunk's wall. A hollow with a wall of its
54
+ * own is a loft cut out: each nostril and each ear's bowl from the head.
55
+ *
56
+ * Every family is placed through f1's segment frames (`assemble`): its course, its chart's `up` and its reliefs' directions are stored in
57
+ * the frames of the segments they belong to (`AutoMovieHumanF1Placing`) and mapped to the figure's frame at a pose, the reference pose
58
+ * unless another is given. Whatever reads the figure's frame here (the port loops, the fan seams, the fills) reads it through those frames.
59
+ */
60
+ var AutoMovieHumanF1;
61
+ (function (AutoMovieHumanF1) {
62
+ /** The families the sewn body is built from. */
63
+ AutoMovieHumanF1.BODY = { trunk: AutoMovieHumanF1Trunk_1.AutoMovieHumanF1Trunk, arm: AutoMovieHumanF1Arm_1.AutoMovieHumanF1Arm, hand: AutoMovieHumanF1Hand_1.AutoMovieHumanF1Hand, leg: AutoMovieHumanF1Leg_1.AutoMovieHumanF1Leg, ear: AutoMovieHumanF1Plate_1.AutoMovieHumanF1Plate, nose: AutoMovieHumanF1Nose_1.AutoMovieHumanF1Nose, breast: AutoMovieHumanF1Breast_1.AutoMovieHumanF1Breast };
64
+ /**
65
+ * The least shoulder of a toe's arcs (`AutoMovieHumanConicSection.ILayout.least`). The big toe's arc from its top to its medial side held
66
+ * shoulders of 0.24 and 0.27 at its last two knots, 43 and 53 mm: an arc that hugs its chord turns at its ends, and the toe's medial side
67
+ * stood a corner that its short cap carried into a fan of facets (`toes.front` px 640..790 x 440..540, folds of 33 degrees). The bound is
68
+ * the knee's (`FamilyConicBody.ts --least=0.3`); every other toe's arcs and every toe's first section already hold 0.34 or more, so the
69
+ * seams read on the toes' first rings (`fanSeams`) do not move.
70
+ */
71
+ const TOE_LEAST = 0.3;
72
+ /**
73
+ * The length of a toe's dome as a share of its section's mean reach where the dome starts (`rounded`). The big toe's reference section
74
+ * reaches 7.95 mm on average 3.13 mm before its tip and 10.97 mm at 13.13 mm (its fitted fields at 53 and 43 mm, within 0.6 mm of the
75
+ * skin): a half ellipse through the first whose foot stands on the wall is 8 mm long on a reach of 10 mm. A dome as long as its reach
76
+ * (share 1) drew the big toe's end as a tapered ellipsoid on `toes.left`, where the reference's is blunt.
77
+ */
78
+ const TOE_DOME = 0.8;
79
+ /**
80
+ * The largest turn of a toe's ring between two neighbouring phases, radians (`AutoMovieHumanConicLoft.IFamily.turn`), the arm's. On the
81
+ * uniform 48 phases a toe takes by its girth, the big toe's medial side, where its section turns fastest, stood as flat strips along the toe
82
+ * that read as a fan of facets from the front (`toes.front` px 640..790 x 440..540), as the forefoot's edge did on the leg's uniform phases.
83
+ * Only a toe whose fit held an arc under `TOE_LEAST` has such a corner, the big toe alone: spaced by turn at 0.1 or 0.2 rad, the little
84
+ * toe's band folded at its plantar fork (edges of 130 to 170 degrees over 32 to 53 edges at [132, 1, 198], against none past 112 on its
85
+ * uniform phases), since its ring's phases moved under the fork's fill.
86
+ */
87
+ const TOE_TURN = 0.1;
88
+ /**
89
+ * Rings a toe's dome is meshed in (`AutoMovieHumanConicLoft.ITip.rings`). The dome turns its normal a quarter turn from the wall to the
90
+ * tip, and the cap's twelve rings, at equal steps of the root of the distance to the tip, turned it 6 to 9 degrees each: under flat
91
+ * shading every toe's tip stood as a bullseye of bands (`toes.front` px 200..260 x 520..570 and 540..600 x 440..500). Thirty turn it
92
+ * 3 degrees or less each.
93
+ */
94
+ const TOE_CAP_RINGS = 30;
95
+ /**
96
+ * A toe whose closed end is a round dome: its cap starts as far before its tip as `TOE_DOME` of the mean reach of its section there
97
+ * (the mean of its four extents), so the end is a half ellipsoid on that section.
98
+ *
99
+ * Each toe's fields were fitted up to the last station whose plane still cuts a loop of the reference, 3.1 to 3.6 mm before its tip, and the
100
+ * cap closed from there (`ITip.from` at the last knot). There the reference's section is already the dome's (the big toe's 15 by 17 mm
101
+ * at 53 mm against 19 by 25 at 43), but a natural cubic has no bend at its last knot, so the wall ran on straight to 53 mm and the cap,
102
+ * 3.1 mm long, closed it as a flat disc ringed where the cap starts (`toes.left` px 700..840 x 330..600); on the small toes, whose walls
103
+ * still shrink fast there, the cap continued their taper to a point. Started where the dome's length is its share of the reach (found by
104
+ * fixed-point iteration from the last knot), the cap's law draws the dome itself. A toe also holds its arcs at `TOE_LEAST`, and one
105
+ * whose fit held an arc under it spaces its phases by `TOE_TURN`.
106
+ *
107
+ * @param family A toe as fitted, closing at its last knot.
108
+ */
109
+ function rounded(family) {
110
+ const layout = { ...family.layout, least: TOE_LEAST };
111
+ const end = family.tips[1];
112
+ const read = AutoMovieHumanConicLoft_1.AutoMovieHumanConicLoft.reader(family);
113
+ const reach = (s) => {
114
+ const chain = AutoMovieHumanConicSection_1.AutoMovieHumanConicSection.resolve(read(s), layout);
115
+ return chain.guides.reduce((sum, g, q) => sum + Math.abs(chain.input.points[g][q % 2]), 0) / 4;
116
+ };
117
+ let from = end.from;
118
+ for (let k = 0; k < 16; ++k)
119
+ from = Math.max(family.knots[1], end.tip - TOE_DOME * reach(from));
120
+ // Only a toe whose fit held an arc under the bound has a corner to space its phases about.
121
+ const { shoulders } = AutoMovieHumanConicSection_1.AutoMovieHumanConicSection.offsets(family.layout);
122
+ const cornered = family.values.slice(shoulders).some((field) => field.some((x) => x < TOE_LEAST));
123
+ return { ...family, layout, ...(cornered ? { turn: TOE_TURN } : {}), tips: [family.tips[0], { ...end, from: Math.round(from * 100) / 100, rings: TOE_CAP_RINGS }] };
124
+ }
125
+ /**
126
+ * The digits sewn to the body. A knuckled digit is a child of its limb's split (`FANS`). The thumb is merged onto the hand's side as a
127
+ * capsule: besides its tip it closes in a point inside the hand (`ROOT_MM`), so it meets the hand in a closed curve wherever it comes out.
128
+ * A toe's end is a round dome (`rounded`).
129
+ */
130
+ AutoMovieHumanF1.DIGITS = [
131
+ { family: AutoMovieHumanF1FingerMiddle_1.AutoMovieHumanF1FingerMiddle, limb: "arm", knuckle: true },
132
+ { family: AutoMovieHumanF1FingerRing_1.AutoMovieHumanF1FingerRing, limb: "arm", knuckle: true },
133
+ { family: AutoMovieHumanF1FingerIndex_1.AutoMovieHumanF1FingerIndex, limb: "arm", knuckle: true },
134
+ { family: AutoMovieHumanF1FingerPinky_1.AutoMovieHumanF1FingerPinky, limb: "arm", knuckle: true },
135
+ { family: AutoMovieHumanF1FingerThumb_1.AutoMovieHumanF1FingerThumb, limb: "arm", knuckle: false },
136
+ { family: rounded(AutoMovieHumanF1ToeBig_1.AutoMovieHumanF1ToeBig), limb: "leg", knuckle: true },
137
+ { family: rounded(AutoMovieHumanF1ToeIndex_1.AutoMovieHumanF1ToeIndex), limb: "leg", knuckle: true },
138
+ { family: rounded(AutoMovieHumanF1ToeMiddle_1.AutoMovieHumanF1ToeMiddle), limb: "leg", knuckle: true },
139
+ { family: rounded(AutoMovieHumanF1ToeRing_1.AutoMovieHumanF1ToeRing), limb: "leg", knuckle: true },
140
+ { family: rounded(AutoMovieHumanF1ToeLittle_1.AutoMovieHumanF1ToeLittle), limb: "leg", knuckle: true },
141
+ ];
142
+ /** The families not sewn: none now. A loose family is emitted as a closed tube of its own, carried by its reach under its neighbour's skin. */
143
+ AutoMovieHumanF1.LOOSE = [];
144
+ /** Every authored family of the figure. */
145
+ AutoMovieHumanF1.FAMILIES = [
146
+ { family: AutoMovieHumanF1.BODY.trunk, mirrored: false },
147
+ { family: AutoMovieHumanF1.BODY.arm, mirrored: true },
148
+ { family: AutoMovieHumanF1.BODY.hand, mirrored: true },
149
+ { family: AutoMovieHumanF1.BODY.leg, mirrored: true },
150
+ { family: AutoMovieHumanF1.BODY.ear, mirrored: true },
151
+ { family: AutoMovieHumanF1Helix_1.AutoMovieHumanF1Helix, mirrored: true },
152
+ { family: AutoMovieHumanF1Antihelix_1.AutoMovieHumanF1Antihelix, mirrored: true },
153
+ { family: AutoMovieHumanF1.BODY.nose, mirrored: false },
154
+ { family: AutoMovieHumanF1.BODY.breast, mirrored: true },
155
+ ...AutoMovieHumanF1.DIGITS.map((digit) => ({ family: digit.family, mirrored: true })),
156
+ ...AutoMovieHumanF1.LOOSE,
157
+ ];
158
+ /**
159
+ * Every stored cutter of the figure: the armpit's slit, each ear's bowl and each nostril are lofts cut out of the skin (`construction`),
160
+ * so `FAMILIES` does not hold them. Each is listed as stored, with `cut`, the family the figure lofts from it: the nostril is drawn in by
161
+ * its rim and spread past its mouth (`drawnIn`, `spreadOut`), the others are cut as stored. A reader that changes a cutter's stored
162
+ * fields reads through `cut` the wall the figure would cut with them.
163
+ */
164
+ AutoMovieHumanF1.CUTTERS = [
165
+ { family: AutoMovieHumanF1Axilla_1.AutoMovieHumanF1Axilla, mirrored: true, cut: (family) => family },
166
+ { family: AutoMovieHumanF1Concha_1.AutoMovieHumanF1Concha, mirrored: true, cut: (family) => family },
167
+ { family: AutoMovieHumanF1Nostril_1.AutoMovieHumanF1Nostril, mirrored: true, cut: (family) => spreadOut(drawnIn(family, NOSTRIL_RIM_MM), NOSTRIL_MOUTH_MM, NOSTRIL_SPREAD_MM) },
168
+ ];
169
+ /**
170
+ * Place every family of the figure at a pose: each family's course, `up` and relief directions are read from the re-based table through
171
+ * the chain of segment frames (`AutoMovieHumanF1Placement.place`), and its section table is carried untouched. Where the pose changes
172
+ * a course's joint angles its turns keep their set-backs, its stations are mapped and its chart takes its joints' twist
173
+ * (`AutoMovieHumanConicPose`). Absent, the pose is the reference pose, at which every family is its stored module number for number. A twin is not placed: it is the reflection of its placed
174
+ * side in the median plane, as before.
175
+ *
176
+ * @param pose One rotation per joint by segment name; a joint it leaves undefined keeps its reference rotation.
177
+ */
178
+ function assemble(pose) {
179
+ const frames = AutoMovieHumanF1Placement_1.AutoMovieHumanF1Placement.frames(pose);
180
+ const maps = new Map();
181
+ const place = (family) => {
182
+ const posed = AutoMovieHumanF1Placement_1.AutoMovieHumanF1Placement.repose(family, frames);
183
+ maps.set(family.name, posed.station);
184
+ return posed.family;
185
+ };
186
+ const body = { trunk: place(AutoMovieHumanF1.BODY.trunk), arm: place(AutoMovieHumanF1.BODY.arm), hand: place(AutoMovieHumanF1.BODY.hand), leg: place(AutoMovieHumanF1.BODY.leg), ear: place(AutoMovieHumanF1.BODY.ear), nose: place(AutoMovieHumanF1.BODY.nose), breast: place(AutoMovieHumanF1.BODY.breast) };
187
+ const digits = AutoMovieHumanF1.DIGITS.map((digit) => ({ ...digit, family: place(digit.family) }));
188
+ const [helix, antihelix, axilla, concha, nostril] = [AutoMovieHumanF1Helix_1.AutoMovieHumanF1Helix, AutoMovieHumanF1Antihelix_1.AutoMovieHumanF1Antihelix, AutoMovieHumanF1Axilla_1.AutoMovieHumanF1Axilla, AutoMovieHumanF1Concha_1.AutoMovieHumanF1Concha, AutoMovieHumanF1Nostril_1.AutoMovieHumanF1Nostril].map(place);
189
+ return {
190
+ frames,
191
+ body,
192
+ digits,
193
+ helix: helix,
194
+ antihelix: antihelix,
195
+ axilla: axilla,
196
+ concha: concha,
197
+ nostril: nostril,
198
+ families: [...Object.values(body), helix, antihelix, ...digits.map((digit) => digit.family), axilla, concha, nostril],
199
+ station: (family, from, length) => {
200
+ const map = maps.get(family);
201
+ if (map === undefined)
202
+ throw new Error("assemble: no family " + family);
203
+ return length === undefined ? (map === null ? from : map(from)) : map === null ? length : map(from + length) - map(from);
204
+ },
205
+ point: (name) => AutoMovieHumanF1Placement_1.AutoMovieHumanF1Placement.point(name, frames),
206
+ direction: (name) => AutoMovieHumanF1Placement_1.AutoMovieHumanF1Placement.direction(name, frames),
207
+ };
208
+ }
209
+ AutoMovieHumanF1.assemble = assemble;
210
+ /**
211
+ * The trunk's chart of a point of the figure's frame at a pose: its station along the trunk's course and its coordinates across it, `u`
212
+ * along the chart's `up` and `v = u x t` as the engine charts a course, whose angle `atan2(v, u)` is the chart's phase. The point is
213
+ * mapped into the pelvis's frame, the trunk's own, and read there about the trunk's course, so a port loop read through it follows a
214
+ * posed child and does not change when the whole figure moves. The trunk's course is straight and its chart has no roll.
215
+ */
216
+ function trunkChart(placed) {
217
+ const pelvis = AutoMovieHumanF1Placement_1.AutoMovieHumanF1Placement.frame("pelvis", placed.frames);
218
+ const floor = AutoMovieHumanSegmentFrame_1.AutoMovieHumanSegmentFrame.toLocal(pelvis, placed.body.trunk.centres[0]);
219
+ const t = AutoMovieHumanSegmentFrame_1.AutoMovieHumanSegmentFrame.unit(AutoMovieHumanSegmentFrame_1.AutoMovieHumanSegmentFrame.sub(AutoMovieHumanSegmentFrame_1.AutoMovieHumanSegmentFrame.toLocal(pelvis, placed.body.trunk.centres[1]), floor));
220
+ const u = AutoMovieHumanSegmentFrame_1.AutoMovieHumanSegmentFrame.perpendicular(AutoMovieHumanSegmentFrame_1.AutoMovieHumanSegmentFrame.toLocalDirection(pelvis, placed.body.trunk.up), t);
221
+ const v = AutoMovieHumanSegmentFrame_1.AutoMovieHumanSegmentFrame.cross(u, t);
222
+ return (p) => {
223
+ const q = AutoMovieHumanSegmentFrame_1.AutoMovieHumanSegmentFrame.sub(AutoMovieHumanSegmentFrame_1.AutoMovieHumanSegmentFrame.toLocal(pelvis, [p[0], p[1], p[2]]), floor);
224
+ return { station: AutoMovieHumanSegmentFrame_1.AutoMovieHumanSegmentFrame.dot(q, t), u: AutoMovieHumanSegmentFrame_1.AutoMovieHumanSegmentFrame.dot(q, u), v: AutoMovieHumanSegmentFrame_1.AutoMovieHumanSegmentFrame.dot(q, v) };
225
+ };
226
+ }
227
+ /**
228
+ * The crotch's seam: the curve both legs' bands start from, under the perineum from the front fork to the back one, in place of the
229
+ * straight chord across the trunk's end. On the chord the two bands met at each fork in a corner, and their triangles folded through
230
+ * each other there (178 degrees), a slit seen from the front.
231
+ *
232
+ * The forks are the trunk's end ring on the median line, 808 mm high, 53.08 mm forward and 17.73 mm back; the chord between them is
233
+ * 70.81 mm. Each knot is `[along, depth]` in metres: the distance from the front fork, `53.08 - x` for a point `x` mm forward, and how far
234
+ * the reference's midline lies under the ring, `808 - y`, both read off `FamilyConicScan.ts crotch` (`midline`) every 10 mm from 30 mm
235
+ * forward to 10 mm back. The midline rises above the ring toward the front fork (809.4 mm at 40 mm forward), where the seam must leave
236
+ * the fork down along the trunk, so the knot at 40 mm holds the ring's level. The bands turn round each fork over 0.6 rad of their clock.
237
+ */
238
+ const CROTCH = { knots: [[0.0131, 0], [0.0231, 0.0011], [0.0331, 0.0028], [0.0431, 0.0031], [0.0531, 0.0029], [0.0631, 0.0018]], corner: 0.6, fair: [0.35, 0.35] };
239
+ /**
240
+ * The limbs split at their ends, Birn's hand: the palm lofted on past the knuckles, its end cut into one opening per finger along the
241
+ * webs, and each opening bridged to its finger by a band. The hand's end at 595 mm on the arm's course, which turns at the middle
242
+ * finger's first joint toward the four fingers' mean direction, faces the fingers, so each band runs on to its finger. The web lines are
243
+ * `FamilyConicScan.ts webs` every 2 mm along each seam's chord, depths of 0 left out so the seam leaves its fork along the host, with the
244
+ * run-out knots it reads beside a palm fork; they were read again once the palm's net (`arm.palm`) brought the end ring's palm side onto
245
+ * the skin, where every web now starts at its palm fork instead of 6 to 10 mm along the chord, and again on the hand's own family
246
+ * (`AutoMovieHumanF1Hand`) for the ring and middle fingers' seams. They were read once more after the hand's wall was laid again from
247
+ * its sound knots at the thumb's web (#3412: the shoulders after anchors 0 and 7 at 552 and 564 mm, and the fullness about anchor 1 at
248
+ * 552 mm), whose refitted palm net moves the end ring by 0.1 mm at most; the webs moved by 0.1 mm at eight knots. The little finger's
249
+ * seam keeps the web read on the arm's end ring
250
+ * (3.0 mm deep): read on the hand's (2.2 mm, from 0.5 mm at 2 mm along) the ring finger's band folded by 175 degrees over 7 edges beside
251
+ * its palm fork ([176, 919, 465], band station 6.5 mm), and with that one seam's old web alone the fold is gone (`limbview`). Each band
252
+ * takes 192 columns: on 96, 0.5 to 1 mm apart along a seam, its quads stood as a comb of steps along every seam. The hand's ribbons keep
253
+ * half their length at each fork (`reach`): the skin's edges folding by more than 90 degrees over the hand fall from 168 to 119. Both
254
+ * limbs' bands leave the end square to its ring (`square`): along the station lines, which lean along the ring where the sections change
255
+ * shape under their polar phase, the toes' bands folded more (edges folding by 60 degrees or more round the toe roots, 197 against 149),
256
+ * and the big toe's band drew a dark slit from its top fork; the hand's are unchanged (62 against 60). Both limbs fair the skin about
257
+ * every fork over a disc half the seam's chord across (`fair`, `fairAutoMovieSolidMesh`): at a fork the end and two bands meet in a corner
258
+ * no one surface owns, and the bands' ribbons turn beside it over the corner window, a share of the seam, so the marks there run as long
259
+ * as the window (8 to 15 mm along the toes' top forks, `limbview`, a scratch render of one limb). Discs of 4 and 5 mm left every mark;
260
+ * at half the chord, 9 to 14 mm, the top forks of the toes open into a V as the reference's do and the hand's dorsal notches soften.
261
+ * The backs take 0.7 of the chord and the palm and the sole half: at half everywhere narrow dark V's stayed at the middle toes' top forks
262
+ * and a bump at the little finger's; at 0.7 everywhere the fill under the plantar forks bulged below the sole; at 0.8 on the back the toes
263
+ * read as webbed far up.
264
+ */
265
+ const FANS = {
266
+ arm: {
267
+ digits: ["finger.pinky", "finger.ring", "finger.middle", "finger.index"],
268
+ webs: [
269
+ [[0.002, 0.0015], [0.004, 0.0029], [0.006, 0.003], [0.008, 0.0015]],
270
+ [[0.0012, 0.001], [0.002, 0.0027], [0.004, 0.0058], [0.006, 0.0081], [0.008, 0.0094], [0.01, 0.0097], [0.012, 0.0085], [0.014, 0.006], [0.016, 0.0025]],
271
+ [[0.0012, 0.001], [0.002, 0.0027], [0.004, 0.0057], [0.006, 0.0069], [0.008, 0.0066], [0.01, 0.0055], [0.012, 0.0042], [0.014, 0.0025], [0.016, 0.0005]],
272
+ ],
273
+ corner: 0.6,
274
+ reach: 0.5,
275
+ square: true,
276
+ fair: [0.5, 0.7],
277
+ rail: 3,
278
+ columns: 192,
279
+ rows: 24,
280
+ },
281
+ // The foot's end at 975 mm on the leg's course, turned at the ball of the foot toward the five toes. Every seam's plane passes through
282
+ // the gap between its toes' facing skins (`fanSeams`); held midway between the index and the big toe's axes it ran through the big
283
+ // toe, whose rays from 8 to 18 mm along the chord ran on inside it (31 to 47 mm) and were left out. Beside each fork the web stands up to 10 mm out of the end, on the sole as on top, so each seam first runs out along the foot and
284
+ // then turns across: the knots before the first web knot and after the last are `FamilyConicScan.ts webs`' run-out readings, rays
285
+ // along the chord every millimetre out from the end; read only every 2 mm along the chord, the seam turned down within 1 to 2 mm of
286
+ // its fork and stood a pointed tent between the toes on top. The bands turn over 0.75 rad of clock at each fork, nearly half of a
287
+ // stretch's 1.57: columns square to the ring and to the seam converge inside a fork's corner within about the turn's window, and the
288
+ // toe bands, 16 to 20 mm long, folded beside their forks over 185 of 3,840 clocks at 0.6 rad, 110 at 0.75 and 237 at 0.3 (sampled
289
+ // every 0.008 rad and 1/40 of each band's span, normals flipping between neighbours). Their ribbons keep a quarter of their length at
290
+ // each fork (`reach`): 110 clocks fold at the whole length, 44 at a half, 24 at a quarter and 28 at a tenth, and the webs' blades on top
291
+ // become grooves. The hand's bands keep their whole length: theirs fold in 13 clocks of 3,072 at the whole, 48 at a quarter.
292
+ leg: {
293
+ digits: ["toe.little", "toe.ring", "toe.middle", "toe.index", "toe.big"],
294
+ webs: [
295
+ [[0.0004, 0.001], [0.001, 0.002], [0.002, 0.003], [0.004, 0.0038], [0.006, 0.0038], [0.008, 0.0036], [0.01, 0.0033], [0.012, 0.0023], [0.014, 0.0008]],
296
+ [[0.0005, 0.001], [0.0007, 0.002], [0.0009, 0.003], [0.0012, 0.004], [0.0014, 0.005], [0.002, 0.0076], [0.004, 0.0117], [0.006, 0.0129], [0.008, 0.0133], [0.01, 0.013], [0.012, 0.0123], [0.014, 0.0114], [0.016, 0.0102], [0.018, 0.0091], [0.02, 0.0072], [0.022, 0.0036], [0.0225, 0.001]],
297
+ [[0.0008, 0.001], [0.001, 0.002], [0.0012, 0.003], [0.0014, 0.004], [0.002, 0.007], [0.004, 0.0144], [0.006, 0.0171], [0.008, 0.0179], [0.01, 0.0182], [0.012, 0.018], [0.014, 0.0176], [0.016, 0.017], [0.018, 0.0162], [0.02, 0.015], [0.022, 0.0136], [0.024, 0.0102], [0.0247, 0.009], [0.025, 0.008], [0.0252, 0.007], [0.0254, 0.006], [0.0256, 0.005], [0.0258, 0.004], [0.0258, 0.003], [0.0258, 0.002], [0.0258, 0.001]],
298
+ [[0.0001, 0.001], [0.0001, 0.002], [0.0003, 0.003], [0.0005, 0.004], [0.0008, 0.005], [0.001, 0.006], [0.0012, 0.007], [0.0015, 0.008], [0.002, 0.0098], [0.004, 0.0141], [0.006, 0.0152], [0.008, 0.0156], [0.01, 0.0154], [0.012, 0.0149], [0.014, 0.0141], [0.016, 0.013], [0.018, 0.0117], [0.02, 0.0102], [0.022, 0.0087], [0.024, 0.0061], [0.026, 0.0028], [0.0269, 0.001]],
299
+ ],
300
+ corner: 0.75,
301
+ reach: 0.25,
302
+ square: true,
303
+ fair: [0.5, 0.7],
304
+ rail: 3,
305
+ columns: 192,
306
+ rows: 24,
307
+ },
308
+ };
309
+ /**
310
+ * The largest turn of a limb's ring between two neighbouring phases, radians (`AutoMovieHumanConicLoft.IFamily.turn`); a limb absent here
311
+ * keeps uniform phases. The leg's 160 uniform phases, set by the thigh's girth, turned by up to 0.83 rad each round the forefoot's outer
312
+ * edge and up to 0.94 at the ankle (the lofted rings read every millimetre of station), and the outer edge of the forefoot showed as level
313
+ * stripes, the phases' facets; they went with phases 2 mm apart everywhere. Spaced so that no ring turns by more than 0.2 rad between
314
+ * two phases, the leg takes 360 phases, most of them round the foot's edges, and its rings, read every millimetre, turn by at
315
+ * most 0.37 rad on the forefoot. The arm's 104 uniform phases, set by the shoulder's girth, stood as flat strips 2.7 mm wide down the
316
+ * hand's ulnar edge, a row of terraces on `hand.left` (px 440..520 x 480..600) that stayed with every net of the hand taken off; at 0.2
317
+ * rad (312 phases) faint ones stayed, and at 0.1 (568) they are gone.
318
+ */
319
+ const PHASE_TURN = { arm: 0.1, leg: 0.2 };
320
+ /**
321
+ * Where the arm's face ends, mm along its course, and the hand's family (`AutoMovieHumanF1Hand`, from 448) takes over across `WRIST`.
322
+ * The arm family's one knuckle turn (half 10) drew the hand's back as two flat-bottomed valleys and creased the palm; the hand's own turn
323
+ * (half 22) is fitted from 448, past the forearm's last level that a single section turn still follows, and the arm stops 3 mm before it
324
+ * so that the band starts on the arm's own surface, not on a ring the hand's fit also claims.
325
+ */
326
+ const ARM_TO_MM = 445;
327
+ /**
328
+ * The band joining the arm's end to the hand (`IAutoMovieConstructionContinuation.band`): its rail into the hand, mm, its columns and its
329
+ * rows. The rail, 10 mm, puts the hand's ring at 458, past the fit's first knot interval (448 to 468 at its 10 mm midpoint), so the band
330
+ * meets the hand where its sections are fitted, not at their free start. 256 columns space the wrist's 165 mm girth 0.65 mm apart, finer
331
+ * than either face's phases there (`PHASE_TURN.arm`), and 12 rows space the 13 mm span about 1.1 mm apart, as the fingers' bands.
332
+ */
333
+ const WRIST = { rail: 10, count: 256, rows: 12 };
334
+ /** Chord of the thumb's blend on either side of the curve where it meets the hand, mm: at 1 mm it folds in the acute web beside the index finger. */
335
+ const THUMB_CHORD_MM = 0.5;
336
+ /**
337
+ * The width of the skin faired about the thumb's blend, mm (`IAutoMovieConstructionJoin.fair`). The blend, 0.5 mm wide, met the hand in a
338
+ * crisp ledge round the thumb's dorsal root (`limbview` close to [212, 972, 425], a scratch render of the arm's split alone). Faired over
339
+ * 1.5 mm the fill folded the blend itself (edges folding by 90 degrees or more on the arm's split, 8 to 38); over 3 to 6 mm the ledge
340
+ * softened and a fin stood in the web beside the index finger; over 8 mm, about the thumb's half width at its root, the root runs into
341
+ * the hand with no ledge and the web is clean, with 6 edges folding by 115 to 138 degrees on the hand beside the root. Those folds, the
342
+ * dark crevice in the web and the thin crease along the index metacarpal (`hand.left` px 640..650 x 370..405) are the fill's own rim
343
+ * crossing the root's tight turn: over 11 mm the folds are 106 to 119 degrees, over 14 mm, the thumb's whole root, they are under 91 and
344
+ * the crease is gone.
345
+ */
346
+ const THUMB_FAIR_MM = 14;
347
+ /**
348
+ * The width of the skin faired about each of the ear's merges, mm (`IAutoMovieConstructionJoin.fair`): 4 mm round the plate's root on the
349
+ * head, where the auricle leaves the skull in a soft sulcus, and 1 mm about each tube's blend. At half a tube's width (3 and 2.4 mm, as
350
+ * the thumb's is about half the thumb's) the two tubes' fills met over the narrow scapha at 1,566 to 1,572 mm and the antihelix's walk
351
+ * was lost on the helix's.
352
+ */
353
+ const EAR_FAIR_MM = { helix: 1, antihelix: 1, root: 4 };
354
+ /**
355
+ * How many station lines round each part the seed searches of the ear's joins walk, phase first (`IAutoMovieConstructionSearchSeed.phases`):
356
+ * which line of a part meets its host is a property of both surfaces, not of the part, so a fixed phase holds for one person only. On f1's
357
+ * lens(1) plate the helix's phase-0 line stays outside the plate over its whole search (shares 0 to 0.5) and its first crossing line
358
+ * of eight is 45 degrees, at station 26.8; the antihelix's is phase 0, at 6.8 (`FamilyConicEarRound.ts --crossing`). Eight lines,
359
+ * 45 degrees apart, leave no side of a round tube more than 22.5 degrees from a walked line.
360
+ */
361
+ const EAR_SEED_LINES = 8;
362
+ /** How far behind its first joint the thumb's root closes in a point, inside the hand, mm. */
363
+ const ROOT_MM = 10;
364
+ /**
365
+ * Station spacing of the layers and derived outlines of a sewn family, mm. Each part adds stations of its own where its section turns fast,
366
+ * so 4 mm is admitted whole; at 2 mm the engine read one toe's middle section as degenerate, and at 8 mm it refuses the arm's face.
367
+ */
368
+ const LAYER_MM = 4;
369
+ /**
370
+ * How far outside the arm's ring the port loop stands on the trunk's own skin, mm. With the rail 10 mm in, at 6 mm every column of the band
371
+ * leaves the trunk toward the ring and reaches it along the arm's own direction (`FamilyConicArmscye.ts`), 6 to 19 mm long. At 3 mm with
372
+ * the rail 3 mm in the same held, but a band 4 mm long turned from the trunk's skin to the arm's so sharply that it showed as a line round
373
+ * the shoulder.
374
+ */
375
+ const ARMSCYE_MARGIN_MM = 6;
376
+ /**
377
+ * How far below the armpit's crease the arm's ring is still followed by the loop, mm. The ring 10 mm into the arm dips 25 mm below the
378
+ * crease, since the arm hangs down from it; a loop that follows it there cuts away the trunk's side up to the crease, and the band is a
379
+ * web across the hollow.
380
+ */
381
+ const ARMPIT_DROP_MM = -6;
382
+ /** Width of the smooth maximum by which the loop meets that floor, mm: the loop rounds onto the floor over about this much height. */
383
+ const ARMPIT_ROUND_MM = 12;
384
+ /**
385
+ * Where the arm's band lands on it, mm from its first station, at the +Z arm's phases `2 pi j / 24`, joined by the periodic cubic. Behind
386
+ * the armpit's crease the trunk's side and the arm's inner side meet in a slit, its top at 1,272 to 1,274 mm 25 to 35 mm behind the
387
+ * crease's datum, and the arm's side falls 2 to 4 mm for each millimetre outward from it (`vault`, a scratch survey of the skin in planes
388
+ * x = const); the ring 10 mm in hangs 22 mm below the slit's top at the arm's phases 96 to 136 degrees, and the band there left the
389
+ * trunk upward and folded back over it (108 to 139 degrees, a speck on `shoulder.high-oblique`; `FamilyConicArmscye.ts --table`: host
390
+ * cosines down to -0.82 over 24 columns). There, from 75 to 135 degrees, the rail comes up to 1.5 mm, to the first section's foot at
391
+ * 1,263 mm, and the loop follows the ring under the slit (`ARMPIT_SINK_MM`): the band crosses the slit near its foot and the slit above
392
+ * it is closed. Read by `FamilyConicArmscye.ts --table`, 3 columns point back, at -0.17 at worst, where the dip meets the front fold.
393
+ */
394
+ const ARM_RAILS_MM = [10, 10, 10, 10, 8, 3, 1.5, 1.5, 1.5, 3, 8, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10];
395
+ /**
396
+ * How far the loop's floor sinks where the arm's rail is shortest, mm, by the rail's share of its dip elsewhere. At 23 mm the floor is
397
+ * 4 mm under the ring there, so the smooth maximum and the margin leave the loop 1 to 2 mm under the ring, across the slit from it: sunk
398
+ * 18 mm the loop stood level with the ring and 16 columns left the trunk against it; sunk 28 or 40 mm it stood 3 to 6 mm under the ring
399
+ * and up to 17 columns reached the arm against the arm's own direction, which falls 2 mm a millimetre there.
400
+ */
401
+ const ARMPIT_SINK_MM = 23;
402
+ /** `ARM_RAILS_MM` for one side: the twin's chart runs the other way round, so its phase `psi` is the +Z arm's `-psi`. */
403
+ function armRails(side) {
404
+ return side > 0 ? ARM_RAILS_MM : ARM_RAILS_MM.map((_, j) => ARM_RAILS_MM[(ARM_RAILS_MM.length - j) % ARM_RAILS_MM.length]);
405
+ }
406
+ AutoMovieHumanF1.armRails = armRails;
407
+ /**
408
+ * Where each limb's band lands on it, mm from the limb's first station: the limb keeps its stations beyond. The arm's first station is 2 mm
409
+ * past the armscye's plane and its course is nearly square to that plane for its first 25 mm, so its ring 10 mm on lies beside the plane. The nose's band lands on a curve (`NOSE_RAILS_MM`).
410
+ */
411
+ AutoMovieHumanF1.RAIL_MM = { arm: 10, leg: 6, breast: 1 };
412
+ /**
413
+ * How far from the breast's course the trunk's own skin starts round the port, mm, at the clocks `2 pi j / 8` about the course: 0 up, a
414
+ * quarter turn to the side, a half turn down, three quarters toward the median line. The port's loop stands there. Under the breast it is
415
+ * the fold's lower edge, where the chest begins (`FamilyConicBody.ts BREAST_CHEST_MM`, read off the skin's profile in half-planes about
416
+ * the course: straight down the chest stands level 24 to 26 mm behind the top from 52 mm out), so the band spans the fold and the fold is
417
+ * its short side; elsewhere the skin runs on from the breast with no crease, and the loop stands 5 to 6 mm outside the ring: 2 to 3.5 mm
418
+ * out, the band joined the breast's flank to the trunk's in a visible line on `fold.left`. Over the upper flank, a quarter and an eighth
419
+ * of a turn from the top, the loop stands 4 mm farther out (58 and 52 mm were read off the profile): there the band, 5 to 6 mm long, turned
420
+ * from the trunk's side to the breast's within it and drew a ragged dark line along the breast's outer edge on `shoulder.high-oblique`
421
+ * (px 600..700 x 540..610), its facets 1.9 mm columns by 0.55 mm rows; at 9 to 10 mm the turn is softer. Carried on 2 mm at three
422
+ * eighths of a turn (47 to 49 mm), the fan of the band's columns at [99, 1246, 111] darkened (`fold.left`). The trunk's sections leave out the breast's
423
+ * underside to 1.5 mm inside this curve, and elsewhere the skin to 1 mm inside the ring (`FamilyConicBody.ts BREAST_CLIP_MM`).
424
+ */
425
+ const BREAST_CHEST_MM = [62, 62, 56, 47, 52, 50, 54, 60];
426
+ /**
427
+ * Where the nose's band lands on it, mm from its first station, at its phases `2 pi j / 32` (0 up, a quarter turn toward -Z, a half turn
428
+ * down), joined by the periodic cubic: a curve, not one station, because the nose's root lies in no one plane. The nose's sections start
429
+ * half a millimetre in front of the alar grooves, so from there its wall is the wings' outer face, but its first sections are closed by its
430
+ * box's chords at the top, inside the dorsum, and at the bottom, inside the lip behind the subnasale. Read off the nose's own wall by its
431
+ * distance to the reference skin (`FamilyConicScan.ts nose-rail`, the station from which it lies within 0.3 mm of the skin): the wings'
432
+ * faces from the first station, and the dorsum from 10 mm in (x 123.5). Below, the wall leaves the lip's flesh for the skin 7 to 10.5 mm
433
+ * in, but there the nostrils lie, back to 117.6 mm forward, and a cut that crossed the band admitted only a knife-edged blend. Below,
434
+ * from 135 to 225 degrees round, the band lands on the line where the lip's front meets the nose's floor at 1,543 mm, read off level
435
+ * sections at 1,542 and 1,544 mm (`FamilyConicScan.ts alar`): x 123 on the median line (9 mm in), 122.8 at 2.6 mm across (8.5), 122.2
436
+ * at 5.4 mm (8), 120 at 8.7 mm (5.5, just behind each nostril's blended rim at 120.2 to 120.9) and 116.5 at 13 mm (3), so the band
437
+ * rises from the lip straight into the floor. Landed 3 mm in all along, behind the nostrils, the band ran 4 to 6 mm back under the sill
438
+ * from the lip's front and turned on itself (folds of 110 to 161 degrees along y 1,543); landed 10.5 mm in at the subnasale alone,
439
+ * between neighbours at 3 mm, it stood as a notch. Where the wall is skin from the first station the band still lands 2 mm in, so it
440
+ * rounds the alar groove; under the back of each wing, where the alar groove is sharpest (110 to 125 and 235 to 250 degrees), only
441
+ * 1.5 mm in, so the crease there is crisp and softer above. The floor's net (`AutoMovieHumanF1Nose`, `nose.floor`) lifts the ring
442
+ * between the wings onto the underside's skin, which leaves it no longer star-shaped about its centroid, so the port matches it to its
443
+ * loop by length (`correspondence`); by angle it was refused. Above the wings the
444
+ * face keeps the sidewalls (`FamilyConicBody.ts noseCut`), and the band lands 5 to 8 mm in, the farther the higher, so its loop, 2.5 mm
445
+ * outside this curve, stays on the face's own skin.
446
+ */
447
+ AutoMovieHumanF1.NOSE_RAILS_MM = [10, 9.5, 8, 7, 6, 5, 3.5, 2.5, 2, 2, 1.5, 1.5, 3, 5.5, 8, 8.5, 9, 8.5, 8, 5.5, 3, 1.5, 1.5, 2, 2, 2.5, 3.5, 5, 6, 7, 8, 9.5];
448
+ /**
449
+ * How far outside the nose's rail curve its port loop stands on the face, mm: the rail lies 2 mm in front of the alar groove on the wing's
450
+ * face (`FamilyConicBody.ts nose`), so 2.5 mm puts the loop in the groove and outside the box the face leaves to the nose.
451
+ */
452
+ const NOSE_MARGIN_MM = 2.5;
453
+ /**
454
+ * How much farther out the nose's loop stands under the columella, mm, at the loop's lowest clock, falling off as `(-cos c)^6` (half of
455
+ * it about 10 mm to either side of the median line, nothing at the wings). The reference's lip turns forward into the subnasale over 6 mm of
456
+ * height (its front at 120.6, 121.1, 122.2 and 124 mm forward at 1,538, 1,540, 1,542 and 1,544 mm, `FamilyConicScan.ts alar`); a loop 2.5 mm
457
+ * below the floor stood on the face's own skin just under the nose's cut, which its net leaves fair and 1 mm hollow there, and the
458
+ * profile showed a notch under the band (mouth.left px 580..598 x 235..265). Landed 5 mm below, the band spans the whole turn.
459
+ */
460
+ const NOSE_SUBNASAL_MM = 2.5;
461
+ /**
462
+ * The nose's band's cross profiles (`IAutoMovieConstructionPort.IProfile`), depths in metres along its inward normal, on its loop clock
463
+ * (0 at the dorsum, a quarter turn at the +Z wing, a half turn under the columella). Read by `FamilyConicScan.ts band band.nose 64`: the
464
+ * reference skin's depth below the plain band along its normal at shares 0.1 to 0.9 of its span, with the sidewall's net
465
+ * (`AutoMovieHumanF1Nose`, `nose.side`) on, averaged over each window's columns and over the two sides (`+Z` and its mirror clock):
466
+ * - Behind each wing, the alar-facial groove (clocks 1.57 to 2.36 and 3.93 to 4.71): the plain band stands 0.42, 0.70, 0.45 and 0.09 mm
467
+ * proud of the skin at the shares 0.2, 0.4, 0.6 and 0.8, a hollow nearer the face than the wing.
468
+ * - Under each nostril's sill (clocks 2.6 to 3.0 and 3.28 to 3.68): the plain band lies 0.12, 0.52 and 0.87 mm inside the skin at 0.4, 0.6
469
+ * and 0.8, where the lip rolls into the floor; the band must end flat on the nose's ring, which lies 0.9 to 1.2 mm inside there itself,
470
+ * so the last knot takes 0.6 mm and the ring's own share is left to the floor's net.
471
+ * Each window fades over 0.2 rad of clock (0.15 under the sill, where the columella's columns between the two stand within 0.35 mm).
472
+ */
473
+ const NOSE_PROFILES = [
474
+ { start: 1.57, end: 2.36, transition: 0.2, knots: [[0.3, 0.0003], [0.5, 0.0004], [0.7, 0.0002]] },
475
+ { start: 3.93, end: 4.71, transition: 0.2, knots: [[0.3, 0.0003], [0.5, 0.0004], [0.7, 0.0002]] },
476
+ { start: 2.6, end: 3.0, transition: 0.15, knots: [[0.4, -0.0001], [0.6, -0.0002]] },
477
+ { start: 3.28, end: 3.68, transition: 0.15, knots: [[0.4, -0.0001], [0.6, -0.0002]] },
478
+ ];
479
+ /**
480
+ * Spacing of a digit's layers at its root, mm, and how far from its first station that holds, mm. Each digit meets its limb in a curve a few
481
+ * millimetres across with a blend 1 mm wide; on layers 4 mm apart the digit's root was a few flat facets.
482
+ */
483
+ const WEB_LAYER_MM = 1;
484
+ /**
485
+ * Trunk station from which its layers are spaced on the skin over the crown (`construction` `domed`), mm: 1,640 mm high, above the ears
486
+ * (their roots reach 1,610 mm) and below where the skull's top turns over toward the vertex.
487
+ */
488
+ const CROWN_MM = 860;
489
+ /**
490
+ * The trunk's mesh over the face, apart from its nets: from station 690 to 830 mm (the chin to the brow) layers at most 1 mm apart, and
491
+ * phases at most 0.016 rad apart round the whole trunk (`IFamily.phase`). The layers and phases had followed the face's finest nets (the
492
+ * chin's 0.95 mm rows, the eyes' 105 columns); with those nets coarsened for their own sake to 1.4 to 2 mm rows and 73 columns, the face's
493
+ * mesh read in level bands across the cheeks and the nose and in blocks over the lips and the chin, and the head's skin round the ear
494
+ * in steps.
495
+ */
496
+ const TRUNK_FACE_LAYERS = [690, 830, 1];
497
+ const TRUNK_PHASE = 0.016;
498
+ /**
499
+ * The rows by which a net cuts its family's layers (`leaf`), where they are not the net's own: a layer interval inside a net's window is
500
+ * cut as fine as `(stations[1] - stations[0]) / (rows - 3)`, and these nets were stored at coarser grids for their numbers' sake
501
+ * (issue #3197, stage B2), which would have thinned the layers with them (the nose's from 54 to 41).
502
+ * Each entry is the row count the net had when its family's layers were last accepted, so the mesh stays as it was; a twin and a
503
+ * mirrored family's net read their original's entry. Tessellation, not shape.
504
+ */
505
+ const NET_LAYER_ROWS = { "leg.hollow.1": 18, "nose.under": 31 };
506
+ /**
507
+ * The nose's largest phase step, radians (`IFamily.phase`): the column of its finest net as it was last accepted, `nose.under` at 39
508
+ * columns over its window of 2.0416 to 4.2416 rad, which gave the nose 104 phases. That net is stored at 21 columns now (issue #3197,
509
+ * stage B2), and the nose's phases would have followed it down to 64. Tessellation, not shape.
510
+ */
511
+ const NOSE_PHASE = (4.2416 - 2.0416) / (39 - 3);
512
+ /**
513
+ * Station spacing of the fingers' and the thumb's layers past their roots, mm. At the body's 4 mm the digits' rings showed as fine level
514
+ * stripes along the thumb and the fingers under flat shading (`hand.high-oblique` px 610..660 x 520..580, a fold of 30 degrees at the
515
+ * thumb's [238.8, 942, 427.7]), where a finger's section turns faster along it than the trunk's does; at 2 mm they are gone.
516
+ */
517
+ const FINGER_LAYER_MM = 2;
518
+ /**
519
+ * The largest turn of a finger's or the thumb's ring between two neighbouring phases, radians (`AutoMovieHumanConicLoft.IFamily.turn`),
520
+ * as the arm's (`PHASE_TURN`). On phases set by its girth the thumb's flat side turned into its edges between few columns and drew a
521
+ * sawtooth of long thin facets along the thumb (`limbview` close to [236, 945, 427]), the stripes `hand.high-oblique` showed.
522
+ */
523
+ const FINGER_TURN = 0.1;
524
+ const WEB_REACH_MM = 12;
525
+ /**
526
+ * When a layer is added midway between two of a family that carries reliefs: its skin there stands off the middle of the chord between the
527
+ * two by more than `sagitta` mm at some phase. No interval is cut below `least` mm. Layers are level rings, so a fold that crosses them
528
+ * aslant, as the one under the breast does, is drawn in steps as tall as the layers are apart; where the skin turns that fast the layers
529
+ * must stand closer than the 4 mm that carries the rest.
530
+ *
531
+ * Over a crease's stations on its family (`creases`: the fold under each breast, 400 to 490 mm on the trunk) a layer is also added where the
532
+ * skin turns along the station by more than `turn` degrees between the two halves of the interval, at `fine` phases. Flat shading shows
533
+ * the turn, not the sagitta: the fold turned 14 to 20 degrees across one layer 2 to 4 mm tall, a sagitta of 0.1 mm, and stood in level
534
+ * steps from the front. The rule holds only there: everywhere on the trunk it added 166 rings and moved the head's, whose rings the
535
+ * ear's band is triangulated against. The mouth's band of the trunk (722 to 758 mm, `trunk.mouth`'s stations) takes it too: the lips turn through their whole roll within a few
536
+ * millimetres of height, and on the layers the sagitta left there, 2 to 2.6 mm apart, each lip stood in level bands of light and dark
537
+ * from the front and in steps in profile (mouth.front px 200..720 x 330..640, mouth.left).
538
+ */
539
+ const FOLD = { sagitta: 0.15, least: 0.5, phases: 96, turn: 4, fine: 192, creases: [{ family: "trunk", stations: [400, 490] }, { family: "trunk", stations: [722, 758] }] };
540
+ /** Columns round each band and rows across it. */
541
+ const BAND = { count: 96, rows: 8 };
542
+ /**
543
+ * Columns round each leg's band at the crotch and round each arm's at the armscye. A band twists from its loop's direction to its ring's, so
544
+ * each of its quads is two triangles of different slope, and a column wider than about 2 mm shows as a pair of stripes: at 96 columns a ring
545
+ * of facets stood round each thigh, at 144 upright hatching, and at 288, 2 mm apart round a thigh's girth of 565 mm, neither.
546
+ */
547
+ const THIGH_COLUMNS = 288;
548
+ const SHOULDER_COLUMNS = 192;
549
+ /**
550
+ * Grid stations across each arm's band. Each column's ribbons take their own scale (`ribbons: "column"`), so in front of the armpit and
551
+ * over the cap the band arches from the trunk to the arm over its whole length instead of hugging its chord, and its rows must follow
552
+ * that arch as the splits' rows follow theirs (`IFan.rows`).
553
+ */
554
+ const ARMSCYE_ROWS = 24;
555
+ /**
556
+ * Spacing of the breast's layers, mm. Over the dome a ring moves 1.5 to 4 mm across the skin for each millimetre of station, so layers
557
+ * 4 mm apart stood as concentric steps on `fold.front`, and at 1 mm the rings still showed as ring facets folding by about 4 degrees
558
+ * ([118, 1272, 90]).
559
+ */
560
+ const BREAST_LAYER_MM = 0.5;
561
+ /**
562
+ * Largest distance between the breast's neighbouring phases, mm (`AutoMovieHumanConicLoft.IFamily.pitch`). At the figure's 4 mm the
563
+ * breast's girth of about 315 mm took about 80 phases, and with its layers half a millimetre apart the dome still showed radial spokes
564
+ * and ring facets on `fold.front` (px 300..500 x 200..300): the phases' facets, converging on the tip. 1.5 mm is the ear rim's pitch.
565
+ */
566
+ const BREAST_PITCH_MM = 1.5;
567
+ /**
568
+ * Columns round the nose's band. Its rail is a curve on the nose, which the band's end meets exactly only at its columns; between them the
569
+ * band's own interpolation stood 0.03 mm off the nose's rail at 96 columns, and a nostril's cut, which crosses there, could not place its
570
+ * crossing from one face to the next (`AutoMovieSolidClip.CROSSING`, 0.01 mm).
571
+ */
572
+ const NOSE_COLUMNS = 192;
573
+ /**
574
+ * The nostril's rim, mm: the width of its cut's blend on either side of the curve, and how far its cutter is drawn in so the opening,
575
+ * widened by the blend, keeps the hollow's own size. The reference's rim, the alar rim and the sill, is a roll of about 1.5 to 2 mm radius
576
+ * (`FamilyConicFigure.ts nose`, from below); with a blend of 0.15 mm the generated rim was a knife's edge.
577
+ */
578
+ const NOSTRIL_RIM_MM = 1.5;
579
+ /**
580
+ * Spacing of a nostril cutter's layers over its whole length, mm. The cutter's wall turns from its flared mouth into the canal within
581
+ * about 2.5 mm of station above the cut (its station line at 0.4 rad round turns 72 degrees between 10.4 and 13 mm along its course,
582
+ * where its knots at 9 and 11 mm change its section by 7 mm), and on layers 1.6 mm apart there the mesh folded 64 to 72 degrees along
583
+ * one ring inside each nostril, a faint streak down its walls (mouth.front px 555..600 x 190..260). On layers 1 mm apart the folds were
584
+ * 44 degrees.
585
+ */
586
+ const NOSTRIL_LAYER_MM = 0.5;
587
+ /**
588
+ * The nostril cutter's mouth, mm along its course: its first fitted knot (`AutoMovieHumanF1Nostril`, sections read from 9 mm), whose
589
+ * section the lead carries out of the nose; the cut meets the floor 8 to 10 mm along it. And how far its later knots and its closed end are
590
+ * moved on (`spreadOut`), mm: fitted, the section moves 7 mm between the knots at 9 and 11 mm, a flare whose station line turns 72 degrees
591
+ * into the canal within 2.5 mm, and that turn stood as a streak inside each nostril however finely it was layered (folds of 32 to 50
592
+ * degrees on layers half a millimetre apart). Spread by this much the canal starts 2 mm higher and the flare is drawn over 4 mm: the
593
+ * nostril's lateral wall reads as one shadow from the front and from below, as the reference's does. Spread by 1 or 1.5 mm, one
594
+ * nostril's face was refused by the triangulation ("interior point hits an unshared boundary", "does not share one original diagonal").
595
+ */
596
+ const NOSTRIL_MOUTH_MM = 9;
597
+ const NOSTRIL_SPREAD_MM = 2;
598
+ /**
599
+ * Spacing of the armpit slit cutter's layers, mm (`AutoMovieHumanF1Axilla`). Its sections narrow from the dome under the crease's front
600
+ * to the cusp behind it within about 20 mm of station, and its cut runs along the arm's band, so its rings stand a millimetre apart as a
601
+ * digit's root's do (`WEB_LAYER_MM`).
602
+ */
603
+ const AXILLA_LAYER_MM = 1;
604
+ /**
605
+ * Where the slit's cut is seeded: at the middle of the longest branch of its cutter's measured crossing with the skin, on the +Z side;
606
+ * the twin's phase is mirrored, since a twin's `v` is negated. The cutter's surface, sampled every 0.5 mm at 720 phases from tip to tip
607
+ * and classed inside or outside the realized body by the nearest triangle's side (`isect`, a scratch probe), meets the band in one
608
+ * branch down each flank the whole length, on the band: the arm side's 75 mm, from 59 to 132 degrees, the trunk side's 70 mm, from 212
609
+ * to 328. The trunk side's middle is station 60.5, phase 4.6173, [-37.4, 1266.5, 149.4], on the band (the twin's 1.6659); the search
610
+ * spans 2 mm either side, shares 0.613 to 0.669 of the cutter's stations from its tip at 15 to its tip at 86: over 0.9 mm the twin's
611
+ * found no meeting. Seeded on the cutter's bottom, phase pi, from its front end, the cut on the corrected trunk was lost on the
612
+ * trunk's face at [-51.7, 1276.4, 147.2].
613
+ */
614
+ const AXILLA_SEED = { phase: 4.6173, from: 0.613, to: 0.669 };
615
+ /**
616
+ * The radius the skin is faired over where the breast's band fans against the trunk below the breast's side, mm, about the thorax's
617
+ * datum `AutoMovieHumanF1Joints.breastFan` on the +Z side and its mirror image on the other: a dark dash on `fold.left`
618
+ * (px 600..640 x 335..345), folds of 14 degrees in the band's own triangles (`creases.ts`), where the loop's distance falls from 56 to
619
+ * 47 mm within an eighth of a turn.
620
+ */
621
+ const BREAST_FAN_FILL_MM = 4;
622
+ /**
623
+ * The armscye's port on the trunk's chart.
624
+ *
625
+ * The armscye is the armpit's sagittal plane: the trunk owns the skin medial of it and the arm the skin lateral of it, the shoulder's cap
626
+ * included. The arm's course leaves the trunk square to that plane, so the ring the band lands on lies beside the plane. The port is that
627
+ * ring's own outline as the trunk's chart sees it, each point's height above the axis's foot and its phase about the axis, pushed out from
628
+ * the outline's centre by the margin so the loop stands on the trunk's own skin round the ring. The loop is written as the ellipse on the
629
+ * outline's half extents with a share per column. An ellipse alone stood up to 29 mm from the ring under the armpit, where the ring's
630
+ * lower edge runs aslant, and the band there reached the arm against the arm's own direction.
631
+ *
632
+ * The ring, the armpit's crease and the axis's foot are read in the trunk's chart at the pose (`trunkChart`), heights as stations along
633
+ * the trunk's course, so the loop follows a posed arm.
634
+ *
635
+ * @param side +1 for the +Z side, -1 for its twin.
636
+ * @param placed The figure's families at a pose; absent, the reference pose.
637
+ */
638
+ function armscye(side, placed = assemble()) {
639
+ const family = side > 0 ? placed.body.arm : AutoMovieHumanConicLoft_1.AutoMovieHumanConicLoft.mirror(placed.body.arm, placed.body.arm.name + ".mirror");
640
+ // Stations past the arm's first knot as the stored arm dates them, carried to the pose: the first sections lie in the shoulder's turn.
641
+ const past = (mm) => placed.station(AutoMovieHumanF1.BODY.arm.name, AutoMovieHumanF1.BODY.arm.knots[0] + mm);
642
+ const chart = trunkChart(placed);
643
+ const armpit = chart(placed.point("armpit"));
644
+ // The arm's ring at its rail curve (`armRails`), read from a loft of its first stations alone.
645
+ const along = engine_1.AutoMovieNaturalSpline.periodic(armRails(side).map(past));
646
+ const loft = AutoMovieHumanConicLoft_1.AutoMovieHumanConicLoft.create({ ...family, tips: undefined, reliefs: undefined }, [past(0), past(Math.min(...ARM_RAILS_MM) / 2), past(AutoMovieHumanF1.RAIL_MM.arm), past(2 * AutoMovieHumanF1.RAIL_MM.arm), past(4 * AutoMovieHumanF1.RAIL_MM.arm)]);
647
+ if (loft.chain === null)
648
+ throw new Error("the arm's first stations do not loft");
649
+ const chain = loft.chain;
650
+ const behind = engine_1.AutoMovieNaturalSpline.periodic(armRails(side).map((mm) => (AutoMovieHumanF1.RAIL_MM.arm - mm) / (AutoMovieHumanF1.RAIL_MM.arm - Math.min(...ARM_RAILS_MM))));
651
+ const outline = Array.from({ length: 4 * SHOULDER_COLUMNS }, (_, j) => {
652
+ const psi = (2 * Math.PI * j) / (4 * SHOULDER_COLUMNS);
653
+ const p = chart(engine_1.AutoMovieLoftChain.point(chain, along(psi), psi));
654
+ // The floor under the crease, met by a smooth maximum: held by a plain one, the loop ran level along the floor and turned up at a
655
+ // corner at each end, and the band stood a box-shaped notch at the back of the armpit. Behind the crease, where the rail comes up to
656
+ // the arm's first section, the floor sinks by the same share, so the loop follows the ring there.
657
+ const floor = armpit.station - ARMPIT_DROP_MM - ARMPIT_SINK_MM * Math.max(0, Math.min(1, behind(psi)));
658
+ return [(p.station + floor + Math.hypot(p.station - floor, ARMPIT_ROUND_MM)) / 2, Math.atan2(p.v, p.u)];
659
+ });
660
+ // The margin's phase is taken at the armpit's side distance from the trunk's course.
661
+ return around(outline, SHOULDER_COLUMNS, ARMSCYE_MARGIN_MM, armpit.v, side);
662
+ }
663
+ AutoMovieHumanF1.armscye = armscye;
664
+ /**
665
+ * A port loop round a part's ring as the trunk's chart sees it: the ellipse on the outline's half extents about their middle, with each
666
+ * column's distance from the centre a share of the ellipse's, pushed out from the centre by the margin.
667
+ *
668
+ * @param outline The ring's points in the trunk's chart, `[station, phase]`, mm and radians, densely round it.
669
+ * @param columns The band's columns.
670
+ * @param margin How far outside the ring the loop stands, mm, or that distance at each clock round the ellipse.
671
+ * @param radius The distance from the trunk's axis at which a phase is read as millimetres, mm.
672
+ * @param sense The phase's sense of increasing clock.
673
+ */
674
+ function around(outline, columns, margin, radius, sense) {
675
+ const span = (c) => [Math.min(...outline.map((q) => q[c])), Math.max(...outline.map((q) => q[c]))];
676
+ const [stations, phases] = [span(0), span(1)];
677
+ const centre = [(stations[0] + stations[1]) / 2, (phases[0] + phases[1]) / 2];
678
+ const semi = [(stations[1] - stations[0]) / 2, (phases[1] - phases[0]) / 2];
679
+ // Each outline point by its clock on that ellipse and its distance from the centre as a share of the ellipse's.
680
+ const polar = outline
681
+ .map((q) => {
682
+ const x = (q[0] - centre[0]) / semi[0];
683
+ const y = (sense * (q[1] - centre[1])) / semi[1];
684
+ return [(Math.atan2(y, x) + 2 * Math.PI) % (2 * Math.PI), Math.hypot(x, y)];
685
+ })
686
+ .sort((a, b) => a[0] - b[0]);
687
+ const shape = Array.from({ length: columns }, (_, k) => {
688
+ const clock = (2 * Math.PI * k) / columns;
689
+ const after = polar.findIndex((q) => q[0] >= clock);
690
+ // The outline's two points on either side of the clock; round the turn's end, its last point and its first.
691
+ const [a, b] = after > 0 ? [polar[after - 1], polar[after]] : after === 0 ? [[polar.at(-1)[0] - 2 * Math.PI, polar.at(-1)[1]], polar[0]] : [polar.at(-1), [polar[0][0] + 2 * Math.PI, polar[0][1]]];
692
+ const share = b[0] === a[0] ? a[1] : a[1] + ((b[1] - a[1]) * (clock - a[0])) / (b[0] - a[0]);
693
+ // The margin as a share of the ellipse's own distance at this clock.
694
+ return share + (typeof margin === "number" ? margin : margin(clock)) / Math.hypot(semi[0] * Math.cos(clock), semi[1] * radius * Math.sin(clock));
695
+ });
696
+ return { centre: [centre[0] / 1000, centre[1]], semi: [semi[0] / 1000, semi[1]], sense, shape };
697
+ }
698
+ /**
699
+ * A family with every section drawn in by a distance: at each knot each extreme moves that far toward the middle of the section's
700
+ * extremes, and the shoulders and the medians, shares of their arcs, stay. A cutter whose cut is blended is drawn in by the blend's
701
+ * width, which moves the opening's edge out again by about as much.
702
+ *
703
+ * @param family The family, whose layout's extremes come in (u, v) pairs.
704
+ * @param mm The distance, mm.
705
+ */
706
+ function drawnIn(family, mm) {
707
+ const units = AutoMovieHumanConicSection_1.AutoMovieHumanConicSection.units(family.layout);
708
+ const pairs = units.flatMap((unit, f) => (unit === "mm" && units[f + 1] === "mm" && pairsBefore(units, f) ? [f] : []));
709
+ const values = family.values.map((row) => [...row]);
710
+ for (let k = 0; k < family.knots.length; ++k) {
711
+ const centre = [pairs.reduce((s, f) => s + family.values[f][k], 0) / pairs.length, pairs.reduce((s, f) => s + family.values[f + 1][k], 0) / pairs.length];
712
+ for (const f of pairs) {
713
+ const [u, v] = [family.values[f][k], family.values[f + 1][k]];
714
+ const far = Math.hypot(u - centre[0], v - centre[1]);
715
+ if (far <= mm)
716
+ throw new Error("drawnIn: " + family.name + "'s section at knot " + k + " is narrower than " + mm + " mm");
717
+ values[f][k] = u - (mm * (u - centre[0])) / far;
718
+ values[f + 1][k] = v - (mm * (v - centre[1])) / far;
719
+ }
720
+ }
721
+ return { ...family, values };
722
+ }
723
+ /**
724
+ * A family whose knots past `mouth`, and its closed end, are moved on along its course by a distance: the section at `mouth` and every
725
+ * section before it stay, and the change from it to the next knot's section is drawn over that much more station. A cutter whose wall
726
+ * turns from its flared mouth into its canal within a few millimetres is spread so it turns more gently.
727
+ *
728
+ * @param family The family.
729
+ * @param mouth The station of the last knot that stays, mm.
730
+ * @param mm The distance, mm.
731
+ */
732
+ function spreadOut(family, mouth, mm) {
733
+ const moved = (s) => (s > mouth ? s + mm : s);
734
+ const end = (tip) => (tip === null ? null : { ...tip, from: moved(tip.from), tip: moved(tip.tip) });
735
+ return { ...family, knots: family.knots.map(moved), ...(family.tips === undefined ? {} : { tips: [end(family.tips[0]), end(family.tips[1])] }) };
736
+ }
737
+ /** Whether the "mm" field at `f` starts a (u, v) pair: an even count of "mm" fields runs up to it. */
738
+ function pairsBefore(units, f) {
739
+ let run = 0;
740
+ for (let g = f - 1; g >= 0 && units[g] === "mm"; --g)
741
+ ++run;
742
+ return run % 2 === 0;
743
+ }
744
+ /**
745
+ * The nose's port on the trunk's chart: the nose's own rail curve as the trunk's chart sees it, each point's height above the axis's foot
746
+ * and its phase about the axis, pushed out by the margin, as the armscye's loop is the arm's ring. Its phase is read as millimetres at the
747
+ * ring's mean distance from the trunk's axis.
748
+ *
749
+ * @param placed The figure's families at a pose; absent, the reference pose.
750
+ */
751
+ function nostril(placed = assemble()) {
752
+ const family = placed.body.nose;
753
+ const first = family.knots[0];
754
+ const along = engine_1.AutoMovieNaturalSpline.periodic(AutoMovieHumanF1.NOSE_RAILS_MM.map((rail) => first + rail));
755
+ const far = first + Math.max(...AutoMovieHumanF1.NOSE_RAILS_MM);
756
+ const loft = AutoMovieHumanConicLoft_1.AutoMovieHumanConicLoft.create({ ...family, tips: undefined, reliefs: undefined }, [first, (first + far) / 2, far, far + LAYER_MM]);
757
+ if (loft.chain === null)
758
+ throw new Error("the nose's first stations do not loft");
759
+ const chain = loft.chain;
760
+ const chart = trunkChart(placed);
761
+ const ring = Array.from({ length: 4 * NOSE_COLUMNS }, (_, j) => {
762
+ const psi = (2 * Math.PI * j) / (4 * NOSE_COLUMNS);
763
+ return chart(engine_1.AutoMovieLoftChain.point(chain, along(psi), psi));
764
+ });
765
+ const radius = ring.reduce((sum, p) => sum + Math.hypot(p.u, p.v), 0) / ring.length;
766
+ return around(ring.map((p) => [p.station, Math.atan2(p.v, p.u)]), NOSE_COLUMNS, (clock) => NOSE_MARGIN_MM + NOSE_SUBNASAL_MM * Math.max(0, -Math.cos(clock)) ** 6, radius, 1);
767
+ }
768
+ AutoMovieHumanF1.nostril = nostril;
769
+ /**
770
+ * The breast's port on the trunk's chart: each point of the breast's ring at its rail carried out from the breast's course, square to
771
+ * it, to the distance `BREAST_CHEST_MM` gives at its clock, as the trunk's chart sees it; written as the armscye's loop is. Its phase is
772
+ * read as millimetres at the ring's mean distance from the trunk's axis.
773
+ *
774
+ * The clocks' zero, up, is the thorax's Y made square to the course, and the ring is read in the trunk's chart at the pose
775
+ * (`trunkChart`).
776
+ *
777
+ * @param side +1 for the +Z side, -1 for its twin.
778
+ * @param placed The figure's families at a pose; absent, the reference pose.
779
+ */
780
+ function mammary(side, placed = assemble()) {
781
+ const family = placed.body.breast;
782
+ const first = family.knots[0];
783
+ const rail = first + AutoMovieHumanF1.RAIL_MM.breast;
784
+ const loft = AutoMovieHumanConicLoft_1.AutoMovieHumanConicLoft.create({ ...family, tips: undefined, reliefs: undefined }, [first, rail, first + 2 * LAYER_MM, first + 4 * LAYER_MM]);
785
+ if (loft.chain === null)
786
+ throw new Error("the breast's first stations do not loft");
787
+ const chain = loft.chain;
788
+ // The course's point and directions at the rail: along it, up squared to it, and to +Z square to both.
789
+ const frame = AutoMovieHumanConicLoft_1.AutoMovieHumanConicLoft.axis(family).at(rail);
790
+ const w = [0, 1, 2].map((k) => family.centres[1][k] - family.centres[0][k]);
791
+ const length = Math.hypot(w[0], w[1], w[2]);
792
+ const t = w.map((x) => x / length);
793
+ const y = AutoMovieHumanF1Placement_1.AutoMovieHumanF1Placement.frame("thorax", placed.frames).axes[1];
794
+ const rise = t[0] * y[0] + t[1] * y[1] + t[2] * y[2];
795
+ const up = [y[0] - rise * t[0], y[1] - rise * t[1], y[2] - rise * t[2]];
796
+ const lateral = [t[1] * up[2] - t[2] * up[1], t[2] * up[0] - t[0] * up[2], t[0] * up[1] - t[1] * up[0]];
797
+ const chest = engine_1.AutoMovieNaturalSpline.periodic(BREAST_CHEST_MM);
798
+ const ring = Array.from({ length: 4 * SHOULDER_COLUMNS }, (_, j) => {
799
+ const p = engine_1.AutoMovieLoftChain.point(chain, rail, (2 * Math.PI * j) / (4 * SHOULDER_COLUMNS));
800
+ const off = [0, 1, 2].map((k) => p[k] - frame.origin[k]);
801
+ const r = Math.hypot(off[0], off[1], off[2]);
802
+ const clock = Math.atan2(off[0] * lateral[0] + off[1] * lateral[1] + off[2] * lateral[2], off[0] * up[0] + off[1] * up[1] + off[2] * up[2]);
803
+ const out = chest(clock < 0 ? clock + 2 * Math.PI : clock) / r;
804
+ return [0, 1, 2].map((k) => frame.origin[k] + off[k] * out);
805
+ });
806
+ const chart = trunkChart(placed);
807
+ const seen = ring.map(chart);
808
+ const radius = seen.reduce((sum, p) => sum + Math.hypot(p.u, p.v), 0) / seen.length;
809
+ return around(seen.map((p) => [p.station, side * Math.atan2(p.v, p.u)]), SHOULDER_COLUMNS, 0, radius, side);
810
+ }
811
+ AutoMovieHumanF1.mammary = mammary;
812
+ /**
813
+ * Where the plane between two neighbouring digits crosses a limb's open end: the two host phases at which the end's ring crosses the
814
+ * plane through the midpoints of the two digits' first joints and of their second joints that holds `up`, increasing in `[0, 2 pi)`.
815
+ *
816
+ * @param family The limb's family, its end open.
817
+ * @param station The end's station, mm.
818
+ * @param joints The two digits' first and second joints: `[[first, second], [first, second]]`.
819
+ * @param up The palm's or the sole's normal, or any direction the plane must hold.
820
+ */
821
+ function valley(family, station, joints, up) {
822
+ const loft = AutoMovieHumanConicLoft_1.AutoMovieHumanConicLoft.create(family, family.knots);
823
+ if (loft.chain === null)
824
+ throw new Error("valley: the limb does not loft");
825
+ const chain = loft.chain;
826
+ const mid = (a, b) => [(a[0] + b[0]) / 2, (a[1] + b[1]) / 2, (a[2] + b[2]) / 2];
827
+ const m1 = mid(joints[0][0], joints[1][0]);
828
+ const m2 = mid(joints[0][1], joints[1][1]);
829
+ const d = [m2[0] - m1[0], m2[1] - m1[1], m2[2] - m1[2]];
830
+ const normal = [d[1] * up[2] - d[2] * up[1], d[2] * up[0] - d[0] * up[2], d[0] * up[1] - d[1] * up[0]];
831
+ const side = (t) => {
832
+ const p = engine_1.AutoMovieLoftChain.point(chain, station, t);
833
+ return (p[0] - m1[0]) * normal[0] + (p[1] - m1[1]) * normal[1] + (p[2] - m1[2]) * normal[2];
834
+ };
835
+ const count = 720;
836
+ const crossings = [];
837
+ for (let k = 0; k < count; ++k) {
838
+ let [lo, hi] = [(2 * Math.PI * k) / count, (2 * Math.PI * (k + 1)) / count];
839
+ if (side(lo) <= 0 === side(hi) <= 0)
840
+ continue;
841
+ for (let i = 0; i < 50; ++i) {
842
+ const middle = (lo + hi) / 2;
843
+ if (side(middle) <= 0 === side(lo) <= 0)
844
+ lo = middle;
845
+ else
846
+ hi = middle;
847
+ }
848
+ crossings.push((lo + hi) / 2);
849
+ }
850
+ if (crossings.length !== 2)
851
+ throw new Error("valley: the plane crosses the limb's end " + crossings.length + " times");
852
+ return [crossings[0], crossings[1]];
853
+ }
854
+ AutoMovieHumanF1.valley = valley;
855
+ /**
856
+ * The seams a limb's open end is split along between its knuckled digits (`IAutoMovieConstructionSplit.outer`), from the little
857
+ * finger's or the little toe's valley inward, each a pair of host phases on the end's ring enclosing the one before; each seam's heading,
858
+ * toward the middle of the gap between the two digits' facing skins (`IAutoMovieConstructionSplit.IProfile.heading`); and the end's station, outward normal and palm or
859
+ * sole normal. The split of a fanned limb's end (`FANS`) and `FamilyConicScan.ts webs` read it.
860
+ *
861
+ * The joints are the datums at the pose. The palm's normal is the vector product of the wrist's lines to the index and the pinky
862
+ * finger's first joints; the sole's is the foot's stored direction `leg.fan.up`, the floor's normal reversed in the reference pose.
863
+ *
864
+ * @param which The limb.
865
+ * @param placed The figure's families at a pose; absent, the reference pose.
866
+ */
867
+ function fanSeams(which, placed = assemble()) {
868
+ const at = placed.point;
869
+ const family = { ...(which === "arm" ? placed.body.hand : placed.body.leg), tips: undefined };
870
+ const station = family.knots.at(-1);
871
+ const sub = (a, b) => [a[0] - b[0], a[1] - b[1], a[2] - b[2]];
872
+ const [a, b] = [sub(at("index1"), at("hand")), sub(at("pinky1"), at("hand"))];
873
+ const up = which === "arm" ? [a[1] * b[2] - a[2] * b[1], a[2] * b[0] - a[0] * b[2], a[0] * b[1] - a[1] * b[0]] : placed.direction("leg.fan.up");
874
+ const rows = (which === "arm" ? ["pinky", "ring", "middle", "index"] : ["littletoe", "ringtoe", "middletoe", "indextoe", "bigtoe"]).map((digit) => [at(digit + "1"), at(digit + "2")]);
875
+ const seams = [];
876
+ for (let i = 0; i + 1 < rows.length; ++i) {
877
+ const [p, q] = valley(family, station, [rows[i], rows[i + 1]], up);
878
+ if (seams.length === 0) {
879
+ seams.push([p, q]);
880
+ continue;
881
+ }
882
+ // Of the three readings of the same two crossings, the one that encloses the seam before.
883
+ const [ia, ib] = seams.at(-1);
884
+ const enclosing = [[p, q], [q, p + 2 * Math.PI], [q - 2 * Math.PI, p]].find(([x, y]) => x < ia && y > ib && y < x + 2 * Math.PI);
885
+ if (enclosing === undefined)
886
+ throw new Error("fanSeams: the valleys of the " + which + " do not nest");
887
+ seams.push(enclosing);
888
+ }
889
+ const frame = AutoMovieHumanConicLoft_1.AutoMovieHumanConicLoft.axis(family).at(station);
890
+ const normal = [frame.v[1] * frame.u[2] - frame.v[2] * frame.u[1], frame.v[2] * frame.u[0] - frame.v[0] * frame.u[2], frame.v[0] * frame.u[1] - frame.v[1] * frame.u[0]];
891
+ // Each seam's plane holds its chord and the middle of the gap between the two digits' skins where they face each other, on each
892
+ // digit's first section: the point of that ring farthest toward the other ring's centre. Held to the digits' mean direction instead
893
+ // (the line from their first joints' midpoint to their second joints'), the plane between the index and the big toe stood midway
894
+ // between their axes, 12.3 mm from each, but the big toe is the wider: its skin crossed the plane by 1.1 to 1.5 mm from 8 to 18 mm
895
+ // along the seam, and the web scan's rays there ran on inside the big toe (31 to 47 mm) and were left out. The gap's middle stands
896
+ // 3.1 mm toward the index toe there, and within 0.7 mm of the mean-direction plane at every other seam.
897
+ const names = which === "arm" ? ["finger.pinky", "finger.ring", "finger.middle", "finger.index"] : ["toe.little", "toe.ring", "toe.middle", "toe.index", "toe.big"];
898
+ const end = AutoMovieHumanConicLoft_1.AutoMovieHumanConicLoft.create(family, family.knots);
899
+ if (end.chain === null)
900
+ throw new Error("fanSeams: the " + which + " does not loft");
901
+ const firstRings = names.map((name) => {
902
+ const digit = placed.digits.find((d) => d.family.name === name).family;
903
+ const loft = AutoMovieHumanConicLoft_1.AutoMovieHumanConicLoft.create({ ...digit, tips: [null, digit.tips?.[1] ?? null] }, digit.knots);
904
+ if (loft.chain === null)
905
+ throw new Error("fanSeams: " + name + " does not loft");
906
+ const chain = loft.chain;
907
+ return Array.from({ length: 256 }, (_, k) => engine_1.AutoMovieLoftChain.point(chain, digit.knots[0], (2 * Math.PI * k) / 256));
908
+ });
909
+ const centre = (ring) => [0, 1, 2].map((c) => ring.reduce((sum, p) => sum + p[c], 0) / ring.length);
910
+ const headings = seams.map(([phase], i) => {
911
+ const [one, two] = [firstRings[i], firstRings[i + 1]];
912
+ const toward = sub(centre(two), centre(one));
913
+ const reach = (p) => p[0] * toward[0] + p[1] * toward[1] + p[2] * toward[2];
914
+ const near = one.reduce((best, p) => (reach(p) > reach(best) ? p : best));
915
+ const far = two.reduce((best, p) => (reach(p) < reach(best) ? p : best));
916
+ const d = sub([0, 1, 2].map((c) => (near[c] + far[c]) / 2), engine_1.AutoMovieLoftChain.point(end.chain, station, phase));
917
+ const l = Math.hypot(d[0], d[1], d[2]);
918
+ return [Math.round((d[0] / l) * 1e4) / 1e4, Math.round((d[1] / l) * 1e4) / 1e4, Math.round((d[2] / l) * 1e4) / 1e4];
919
+ });
920
+ return { station, seams, headings, normal, up };
921
+ }
922
+ AutoMovieHumanF1.fanSeams = fanSeams;
923
+ /**
924
+ * Declare the sewn body.
925
+ *
926
+ * @param layer Station spacing of each family's layers and derived outlines, mm.
927
+ * @param pose The pose the families are placed at (`assemble`); absent, the reference pose.
928
+ */
929
+ function construction(layer = LAYER_MM, pose) {
930
+ const placed = assemble(pose);
931
+ const sources = new Map();
932
+ const leaf = (family, fine = -Infinity, close = WEB_LAYER_MM, pitch = layer, until = Infinity, dome = Infinity) => {
933
+ const from = family.knots[0];
934
+ const to = Math.min(family.knots.at(-1), until);
935
+ const count = Math.ceil((to - from) / pitch) + 1;
936
+ const even = Array.from({ length: count }, (_, i) => from + ((to - from) * i) / (count - 1));
937
+ // Inside a relief whose net is finer along the station than the layers, each layer interval is cut until it is as fine: rings 4 mm
938
+ // apart showed the face's net, 2.6 mm apart, as level steps.
939
+ const stations = even.flatMap((s, i) => {
940
+ if (i === 0)
941
+ return [s];
942
+ const before = even[i - 1];
943
+ const step = Math.min(pitch, before < fine ? close : pitch, ...(family.name === AutoMovieHumanF1.BODY.trunk.name && s > TRUNK_FACE_LAYERS[0] && before < TRUNK_FACE_LAYERS[1] ? [TRUNK_FACE_LAYERS[2]] : []), ...(family.reliefs ?? []).filter((relief) => relief.stations[0] < s && relief.stations[1] > before).map((relief) => (relief.stations[1] - relief.stations[0]) / ((NET_LAYER_ROWS[relief.name.replace(/(\.twin)?(\.mirror)?$/, "")] ?? relief.rows) - 3)));
944
+ const cuts = Math.ceil((s - before) / step - 1e-9);
945
+ return Array.from({ length: cuts }, (_, k) => before + ((s - before) * (k + 1)) / cuts);
946
+ });
947
+ sources.set(family.name, AutoMovieHumanConicLoft_1.AutoMovieHumanConicLoft.part(family, folded(family, domed(family, swept(family, stations), dome))));
948
+ return { type: "source", name: family.name, source: family.name };
949
+ };
950
+ // The same stations with each interval from `from` on cut until no ring point of the wall moves farther than a layer between two
951
+ // rings. Over a dome the skin faces up, and a ring point moves across it several times as far as the station: on f1's crown the wall
952
+ // narrows 1.2 to 1.3 mm a millimetre of station, rings 4 mm apart stood 6 to 7 mm apart on the skin and drew concentric terraces on
953
+ // `head.high-oblique`. Measured on the wall alone, without the reliefs, and only over the crown, so the head's rings below, which the
954
+ // ear's band is triangulated against, stay where they were.
955
+ const domed = (family, stations, from) => {
956
+ if (!Number.isFinite(from))
957
+ return stations;
958
+ const loft = AutoMovieHumanConicLoft_1.AutoMovieHumanConicLoft.create({ ...family, reliefs: undefined }, stations);
959
+ if (loft.chain === null)
960
+ return stations;
961
+ const chain = loft.chain;
962
+ const moved = (s, t) => Math.max(...Array.from({ length: FOLD.phases }, (_, j) => {
963
+ const [p, q] = [s, t].map((x) => engine_1.AutoMovieLoftChain.point(chain, x, (2 * Math.PI * j) / FOLD.phases));
964
+ return Math.hypot(p[0] - q[0], p[1] - q[1], p[2] - q[2]);
965
+ }));
966
+ return stations.flatMap((s, i) => {
967
+ if (i === 0)
968
+ return [s];
969
+ const before = stations[i - 1];
970
+ const cuts = before < from ? 1 : Math.max(1, Math.ceil(moved(before, s) / layer - 1e-9));
971
+ return Array.from({ length: cuts }, (_, k) => before + ((s - before) * (k + 1)) / cuts);
972
+ });
973
+ };
974
+ // The same stations with each interval cut until no ring point moves farther than a layer by the course frame's own sweep. Round a
975
+ // turn a point off the course moves by `1 + kappa d` times the station, `d` its distance toward the turn's outside: round the shoulder
976
+ // the deltoid's cap moved 7 to 10 mm between layers 4 mm apart, round the heel 8 to 10, and every ring showed as a stripe. Measured by
977
+ // the frame alone, not by the rings' whole change, so a section that changes shape on a straight course keeps its layers.
978
+ const swept = (family, stations) => {
979
+ if (family.centres.length < 3)
980
+ return stations;
981
+ const loft = AutoMovieHumanConicLoft_1.AutoMovieHumanConicLoft.create({ ...family, reliefs: undefined }, stations);
982
+ if (loft.chain === null)
983
+ return stations;
984
+ const chain = loft.chain;
985
+ const course = AutoMovieHumanConicLoft_1.AutoMovieHumanConicLoft.axis(family);
986
+ const reach = (s, t) => {
987
+ const [from, to] = [course.at(s), course.at(t)];
988
+ return Math.max(...Array.from({ length: FOLD.phases }, (_, j) => {
989
+ const p = engine_1.AutoMovieLoftChain.point(chain, s, (2 * Math.PI * j) / FOLD.phases);
990
+ const r = [0, 1, 2].map((k) => p[k] - from.origin[k]);
991
+ const [x, y] = [from.u, from.v].map((e) => r[0] * e[0] + r[1] * e[1] + r[2] * e[2]);
992
+ return Math.hypot(...[0, 1, 2].map((k) => to.origin[k] + x * to.u[k] + y * to.v[k] - p[k]));
993
+ }));
994
+ };
995
+ return stations.flatMap((s, i) => {
996
+ if (i === 0)
997
+ return [s];
998
+ const before = stations[i - 1];
999
+ const cuts = Math.ceil(Math.max(reach(before, s), reach(s, before)) / layer - 1e-9);
1000
+ return Array.from({ length: Math.max(1, cuts) }, (_, k) => before + ((s - before) * (k + 1)) / Math.max(1, cuts));
1001
+ });
1002
+ };
1003
+ // The same stations with a layer added wherever the family's relieved skin turns too fast between two of them (`FOLD`).
1004
+ const folded = (family, stations) => {
1005
+ if ((family.reliefs ?? []).length === 0)
1006
+ return stations;
1007
+ const loft = AutoMovieHumanConicLoft_1.AutoMovieHumanConicLoft.create(family, stations);
1008
+ if (loft.chain === null)
1009
+ return stations;
1010
+ const chain = loft.chain;
1011
+ const ring = (s) => Array.from({ length: FOLD.phases }, (_, j) => engine_1.AutoMovieLoftChain.point(chain, s, (2 * Math.PI * j) / FOLD.phases));
1012
+ const between = (a, low, b, high) => {
1013
+ if (b - a <= 2 * FOLD.least)
1014
+ return [];
1015
+ const middle = (a + b) / 2;
1016
+ const mid = ring(middle);
1017
+ const off = mid.some((p, j) => Math.hypot(p[0] - (low[j][0] + high[j][0]) / 2, p[1] - (low[j][1] + high[j][1]) / 2, p[2] - (low[j][2] + high[j][2]) / 2) > FOLD.sagitta);
1018
+ return off ? [...between(a, low, middle, mid), middle, ...between(middle, mid, b, high)] : [];
1019
+ };
1020
+ const rings = stations.map(ring);
1021
+ const cut = stations.flatMap((s, i) => (i === 0 ? [s] : [...between(stations[i - 1], rings[i - 1], s, rings[i]), s]));
1022
+ // Over a crease's window, where the skin turns along the station faster than `FOLD.turn` between an interval's halves.
1023
+ const windows = FOLD.creases.filter((crease) => crease.family === family.name).map((crease) => crease.stations);
1024
+ if (windows.length === 0)
1025
+ return cut;
1026
+ const fine = (s) => Array.from({ length: FOLD.fine }, (_, j) => engine_1.AutoMovieLoftChain.point(chain, s, (2 * Math.PI * j) / FOLD.fine));
1027
+ const turned = (low, mid, high) => {
1028
+ const u = [0, 1, 2].map((k) => mid[k] - low[k]);
1029
+ const w = [0, 1, 2].map((k) => high[k] - mid[k]);
1030
+ const cosine = (u[0] * w[0] + u[1] * w[1] + u[2] * w[2]) / (Math.hypot(u[0], u[1], u[2]) * Math.hypot(w[0], w[1], w[2]));
1031
+ return (Math.acos(Math.max(-1, Math.min(1, cosine))) * 180) / Math.PI;
1032
+ };
1033
+ const bend = (a, low, b, high) => {
1034
+ if (b - a <= 2 * FOLD.least)
1035
+ return [];
1036
+ const middle = (a + b) / 2;
1037
+ const mid = fine(middle);
1038
+ const off = mid.some((p, j) => turned(low[j], p, high[j]) > FOLD.turn);
1039
+ return off ? [...bend(a, low, middle, mid), middle, ...bend(middle, mid, b, high)] : [];
1040
+ };
1041
+ const inside = (a, b) => windows.some((window) => a >= window[0] && b <= window[1]);
1042
+ const sharp = cut.map((s, i) => (inside(cut[Math.max(0, i - 1)], s) || inside(s, cut[Math.min(cut.length - 1, i + 1)]) ? fine(s) : null));
1043
+ return cut.flatMap((s, i) => (i === 0 ? [s] : [...(inside(cut[i - 1], s) ? bend(cut[i - 1], sharp[i - 1], s, sharp[i]) : []), s]));
1044
+ };
1045
+ const twin = (family) => AutoMovieHumanConicLoft_1.AutoMovieHumanConicLoft.mirror(family, family.name + ".mirror");
1046
+ // A digit as stored, whose stations the constants below are given in; `placed.station` carries each to the pose.
1047
+ const stored = (name) => AutoMovieHumanF1.DIGITS.find((d) => d.family.name === name).family;
1048
+ const trunk = AutoMovieHumanF1.BODY.trunk.name;
1049
+ // A limb with its digits: each digit is merged onto the limb's cap before the limb is attached to the trunk, so the engine traces where a
1050
+ // capsule comes out against the limb alone. Merged after the whole body was sewn, every digit was traced against all of it.
1051
+ const limb = (which, side) => {
1052
+ // The limb's end stays open and is split into its knuckled digits (`FANS`); the thumb is merged onto the hand's side first, as a
1053
+ // capsule closed `ROOT_MM` behind its first joint, inside the hand.
1054
+ const fanned = FANS[which];
1055
+ const own = which === "arm" ? placed.body.hand : placed.body.leg;
1056
+ const leaned = { ...own, tips: [which === "arm" ? null : own.tips[0], null], ...(PHASE_TURN[which] === undefined ? {} : { turn: PHASE_TURN[which] }) };
1057
+ const family = side > 0 ? leaned : twin(leaned);
1058
+ let node = leaf(family);
1059
+ for (const digit of placed.digits.filter((d) => d.limb === which && !d.knuckle)) {
1060
+ const capsule = { ...digit.family, tips: [{ from: digit.family.knots[0], tip: -ROOT_MM, covered: true }, digit.family.tips?.[1] ?? null], ...(which === "arm" ? { turn: FINGER_TURN } : {}) };
1061
+ const part = side > 0 ? capsule : twin(capsule);
1062
+ node = {
1063
+ type: "join",
1064
+ kind: "merge",
1065
+ name: "web." + part.name,
1066
+ host: node,
1067
+ part: leaf(part, placed.station(digit.family.name, stored(digit.family.name).knots[0] + WEB_REACH_MM), WEB_LAYER_MM, which === "arm" ? FINGER_LAYER_MM : layer),
1068
+ seed: { type: "search", partFace: part.name, hostFace: family.name, phase: 0, from: 0, to: 0.7 },
1069
+ parameter: { type: "phase" },
1070
+ partWidth: { type: "chord", value: THUMB_CHORD_MM / 1000 },
1071
+ hostWidth: { type: "chord", value: THUMB_CHORD_MM / 1000 },
1072
+ continuity: "G2",
1073
+ count: 48,
1074
+ rows: 4,
1075
+ tolerance: 1e-12,
1076
+ grazing: 0.05,
1077
+ fair: THUMB_FAIR_MM / 1000,
1078
+ };
1079
+ }
1080
+ // The split: the end's seams along the valleys between the knuckled digits (`fanSeams`), each curved along its web line (`IFan.webs`)
1081
+ // in the plane that holds the two digits' mean direction. The twin's phases run the other way, so a seam `[a, b]` is `[-b, -a]` there,
1082
+ // read from its other fork: its knots run back along the chord, and its heading is reflected.
1083
+ const fan = fanSeams(which, placed);
1084
+ const loft = AutoMovieHumanConicLoft_1.AutoMovieHumanConicLoft.create(leaned, leaned.knots);
1085
+ if (loft.chain === null)
1086
+ throw new Error("the " + which + " does not loft");
1087
+ const chain = loft.chain;
1088
+ const seam = (j) => {
1089
+ const [a, b] = fan.seams[j];
1090
+ const knots = fanned.webs[j];
1091
+ const [pa, pb] = [engine_1.AutoMovieLoftChain.point(chain, fan.station, a), engine_1.AutoMovieLoftChain.point(chain, fan.station, b)];
1092
+ const chord = Math.hypot(pb[0] - pa[0], pb[1] - pa[1], pb[2] - pa[2]) / 1000;
1093
+ const h = fan.headings[j];
1094
+ const tuned = { ...(fanned.reach === undefined ? {} : { reach: fanned.reach }), ...(fanned.square === true ? { square: true } : {}), ...(fanned.fair === undefined ? {} : { fair: typeof fanned.fair === "number" || side > 0 ? fanned.fair : [fanned.fair[1], fanned.fair[0]] }) };
1095
+ return side > 0
1096
+ ? { seam: [a, b], profile: { knots, corner: fanned.corner, heading: h, ...tuned } }
1097
+ : { seam: [-b, -a], profile: { knots: knots.map(([along, depth]) => [chord - along, depth]).reverse(), corner: fanned.corner, heading: [h[0], h[1], -h[2]], ...tuned } };
1098
+ };
1099
+ const children = fanned.digits.map((name) => {
1100
+ const digit = placed.digits.find((d) => d.family.name === name);
1101
+ const own = which === "arm" ? { ...digit.family, turn: FINGER_TURN } : digit.family;
1102
+ const part = side > 0 ? own : twin(own);
1103
+ return { band: "band." + part.name, part: leaf(part, -Infinity, WEB_LAYER_MM, which === "arm" ? FINGER_LAYER_MM : layer), partFace: part.name, partEnd: "bottom", rail: placed.station(name, stored(name).knots[0], fanned.rail) / 1000, correspondence: "length" };
1104
+ });
1105
+ const first = seam(0);
1106
+ node = {
1107
+ type: "split",
1108
+ name: "fan." + family.name,
1109
+ host: node,
1110
+ hostFace: family.name,
1111
+ hostEnd: "top",
1112
+ seam: first.seam,
1113
+ ...(first.profile === undefined ? {} : { profile: first.profile }),
1114
+ outer: fan.seams.slice(1).map((_, j) => seam(j + 1)),
1115
+ count: fanned.columns,
1116
+ rows: fanned.rows,
1117
+ children: children,
1118
+ };
1119
+ if (which === "leg")
1120
+ return { node, face: family.name };
1121
+ // The arm ends open before the wrist (`ARM_TO_MM`) and the hand, a family of its own on a wider knuckle turn, continues it across a
1122
+ // band (`WRIST`), since the two families' sections need not share one ring.
1123
+ const arm = { ...placed.body.arm, tips: [placed.body.arm.tips[0], null], ...(PHASE_TURN.arm === undefined ? {} : { turn: PHASE_TURN.arm }) };
1124
+ const armFamily = side > 0 ? arm : twin(arm);
1125
+ return {
1126
+ node: { type: "continue", name: "wrist." + armFamily.name, host: leaf(armFamily, -Infinity, WEB_LAYER_MM, layer, placed.station(AutoMovieHumanF1.BODY.arm.name, ARM_TO_MM)), hostFace: armFamily.name, hostEnd: "top", part: node, partFace: family.name, partEnd: "bottom", band: { rail: placed.station(AutoMovieHumanF1.BODY.hand.name, AutoMovieHumanF1.BODY.hand.knots[0], WRIST.rail) / 1000, count: WRIST.count, rows: WRIST.rows, correspondence: "length" } },
1127
+ face: armFamily.name,
1128
+ };
1129
+ };
1130
+ // The trunk's section chart has +u forward and +v to +Z, so the seam from phase 0 to pi gives the first child the +Z half of the end.
1131
+ const legs = [limb("leg", 1), limb("leg", -1)];
1132
+ let root = {
1133
+ type: "split",
1134
+ name: "crotch",
1135
+ host: leaf({ ...placed.body.trunk, phase: TRUNK_PHASE }, -Infinity, WEB_LAYER_MM, layer, Infinity, CROWN_MM),
1136
+ hostFace: trunk,
1137
+ hostEnd: "bottom",
1138
+ seam: [0, Math.PI],
1139
+ profile: CROTCH,
1140
+ count: THIGH_COLUMNS,
1141
+ rows: BAND.rows,
1142
+ children: [
1143
+ { band: "band." + legs[0].face, part: legs[0].node, partFace: legs[0].face, partEnd: "bottom", rail: placed.station(AutoMovieHumanF1.BODY.leg.name, AutoMovieHumanF1.BODY.leg.knots[0], AutoMovieHumanF1.RAIL_MM.leg) / 1000 },
1144
+ { band: "band." + legs[1].face, part: legs[1].node, partFace: legs[1].face, partEnd: "bottom", rail: placed.station(AutoMovieHumanF1.BODY.leg.name, AutoMovieHumanF1.BODY.leg.knots[0], AutoMovieHumanF1.RAIL_MM.leg) / 1000 },
1145
+ ],
1146
+ };
1147
+ for (const side of [1, -1]) {
1148
+ const arm = limb("arm", side);
1149
+ root = { type: "port", name: "armscye." + arm.face, host: root, hostFace: trunk, loop: armscye(side, placed), band: "band." + arm.face, part: arm.node, partFace: arm.face, partEnd: "bottom", rail: placed.station(AutoMovieHumanF1.BODY.arm.name, AutoMovieHumanF1.BODY.arm.knots[0], Math.min(...ARM_RAILS_MM)) / 1000, rails: armRails(side).map((mm) => placed.station(AutoMovieHumanF1.BODY.arm.name, AutoMovieHumanF1.BODY.arm.knots[0], mm) / 1000), ribbons: "column", count: SHOULDER_COLUMNS, rows: ARMSCYE_ROWS };
1150
+ // The armpit's slit, cut after the arm's port: no wall is star-shaped about the slit (the conic audit), and the arm's band closes it
1151
+ // 12 to 17 mm under its apex. The cutter's sections are the slit's air from 3 mm under that band up to its apex, drawn in from the
1152
+ // walls, its arm-side flank concave under the apex (`AutoMovieHumanF1Axilla`). It is seeded on its bottom, phase pi, whose station line
1153
+ // stands in the flesh above the band where the cutter closes at its front end and runs on under the band; its top's stays above the
1154
+ // band all along. Walked by its own length; at a phase parameter the twin's trace was lost. Blended 0.25 mm wide on either side: at
1155
+ // 0.5 mm the twin's cutter face did not triangulate ("subconstraints cross without a supplied shared vertex"), with 256 columns or
1156
+ // the search reversed as well.
1157
+ const axilla = side > 0 ? placed.axilla : twin(placed.axilla);
1158
+ root = { type: "join", kind: "diff", name: "cut." + axilla.name, host: root, part: leaf(axilla, Infinity, AXILLA_LAYER_MM), seed: { type: "search", partFace: axilla.name, hostFace: "band." + arm.face, phase: side > 0 ? AXILLA_SEED.phase : 2 * Math.PI - AXILLA_SEED.phase, from: AXILLA_SEED.from, to: AXILLA_SEED.to }, parameter: { type: "arc" }, partWidth: { type: "chord", value: 0.00025 }, hostWidth: { type: "chord", value: 0.00025 }, continuity: "G2", count: 192, rows: 4, tolerance: 1e-12, grazing: 0.04 }; // The ear as its parts. The plate is the auricle's back sheet from its root, 6 mm inside the head, out to under the rim, the whole
1159
+ // lobule included; at mid heights it runs from the head out to the rim, so its front face is the concha's back wall. The helix and
1160
+ // the antihelix are round tubes along their crests, walked by their own length and seeded on their top lines, phase 0, which come up
1161
+ // out of the plate past their buried ends; the scapha and the fossa are the plate's floor between them. The plate is merged onto the
1162
+ // head along the curve round its root, seeded on its root end, phase pi, which leaves the head at the plate's top cap (no port, no
1163
+ // band); then the helix, whose front end runs down its crus into the head, onto the two; then the antihelix, its lower end in the plate
1164
+ // and its upper end inside the helix's tube, so neither tube's walk crosses the other's blend. Each merge's blend is faired over half
1165
+ // its part's width (`IAutoMovieConstructionJoin.fair`, as the thumb's). Last the concha's bowl is cut from the head in front of the
1166
+ // antihelix: its cutter runs square into the head to the bowl's floor and is closed at both ends; seeded on its lower side, phase pi,
1167
+ // which is its twin's too. Its back side, phase pi / 2, only grazes the plate's front face, and its other lines meet the head only
1168
+ // inside its cap (a scratch probe along its four quarter lines).
1169
+ const helix = side > 0 ? placed.helix : twin(placed.helix);
1170
+ const antihelix = side > 0 ? placed.antihelix : twin(placed.antihelix);
1171
+ const concha = side > 0 ? placed.concha : twin(placed.concha);
1172
+ const plate = side > 0 ? placed.body.ear : twin(placed.body.ear);
1173
+ const ridge = (host, part, fair) => ({ type: "join", kind: "merge", name: "ridge." + part.name, host, part: leaf(part, Infinity), seed: { type: "search", partFace: part.name, hostFace: plate.name, phase: 0, phases: EAR_SEED_LINES, from: 0, to: 0.5 }, parameter: { type: "arc" }, partWidth: { type: "chord", value: 0.00025 }, hostWidth: { type: "chord", value: 0.00025 }, continuity: "G2", count: 192, rows: 4, tolerance: 1e-12, grazing: 0.04, fair: fair / 1000 });
1174
+ root = { type: "join", kind: "merge", name: "root." + plate.name, host: root, part: leaf(plate, Infinity), seed: { type: "search", partFace: plate.name, hostFace: trunk, phase: Math.PI, phases: EAR_SEED_LINES, from: 0, to: 1 }, parameter: { type: "arc" }, partWidth: { type: "chord", value: 0.0005 }, hostWidth: { type: "chord", value: 0.0005 }, continuity: "G2", count: 256, rows: 4, tolerance: 1e-12, grazing: 0.04, fair: EAR_FAIR_MM.root / 1000 };
1175
+ root = ridge(root, helix, EAR_FAIR_MM.helix);
1176
+ root = ridge(root, antihelix, EAR_FAIR_MM.antihelix);
1177
+ root = { type: "join", kind: "diff", name: "cut." + concha.name, host: root, part: leaf(concha), seed: { type: "search", partFace: concha.name, hostFace: trunk, phase: Math.PI, phases: EAR_SEED_LINES, from: 0, to: 0.9 }, parameter: { type: "arc" }, partWidth: { type: "chord", value: 0.00025 }, hostWidth: { type: "chord", value: 0.00025 }, continuity: "G2", count: 192, rows: 4, tolerance: 1e-12, grazing: 0.04 };
1178
+ // The breast, which the trunk's sections leave out: its band spans the fold under it from the chest to the breast's own wall. Its
1179
+ // layers stand half a millimetre apart all along it (`BREAST_LAYER_MM`) and its phases 1.5 mm (`BREAST_PITCH_MM`).
1180
+ const breast = side > 0 ? { ...placed.body.breast, pitch: BREAST_PITCH_MM } : twin({ ...placed.body.breast, pitch: BREAST_PITCH_MM });
1181
+ root = { type: "port", name: "mammary." + breast.name, host: root, hostFace: trunk, loop: mammary(side, placed), band: "band." + breast.name, part: leaf(breast, Infinity, BREAST_LAYER_MM), partFace: breast.name, partEnd: "bottom", rail: AutoMovieHumanF1.RAIL_MM.breast / 1000, count: SHOULDER_COLUMNS, rows: BAND.rows };
1182
+ }
1183
+ root = { type: "port", name: "nostril." + AutoMovieHumanF1.BODY.nose.name, host: root, hostFace: trunk, loop: nostril(placed), band: "band." + AutoMovieHumanF1.BODY.nose.name, part: leaf({ ...placed.body.nose, phase: NOSE_PHASE }), partFace: AutoMovieHumanF1.BODY.nose.name, partEnd: "bottom", rail: Math.min(...AutoMovieHumanF1.NOSE_RAILS_MM) / 1000, rails: AutoMovieHumanF1.NOSE_RAILS_MM.map((rail) => rail / 1000), correspondence: "length", profiles: NOSE_PROFILES, count: NOSE_COLUMNS, rows: BAND.rows };
1184
+ // Each nostril is cut from the head: its loft comes up out of the nose's underside and closes inside it. The band lands behind it, so the
1185
+ // cut lies wholly on the nose's own face and its blend may be as wide as the rim's roll; while the cut crossed the band at the sill only
1186
+ // a blend 0.15 mm wide found its rails there.
1187
+ for (const side of [1, -1]) {
1188
+ const drawn = spreadOut(drawnIn(placed.nostril, NOSTRIL_RIM_MM), NOSTRIL_MOUTH_MM, NOSTRIL_SPREAD_MM);
1189
+ const hollow = side > 0 ? drawn : twin(drawn);
1190
+ root = { type: "join", kind: "diff", name: "cut." + hollow.name, host: root, part: leaf(hollow, Infinity, NOSTRIL_LAYER_MM), seed: { type: "search", partFace: hollow.name, hostFace: AutoMovieHumanF1.BODY.nose.name, phase: 0, from: 0, to: 0.9 }, parameter: { type: "phase" }, partWidth: { type: "chord", value: NOSTRIL_RIM_MM / 1000 }, hostWidth: { type: "chord", value: NOSTRIL_RIM_MM / 1000 }, continuity: "G2", count: 48, rows: 4, tolerance: 1e-12, grazing: 0.05 };
1191
+ }
1192
+ const breastFan = placed.point("breastFan");
1193
+ const fills = [1, -1].map((side) => ({ point: [breastFan[0] / 1000, breastFan[1] / 1000, (side * breastFan[2]) / 1000], radius: BREAST_FAN_FILL_MM / 1000 }));
1194
+ return { root, sources, fills };
1195
+ }
1196
+ AutoMovieHumanF1.construction = construction;
1197
+ /**
1198
+ * Generate the figure's pieces: the sewn body, then every loose family and its twin.
1199
+ *
1200
+ * @param step Station spacing of a loose family's layers, mm.
1201
+ * @param phases Vertices round every layer of a loose family.
1202
+ * @param chord Largest distance the sewn body's triangles may stand off its surfaces, metres. Most of the generation time is this tessellation.
1203
+ */
1204
+ function create(step = 4, phases = 128, chord = 0.001) {
1205
+ const declared = construction();
1206
+ const real = (0, engine_1.realizeAutoMovieConstruction)({ name: "f1.body", root: declared.root, fills: declared.fills }, { chord, sources: declared.sources });
1207
+ const pieces = [{ name: "body", positions: Array.from(real.mesh.positions), indices: Array.from(real.mesh.indices), diagnostics: real.diagnostics.map((d) => d.node + " (" + d.contract + "): " + d.detail) }];
1208
+ for (const { family, mirrored, reach } of AutoMovieHumanF1.LOOSE) {
1209
+ // Layers from the first knot to the last, widened by the member's reach, evenly spaced at most `step` apart.
1210
+ const from = family.knots[0] - (reach?.[0] ?? 0);
1211
+ const to = family.knots.at(-1) + (reach?.[1] ?? 0);
1212
+ const count = Math.max(2, Math.ceil((to - from) / step) + 1);
1213
+ const stations = Array.from({ length: count }, (_, i) => from + ((to - from) * i) / (count - 1));
1214
+ const loft = AutoMovieHumanConicLoft_1.AutoMovieHumanConicLoft.create(family, stations);
1215
+ const diagnostics = loft.diagnostics.map((d) => JSON.stringify(d));
1216
+ if (loft.chain === null) {
1217
+ pieces.push({ name: family.name, positions: [], indices: [], diagnostics });
1218
+ continue;
1219
+ }
1220
+ const chain = loft.chain;
1221
+ // Past the last knot the loft's own cap layers follow, and the pole closes them by a fan.
1222
+ const layers = [...stations, ...chain.layers.map((layer) => layer.y).filter((y) => y > to)];
1223
+ const rings = layers.map((s) => Array.from({ length: phases }, (_, j) => engine_1.AutoMovieLoftChain.point(chain, s, (2 * Math.PI * j) / phases)));
1224
+ for (const sign of mirrored ? [1, -1] : [1]) {
1225
+ const positions = [];
1226
+ const indices = [];
1227
+ for (const ring of rings)
1228
+ for (const p of ring)
1229
+ positions.push(p[0] / 1000, p[1] / 1000, (sign * p[2]) / 1000);
1230
+ if (chain.pole?.end === "top") {
1231
+ const apex = positions.length / 3;
1232
+ const last = (rings.length - 1) * phases;
1233
+ positions.push(chain.pole.point[0] / 1000, chain.pole.point[1] / 1000, (sign * chain.pole.point[2]) / 1000);
1234
+ for (let j = 0; j < phases; ++j)
1235
+ indices.push(...(sign > 0 ? [last + j, apex, last + ((j + 1) % phases)] : [last + j, last + ((j + 1) % phases), apex]));
1236
+ }
1237
+ for (let i = 0; i + 1 < rings.length; ++i)
1238
+ for (let j = 0; j < phases; ++j) {
1239
+ const a = i * phases + j;
1240
+ const b = i * phases + ((j + 1) % phases);
1241
+ // The reflection reverses the winding, so the twin's triangles are listed the other way round.
1242
+ if (sign > 0)
1243
+ indices.push(a, a + phases, b, b, a + phases, b + phases);
1244
+ else
1245
+ indices.push(a, b, a + phases, b, b + phases, a + phases);
1246
+ }
1247
+ pieces.push({ name: family.name + (sign > 0 ? "" : ".mirror"), positions, indices, diagnostics });
1248
+ }
1249
+ }
1250
+ return pieces;
1251
+ }
1252
+ AutoMovieHumanF1.create = create;
1253
+ })(AutoMovieHumanF1 || (exports.AutoMovieHumanF1 = AutoMovieHumanF1 = {}));
1254
+ //# sourceMappingURL=AutoMovieHumanF1.js.map