@automovie/engine 0.0.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 (966) hide show
  1. package/README.md +1 -1
  2. package/lib/IAutoMovieFormationPlacement.d.ts +4 -3
  3. package/lib/analysis/index.d.ts +5 -0
  4. package/lib/analysis/index.js +5 -0
  5. package/lib/analysis/index.js.map +1 -1
  6. package/lib/anthropometry/AutoMovieHandAnthropometry.d.ts +47 -0
  7. package/lib/anthropometry/AutoMovieHandAnthropometry.js +53 -0
  8. package/lib/anthropometry/AutoMovieHandAnthropometry.js.map +1 -0
  9. package/lib/anthropometry/index.d.ts +1 -0
  10. package/lib/anthropometry/index.js +18 -0
  11. package/lib/anthropometry/index.js.map +1 -0
  12. package/lib/architecture/appendBuiltRegionDefects.d.ts +1 -1
  13. package/lib/architecture/appendBuiltRegionDefects.js +3 -3
  14. package/lib/architecture/appendBuiltRegionDefects.js.map +1 -1
  15. package/lib/architecture/builtOutlineIsClosed.d.ts +1 -1
  16. package/lib/architecture/builtOutlineIsClosed.js +3 -3
  17. package/lib/architecture/builtOutlineIsClosed.js.map +1 -1
  18. package/{src/architecture/constants/PLANAR_EPSILON.ts → lib/architecture/constants/BUILT_PLANAR_EPSILON.d.ts} +1 -1
  19. package/lib/architecture/constants/{PLANAR_EPSILON.js → BUILT_PLANAR_EPSILON.js} +3 -3
  20. package/lib/architecture/constants/BUILT_PLANAR_EPSILON.js.map +1 -0
  21. package/lib/architecture/constants/index.d.ts +1 -1
  22. package/lib/architecture/constants/index.js +1 -1
  23. package/lib/architecture/constants/index.js.map +1 -1
  24. package/lib/architecture/index.d.ts +157 -117
  25. package/lib/architecture/index.js +171 -158
  26. package/lib/architecture/index.js.map +1 -1
  27. package/lib/cache/index.d.ts +9 -0
  28. package/lib/cache/index.js +26 -0
  29. package/lib/cache/index.js.map +1 -0
  30. package/lib/composition/AutoMovieComposition.d.ts +25 -6
  31. package/lib/composition/AutoMovieComposition.js +4 -3
  32. package/lib/composition/AutoMovieComposition.js.map +1 -1
  33. package/lib/composition/AutoMovieScheduleCut.d.ts +53 -0
  34. package/lib/composition/AutoMovieScheduleCut.js +99 -0
  35. package/lib/composition/AutoMovieScheduleCut.js.map +1 -0
  36. package/lib/composition/AutoMovieScheduleError.d.ts +79 -0
  37. package/lib/composition/AutoMovieScheduleError.js +51 -0
  38. package/lib/composition/AutoMovieScheduleError.js.map +1 -0
  39. package/lib/composition/AutoMovieSchedulePlace.d.ts +56 -0
  40. package/lib/composition/AutoMovieSchedulePlace.js +185 -0
  41. package/lib/composition/AutoMovieSchedulePlace.js.map +1 -0
  42. package/lib/composition/AutoMovieScheduleWalk.d.ts +121 -0
  43. package/lib/composition/AutoMovieScheduleWalk.js +161 -0
  44. package/lib/composition/AutoMovieScheduleWalk.js.map +1 -0
  45. package/lib/composition/IAutoMovieIntent.d.ts +9 -6
  46. package/lib/composition/index.d.ts +12 -7
  47. package/lib/composition/index.js +12 -2
  48. package/lib/composition/index.js.map +1 -1
  49. package/lib/composition/markAutoMovieContacts.d.ts +29 -0
  50. package/lib/composition/markAutoMovieContacts.js +69 -0
  51. package/lib/composition/markAutoMovieContacts.js.map +1 -0
  52. package/lib/composition/resolveAutoMovieContactEvents.d.ts +56 -7
  53. package/lib/composition/resolveAutoMovieContactEvents.js +89 -18
  54. package/lib/composition/resolveAutoMovieContactEvents.js.map +1 -1
  55. package/lib/composition/resolveAutoMovieMutualGoal.d.ts +45 -29
  56. package/lib/composition/resolveAutoMovieMutualGoal.js +123 -60
  57. package/lib/composition/resolveAutoMovieMutualGoal.js.map +1 -1
  58. package/lib/composition/resolveAutoMovieSchedule.d.ts +69 -11
  59. package/lib/composition/resolveAutoMovieSchedule.js +32 -103
  60. package/lib/composition/resolveAutoMovieSchedule.js.map +1 -1
  61. package/lib/constants/index.d.ts +2 -0
  62. package/lib/constants/index.js +2 -0
  63. package/lib/constants/index.js.map +1 -1
  64. package/lib/createAutoMovieGeometryActorReader.js +2 -1
  65. package/lib/createAutoMovieGeometryActorReader.js.map +1 -1
  66. package/lib/describeAutoMovieInstanceSetSubject.js +2 -5
  67. package/lib/describeAutoMovieInstanceSetSubject.js.map +1 -1
  68. package/lib/drawing/index.d.ts +12 -0
  69. package/lib/drawing/index.js +12 -0
  70. package/lib/drawing/index.js.map +1 -1
  71. package/lib/effectRuntime/index.d.ts +7 -0
  72. package/lib/effectRuntime/index.js +7 -0
  73. package/lib/effectRuntime/index.js.map +1 -1
  74. package/lib/film/compileAttach.js +2 -5
  75. package/lib/film/compileAttach.js.map +1 -1
  76. package/lib/film/compileLaunch.d.ts +2 -2
  77. package/lib/film/compileLaunch.js +4 -3
  78. package/lib/film/compileLaunch.js.map +1 -1
  79. package/lib/film/constants/index.d.ts +3 -0
  80. package/lib/film/constants/index.js +3 -0
  81. package/lib/film/constants/index.js.map +1 -1
  82. package/lib/film/index.d.ts +61 -6
  83. package/lib/film/index.js +61 -12
  84. package/lib/film/index.js.map +1 -1
  85. package/lib/film/propAnchorFrame.js +6 -9
  86. package/lib/film/propAnchorFrame.js.map +1 -1
  87. package/lib/film/stageScene.js +3 -10
  88. package/lib/film/stageScene.js.map +1 -1
  89. package/lib/film/staging/index.d.ts +11 -0
  90. package/lib/film/staging/index.js +28 -0
  91. package/lib/film/staging/index.js.map +1 -0
  92. package/lib/film/staging/lowerLightPlacement.js +4 -7
  93. package/lib/film/staging/lowerLightPlacement.js.map +1 -1
  94. package/lib/formationSlotPosition.d.ts +6 -1
  95. package/lib/formationSlotPosition.js +38 -3
  96. package/lib/formationSlotPosition.js.map +1 -1
  97. package/lib/geometry/IAutoMovieMark.d.ts +99 -0
  98. package/lib/geometry/IAutoMovieMark.js +3 -0
  99. package/lib/geometry/IAutoMovieMark.js.map +1 -0
  100. package/lib/geometry/IAutoMovieMeshDefect.d.ts +33 -0
  101. package/lib/geometry/IAutoMovieMeshDefect.js +3 -0
  102. package/lib/geometry/IAutoMovieMeshDefect.js.map +1 -0
  103. package/lib/geometry/constants/index.d.ts +2 -0
  104. package/lib/geometry/constants/index.js +2 -0
  105. package/lib/geometry/constants/index.js.map +1 -1
  106. package/lib/geometry/construction/AutoMovieConstructionAdmission.js +72 -10
  107. package/lib/geometry/construction/AutoMovieConstructionAdmission.js.map +1 -1
  108. package/lib/geometry/construction/AutoMovieConstructionBridgeRealize.d.ts +35 -0
  109. package/lib/geometry/construction/AutoMovieConstructionBridgeRealize.js +155 -0
  110. package/lib/geometry/construction/AutoMovieConstructionBridgeRealize.js.map +1 -0
  111. package/lib/geometry/construction/AutoMovieConstructionContinuationRealize.js +4 -0
  112. package/lib/geometry/construction/AutoMovieConstructionContinuationRealize.js.map +1 -1
  113. package/lib/geometry/construction/AutoMovieConstructionPortRealize.d.ts +1 -1
  114. package/lib/geometry/construction/AutoMovieConstructionPortRealize.js +38 -14
  115. package/lib/geometry/construction/AutoMovieConstructionPortRealize.js.map +1 -1
  116. package/lib/geometry/construction/AutoMovieConstructionSeeds.d.ts +6 -6
  117. package/lib/geometry/construction/AutoMovieConstructionSeeds.js +34 -11
  118. package/lib/geometry/construction/AutoMovieConstructionSeeds.js.map +1 -1
  119. package/lib/geometry/construction/AutoMovieConstructionSplitBand.d.ts +107 -2
  120. package/lib/geometry/construction/AutoMovieConstructionSplitBand.js +452 -16
  121. package/lib/geometry/construction/AutoMovieConstructionSplitBand.js.map +1 -1
  122. package/lib/geometry/construction/AutoMovieConstructionSplitRealize.js +262 -0
  123. package/lib/geometry/construction/AutoMovieConstructionSplitRealize.js.map +1 -1
  124. package/lib/geometry/construction/AutoMovieConstructionSplitSeam.d.ts +28 -2
  125. package/lib/geometry/construction/AutoMovieConstructionSplitSeam.js +51 -12
  126. package/lib/geometry/construction/AutoMovieConstructionSplitSeam.js.map +1 -1
  127. package/lib/geometry/construction/AutoMovieConstructionState.d.ts +11 -0
  128. package/lib/geometry/construction/AutoMovieConstructionState.js +5 -0
  129. package/lib/geometry/construction/AutoMovieConstructionState.js.map +1 -1
  130. package/lib/geometry/construction/AutoMovieLoftCapRead.js +3 -2
  131. package/lib/geometry/construction/AutoMovieLoftCapRead.js.map +1 -1
  132. package/lib/geometry/construction/AutoMovieLoftCapSource.js +21 -1
  133. package/lib/geometry/construction/AutoMovieLoftCapSource.js.map +1 -1
  134. package/lib/geometry/construction/AutoMovieLoftJet.js +7 -5
  135. package/lib/geometry/construction/AutoMovieLoftJet.js.map +1 -1
  136. package/lib/geometry/construction/AutoMovieLoftPoint.js +7 -4
  137. package/lib/geometry/construction/AutoMovieLoftPoint.js.map +1 -1
  138. package/lib/geometry/construction/AutoMovieLoftRelief.d.ts +25 -0
  139. package/lib/geometry/construction/AutoMovieLoftRelief.js +37 -0
  140. package/lib/geometry/construction/AutoMovieLoftRelief.js.map +1 -1
  141. package/lib/geometry/construction/AutoMovieLoftViewRead.js +29 -7
  142. package/lib/geometry/construction/AutoMovieLoftViewRead.js.map +1 -1
  143. package/lib/geometry/construction/AutoMovieLoftViewSource.js +4 -2
  144. package/lib/geometry/construction/AutoMovieLoftViewSource.js.map +1 -1
  145. package/lib/geometry/construction/AutoMovieNaturalSpline.d.ts +20 -0
  146. package/lib/geometry/construction/AutoMovieNaturalSpline.js +37 -0
  147. package/lib/geometry/construction/AutoMovieNaturalSpline.js.map +1 -1
  148. package/lib/geometry/construction/AutoMovieSolidBlendChain.d.ts +9 -1
  149. package/lib/geometry/construction/AutoMovieSolidBlendChain.js +13 -8
  150. package/lib/geometry/construction/AutoMovieSolidBlendChain.js.map +1 -1
  151. package/lib/geometry/construction/AutoMovieSolidBodyMerge.js +2 -0
  152. package/lib/geometry/construction/AutoMovieSolidBodyMerge.js.map +1 -1
  153. package/lib/geometry/construction/AutoMovieSolidClip.d.ts +15 -1
  154. package/lib/geometry/construction/AutoMovieSolidClip.js +306 -38
  155. package/lib/geometry/construction/AutoMovieSolidClip.js.map +1 -1
  156. package/lib/geometry/construction/AutoMovieSolidCycle.d.ts +20 -5
  157. package/lib/geometry/construction/AutoMovieSolidCycle.js +68 -16
  158. package/lib/geometry/construction/AutoMovieSolidCycle.js.map +1 -1
  159. package/lib/geometry/construction/AutoMovieSolidIntersectionWalk.js +89 -41
  160. package/lib/geometry/construction/AutoMovieSolidIntersectionWalk.js.map +1 -1
  161. package/lib/geometry/construction/AutoMovieSolidJoin.d.ts +13 -0
  162. package/lib/geometry/construction/AutoMovieSolidJoin.js +23 -2
  163. package/lib/geometry/construction/AutoMovieSolidJoin.js.map +1 -1
  164. package/lib/geometry/construction/AutoMovieSolidMeshConstraints.d.ts +1 -1
  165. package/lib/geometry/construction/AutoMovieSolidMeshConstraints.js +28 -3
  166. package/lib/geometry/construction/AutoMovieSolidMeshConstraints.js.map +1 -1
  167. package/lib/geometry/construction/AutoMovieSolidMeshLoop.d.ts +4 -4
  168. package/lib/geometry/construction/AutoMovieSolidMeshLoop.js +42 -4
  169. package/lib/geometry/construction/AutoMovieSolidMeshLoop.js.map +1 -1
  170. package/lib/geometry/construction/AutoMovieSolidMeshPlan.d.ts +2 -1
  171. package/lib/geometry/construction/AutoMovieSolidMeshPlan.js +57 -25
  172. package/lib/geometry/construction/AutoMovieSolidMeshPlan.js.map +1 -1
  173. package/lib/geometry/construction/AutoMovieSolidRail.d.ts +40 -0
  174. package/lib/geometry/construction/AutoMovieSolidRail.js +101 -31
  175. package/lib/geometry/construction/AutoMovieSolidRail.js.map +1 -1
  176. package/lib/geometry/construction/AutoMovieSolidRailSolve.d.ts +7 -3
  177. package/lib/geometry/construction/AutoMovieSolidRailSolve.js +115 -18
  178. package/lib/geometry/construction/AutoMovieSolidRailSolve.js.map +1 -1
  179. package/lib/geometry/construction/AutoMovieViewLoft.js +9 -0
  180. package/lib/geometry/construction/AutoMovieViewLoft.js.map +1 -1
  181. package/lib/geometry/construction/IAutoMovieConstructionCurve.d.ts +37 -0
  182. package/lib/geometry/construction/IAutoMovieConstructionCurve.js +3 -0
  183. package/lib/geometry/construction/IAutoMovieConstructionCurve.js.map +1 -0
  184. package/lib/geometry/construction/IAutoMovieLoftChain.d.ts +6 -0
  185. package/lib/geometry/construction/IAutoMovieLoftRelief.d.ts +10 -0
  186. package/lib/geometry/construction/IAutoMovieViewPart.d.ts +9 -1
  187. package/lib/geometry/construction/faceAutoMovieSolidMesh.d.ts +3 -3
  188. package/lib/geometry/construction/faceAutoMovieSolidMesh.js +65 -16
  189. package/lib/geometry/construction/faceAutoMovieSolidMesh.js.map +1 -1
  190. package/lib/geometry/construction/fairAutoMovieSolidMesh.d.ts +45 -0
  191. package/lib/geometry/construction/fairAutoMovieSolidMesh.js +270 -0
  192. package/lib/geometry/construction/fairAutoMovieSolidMesh.js.map +1 -0
  193. package/lib/geometry/construction/gridAutoMovieSolidMesh.d.ts +18 -1
  194. package/lib/geometry/construction/gridAutoMovieSolidMesh.js +139 -7
  195. package/lib/geometry/construction/gridAutoMovieSolidMesh.js.map +1 -1
  196. package/lib/geometry/construction/index.d.ts +82 -2
  197. package/lib/geometry/construction/index.js +82 -2
  198. package/lib/geometry/construction/index.js.map +1 -1
  199. package/lib/geometry/construction/legalizeAutoMovieSolidMesh.d.ts +14 -1
  200. package/lib/geometry/construction/legalizeAutoMovieSolidMesh.js +26 -4
  201. package/lib/geometry/construction/legalizeAutoMovieSolidMesh.js.map +1 -1
  202. package/lib/geometry/construction/markAutoMovieConstructionCurves.d.ts +33 -0
  203. package/lib/geometry/construction/markAutoMovieConstructionCurves.js +51 -0
  204. package/lib/geometry/construction/markAutoMovieConstructionCurves.js.map +1 -0
  205. package/lib/geometry/construction/orientAutoMovieSolidChart.d.ts +1 -1
  206. package/lib/geometry/construction/orientAutoMovieSolidChart.js +28 -4
  207. package/lib/geometry/construction/orientAutoMovieSolidChart.js.map +1 -1
  208. package/lib/geometry/construction/probeAutoMovieSolidMesh.d.ts +11 -5
  209. package/lib/geometry/construction/probeAutoMovieSolidMesh.js +41 -28
  210. package/lib/geometry/construction/probeAutoMovieSolidMesh.js.map +1 -1
  211. package/lib/geometry/construction/realizeAutoMovieConstruction.js +45 -1
  212. package/lib/geometry/construction/realizeAutoMovieConstruction.js.map +1 -1
  213. package/lib/geometry/construction/sampleAutoMovieConstructionCurves.d.ts +31 -0
  214. package/lib/geometry/construction/sampleAutoMovieConstructionCurves.js +234 -0
  215. package/lib/geometry/construction/sampleAutoMovieConstructionCurves.js.map +1 -0
  216. package/lib/geometry/curve/index.d.ts +48 -25
  217. package/lib/geometry/curve/index.js +48 -25
  218. package/lib/geometry/curve/index.js.map +1 -1
  219. package/lib/geometry/extract/index.d.ts +0 -1
  220. package/lib/geometry/extract/index.js +0 -1
  221. package/lib/geometry/extract/index.js.map +1 -1
  222. package/lib/geometry/index.d.ts +87 -53
  223. package/lib/geometry/index.js +87 -50
  224. package/lib/geometry/index.js.map +1 -1
  225. package/lib/geometry/markAutoMovieMeshClearance.d.ts +32 -0
  226. package/lib/geometry/markAutoMovieMeshClearance.js +53 -0
  227. package/lib/geometry/markAutoMovieMeshClearance.js.map +1 -0
  228. package/lib/geometry/measureAutoMovieMeshDefects.d.ts +31 -0
  229. package/lib/geometry/measureAutoMovieMeshDefects.js +244 -0
  230. package/lib/geometry/measureAutoMovieMeshDefects.js.map +1 -0
  231. package/lib/geometry/sweep/index.d.ts +54 -15
  232. package/lib/geometry/sweep/index.js +54 -1
  233. package/lib/geometry/sweep/index.js.map +1 -1
  234. package/lib/index.d.ts +41 -450
  235. package/lib/index.js +41 -660
  236. package/lib/index.js.map +1 -1
  237. package/lib/kinematics/AutoMovieHumanoidDigitSurfaces.d.ts +36 -0
  238. package/lib/kinematics/AutoMovieHumanoidDigitSurfaces.js +67 -0
  239. package/lib/kinematics/AutoMovieHumanoidDigitSurfaces.js.map +1 -0
  240. package/lib/kinematics/AutoMovieHumanoidSurfaceExtents.d.ts +28 -0
  241. package/lib/kinematics/AutoMovieHumanoidSurfaceExtents.js +52 -0
  242. package/lib/kinematics/AutoMovieHumanoidSurfaceExtents.js.map +1 -0
  243. package/lib/kinematics/AutoMovieHumanoidSurfaceRays.d.ts +55 -0
  244. package/lib/kinematics/AutoMovieHumanoidSurfaceRays.js +191 -0
  245. package/lib/kinematics/AutoMovieHumanoidSurfaceRays.js.map +1 -0
  246. package/lib/kinematics/AutoMovieHumanoidSurfaceRegions.d.ts +49 -0
  247. package/lib/kinematics/AutoMovieHumanoidSurfaceRegions.js +147 -0
  248. package/lib/kinematics/AutoMovieHumanoidSurfaceRegions.js.map +1 -0
  249. package/lib/kinematics/IAutoMovieHingedArticulation.d.ts +17 -3
  250. package/lib/kinematics/IAutoMoviePoseRig.d.ts +31 -0
  251. package/lib/kinematics/IAutoMoviePoseRig.js +3 -0
  252. package/lib/kinematics/IAutoMoviePoseRig.js.map +1 -0
  253. package/lib/kinematics/IAutoMovieSwivelNear.d.ts +25 -0
  254. package/lib/kinematics/IAutoMovieSwivelNear.js +3 -0
  255. package/lib/kinematics/IAutoMovieSwivelNear.js.map +1 -0
  256. package/lib/kinematics/IAutoMovieSwivelSeed.d.ts +18 -0
  257. package/lib/kinematics/IAutoMovieSwivelSeed.js +3 -0
  258. package/lib/kinematics/IAutoMovieSwivelSeed.js.map +1 -0
  259. package/lib/kinematics/alternateRigJointAngles.d.ts +27 -0
  260. package/lib/kinematics/alternateRigJointAngles.js +34 -0
  261. package/lib/kinematics/alternateRigJointAngles.js.map +1 -0
  262. package/lib/kinematics/boxExcludedSwivels.d.ts +64 -0
  263. package/lib/kinematics/boxExcludedSwivels.js +187 -0
  264. package/lib/kinematics/boxExcludedSwivels.js.map +1 -0
  265. package/lib/kinematics/constants/HUMANOID_JOINT_AXES.d.ts +16 -2
  266. package/lib/kinematics/constants/HUMANOID_JOINT_AXES.js +19 -4
  267. package/lib/kinematics/constants/HUMANOID_JOINT_AXES.js.map +1 -1
  268. package/lib/kinematics/curlChainUntilContact.d.ts +16 -0
  269. package/lib/kinematics/curlChainUntilContact.js +45 -5
  270. package/lib/kinematics/curlChainUntilContact.js.map +1 -1
  271. package/lib/kinematics/decomposeJointRotation.d.ts +5 -2
  272. package/lib/kinematics/decomposeJointRotation.js +10 -131
  273. package/lib/kinematics/decomposeJointRotation.js.map +1 -1
  274. package/lib/kinematics/decomposeJointRotationOnBasis.d.ts +36 -0
  275. package/lib/kinematics/decomposeJointRotationOnBasis.js +228 -0
  276. package/lib/kinematics/decomposeJointRotationOnBasis.js.map +1 -0
  277. package/lib/kinematics/fitDigitDescent.d.ts +66 -0
  278. package/lib/kinematics/fitDigitDescent.js +142 -0
  279. package/lib/kinematics/fitDigitDescent.js.map +1 -0
  280. package/lib/kinematics/fitDigitToTarget.d.ts +125 -0
  281. package/lib/kinematics/fitDigitToTarget.js +251 -0
  282. package/lib/kinematics/fitDigitToTarget.js.map +1 -0
  283. package/lib/kinematics/hingedArmArticulation.d.ts +55 -7
  284. package/lib/kinematics/hingedArmArticulation.js +273 -84
  285. package/lib/kinematics/hingedArmArticulation.js.map +1 -1
  286. package/lib/kinematics/hingedArmSwivel.d.ts +141 -0
  287. package/lib/kinematics/hingedArmSwivel.js +196 -0
  288. package/lib/kinematics/hingedArmSwivel.js.map +1 -0
  289. package/lib/kinematics/index.d.ts +30 -7
  290. package/lib/kinematics/index.js +30 -5
  291. package/lib/kinematics/index.js.map +1 -1
  292. package/lib/kinematics/jointRomOvershoot.d.ts +13 -9
  293. package/lib/kinematics/jointRomOvershoot.js +21 -17
  294. package/lib/kinematics/jointRomOvershoot.js.map +1 -1
  295. package/lib/kinematics/jointToQuaternion.d.ts +2 -2
  296. package/lib/kinematics/jointToQuaternion.js +4 -19
  297. package/lib/kinematics/jointToQuaternion.js.map +1 -1
  298. package/lib/kinematics/jointToQuaternionOnBasis.d.ts +34 -0
  299. package/lib/kinematics/jointToQuaternionOnBasis.js +50 -0
  300. package/lib/kinematics/jointToQuaternionOnBasis.js.map +1 -0
  301. package/lib/kinematics/markAutoMovieBalance.d.ts +32 -0
  302. package/lib/kinematics/markAutoMovieBalance.js +65 -0
  303. package/lib/kinematics/markAutoMovieBalance.js.map +1 -0
  304. package/lib/kinematics/markAutoMovieRomOvershoot.d.ts +25 -0
  305. package/lib/kinematics/markAutoMovieRomOvershoot.js +43 -0
  306. package/lib/kinematics/markAutoMovieRomOvershoot.js.map +1 -0
  307. package/lib/kinematics/measureAutoMovieHumanoidBody.js +16 -5
  308. package/lib/kinematics/measureAutoMovieHumanoidBody.js.map +1 -1
  309. package/lib/kinematics/normalizeJointAxes.d.ts +15 -7
  310. package/lib/kinematics/normalizeJointAxes.js +52 -12
  311. package/lib/kinematics/normalizeJointAxes.js.map +1 -1
  312. package/lib/kinematics/poseJointCodec.d.ts +71 -0
  313. package/lib/kinematics/poseJointCodec.js +70 -0
  314. package/lib/kinematics/poseJointCodec.js.map +1 -0
  315. package/lib/kinematics/resolveAutoMovieBalanceOutcome.d.ts +112 -0
  316. package/lib/kinematics/resolveAutoMovieBalanceOutcome.js +168 -0
  317. package/lib/kinematics/resolveAutoMovieBalanceOutcome.js.map +1 -0
  318. package/lib/kinematics/resolveAutoMovieCenterOfMass.d.ts +29 -4
  319. package/lib/kinematics/resolveAutoMovieCenterOfMass.js +42 -8
  320. package/lib/kinematics/resolveAutoMovieCenterOfMass.js.map +1 -1
  321. package/lib/kinematics/resolveAutoMovieHumanoidRingModules.d.ts +75 -0
  322. package/lib/kinematics/resolveAutoMovieHumanoidRingModules.js +228 -0
  323. package/lib/kinematics/resolveAutoMovieHumanoidRingModules.js.map +1 -0
  324. package/lib/kinematics/resolveAutoMovieHumanoidSurfaces.d.ts +90 -10
  325. package/lib/kinematics/resolveAutoMovieHumanoidSurfaces.js +183 -258
  326. package/lib/kinematics/resolveAutoMovieHumanoidSurfaces.js.map +1 -1
  327. package/lib/kinematics/resolveAutoMovieMomentum.d.ts +112 -0
  328. package/lib/kinematics/resolveAutoMovieMomentum.js +153 -0
  329. package/lib/kinematics/resolveAutoMovieMomentum.js.map +1 -0
  330. package/lib/kinematics/swingTwistBasis.d.ts +108 -0
  331. package/lib/kinematics/swingTwistBasis.js +116 -0
  332. package/lib/kinematics/swingTwistBasis.js.map +1 -0
  333. package/lib/kinematics/swingTwistExcludedSwivels.d.ts +65 -0
  334. package/lib/kinematics/swingTwistExcludedSwivels.js +138 -0
  335. package/lib/kinematics/swingTwistExcludedSwivels.js.map +1 -0
  336. package/lib/kinematics/swingTwistRange.d.ts +246 -0
  337. package/lib/kinematics/swingTwistRange.js +322 -0
  338. package/lib/kinematics/swingTwistRange.js.map +1 -0
  339. package/lib/kinematics/swingTwistRegion.d.ts +50 -0
  340. package/lib/kinematics/swingTwistRegion.js +212 -0
  341. package/lib/kinematics/swingTwistRegion.js.map +1 -0
  342. package/lib/kinematics/swivelArcs.d.ts +166 -0
  343. package/lib/kinematics/swivelArcs.js +200 -0
  344. package/lib/kinematics/swivelArcs.js.map +1 -0
  345. package/lib/math/Quaternion.d.ts +29 -2
  346. package/lib/math/Quaternion.js +33 -2
  347. package/lib/math/Quaternion.js.map +1 -1
  348. package/lib/math/Transform.d.ts +50 -0
  349. package/lib/math/Transform.js +58 -0
  350. package/lib/math/Transform.js.map +1 -0
  351. package/lib/math/assignAutoMovieMinimumCost.d.ts +18 -0
  352. package/lib/math/assignAutoMovieMinimumCost.js +86 -0
  353. package/lib/math/assignAutoMovieMinimumCost.js.map +1 -0
  354. package/lib/math/bracketedBisection.d.ts +33 -0
  355. package/lib/math/bracketedBisection.js +52 -0
  356. package/lib/math/bracketedBisection.js.map +1 -0
  357. package/lib/math/bracketedRoot.d.ts +32 -0
  358. package/lib/math/bracketedRoot.js +76 -0
  359. package/lib/math/bracketedRoot.js.map +1 -0
  360. package/lib/math/constants/index.d.ts +1 -0
  361. package/lib/math/constants/index.js +18 -0
  362. package/lib/math/constants/index.js.map +1 -0
  363. package/lib/math/index.d.ts +64 -5
  364. package/lib/math/index.js +64 -5
  365. package/lib/math/index.js.map +1 -1
  366. package/lib/math/nearestAngleAlias.d.ts +27 -0
  367. package/lib/math/nearestAngleAlias.js +44 -0
  368. package/lib/math/nearestAngleAlias.js.map +1 -0
  369. package/lib/math/solveAutoMovieHalfPlaneProgram.d.ts +68 -0
  370. package/lib/math/solveAutoMovieHalfPlaneProgram.js +199 -0
  371. package/lib/math/solveAutoMovieHalfPlaneProgram.js.map +1 -0
  372. package/lib/math/tetrahedralizeAutoMovieDelaunay.d.ts +82 -0
  373. package/lib/math/tetrahedralizeAutoMovieDelaunay.js +187 -0
  374. package/lib/math/tetrahedralizeAutoMovieDelaunay.js.map +1 -0
  375. package/lib/measureAutoMovieGeometryReach.js +2 -4
  376. package/lib/measureAutoMovieGeometryReach.js.map +1 -1
  377. package/lib/motion/AirborneTakeoffLinear.d.ts +22 -0
  378. package/lib/motion/AirborneTakeoffLinear.js +58 -0
  379. package/lib/motion/AirborneTakeoffLinear.js.map +1 -0
  380. package/lib/motion/IAutoMovieCrowdAgent.d.ts +113 -0
  381. package/lib/motion/IAutoMovieCrowdAgent.js +3 -0
  382. package/lib/motion/IAutoMovieCrowdAgent.js.map +1 -0
  383. package/lib/motion/IAutoMovieSeededChainFit.d.ts +32 -0
  384. package/lib/motion/IAutoMovieSeededChainFit.js +3 -0
  385. package/lib/motion/IAutoMovieSeededChainFit.js.map +1 -0
  386. package/lib/motion/IAutoMovieSolvedChainPlant.d.ts +20 -0
  387. package/lib/motion/IFitChainToTargetProps.d.ts +59 -0
  388. package/lib/motion/MotionTrajectoryStepper.d.ts +100 -0
  389. package/lib/motion/MotionTrajectoryStepper.js +357 -0
  390. package/lib/motion/MotionTrajectoryStepper.js.map +1 -0
  391. package/lib/motion/basisOf.d.ts +18 -0
  392. package/lib/motion/basisOf.js +25 -0
  393. package/lib/motion/basisOf.js.map +1 -0
  394. package/lib/motion/carriedAcceleration.d.ts +43 -0
  395. package/lib/motion/carriedAcceleration.js +55 -0
  396. package/lib/motion/carriedAcceleration.js.map +1 -0
  397. package/lib/motion/carriedRate.d.ts +48 -0
  398. package/lib/motion/carriedRate.js +60 -0
  399. package/lib/motion/carriedRate.js.map +1 -0
  400. package/lib/motion/constants/PLANT_RESIDUAL_EPSILON.d.ts +10 -0
  401. package/lib/motion/constants/PLANT_RESIDUAL_EPSILON.js +14 -0
  402. package/lib/motion/constants/PLANT_RESIDUAL_EPSILON.js.map +1 -0
  403. package/lib/motion/constants/index.d.ts +1 -0
  404. package/lib/motion/constants/index.js +1 -0
  405. package/lib/motion/constants/index.js.map +1 -1
  406. package/lib/motion/fitChainBend.d.ts +23 -0
  407. package/lib/motion/fitChainBend.js +293 -0
  408. package/lib/motion/fitChainBend.js.map +1 -0
  409. package/lib/motion/fitChainToTarget.d.ts +11 -13
  410. package/lib/motion/fitChainToTarget.js +12 -283
  411. package/lib/motion/fitChainToTarget.js.map +1 -1
  412. package/lib/motion/fitHingedChainCandidate.d.ts +16 -4
  413. package/lib/motion/fitHingedChainCandidate.js +186 -76
  414. package/lib/motion/fitHingedChainCandidate.js.map +1 -1
  415. package/lib/motion/fitHingedRotationError.d.ts +31 -0
  416. package/lib/motion/fitHingedRotationError.js +107 -0
  417. package/lib/motion/fitHingedRotationError.js.map +1 -0
  418. package/lib/motion/fitSeededChainToTarget.d.ts +20 -0
  419. package/lib/motion/fitSeededChainToTarget.js +32 -0
  420. package/lib/motion/fitSeededChainToTarget.js.map +1 -0
  421. package/lib/motion/gaitMotion.js +7 -13
  422. package/lib/motion/gaitMotion.js.map +1 -1
  423. package/lib/motion/gestureMotion.js +2 -5
  424. package/lib/motion/gestureMotion.js.map +1 -1
  425. package/lib/motion/importedNodeClipToAutoMovieMotion.js +6 -9
  426. package/lib/motion/importedNodeClipToAutoMovieMotion.js.map +1 -1
  427. package/lib/motion/index.d.ts +40 -9
  428. package/lib/motion/index.js +40 -12
  429. package/lib/motion/index.js.map +1 -1
  430. package/lib/motion/inertializeOffset.d.ts +15 -2
  431. package/lib/motion/inertializeOffset.js +16 -3
  432. package/lib/motion/inertializeOffset.js.map +1 -1
  433. package/lib/motion/inertializePose.d.ts +36 -13
  434. package/lib/motion/inertializePose.js +122 -43
  435. package/lib/motion/inertializePose.js.map +1 -1
  436. package/lib/motion/integrateAirborneRotation.d.ts +151 -0
  437. package/lib/motion/integrateAirborneRotation.js +204 -0
  438. package/lib/motion/integrateAirborneRotation.js.map +1 -0
  439. package/lib/motion/integrateMotionTrajectory.d.ts +117 -0
  440. package/lib/motion/integrateMotionTrajectory.js +156 -0
  441. package/lib/motion/integrateMotionTrajectory.js.map +1 -0
  442. package/lib/motion/orientChainEffector.d.ts +1 -1
  443. package/lib/motion/orientChainEffector.js +15 -7
  444. package/lib/motion/orientChainEffector.js.map +1 -1
  445. package/lib/motion/resolveHydrodynamicForce.d.ts +85 -0
  446. package/lib/motion/resolveHydrodynamicForce.js +100 -0
  447. package/lib/motion/resolveHydrodynamicForce.js.map +1 -0
  448. package/lib/motion/sampleMotion.js +2 -5
  449. package/lib/motion/sampleMotion.js.map +1 -1
  450. package/lib/motion/samplePoseVelocity.d.ts +76 -13
  451. package/lib/motion/samplePoseVelocity.js +126 -38
  452. package/lib/motion/samplePoseVelocity.js.map +1 -1
  453. package/lib/motion/smoothMinimum.d.ts +29 -0
  454. package/lib/motion/smoothMinimum.js +40 -0
  455. package/lib/motion/smoothMinimum.js.map +1 -0
  456. package/lib/motion/solveAirborneTakeoff.d.ts +150 -0
  457. package/lib/motion/solveAirborneTakeoff.js +324 -0
  458. package/lib/motion/solveAirborneTakeoff.js.map +1 -0
  459. package/lib/motion/solveDistalTwist.d.ts +62 -0
  460. package/lib/motion/solveDistalTwist.js +152 -0
  461. package/lib/motion/solveDistalTwist.js.map +1 -0
  462. package/lib/motion/speedProfile.d.ts +175 -0
  463. package/lib/motion/speedProfile.js +261 -0
  464. package/lib/motion/speedProfile.js.map +1 -0
  465. package/lib/motion/splitDistalTwist.d.ts +12 -17
  466. package/lib/motion/splitDistalTwist.js +37 -40
  467. package/lib/motion/splitDistalTwist.js.map +1 -1
  468. package/lib/motion/steerAutoMovieCrowd.d.ts +74 -0
  469. package/lib/motion/steerAutoMovieCrowd.js +249 -0
  470. package/lib/motion/steerAutoMovieCrowd.js.map +1 -0
  471. package/lib/motion/steerAutoMovieCrowdGeometry.d.ts +241 -0
  472. package/lib/motion/steerAutoMovieCrowdGeometry.js +470 -0
  473. package/lib/motion/steerAutoMovieCrowdGeometry.js.map +1 -0
  474. package/lib/perform/index.d.ts +10 -0
  475. package/lib/perform/index.js +10 -0
  476. package/lib/perform/index.js.map +1 -1
  477. package/lib/physics/AutoMovieAir.d.ts +21 -0
  478. package/lib/physics/AutoMovieAir.js +26 -0
  479. package/lib/physics/AutoMovieAir.js.map +1 -0
  480. package/lib/physics/AutoMovieGravity.d.ts +22 -0
  481. package/lib/physics/AutoMovieGravity.js +30 -0
  482. package/lib/physics/AutoMovieGravity.js.map +1 -0
  483. package/lib/physics/IAutoMovieHit.d.ts +11 -7
  484. package/lib/physics/IAutoMovieProjectile.d.ts +65 -6
  485. package/lib/physics/IAutoMovieProjectileState.d.ts +6 -4
  486. package/lib/physics/admitMotionGeometry.js +12 -0
  487. package/lib/physics/admitMotionGeometry.js.map +1 -1
  488. package/lib/physics/bindPhysicalWorld.js +16 -4
  489. package/lib/physics/bindPhysicalWorld.js.map +1 -1
  490. package/lib/physics/combinePhysicalMassProperties.d.ts +2 -1
  491. package/lib/physics/combinePhysicalMassProperties.js +8 -90
  492. package/lib/physics/combinePhysicalMassProperties.js.map +1 -1
  493. package/lib/physics/deriveCenterOfMass.js +2 -5
  494. package/lib/physics/deriveCenterOfMass.js.map +1 -1
  495. package/lib/physics/derivePhysicalProfile.js +7 -5
  496. package/lib/physics/derivePhysicalProfile.js.map +1 -1
  497. package/lib/physics/index.d.ts +155 -2
  498. package/lib/physics/index.js +155 -2
  499. package/lib/physics/index.js.map +1 -1
  500. package/lib/physics/markAutoMovieSkeleton.d.ts +33 -0
  501. package/lib/physics/markAutoMovieSkeleton.js +62 -0
  502. package/lib/physics/markAutoMovieSkeleton.js.map +1 -0
  503. package/lib/physics/physicalHullErode.d.ts +25 -0
  504. package/lib/physics/physicalHullErode.js +54 -0
  505. package/lib/physics/physicalHullErode.js.map +1 -0
  506. package/lib/physics/physicalHullFaces.d.ts +56 -0
  507. package/lib/physics/physicalHullFaces.js +151 -0
  508. package/lib/physics/physicalHullFaces.js.map +1 -0
  509. package/lib/physics/physicalHullMass.d.ts +32 -0
  510. package/lib/physics/physicalHullMass.js +80 -0
  511. package/lib/physics/physicalHullMass.js.map +1 -0
  512. package/lib/physics/physicalHullNearest.d.ts +37 -0
  513. package/lib/physics/physicalHullNearest.js +178 -0
  514. package/lib/physics/physicalHullNearest.js.map +1 -0
  515. package/lib/physics/physicalHullSegment.d.ts +34 -0
  516. package/lib/physics/physicalHullSegment.js +276 -0
  517. package/lib/physics/physicalHullSegment.js.map +1 -0
  518. package/lib/physics/physicalInertiaTensor.d.ts +28 -0
  519. package/lib/physics/physicalInertiaTensor.js +58 -0
  520. package/lib/physics/physicalInertiaTensor.js.map +1 -0
  521. package/lib/physics/physicalNativeShape.d.ts +1 -1
  522. package/lib/physics/physicalNativeShape.js +15 -4
  523. package/lib/physics/physicalNativeShape.js.map +1 -1
  524. package/lib/physics/physicalPrincipalAxes.d.ts +28 -0
  525. package/lib/physics/physicalPrincipalAxes.js +96 -0
  526. package/lib/physics/physicalPrincipalAxes.js.map +1 -0
  527. package/lib/physics/physicalShapeBounds.d.ts +2 -1
  528. package/lib/physics/physicalShapeBounds.js +26 -2
  529. package/lib/physics/physicalShapeBounds.js.map +1 -1
  530. package/lib/physics/physicalShapeNearest.d.ts +70 -0
  531. package/lib/physics/physicalShapeNearest.js +201 -0
  532. package/lib/physics/physicalShapeNearest.js.map +1 -0
  533. package/lib/physics/physicalShapeNormal.d.ts +26 -0
  534. package/lib/physics/physicalShapeNormal.js +70 -0
  535. package/lib/physics/physicalShapeNormal.js.map +1 -0
  536. package/lib/physics/physicalShapePairDistance.d.ts +32 -0
  537. package/lib/physics/physicalShapePairDistance.js +124 -0
  538. package/lib/physics/physicalShapePairDistance.js.map +1 -0
  539. package/lib/physics/physicalShapeSegmentDistance.d.ts +16 -20
  540. package/lib/physics/physicalShapeSegmentDistance.js +18 -70
  541. package/lib/physics/physicalShapeSegmentDistance.js.map +1 -1
  542. package/lib/physics/physicalShapeSpan.d.ts +21 -0
  543. package/lib/physics/physicalShapeSpan.js +55 -0
  544. package/lib/physics/physicalShapeSpan.js.map +1 -0
  545. package/lib/physics/physicalShapeSurfaceAnchor.d.ts +1 -1
  546. package/lib/physics/physicalShapeSurfaceAnchor.js +24 -5
  547. package/lib/physics/physicalShapeSurfaceAnchor.js.map +1 -1
  548. package/lib/physics/projectileAt.d.ts +14 -12
  549. package/lib/physics/projectileAt.js +46 -16
  550. package/lib/physics/projectileAt.js.map +1 -1
  551. package/lib/physics/projectileContinue.d.ts +114 -0
  552. package/lib/physics/projectileContinue.js +189 -0
  553. package/lib/physics/projectileContinue.js.map +1 -0
  554. package/lib/physics/projectileDragFlight.d.ts +72 -0
  555. package/lib/physics/projectileDragFlight.js +166 -0
  556. package/lib/physics/projectileDragFlight.js.map +1 -0
  557. package/lib/physics/projectileFirstContact.d.ts +105 -0
  558. package/lib/physics/projectileFirstContact.js +174 -0
  559. package/lib/physics/projectileFirstContact.js.map +1 -0
  560. package/lib/physics/projectileTrajectory.js +3 -2
  561. package/lib/physics/projectileTrajectory.js.map +1 -1
  562. package/lib/physics/solveBallisticLaunch.js +2 -1
  563. package/lib/physics/solveBallisticLaunch.js.map +1 -1
  564. package/lib/physics/solveMovingLaunch.js +2 -1
  565. package/lib/physics/solveMovingLaunch.js.map +1 -1
  566. package/lib/physics/validatePhysicalProfile.js +18 -1
  567. package/lib/physics/validatePhysicalProfile.js.map +1 -1
  568. package/lib/populationRuntime/index.d.ts +6 -0
  569. package/lib/populationRuntime/index.js +6 -0
  570. package/lib/populationRuntime/index.js.map +1 -1
  571. package/lib/populationRuntime/materializeCompiledFormation.js +2 -5
  572. package/lib/populationRuntime/materializeCompiledFormation.js.map +1 -1
  573. package/lib/random/index.d.ts +1 -1
  574. package/lib/random/index.js +1 -0
  575. package/lib/random/index.js.map +1 -1
  576. package/lib/render/index.d.ts +20 -11
  577. package/lib/render/index.js +20 -11
  578. package/lib/render/index.js.map +1 -1
  579. package/lib/resolve/index.d.ts +7 -2
  580. package/lib/resolve/index.js +7 -5
  581. package/lib/resolve/index.js.map +1 -1
  582. package/lib/resolve/lowerSkeletonNodes.js +3 -10
  583. package/lib/resolve/lowerSkeletonNodes.js.map +1 -1
  584. package/lib/rom/clampJointRom.d.ts +11 -3
  585. package/lib/rom/clampJointRom.js +43 -3
  586. package/lib/rom/clampJointRom.js.map +1 -1
  587. package/lib/rom/clampJointToSkeleton.d.ts +25 -2
  588. package/lib/rom/clampJointToSkeleton.js +39 -8
  589. package/lib/rom/clampJointToSkeleton.js.map +1 -1
  590. package/lib/rom/constants/ANKLE_DORSIFLEXION.d.ts +18 -0
  591. package/lib/rom/constants/ANKLE_DORSIFLEXION.js +22 -0
  592. package/lib/rom/constants/ANKLE_DORSIFLEXION.js.map +1 -0
  593. package/lib/rom/constants/DEFAULT_HUMANOID_ROM.d.ts +28 -0
  594. package/lib/rom/constants/DEFAULT_HUMANOID_ROM.js +129 -39
  595. package/lib/rom/constants/DEFAULT_HUMANOID_ROM.js.map +1 -1
  596. package/lib/rom/constants/ROM_TOLERANCE.d.ts +8 -0
  597. package/lib/rom/constants/ROM_TOLERANCE.js +12 -0
  598. package/lib/rom/constants/ROM_TOLERANCE.js.map +1 -0
  599. package/lib/rom/constants/index.d.ts +2 -0
  600. package/lib/rom/constants/index.js +2 -0
  601. package/lib/rom/constants/index.js.map +1 -1
  602. package/lib/rom/index.d.ts +1 -0
  603. package/lib/rom/index.js +1 -0
  604. package/lib/rom/index.js.map +1 -1
  605. package/lib/rom/scanJointRom.d.ts +62 -0
  606. package/lib/rom/scanJointRom.js +117 -0
  607. package/lib/rom/scanJointRom.js.map +1 -0
  608. package/lib/rom/validateJointRom.d.ts +4 -2
  609. package/lib/rom/validateJointRom.js +23 -45
  610. package/lib/rom/validateJointRom.js.map +1 -1
  611. package/lib/service/index.d.ts +9 -0
  612. package/lib/service/index.js +9 -0
  613. package/lib/service/index.js.map +1 -1
  614. package/lib/soft/IAutoMovieSoftBodyBoundarySample.d.ts +2 -0
  615. package/lib/soft/IAutoMovieSoftBodyObserver.d.ts +30 -0
  616. package/lib/soft/IAutoMovieSoftBodyObserver.js +3 -0
  617. package/lib/soft/IAutoMovieSoftBodyObserver.js.map +1 -0
  618. package/lib/soft/applySoftBodyFriction.d.ts +34 -0
  619. package/lib/soft/applySoftBodyFriction.js +52 -0
  620. package/lib/soft/applySoftBodyFriction.js.map +1 -0
  621. package/lib/soft/index.d.ts +22 -0
  622. package/lib/soft/index.js +22 -0
  623. package/lib/soft/index.js.map +1 -1
  624. package/lib/soft/projectSoftCordSelfContact.d.ts +53 -0
  625. package/lib/soft/projectSoftCordSelfContact.js +172 -0
  626. package/lib/soft/projectSoftCordSelfContact.js.map +1 -0
  627. package/lib/soft/simulateSoftBodyCore.d.ts +6 -3
  628. package/lib/soft/simulateSoftBodyCore.js +108 -16
  629. package/lib/soft/simulateSoftBodyCore.js.map +1 -1
  630. package/lib/soft/simulateSoftBodyWithBoundaries.d.ts +3 -2
  631. package/lib/soft/simulateSoftBodyWithBoundaries.js +10 -3
  632. package/lib/soft/simulateSoftBodyWithBoundaries.js.map +1 -1
  633. package/lib/soft/softBodyBudget.js +7 -0
  634. package/lib/soft/softBodyBudget.js.map +1 -1
  635. package/lib/soft/softBodyHeldLoads.d.ts +34 -0
  636. package/lib/soft/softBodyHeldLoads.js +69 -0
  637. package/lib/soft/softBodyHeldLoads.js.map +1 -0
  638. package/lib/soft/solveSoftBodyCompliantSweep.d.ts +48 -0
  639. package/lib/soft/solveSoftBodyCompliantSweep.js +86 -0
  640. package/lib/soft/solveSoftBodyCompliantSweep.js.map +1 -0
  641. package/lib/soft/validateSoftAnchors.d.ts +24 -0
  642. package/lib/soft/validateSoftAnchors.js +74 -0
  643. package/lib/soft/validateSoftAnchors.js.map +1 -0
  644. package/lib/soft/validateSoftBodyDomain.js +6 -48
  645. package/lib/soft/validateSoftBodyDomain.js.map +1 -1
  646. package/lib/soft/validateSoftBounded.d.ts +20 -0
  647. package/lib/soft/validateSoftBounded.js +27 -0
  648. package/lib/soft/validateSoftBounded.js.map +1 -0
  649. package/lib/soft/validateSoftCompliance.d.ts +30 -0
  650. package/lib/soft/validateSoftCompliance.js +54 -0
  651. package/lib/soft/validateSoftCompliance.js.map +1 -0
  652. package/lib/sound/index.d.ts +2 -0
  653. package/lib/sound/index.js +2 -0
  654. package/lib/sound/index.js.map +1 -1
  655. package/lib/text/index.d.ts +1 -0
  656. package/lib/text/index.js +1 -0
  657. package/lib/text/index.js.map +1 -1
  658. package/lib/validation/AffordanceArticulation.d.ts +69 -0
  659. package/lib/validation/AffordanceArticulation.js +142 -0
  660. package/lib/validation/AffordanceArticulation.js.map +1 -0
  661. package/lib/validation/affordanceFollowedTravel.d.ts +19 -0
  662. package/lib/validation/affordanceFollowedTravel.js +43 -0
  663. package/lib/validation/affordanceFollowedTravel.js.map +1 -0
  664. package/lib/validation/affordanceLeadingTravel.d.ts +21 -0
  665. package/lib/validation/affordanceLeadingTravel.js +99 -0
  666. package/lib/validation/affordanceLeadingTravel.js.map +1 -0
  667. package/lib/validation/affordanceTravelRange.d.ts +21 -0
  668. package/lib/validation/affordanceTravelRange.js +39 -0
  669. package/lib/validation/affordanceTravelRange.js.map +1 -0
  670. package/lib/validation/appendShotEventsArtifact.js +12 -0
  671. package/lib/validation/appendShotEventsArtifact.js.map +1 -1
  672. package/lib/validation/constants/index.d.ts +3 -3
  673. package/lib/validation/constants/index.js +3 -3
  674. package/lib/validation/constants/index.js.map +1 -1
  675. package/lib/validation/detectFreeFall.js +2 -1
  676. package/lib/validation/detectFreeFall.js.map +1 -1
  677. package/lib/validation/index.d.ts +52 -4
  678. package/lib/validation/index.js +52 -6
  679. package/lib/validation/index.js.map +1 -1
  680. package/lib/validation/markAutoMovieSlip.d.ts +26 -0
  681. package/lib/validation/markAutoMovieSlip.js +52 -0
  682. package/lib/validation/markAutoMovieSlip.js.map +1 -0
  683. package/lib/validation/validateAffordance.d.ts +3 -3
  684. package/lib/validation/validateAffordance.js +21 -3
  685. package/lib/validation/validateAffordance.js.map +1 -1
  686. package/lib/validation/validateAffordanceArticulation.d.ts +19 -0
  687. package/lib/validation/validateAffordanceArticulation.js +183 -0
  688. package/lib/validation/validateAffordanceArticulation.js.map +1 -0
  689. package/lib/validation/validateBalanceSupport.d.ts +1 -2
  690. package/lib/validation/validateBalanceSupport.js.map +1 -1
  691. package/lib/validation/validateBody.d.ts +2 -2
  692. package/lib/validation/validateBody.js +27 -3
  693. package/lib/validation/validateBody.js.map +1 -1
  694. package/lib/validation/validateFootSkate.d.ts +1 -2
  695. package/lib/validation/validateFootSkate.js.map +1 -1
  696. package/lib/validation/validateGroundContact.d.ts +1 -2
  697. package/lib/validation/validateGroundContact.js.map +1 -1
  698. package/lib/validation/validateJointConstraint.d.ts +1 -1
  699. package/lib/validation/validateJointConstraint.js +9 -1
  700. package/lib/validation/validateJointConstraint.js.map +1 -1
  701. package/lib/validation/validateModel.js +2 -0
  702. package/lib/validation/validateModel.js.map +1 -1
  703. package/lib/validation/validateSelfIntersection.d.ts +1 -2
  704. package/lib/validation/validateSelfIntersection.js.map +1 -1
  705. package/lib/worldBlock.js +6 -9
  706. package/lib/worldBlock.js.map +1 -1
  707. package/package.json +6 -6
  708. package/src/IAutoMovieFormationPlacement.ts +4 -3
  709. package/src/analysis/index.ts +5 -0
  710. package/src/anthropometry/AutoMovieHandAnthropometry.ts +65 -0
  711. package/src/anthropometry/index.ts +1 -0
  712. package/src/architecture/appendBuiltRegionDefects.ts +3 -3
  713. package/src/architecture/builtOutlineIsClosed.ts +3 -3
  714. package/{lib/architecture/constants/PLANAR_EPSILON.d.ts → src/architecture/constants/BUILT_PLANAR_EPSILON.ts} +1 -1
  715. package/src/architecture/constants/index.ts +1 -1
  716. package/src/architecture/index.ts +157 -117
  717. package/src/cache/index.ts +9 -0
  718. package/src/composition/AutoMovieComposition.ts +34 -7
  719. package/src/composition/AutoMovieScheduleCut.ts +141 -0
  720. package/src/composition/AutoMovieScheduleError.ts +108 -0
  721. package/src/composition/AutoMovieSchedulePlace.ts +253 -0
  722. package/src/composition/AutoMovieScheduleWalk.ts +215 -0
  723. package/src/composition/IAutoMovieIntent.ts +9 -7
  724. package/src/composition/index.ts +12 -7
  725. package/src/composition/markAutoMovieContacts.ts +79 -0
  726. package/src/composition/resolveAutoMovieContactEvents.ts +160 -19
  727. package/src/composition/resolveAutoMovieMutualGoal.ts +146 -72
  728. package/src/composition/resolveAutoMovieSchedule.ts +106 -145
  729. package/src/constants/index.ts +2 -0
  730. package/src/createAutoMovieGeometryActorReader.ts +2 -1
  731. package/src/describeAutoMovieInstanceSetSubject.ts +2 -5
  732. package/src/drawing/index.ts +12 -0
  733. package/src/effectRuntime/index.ts +7 -0
  734. package/src/film/compileAttach.ts +2 -5
  735. package/src/film/compileLaunch.ts +5 -4
  736. package/src/film/constants/index.ts +3 -0
  737. package/src/film/index.ts +61 -6
  738. package/src/film/propAnchorFrame.ts +3 -6
  739. package/src/film/stageScene.ts +3 -10
  740. package/src/film/staging/index.ts +11 -0
  741. package/src/film/staging/lowerLightPlacement.ts +3 -7
  742. package/src/formationSlotPosition.ts +54 -7
  743. package/src/geometry/IAutoMovieMark.ts +115 -0
  744. package/src/geometry/IAutoMovieMeshDefect.ts +39 -0
  745. package/src/geometry/constants/index.ts +2 -0
  746. package/src/geometry/construction/AutoMovieConstructionAdmission.ts +98 -13
  747. package/src/geometry/construction/AutoMovieConstructionBridgeRealize.ts +172 -0
  748. package/src/geometry/construction/AutoMovieConstructionContinuationRealize.ts +3 -0
  749. package/src/geometry/construction/AutoMovieConstructionPortRealize.ts +48 -16
  750. package/src/geometry/construction/AutoMovieConstructionSeeds.ts +54 -10
  751. package/src/geometry/construction/AutoMovieConstructionSplitBand.ts +509 -15
  752. package/src/geometry/construction/AutoMovieConstructionSplitRealize.ts +278 -0
  753. package/src/geometry/construction/AutoMovieConstructionSplitSeam.ts +50 -18
  754. package/src/geometry/construction/AutoMovieConstructionState.ts +13 -0
  755. package/src/geometry/construction/AutoMovieLoftCapRead.ts +3 -2
  756. package/src/geometry/construction/AutoMovieLoftCapSource.ts +34 -1
  757. package/src/geometry/construction/AutoMovieLoftJet.ts +10 -5
  758. package/src/geometry/construction/AutoMovieLoftPoint.ts +13 -4
  759. package/src/geometry/construction/AutoMovieLoftRelief.ts +42 -0
  760. package/src/geometry/construction/AutoMovieLoftViewRead.ts +34 -6
  761. package/src/geometry/construction/AutoMovieLoftViewSource.ts +4 -2
  762. package/src/geometry/construction/AutoMovieNaturalSpline.ts +44 -0
  763. package/src/geometry/construction/AutoMovieSolidBlendChain.ts +34 -20
  764. package/src/geometry/construction/AutoMovieSolidBodyMerge.ts +2 -0
  765. package/src/geometry/construction/AutoMovieSolidClip.ts +341 -54
  766. package/src/geometry/construction/AutoMovieSolidCycle.ts +104 -26
  767. package/src/geometry/construction/AutoMovieSolidIntersectionWalk.ts +100 -50
  768. package/src/geometry/construction/AutoMovieSolidJoin.ts +48 -2
  769. package/src/geometry/construction/AutoMovieSolidMeshConstraints.ts +35 -3
  770. package/src/geometry/construction/AutoMovieSolidMeshLoop.ts +55 -4
  771. package/src/geometry/construction/AutoMovieSolidMeshPlan.ts +79 -34
  772. package/src/geometry/construction/AutoMovieSolidRail.ts +124 -22
  773. package/src/geometry/construction/AutoMovieSolidRailSolve.ts +116 -25
  774. package/src/geometry/construction/AutoMovieViewLoft.ts +9 -0
  775. package/src/geometry/construction/IAutoMovieConstructionCurve.ts +42 -0
  776. package/src/geometry/construction/IAutoMovieLoftChain.ts +7 -0
  777. package/src/geometry/construction/IAutoMovieLoftRelief.ts +11 -0
  778. package/src/geometry/construction/IAutoMovieViewPart.ts +10 -1
  779. package/src/geometry/construction/faceAutoMovieSolidMesh.ts +76 -15
  780. package/src/geometry/construction/fairAutoMovieSolidMesh.ts +252 -0
  781. package/src/geometry/construction/gridAutoMovieSolidMesh.ts +173 -8
  782. package/src/geometry/construction/index.ts +82 -2
  783. package/src/geometry/construction/legalizeAutoMovieSolidMesh.ts +28 -2
  784. package/src/geometry/construction/markAutoMovieConstructionCurves.ts +58 -0
  785. package/src/geometry/construction/orientAutoMovieSolidChart.ts +32 -7
  786. package/src/geometry/construction/probeAutoMovieSolidMesh.ts +52 -30
  787. package/src/geometry/construction/realizeAutoMovieConstruction.ts +47 -5
  788. package/src/geometry/construction/sampleAutoMovieConstructionCurves.ts +307 -0
  789. package/src/geometry/curve/index.ts +48 -25
  790. package/src/geometry/extract/index.ts +0 -1
  791. package/src/geometry/index.ts +87 -53
  792. package/src/geometry/markAutoMovieMeshClearance.ts +69 -0
  793. package/src/geometry/measureAutoMovieMeshDefects.ts +327 -0
  794. package/src/geometry/sweep/index.ts +54 -15
  795. package/src/index.ts +41 -450
  796. package/src/kinematics/AutoMovieHumanoidDigitSurfaces.ts +110 -0
  797. package/src/kinematics/AutoMovieHumanoidSurfaceExtents.ts +81 -0
  798. package/src/kinematics/AutoMovieHumanoidSurfaceRays.ts +286 -0
  799. package/src/kinematics/AutoMovieHumanoidSurfaceRegions.ts +189 -0
  800. package/src/kinematics/IAutoMovieHingedArticulation.ts +21 -3
  801. package/src/kinematics/IAutoMoviePoseRig.ts +39 -0
  802. package/src/kinematics/IAutoMovieSwivelNear.ts +26 -0
  803. package/src/kinematics/IAutoMovieSwivelSeed.ts +19 -0
  804. package/src/kinematics/alternateRigJointAngles.ts +41 -0
  805. package/src/kinematics/boxExcludedSwivels.ts +260 -0
  806. package/src/kinematics/constants/HUMANOID_JOINT_AXES.ts +19 -4
  807. package/src/kinematics/curlChainUntilContact.ts +35 -8
  808. package/src/kinematics/decomposeJointRotation.ts +15 -178
  809. package/src/kinematics/decomposeJointRotationOnBasis.ts +310 -0
  810. package/src/kinematics/fitDigitDescent.ts +253 -0
  811. package/src/kinematics/fitDigitToTarget.ts +425 -0
  812. package/src/kinematics/hingedArmArticulation.ts +402 -116
  813. package/src/kinematics/hingedArmSwivel.ts +295 -0
  814. package/src/kinematics/index.ts +30 -12
  815. package/src/kinematics/jointRomOvershoot.ts +30 -19
  816. package/src/kinematics/jointToQuaternion.ts +8 -43
  817. package/src/kinematics/jointToQuaternionOnBasis.ts +84 -0
  818. package/src/kinematics/markAutoMovieBalance.ts +75 -0
  819. package/src/kinematics/markAutoMovieRomOvershoot.ts +52 -0
  820. package/src/kinematics/measureAutoMovieHumanoidBody.ts +31 -9
  821. package/src/kinematics/normalizeJointAxes.ts +66 -12
  822. package/src/kinematics/poseJointCodec.ts +148 -0
  823. package/src/kinematics/resolveAutoMovieBalanceOutcome.ts +293 -0
  824. package/src/kinematics/resolveAutoMovieCenterOfMass.ts +63 -10
  825. package/src/kinematics/resolveAutoMovieHumanoidRingModules.ts +434 -0
  826. package/src/kinematics/resolveAutoMovieHumanoidSurfaces.ts +230 -356
  827. package/src/kinematics/resolveAutoMovieMomentum.ts +253 -0
  828. package/src/kinematics/swingTwistBasis.ts +162 -0
  829. package/src/kinematics/swingTwistExcludedSwivels.ts +204 -0
  830. package/src/kinematics/swingTwistRange.ts +460 -0
  831. package/src/kinematics/swingTwistRegion.ts +298 -0
  832. package/src/kinematics/swivelArcs.ts +245 -0
  833. package/src/math/Quaternion.ts +42 -2
  834. package/src/math/Transform.ts +65 -0
  835. package/src/math/assignAutoMovieMinimumCost.ts +86 -0
  836. package/src/math/bracketedBisection.ts +51 -0
  837. package/src/math/bracketedRoot.ts +72 -0
  838. package/src/math/constants/index.ts +1 -0
  839. package/src/math/index.ts +64 -5
  840. package/src/math/nearestAngleAlias.ts +43 -0
  841. package/src/math/solveAutoMovieHalfPlaneProgram.ts +288 -0
  842. package/src/math/tetrahedralizeAutoMovieDelaunay.ts +264 -0
  843. package/src/measureAutoMovieGeometryReach.ts +2 -4
  844. package/src/motion/AirborneTakeoffLinear.ts +70 -0
  845. package/src/motion/IAutoMovieCrowdAgent.ts +121 -0
  846. package/src/motion/IAutoMovieSeededChainFit.ts +32 -0
  847. package/src/motion/IAutoMovieSolvedChainPlant.ts +20 -0
  848. package/src/motion/IFitChainToTargetProps.ts +67 -0
  849. package/src/motion/MotionTrajectoryStepper.ts +478 -0
  850. package/src/motion/basisOf.ts +29 -0
  851. package/src/motion/carriedAcceleration.ts +56 -0
  852. package/src/motion/carriedRate.ts +61 -0
  853. package/src/motion/constants/PLANT_RESIDUAL_EPSILON.ts +10 -0
  854. package/src/motion/constants/index.ts +1 -0
  855. package/src/motion/fitChainBend.ts +491 -0
  856. package/src/motion/fitChainToTarget.ts +13 -485
  857. package/src/motion/fitHingedChainCandidate.ts +281 -148
  858. package/src/motion/fitHingedRotationError.ts +164 -0
  859. package/src/motion/fitSeededChainToTarget.ts +34 -0
  860. package/src/motion/gaitMotion.ts +6 -10
  861. package/src/motion/gestureMotion.ts +2 -5
  862. package/src/motion/importedNodeClipToAutoMovieMotion.ts +3 -6
  863. package/src/motion/index.ts +40 -9
  864. package/src/motion/inertializeOffset.ts +16 -2
  865. package/src/motion/inertializePose.ts +158 -53
  866. package/src/motion/integrateAirborneRotation.ts +334 -0
  867. package/src/motion/integrateMotionTrajectory.ts +309 -0
  868. package/src/motion/orientChainEffector.ts +19 -13
  869. package/src/motion/resolveHydrodynamicForce.ts +143 -0
  870. package/src/motion/sampleMotion.ts +2 -5
  871. package/src/motion/samplePoseVelocity.ts +168 -41
  872. package/src/motion/smoothMinimum.ts +36 -0
  873. package/src/motion/solveAirborneTakeoff.ts +471 -0
  874. package/src/motion/solveDistalTwist.ts +256 -0
  875. package/src/motion/speedProfile.ts +470 -0
  876. package/src/motion/splitDistalTwist.ts +55 -64
  877. package/src/motion/steerAutoMovieCrowd.ts +381 -0
  878. package/src/motion/steerAutoMovieCrowdGeometry.ts +592 -0
  879. package/src/perform/index.ts +10 -0
  880. package/src/physics/AutoMovieAir.ts +22 -0
  881. package/src/physics/AutoMovieGravity.ts +28 -0
  882. package/src/physics/IAutoMovieHit.ts +13 -7
  883. package/src/physics/IAutoMovieProjectile.ts +82 -6
  884. package/src/physics/IAutoMovieProjectileState.ts +10 -4
  885. package/src/physics/admitMotionGeometry.ts +16 -0
  886. package/src/physics/bindPhysicalWorld.ts +22 -11
  887. package/src/physics/combinePhysicalMassProperties.ts +9 -117
  888. package/src/physics/deriveCenterOfMass.ts +2 -5
  889. package/src/physics/derivePhysicalProfile.ts +3 -1
  890. package/src/physics/index.ts +155 -2
  891. package/src/physics/markAutoMovieSkeleton.ts +69 -0
  892. package/src/physics/physicalHullErode.ts +72 -0
  893. package/src/physics/physicalHullFaces.ts +215 -0
  894. package/src/physics/physicalHullMass.ts +99 -0
  895. package/src/physics/physicalHullNearest.ts +210 -0
  896. package/src/physics/physicalHullSegment.ts +338 -0
  897. package/src/physics/physicalInertiaTensor.ts +75 -0
  898. package/src/physics/physicalNativeShape.ts +31 -9
  899. package/src/physics/physicalPrincipalAxes.ts +114 -0
  900. package/src/physics/physicalShapeBounds.ts +24 -2
  901. package/src/physics/physicalShapeNearest.ts +287 -0
  902. package/src/physics/physicalShapeNormal.ts +105 -0
  903. package/src/physics/physicalShapePairDistance.ts +153 -0
  904. package/src/physics/physicalShapeSegmentDistance.ts +18 -92
  905. package/src/physics/physicalShapeSpan.ts +75 -0
  906. package/src/physics/physicalShapeSurfaceAnchor.ts +33 -14
  907. package/src/physics/projectileAt.ts +61 -20
  908. package/src/physics/projectileContinue.ts +287 -0
  909. package/src/physics/projectileDragFlight.ts +208 -0
  910. package/src/physics/projectileFirstContact.ts +286 -0
  911. package/src/physics/projectileTrajectory.ts +6 -5
  912. package/src/physics/solveBallisticLaunch.ts +2 -1
  913. package/src/physics/solveMovingLaunch.ts +2 -1
  914. package/src/physics/validatePhysicalProfile.ts +20 -1
  915. package/src/populationRuntime/index.ts +6 -0
  916. package/src/populationRuntime/materializeCompiledFormation.ts +3 -6
  917. package/src/random/index.ts +1 -1
  918. package/src/render/index.ts +20 -11
  919. package/src/resolve/index.ts +7 -2
  920. package/src/resolve/lowerSkeletonNodes.ts +3 -10
  921. package/src/rom/clampJointRom.ts +59 -2
  922. package/src/rom/clampJointToSkeleton.ts +52 -15
  923. package/src/rom/constants/ANKLE_DORSIFLEXION.ts +20 -0
  924. package/src/rom/constants/DEFAULT_HUMANOID_ROM.ts +148 -37
  925. package/src/rom/constants/ROM_TOLERANCE.ts +8 -0
  926. package/src/rom/constants/index.ts +2 -0
  927. package/src/rom/index.ts +1 -0
  928. package/src/rom/scanJointRom.ts +169 -0
  929. package/src/rom/validateJointRom.ts +69 -74
  930. package/src/service/index.ts +9 -0
  931. package/src/soft/IAutoMovieSoftBodyBoundarySample.ts +3 -0
  932. package/src/soft/IAutoMovieSoftBodyObserver.ts +36 -0
  933. package/src/soft/applySoftBodyFriction.ts +65 -0
  934. package/src/soft/index.ts +22 -0
  935. package/src/soft/projectSoftCordSelfContact.ts +239 -0
  936. package/src/soft/simulateSoftBodyCore.ts +127 -15
  937. package/src/soft/simulateSoftBodyWithBoundaries.ts +16 -2
  938. package/src/soft/softBodyBudget.ts +11 -0
  939. package/src/soft/softBodyHeldLoads.ts +85 -0
  940. package/src/soft/solveSoftBodyCompliantSweep.ts +107 -0
  941. package/src/soft/validateSoftAnchors.ts +143 -0
  942. package/src/soft/validateSoftBodyDomain.ts +5 -124
  943. package/src/soft/validateSoftBounded.ts +42 -0
  944. package/src/soft/validateSoftCompliance.ts +102 -0
  945. package/src/sound/index.ts +2 -0
  946. package/src/text/index.ts +1 -0
  947. package/src/validation/AffordanceArticulation.ts +173 -0
  948. package/src/validation/affordanceFollowedTravel.ts +40 -0
  949. package/src/validation/affordanceLeadingTravel.ts +108 -0
  950. package/src/validation/affordanceTravelRange.ts +42 -0
  951. package/src/validation/appendShotEventsArtifact.ts +26 -0
  952. package/src/validation/constants/index.ts +3 -3
  953. package/src/validation/detectFreeFall.ts +3 -2
  954. package/src/validation/index.ts +52 -4
  955. package/src/validation/markAutoMovieSlip.ts +65 -0
  956. package/src/validation/validateAffordance.ts +38 -3
  957. package/src/validation/validateAffordanceArticulation.ts +311 -0
  958. package/src/validation/validateBalanceSupport.ts +2 -5
  959. package/src/validation/validateBody.ts +80 -3
  960. package/src/validation/validateFootSkate.ts +1 -1
  961. package/src/validation/validateGroundContact.ts +2 -5
  962. package/src/validation/validateJointConstraint.ts +19 -1
  963. package/src/validation/validateModel.ts +7 -0
  964. package/src/validation/validateSelfIntersection.ts +2 -5
  965. package/src/worldBlock.ts +3 -6
  966. package/lib/architecture/constants/PLANAR_EPSILON.js.map +0 -1
@@ -0,0 +1,228 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.decomposeJointRotationOnBasis = void 0;
4
+ const Quaternion_1 = require("../math/Quaternion");
5
+ const Vector3_1 = require("../math/Vector3");
6
+ const nearestAngleAlias_1 = require("../math/nearestAngleAlias");
7
+ const toClinicalAngle_1 = require("../rom/toClinicalAngle");
8
+ const alternateRigJointAngles_1 = require("./alternateRigJointAngles");
9
+ const jointRomOvershoot_1 = require("./jointRomOvershoot");
10
+ const RAD2DEG = 180 / Math.PI;
11
+ const QUATERNION_AXES = ["x", "y", "z", "w"];
12
+ /**
13
+ * Projected cosine at or below which the gimbal convention pins one outer
14
+ * angle: the square root of the binary64 unit roundoff, about 1.5e-8.
15
+ *
16
+ * With a projected cosine `c`, the two outer angles are read from matrix
17
+ * entries of size `c` that carry a rounding error of about one unit roundoff
18
+ * `e`, so each is uncertain by about `e / c` radians; pinning one of them to
19
+ * zero instead rebuilds the rotation within `c` times the pinned angle. The
20
+ * two errors meet at `c = sqrt(e)`, the usual balance of a rounding against a
21
+ * truncation error, where both are near 1e-8 radian. A narrower band leaves
22
+ * turns whose outer angles are rounding noise, tens of degrees at `c` near
23
+ * 1e-15, which a caller that holds one of the two (a hinge's immobile
24
+ * abduction clamped to zero) then shows as a rotation error of that size: an
25
+ * elbow held at a right angle read a different forearm twist every call.
26
+ * Resolvable near-gimbal turns, from about a millionth of a degree off the
27
+ * right angle, stay active.
28
+ */
29
+ const GIMBAL_COSINE_EPSILON = Math.sqrt(Number.EPSILON);
30
+ const assertFiniteQuaternion = (q) => {
31
+ for (const axis of QUATERNION_AXES) {
32
+ const value = q[axis];
33
+ if (!Number.isFinite(value))
34
+ throw new Error(`decomposeJointRotation quaternion.${axis} must be finite, but was ${value}`);
35
+ }
36
+ };
37
+ /**
38
+ * {@link decomposeJointRotation} on a basis its caller already admitted and
39
+ * normalized through {@link normalizeJointAxes}: the extraction itself, with
40
+ * no validation of the basis.
41
+ *
42
+ * A solver that decomposes hundreds of candidate rotations of one joint
43
+ * normalizes that joint's basis once and calls this for each candidate, so
44
+ * the basis is checked once per solve rather than once per candidate. The
45
+ * angles, the gimbal convention, the handedness correction, the frame lift
46
+ * and the chart choice are `decomposeJointRotation`'s, which documents them
47
+ * and is this function behind one normalization.
48
+ *
49
+ * Throws on a non-finite quaternion component. A basis that is not
50
+ * orthonormal gives angles that do not rebuild the rotation; nothing here
51
+ * detects it.
52
+ *
53
+ * @param q Bone-local articulation rotation; unit length expected.
54
+ * @param basis Orthonormal clinical axis basis, as `normalizeJointAxes` returns it.
55
+ * @param frame Rest frame lifting rest-relative angles to clinical ones;
56
+ * omitted, the angles stay rest-relative.
57
+ * @param domain Bone and resolved ROM that choose among equivalent charts;
58
+ * omitted or with a `null` constraint, the principal chart is returned.
59
+ *
60
+ * @evidence contracts/development/common.md#meaningful-documentation States what the caller must have done to the basis, why the split exists, that the conventions are `decomposeJointRotation`'s, what is thrown and what an unnormalized basis silently gives.
61
+ * @evidence contracts/development/implementation.md#principled-implementation Closed-form Euler extraction reads each angle's sine and projected cosine through atan2; a projected cosine within the square root of the binary64 unit roundoff, where a rounding error and the pin's truncation error meet, takes the undetermined-angle convention. Among the principal chart, the alternate chart and each angle's full-turn alias nearest its range, the least ROM overshoot wins, and every candidate is the same rotation. A constraint's `swingTwist` is set aside while the readings are ranked, since both readings of one rotation lie equally inside such a gate; the three-angle box ranks them, so the reading a pose reports stays the one it always was.
62
+ * @evidence contracts/development/implementation.md#clear-and-simple-structure The extraction, the handedness correction, the clinical lift and the chart choice sit in one inverse because each depends on the others' convention; ROM scoring is delegated to `jointRomOvershoot`, the alias to `nearestAngleAlias` and frame arithmetic to `toClinicalAngle`, and `decomposeJointRotation` is this function behind one normalization.
63
+ * @evidence contracts/development/implementation.md#prohibited-implementation-shortcuts Selection compares the caller's unchanged constraint and never clamps an angle into range; the gimbal pin is the standard convention for an undetermined pair, and no bone is special-cased.
64
+ * @evidence contracts/development/implementation.md#efficient-algorithms Three vector rotations, a few dot products and at most three overshoot scores in constant time, an alias that leaves the selected reading unchanged not scored again; taking the basis already normalized removes one validation and normalization from each of the hundreds of candidates a limb fit decomposes.
65
+ * @evidence contracts/development/implementation.md#reuse-equivalent-work The caller normalizes a joint's basis once per solve and passes it to every call, which is the reason this entry exists beside `decomposeJointRotation`.
66
+ * @evidenceExclude contracts/development/implementation.md#bound-retention-and-release-resources Retains nothing; the angles are a new record.
67
+ */
68
+ const decomposeJointRotationOnBasis = (q, basis, frame, domain) => {
69
+ assertFiniteQuaternion(q);
70
+ // Lift a rig-relative extraction into clinical angles (the inverse of
71
+ // jointToQuaternion's `frame` map); the identity when no frame is given.
72
+ const clinical = (rig) => ({
73
+ // toClinicalAngle only returns null for a null input; these are numbers.
74
+ flexion: (0, toClinicalAngle_1.toClinicalAngle)(rig.flexion, frame?.flexion),
75
+ abduction: (0, toClinicalAngle_1.toClinicalAngle)(rig.abduction, frame?.abduction),
76
+ twist: (0, toClinicalAngle_1.toClinicalAngle)(rig.twist, frame?.twist),
77
+ });
78
+ // Right-handedness of the basis: +1 when flex × abd = +twist. A left-handed
79
+ // triple is made right-handed by extracting against −twist, then negating the
80
+ // recovered twist (a rotation about −t by θ is one about t by −θ).
81
+ const { handed, twistAxis } = handednessOf(basis);
82
+ const lift = (rig) => {
83
+ const principal = clinical(rig);
84
+ if (domain === undefined || domain.constraint === null)
85
+ return principal;
86
+ // The two readings are ranked by the three-angle box even for a joint
87
+ // gated by swing and twist, under which both readings of one rotation are
88
+ // equally inside: the choice is of a reading, the one a pose reports in,
89
+ // and stays the one it always was.
90
+ const constraint = boxOf(domain.constraint);
91
+ const align = (candidate) => ({
92
+ flexion: (0, nearestAngleAlias_1.nearestAngleAlias)(candidate.flexion, constraint.flexion),
93
+ abduction: (0, nearestAngleAlias_1.nearestAngleAlias)(candidate.abduction, constraint.abduction),
94
+ twist: (0, nearestAngleAlias_1.nearestAngleAlias)(candidate.twist, constraint.twist),
95
+ });
96
+ const alternate = clinical((0, alternateRigJointAngles_1.alternateRigJointAngles)(rig, basis.twistPlacement, handed));
97
+ let selected = principal;
98
+ let overshoot = (0, jointRomOvershoot_1.jointRomOvershoot)({ bone: domain.bone, ...selected }, constraint);
99
+ for (const candidate of [align(principal), align(alternate)]) {
100
+ // A reading the alias leaves as the one selected scores the same, so
101
+ // it cannot be strictly better and is not scored again.
102
+ if (Object.is(candidate.flexion, selected.flexion) &&
103
+ Object.is(candidate.abduction, selected.abduction) &&
104
+ Object.is(candidate.twist, selected.twist))
105
+ continue;
106
+ const next = (0, jointRomOvershoot_1.jointRomOvershoot)({ bone: domain.bone, ...candidate }, constraint);
107
+ if (next < overshoot) {
108
+ selected = candidate;
109
+ overshoot = next;
110
+ }
111
+ }
112
+ return selected;
113
+ };
114
+ const Rf = Quaternion_1.Quaternion.rotateVector(q, basis.flexion);
115
+ const Ra = Quaternion_1.Quaternion.rotateVector(q, basis.abduction);
116
+ const Rt = Quaternion_1.Quaternion.rotateVector(q, twistAxis);
117
+ // Entries of R' = Mᵀ R M (M = [flex|abd|twist]): R'[i][j] = axisᵢ · (R axisⱼ).
118
+ if (basis.twistPlacement === "distal") {
119
+ // R = Ry(a)·Rx(f)·Rz(t): R12 = −sin f, R02 = sin a cos f, R22 = cos a cos f,
120
+ // R10 = cos f sin t, R11 = cos f cos t (row i: basis axis i, column j:
121
+ // basis axis j rotated)
122
+ const r12 = Vector3_1.Vector3.dot(basis.abduction, Rt);
123
+ const r10 = Vector3_1.Vector3.dot(basis.abduction, Rf);
124
+ const r11 = Vector3_1.Vector3.dot(basis.abduction, Ra);
125
+ const cosine = Math.hypot(r10, r11);
126
+ if (cosine <= GIMBAL_COSINE_EPSILON) {
127
+ // with abduction pinned to 0, R = Rx(±90°)·Rz(t): R00 = cos t, R01 = −sin t
128
+ const r00 = Vector3_1.Vector3.dot(basis.flexion, Rf);
129
+ const r01 = Vector3_1.Vector3.dot(basis.flexion, Ra);
130
+ return lift({
131
+ flexion: r12 < 0 ? 90 : -90,
132
+ abduction: 0,
133
+ twist: handed * Math.atan2(-r01, r00) * RAD2DEG,
134
+ });
135
+ }
136
+ return lift({
137
+ flexion: Math.atan2(-r12, cosine) * RAD2DEG,
138
+ abduction: Math.atan2(Vector3_1.Vector3.dot(basis.flexion, Rt), Vector3_1.Vector3.dot(twistAxis, Rt)) *
139
+ RAD2DEG,
140
+ twist: handed * Math.atan2(r10, r11) * RAD2DEG,
141
+ });
142
+ }
143
+ const m00 = Vector3_1.Vector3.dot(basis.flexion, Rf);
144
+ const m10 = Vector3_1.Vector3.dot(basis.abduction, Rf);
145
+ const m20 = Vector3_1.Vector3.dot(twistAxis, Rf);
146
+ const m21 = Vector3_1.Vector3.dot(twistAxis, Ra);
147
+ const m22 = Vector3_1.Vector3.dot(twistAxis, Rt);
148
+ const cosine = Math.hypot(m00, m10);
149
+ if (cosine <= GIMBAL_COSINE_EPSILON) {
150
+ // Gimbal: abduction = ±90°, flexion folds into twist. Pin flexion = 0.
151
+ const m01 = Vector3_1.Vector3.dot(basis.flexion, Ra);
152
+ const m11 = Vector3_1.Vector3.dot(basis.abduction, Ra);
153
+ // Both gimbals leave only (twist ± flexion) determined; with flexion pinned
154
+ // to 0, twist = −atan2(R'[0][1], R'[1][1]) reconstructs the rotation.
155
+ const abduction = m20 < 0 ? 90 : -90;
156
+ const twist = -Math.atan2(m01, m11) * RAD2DEG;
157
+ return lift({ flexion: 0, abduction, twist: handed * twist });
158
+ }
159
+ return lift({
160
+ flexion: Math.atan2(m21, m22) * RAD2DEG,
161
+ abduction: Math.atan2(-m20, cosine) * RAD2DEG,
162
+ twist: handed * Math.atan2(m10, m00) * RAD2DEG,
163
+ });
164
+ };
165
+ exports.decomposeJointRotationOnBasis = decomposeJointRotationOnBasis;
166
+ /** Each basis's handedness, remembered with the components it was read from. */
167
+ const HANDEDNESS = new WeakMap();
168
+ /** A basis's nine components, flexion, abduction and twist, each x, y, z. */
169
+ const componentsOf = (basis) => [
170
+ basis.flexion.x,
171
+ basis.flexion.y,
172
+ basis.flexion.z,
173
+ basis.abduction.x,
174
+ basis.abduction.y,
175
+ basis.abduction.z,
176
+ basis.twist.x,
177
+ basis.twist.y,
178
+ basis.twist.z,
179
+ ];
180
+ /**
181
+ * A basis's handedness and signed twist axis, read once per basis record
182
+ * while it holds the components it was read from (compared exactly), so the
183
+ * hundreds of candidates a limb fit decomposes through one basis share it.
184
+ */
185
+ const handednessOf = (basis) => {
186
+ const now = componentsOf(basis);
187
+ const known = HANDEDNESS.get(basis);
188
+ if (known !== undefined &&
189
+ known.values.every((v, i) => Object.is(v, now[i])))
190
+ return known.read;
191
+ // Right-handedness of the basis: +1 when flex × abd = +twist. A left-handed
192
+ // triple is made right-handed by extracting against −twist, then negating the
193
+ // recovered twist (a rotation about −t by θ is one about t by −θ).
194
+ const handed = Vector3_1.Vector3.dot(basis.twist, Vector3_1.Vector3.cross(basis.flexion, basis.abduction)) >= 0
195
+ ? 1
196
+ : -1;
197
+ const read = {
198
+ handed,
199
+ twistAxis: Vector3_1.Vector3.scale(basis.twist, handed),
200
+ };
201
+ HANDEDNESS.set(basis, { values: now, read });
202
+ return read;
203
+ };
204
+ /** Each gated constraint's copy without its swing-twist gate. */
205
+ const BOXES = new WeakMap();
206
+ /**
207
+ * A constraint as the readings are ranked by: itself, or for one gated by
208
+ * swing and twist a copy with that gate set aside, the copy remembered per
209
+ * constraint and returned only while every other member is still the one it
210
+ * was copied from.
211
+ */
212
+ const boxOf = (constraint) => {
213
+ if (constraint.swingTwist === undefined || constraint.swingTwist === null)
214
+ return constraint;
215
+ const known = BOXES.get(constraint);
216
+ if (known !== undefined) {
217
+ const keys = Object.keys(constraint);
218
+ const same = keys.length === Object.keys(known).length &&
219
+ keys.every((key) => key === "swingTwist" ||
220
+ Object.is(known[key], constraint[key]));
221
+ if (same)
222
+ return known;
223
+ }
224
+ const box = { ...constraint, swingTwist: null };
225
+ BOXES.set(constraint, box);
226
+ return box;
227
+ };
228
+ //# sourceMappingURL=decomposeJointRotationOnBasis.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"decomposeJointRotationOnBasis.js","sourceRoot":"","sources":["../../src/kinematics/decomposeJointRotationOnBasis.ts"],"names":[],"mappings":";;;AAOA,mDAAgD;AAChD,6CAA0C;AAC1C,iEAA8D;AAE9D,4DAAyD;AAGzD,uEAAoE;AACpE,2DAAwD;AAExD,MAAM,OAAO,GAAW,GAAG,GAAG,IAAI,CAAC,EAAE,CAAC;AAEtC,MAAM,eAAe,GAAkC,CAAC,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,CAAC,CAAC;AAE5E;;;;;;;;;;;;;;;;GAgBG;AACH,MAAM,qBAAqB,GAAW,IAAI,CAAC,IAAI,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC;AAEhE,MAAM,sBAAsB,GAAsC,CAChE,CAAuB,EACjB,EAAE;IACR,KAAK,MAAM,IAAI,IAAI,eAAe,EAAE,CAAC;QACnC,MAAM,KAAK,GAAW,CAAC,CAAC,IAAI,CAAC,CAAC;QAC9B,IAAI,CAAC,MAAM,CAAC,QAAQ,CAAC,KAAK,CAAC;YACzB,MAAM,IAAI,KAAK,CACb,qCAAqC,IAAI,4BAA4B,KAAK,EAAE,CAC7E,CAAC;IACN,CAAC;AACH,CAAC,CAAC;AAEF;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA8BG;AACI,MAAM,6BAA6B,GAKL,CACnC,CAAuB,EACvB,KAA0B,EAC1B,KAA2B,EAC3B,MAAsC,EACP,EAAE;IACjC,sBAAsB,CAA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AAE,OAAO,KAAK,CAAC;IACzB,CAAC;IACD,MAAM,GAAG,GAA8B,EAAE,GAAG,UAAU,EAAE,UAAU,EAAE,IAAI,EAAE,CAAC;IAC3E,KAAK,CAAC,GAAG,CAAC,UAAU,EAAE,GAAG,CAAC,CAAC;IAC3B,OAAO,GAAG,CAAC;AACb,CAAC,CAAC"}
@@ -0,0 +1,66 @@
1
+ /**
2
+ * One prioritized descent of a digit's fit: a primary residual (where the
3
+ * point goes) met first, and a secondary one (how it is turned, how its
4
+ * joints couple) bettered only in what the primary leaves free, inside the
5
+ * range the projection keeps.
6
+ *
7
+ * Each step is the damped least-squares step of the primary task, h1 =
8
+ * -(J1'J1 + mu I)^-1 J1'r1, plus the secondary task's damped step taken in
9
+ * the primary's damped null space, N = I - (J1'J1 + mu I)^-1 J1'J1, so the
10
+ * secondary moves only what leaves the primary where it is to first order:
11
+ * the task-priority inverse kinematics of Nakamura, Hanafusa and Yoshikawa
12
+ * 1987 ("Task-priority based redundancy control of robot manipulators",
13
+ * IJRR 6(2):3-15) in the damped form of Chiaverini 1997 ("Singularity-robust
14
+ * task-priority redundancy resolution", IEEE TRA 13(3):398-410). A variable
15
+ * standing on a bound its descent pushes against (the projection undoes a
16
+ * resolution's move along the negative gradient) is held for the step, the
17
+ * active set of a projected Newton method (Bertsekas 1982); the gradient is
18
+ * the primary's while the primary is unmet, so the secondary never holds a
19
+ * joint the primary needs.
20
+ *
21
+ * A trial is accepted lexicographically: while the primary is unmet, only
22
+ * when it lowers the primary; once met (within the effector's motion for one
23
+ * resolution step of every joint, `tolerance`), when it keeps the primary met
24
+ * and lowers the secondary. The damping follows Levenberg-Marquardt with
25
+ * Nielsen's update at its bounds (Madsen, Nielsen and Tingleff 2004,
26
+ * Algorithm 3.16, tau = 1e-3): a third on an accepted step, a doubling growth
27
+ * on a rejected one, so the steps shrink until the descent stops, when the
28
+ * step it would take moves no variable by more than `step`.
29
+ *
30
+ * @param props The start, the residuals, the projection, the resolution and the primary's tolerance.
31
+ * @returns The variables where the descent stops, projected.
32
+ *
33
+ * @evidence contracts/development/common.md#meaningful-documentation States the two tasks, the step's form and its sources, the active set, the lexicographic acceptance, the damping and the stop.
34
+ * @evidence contracts/development/implementation.md#principled-implementation Damped task-priority least squares (Nakamura et al. 1987, Chiaverini 1997) with a projected Newton active set (Bertsekas 1982) and Levenberg-Marquardt damping (Madsen, Nielsen and Tingleff 2004).
35
+ * @evidence contracts/development/implementation.md#clear-and-simple-structure One loop: Jacobians, active set, primary step, null-space secondary step, acceptance.
36
+ * @evidence contracts/development/implementation.md#prohibited-implementation-shortcuts No iteration count and no weight between the tasks: the primary is never traded for the secondary, and the descent stops at the resolution.
37
+ * @evidence contracts/development/implementation.md#efficient-algorithms Two residual evaluations per variable per Jacobian and two small dense solves per step, the variables at most a digit's nine.
38
+ * @evidenceExclude contracts/development/implementation.md#reuse-equivalent-work A pure function of its input; the caller keeps the result.
39
+ * @evidenceExclude contracts/development/implementation.md#bound-retention-and-release-resources Retains nothing.
40
+ */
41
+ export declare function fitDigitDescent(props: fitDigitDescent.IProps): number[];
42
+ /**
43
+ * Companion of {@link fitDigitDescent}.
44
+ *
45
+ * @evidence contracts/development/common.md#meaningful-documentation Documents each member's meaning and unit.
46
+ * @evidence contracts/development/design.md#principled-representation The two tasks as residual functions of the variables, the projection into the range, the resolution and the primary's tolerance.
47
+ * @evidence contracts/development/design.md#minimal-and-owned-surface What one descent reads.
48
+ * @evidence contracts/development/design.md#prohibited-design-shortcuts Plain functions of number arrays; no rig type leaks in.
49
+ */
50
+ export declare namespace fitDigitDescent {
51
+ /** What one descent reads. */
52
+ interface IProps {
53
+ /** The start, the variables' values. */
54
+ start: readonly number[];
55
+ /** The primary residual, metres. */
56
+ primary: (x: readonly number[]) => number[];
57
+ /** The secondary residual, metres; empty when there is none. */
58
+ secondary: (x: readonly number[]) => number[];
59
+ /** The variables projected into their range. */
60
+ project: (x: readonly number[]) => number[];
61
+ /** The variables' resolution: the finite-difference step and the stop. */
62
+ step: number;
63
+ /** The primary residual's length at which the primary counts as met, at `x` with its Jacobian. */
64
+ tolerance: (x: readonly number[], J1: readonly (readonly number[])[]) => number;
65
+ }
66
+ }
@@ -0,0 +1,142 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.fitDigitDescent = fitDigitDescent;
4
+ const AutoMovieSolidVector_1 = require("../geometry/construction/AutoMovieSolidVector");
5
+ /**
6
+ * One prioritized descent of a digit's fit: a primary residual (where the
7
+ * point goes) met first, and a secondary one (how it is turned, how its
8
+ * joints couple) bettered only in what the primary leaves free, inside the
9
+ * range the projection keeps.
10
+ *
11
+ * Each step is the damped least-squares step of the primary task, h1 =
12
+ * -(J1'J1 + mu I)^-1 J1'r1, plus the secondary task's damped step taken in
13
+ * the primary's damped null space, N = I - (J1'J1 + mu I)^-1 J1'J1, so the
14
+ * secondary moves only what leaves the primary where it is to first order:
15
+ * the task-priority inverse kinematics of Nakamura, Hanafusa and Yoshikawa
16
+ * 1987 ("Task-priority based redundancy control of robot manipulators",
17
+ * IJRR 6(2):3-15) in the damped form of Chiaverini 1997 ("Singularity-robust
18
+ * task-priority redundancy resolution", IEEE TRA 13(3):398-410). A variable
19
+ * standing on a bound its descent pushes against (the projection undoes a
20
+ * resolution's move along the negative gradient) is held for the step, the
21
+ * active set of a projected Newton method (Bertsekas 1982); the gradient is
22
+ * the primary's while the primary is unmet, so the secondary never holds a
23
+ * joint the primary needs.
24
+ *
25
+ * A trial is accepted lexicographically: while the primary is unmet, only
26
+ * when it lowers the primary; once met (within the effector's motion for one
27
+ * resolution step of every joint, `tolerance`), when it keeps the primary met
28
+ * and lowers the secondary. The damping follows Levenberg-Marquardt with
29
+ * Nielsen's update at its bounds (Madsen, Nielsen and Tingleff 2004,
30
+ * Algorithm 3.16, tau = 1e-3): a third on an accepted step, a doubling growth
31
+ * on a rejected one, so the steps shrink until the descent stops, when the
32
+ * step it would take moves no variable by more than `step`.
33
+ *
34
+ * @param props The start, the residuals, the projection, the resolution and the primary's tolerance.
35
+ * @returns The variables where the descent stops, projected.
36
+ *
37
+ * @evidence contracts/development/common.md#meaningful-documentation States the two tasks, the step's form and its sources, the active set, the lexicographic acceptance, the damping and the stop.
38
+ * @evidence contracts/development/implementation.md#principled-implementation Damped task-priority least squares (Nakamura et al. 1987, Chiaverini 1997) with a projected Newton active set (Bertsekas 1982) and Levenberg-Marquardt damping (Madsen, Nielsen and Tingleff 2004).
39
+ * @evidence contracts/development/implementation.md#clear-and-simple-structure One loop: Jacobians, active set, primary step, null-space secondary step, acceptance.
40
+ * @evidence contracts/development/implementation.md#prohibited-implementation-shortcuts No iteration count and no weight between the tasks: the primary is never traded for the secondary, and the descent stops at the resolution.
41
+ * @evidence contracts/development/implementation.md#efficient-algorithms Two residual evaluations per variable per Jacobian and two small dense solves per step, the variables at most a digit's nine.
42
+ * @evidenceExclude contracts/development/implementation.md#reuse-equivalent-work A pure function of its input; the caller keeps the result.
43
+ * @evidenceExclude contracts/development/implementation.md#bound-retention-and-release-resources Retains nothing.
44
+ */
45
+ function fitDigitDescent(props) {
46
+ const { primary, secondary, project, step } = props;
47
+ const n = props.start.length;
48
+ const jacobian = (f, x) => {
49
+ const columns = x.map((_v, i) => {
50
+ const up = [...x];
51
+ const down = [...x];
52
+ up[i] = up[i] + step;
53
+ down[i] = down[i] - step;
54
+ const a = f(up);
55
+ const b = f(down);
56
+ return a.map((v, k) => (v - b[k]) / (2 * step));
57
+ });
58
+ return columns[0].map((_r, k) => columns.map((c) => c[k]));
59
+ };
60
+ const squared = (r) => r.reduce((sum, v) => sum + v * v, 0);
61
+ const gram = (J, at) => at.map((i) => at.map((j) => J.reduce((s, row) => s + row[i] * row[j], 0)));
62
+ const times = (J, at, r) => at.map((i) => J.reduce((s, row, k) => s + row[i] * r[k], 0));
63
+ const damped = (A, mu) => A.map((row, i) => row.map((v, j) => (i === j ? v + mu : v)));
64
+ let x = project(props.start);
65
+ let r1 = primary(x);
66
+ let r2 = secondary(x);
67
+ let J1 = jacobian(primary, x);
68
+ let J2 = r2.length === 0 ? [] : jacobian(secondary, x);
69
+ const all = Array.from({ length: n }, (_, i) => i);
70
+ let mu = TAU *
71
+ Math.max(...all.map((i) => gram(J1, [i])[0][0] + (J2.length === 0 ? 0 : gram(J2, [i])[0][0])));
72
+ let nu = 2;
73
+ for (;;) {
74
+ // The active set, by the gradient of the task being served: the
75
+ // primary's while it is unmet, so a bound the secondary pushes against
76
+ // never holds a joint the primary needs; the whole residual's once met.
77
+ const met = props.tolerance(x, J1);
78
+ const served = Math.sqrt(squared(r1)) <= met;
79
+ const g = all.map((i) => times(J1, [i], r1)[0] +
80
+ (J2.length === 0 || !served ? 0 : times(J2, [i], r2)[0]));
81
+ const free = all.filter((i) => {
82
+ if (g[i] === 0)
83
+ return true;
84
+ const probe = [...x];
85
+ probe[i] = x[i] - Math.sign(g[i]) * step;
86
+ return Math.abs(project(probe)[i] - x[i]) >= step / 2;
87
+ });
88
+ if (free.length === 0)
89
+ break;
90
+ // The primary's damped step and its damped null space.
91
+ const A1 = damped(gram(J1, free), mu);
92
+ const h1 = AutoMovieSolidVector_1.AutoMovieSolidVector.solve(A1, times(J1, free, r1).map((v) => -v));
93
+ if (h1 === null)
94
+ break;
95
+ let h = h1;
96
+ if (J2.length !== 0) {
97
+ const G = gram(J1, free);
98
+ const P = free.map((_c, c) => AutoMovieSolidVector_1.AutoMovieSolidVector.solve(A1, G.map((row) => row[c])));
99
+ if (P.some((col) => col === null))
100
+ break;
101
+ // N = I - P, P's columns solved above.
102
+ const N = free.map((_r, a) => free.map((_c, c) => (a === c ? 1 : 0) - P[c][a]));
103
+ const J2f = J2.map((row) => free.map((i) => row[i]));
104
+ const M = J2f.map((row) => free.map((_c, c) => row.reduce((s, v, a) => s + v * N[a][c], 0)));
105
+ const b = J2f.map((row, k) => r2[k] +
106
+ row.reduce((s, v, a) => s + v * h1[a], 0));
107
+ const local = free.map((_v, a) => a);
108
+ const z = AutoMovieSolidVector_1.AutoMovieSolidVector.solve(damped(gram(M, local), mu), times(M, local, b).map((v) => -v));
109
+ if (z !== null)
110
+ h = h1.map((v, a) => v +
111
+ N[a].reduce((s, w, c) => s + w * z[c], 0));
112
+ }
113
+ if (Math.max(...h.map((v) => Math.abs(v))) <= step)
114
+ break;
115
+ const trial = project(x.map((v, i) => {
116
+ const a = free.indexOf(i);
117
+ return a < 0 ? v : v + h[a];
118
+ }));
119
+ const t1 = primary(trial);
120
+ const t2 = secondary(trial);
121
+ const accepted = !served
122
+ ? squared(t1) < squared(r1)
123
+ : Math.sqrt(squared(t1)) <= met && squared(t2) < squared(r2);
124
+ if (accepted) {
125
+ x = trial;
126
+ r1 = t1;
127
+ r2 = t2;
128
+ J1 = jacobian(primary, x);
129
+ J2 = r2.length === 0 ? [] : jacobian(secondary, x);
130
+ mu /= 3;
131
+ nu = 2;
132
+ }
133
+ else {
134
+ mu *= nu;
135
+ nu *= 2;
136
+ }
137
+ }
138
+ return x;
139
+ }
140
+ /** The damping start of Levenberg-Marquardt relative to the largest diagonal entry of the normal matrix (Madsen, Nielsen and Tingleff 2004, section 3.2, tau = 1e-3 for a start believed close). */
141
+ const TAU = 1e-3;
142
+ //# sourceMappingURL=fitDigitDescent.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"fitDigitDescent.js","sourceRoot":"","sources":["../../src/kinematics/fitDigitDescent.ts"],"names":[],"mappings":";;;AAAA,wFAAqF;AAErF;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAuCG;AACH,yBAAgC,KAA6B;IAC3D,MAAM,EAAE,OAAO,EAAE,SAAS,EAAE,OAAO,EAAE,IAAI,EAAE,GAA2B,KAAK,CAAC;IAC5E,MAAM,CAAC,GAAW,KAAK,CAAC,KAAK,CAAC,MAAM,CAAC;IACrC,MAAM,QAAQ,GAAG,CACf,CAAqC,EACrC,CAAoB,EACR,EAAE;QACd,MAAM,OAAO,GAAe,CAAC,CAAC,GAAG,CAAC,CAAC,EAAU,EAAE,CAAS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,CAAC,IAAI,GAAG,IAAI,OAAO,CAAC,EAAE,CAAC,GAAG,OAAO,CAAC,EAAE,CAAC,CAAC;QAC/D,IAAI,QAAQ,EAAE,CAAC;YACb,CAAC,GAAG,KAAK,CAAC;YACV,EAAE,GAAG,EAAE,CAAC;YACR,EAAE,GAAG,EAAE,CAAC;YACR,EAAE,GAAG,QAAQ,CAAC,OAAO,EAAE,CAAC,CAAC,CAAC;YAC1B,EAAE,GAAG,EAAE,CAAC,MAAM,KAAK,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,QAAQ,CAAC,SAAS,EAAE,CAAC,CAAC,CAAC;YACnD,EAAE,IAAI,CAAC,CAAC;YACR,EAAE,GAAG,CAAC,CAAC;QACT,CAAC;aAAM,CAAC;YACN,EAAE,IAAI,EAAE,CAAC;YACT,EAAE,IAAI,CAAC,CAAC;QACV,CAAC;IACH,CAAC;IACD,OAAO,CAAC,CAAC;AACX,CAAC;AAoCD,oMAAoM;AACpM,MAAM,GAAG,GAAW,IAAI,CAAC"}
@@ -0,0 +1,125 @@
1
+ import type { AutoMovieHumanoidBone, IAutoMovieJointAxes, IAutoMovieJointPose, IAutoMoviePose, IAutoMovieSkeleton, IAutoMovieVector3 } from "@automovie/interface";
2
+ import type { IAutoMovieRestFrame } from "../rom/IAutoMovieRestFrame";
3
+ import type { IAutoMovieSkeletonTopology } from "./IAutoMovieSkeletonTopology";
4
+ /**
5
+ * Put a point of a digit (its tip or its pad, a frame on its distal phalanx)
6
+ * on a world point, with the digit's own joints alone, inside their range of
7
+ * motion: the inverse kinematics of one finger or the thumb with the hand
8
+ * where the pose has placed it.
9
+ *
10
+ * Every free axis of every joint of the digit (an axis its constraint does
11
+ * not hold immobile) is a variable, in clinical degrees. The fit has two
12
+ * tasks in priority order. The first puts the effector on the target: its
13
+ * residual is the distance between them. The second, bettered only in what
14
+ * the first leaves free, turns the effector's normal onto the target normal
15
+ * when one is given (the misalignment scaled by the effector's distance from
16
+ * its joint, an arc length, so a degree of tilt counts as the millimetres it
17
+ * swings the phalanx) and keeps a finger's interphalangeal coupling, the
18
+ * distal joint following the middle one at the ratio `coupling` (the
19
+ * coupling of hand animation, DIP = 2/3 PIP, Rijpkema and Girard 1991,
20
+ * SIGGRAPH 25(4):339-348, as relayed by the hand-animation literature;
21
+ * provisional until read at the source), its residual likewise that distance
22
+ * times the angle by which the distal joint misses the ratio. The point
23
+ * goal, optionally eased by soft IK as described below, is never traded
24
+ * against a normal or a coupling it does not allow.
25
+ *
26
+ * Each descent is `fitDigitDescent`: damped task-priority least squares
27
+ * (Nakamura, Hanafusa and Yoshikawa 1987; Chiaverini 1997) with the active
28
+ * set of a projected Newton method (Bertsekas 1982) for the joints on a
29
+ * bound, and Levenberg-Marquardt damping (Madsen, Nielsen and Tingleff 2004).
30
+ * The Jacobians are read by central differences on the engine's own forward
31
+ * kinematics, so the angles mean what `resolvePose` displays, and every
32
+ * trial is projected into the range (`clampJointToSkeleton`) before it is
33
+ * measured. The point counts as reached within the effector's motion for one
34
+ * resolution step of every joint, and a descent stops when its step moves no
35
+ * joint by more than `ROM_TOLERANCE`, the resolution to which the engine
36
+ * resolves a joint's angle.
37
+ * The fit is a continuation: it descends from the pose's own angles for the
38
+ * digit, so a caller that seeds each fit from the one before follows a
39
+ * moving target in one basin, its joints moving continuously. Only when that
40
+ * fit cannot reach the target (the tip farther from it than one joint
41
+ * resolution of every joint would move it) does it restart from the middle
42
+ * of every range, where a digit folded the wrong way round its target is not
43
+ * trapped, keeping the restart only if it comes nearer; it never takes the
44
+ * better of two starts for a target the continued fit reaches, an argmin
45
+ * that would switch basins between neighbouring targets. A caller's `rate`
46
+ * softens the target near full extension, where the exact inverse has an
47
+ * unbounded derivative: the exponential soft IK of Andy Nicholas (2006),
48
+ * demonstrated in Jeremie Passerin's "Control Rig: 5.3: Soft IK" (2024,
49
+ * https://dev.epicgames.com/community/learning/tutorials/y4Ll/unreal-engine-control-rig-5-3-soft-ik).
50
+ * Below the soft band the target is unchanged; within it, some reach is
51
+ * traded for a bounded radial extension rate. The band's width comes from
52
+ * the chain's lengths and the requested rate, not the seed's posture.
53
+ * This controls the full-extension singularity, not every possible change
54
+ * of basin of a constrained digit. The result is
55
+ * deterministic for its input: fixed starts, a fixed order of variables and
56
+ * no random draw. A target outside the digit's workspace is fitted as
57
+ * nearly as this constrained local solve reaches it. With `rate` it fits
58
+ * the eased target instead, so its constrained minimum may differ from
59
+ * the original target's. In either case `residual` reports distance to the
60
+ * original target, including any reach traded away, so a caller refuses
61
+ * or accepts by its own bound.
62
+ *
63
+ * @param input The rig, the posed body, the digit's joints and the effector and target.
64
+ * @returns The digit's fitted joints, the effector's world point and the residual.
65
+ * @throws {Error} When the digit names no joint, a bone cannot be resolved, or `rate` is not finite and positive.
66
+ *
67
+ * @evidence contracts/development/common.md#meaningful-documentation States the variables, the two tasks and their units and order, the coupling's source and status, the method and its sources, the reach and stop rules and their owner, the continuation, determinism and the out-of-reach behaviour.
68
+ * @evidence contracts/development/implementation.md#principled-implementation Damped task-priority least squares (Nakamura et al. 1987, Chiaverini 1997) through `fitDigitDescent` on the engine's forward kinematics, every trial measured after the range clamp, stopping at the engine's joint-angle resolution; continuation from the caller's seed. Optional exponential soft IK eases only the target's radial distance in a band derived from the full-extension curvature.
69
+ * @evidence contracts/development/implementation.md#clear-and-simple-structure Two residual functions over the digit's variables, one continued descent and a restart only when it cannot reach.
70
+ * @evidence contracts/development/implementation.md#prohibited-implementation-shortcuts No iteration count and no weight between the tasks: the fit ends at the joint-angle resolution and reports distance from the original target, including any reach soft IK trades away. The width is derived from the chain lengths and `rate`; it does not penalise departure from an arbitrary seed.
71
+ * @evidence contracts/development/implementation.md#efficient-algorithms Each evaluation is one forward kinematics of the rig, linear in its bones; a Jacobian costs two per variable (at most 9 for a digit of three joints) and the active set's probe one clamp per variable; a step solves two small systems of the free variables; a restart, run only for a target the continued fit cannot reach, doubles the work.
72
+ * @evidenceExclude contracts/development/implementation.md#reuse-equivalent-work A pure function of its input; a caller keeps the result by its own plan.
73
+ * @evidenceExclude contracts/development/implementation.md#bound-retention-and-release-resources Retains nothing; the returned joints belong to the caller.
74
+ */
75
+ export declare function fitDigitToTarget(input: fitDigitToTarget.IInput): fitDigitToTarget.IResult;
76
+ /**
77
+ * Companion types of {@link fitDigitToTarget}.
78
+ *
79
+ * @evidence contracts/development/common.md#meaningful-documentation Documents each member's frame and unit.
80
+ * @evidence contracts/development/design.md#principled-representation A posed rig, the digit's joints proximal to distal, a bone-local effector frame and a world target point with an optional normal.
81
+ * @evidence contracts/development/design.md#minimal-and-owned-surface What the fit reads and what its caller needs back: the joints, where the effector ended and how far from the target.
82
+ * @evidence contracts/development/design.md#prohibited-design-shortcuts Reuses the interface's poses, bones and vectors; the effector is the region frame `resolveAutoMovieHumanoidSurfaces` already gives.
83
+ */
84
+ export declare namespace fitDigitToTarget {
85
+ /** What a digit fit reads. */
86
+ interface IInput {
87
+ /** The rig. */
88
+ skeleton: IAutoMovieSkeleton;
89
+ /** The posed body: its root, arm and hand place the digit's base; its own entries for the digit's joints are the fit's start. */
90
+ pose: IAutoMoviePose;
91
+ /** The digit's joints, proximal to distal: a finger's three, or the thumb's metacarpal, proximal and distal. */
92
+ bones: readonly AutoMovieHumanoidBone[];
93
+ /** The point brought to the target, in its bone's rest frame relative to the bone's joint, metres, with the outward unit normal there: a region frame of the digit's tip or pad. */
94
+ effector: {
95
+ bone: AutoMovieHumanoidBone;
96
+ point: IAutoMovieVector3;
97
+ normal: IAutoMovieVector3;
98
+ };
99
+ /** The target, world metres. */
100
+ target: IAutoMovieVector3;
101
+ /** The world direction the effector's normal is turned onto, when the contact needs one (a pad laid on a key faces against the key's normal); none when absent. */
102
+ normal?: IAutoMovieVector3;
103
+ /** The ratio of the distal joint's flexion to the middle joint's that a finger keeps as its second task, after the point; no coupling when absent (the thumb). */
104
+ coupling?: number;
105
+ /** The joint axes the pose is read with, as `resolvePose` takes them; the skeleton's own when absent. */
106
+ jointAxes?: Partial<Record<AutoMovieHumanoidBone, IAutoMovieJointAxes>>;
107
+ /** The rest frames the pose's clinical angles are lifted by, as `resolvePose` takes them; none when absent. */
108
+ restFrames?: Partial<Record<AutoMovieHumanoidBone, IAutoMovieRestFrame>>;
109
+ /** The rig's topology, when the caller has it. */
110
+ topology?: IAutoMovieSkeletonTopology;
111
+ /** Desired radial extension rate near full reach, positive finite degrees per metre. Derives a soft-IK band from the chain's smallest full-extension hinge curvature; targets in that band are eased short of full reach, and `residual` still measures the original target. Other constrained-IK basin changes are not bounded by this value. No softening when absent. */
112
+ rate?: number;
113
+ }
114
+ /** What a digit fit returns. */
115
+ interface IResult {
116
+ /** The digit's joints, inside their range, clinical degrees. */
117
+ joints: IAutoMovieJointPose[];
118
+ /** Where the effector ended, world metres. */
119
+ point: IAutoMovieVector3;
120
+ /** The effector's outward unit normal there, world frame. */
121
+ normal: IAutoMovieVector3;
122
+ /** The distance from the effector to the target, metres; zero within rounding when the target is reached. */
123
+ residual: number;
124
+ }
125
+ }