flo-mat 2.0.4 → 3.0.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 (652) hide show
  1. package/.quokka +4 -0
  2. package/browser/index.js +18434 -14538
  3. package/browser/index.min.js +1 -1
  4. package/node/closest-boundary-point/cull-bezier-pieces.d.ts +9 -0
  5. package/node/closest-boundary-point/cull-bezier-pieces.js +17 -0
  6. package/node/closest-boundary-point/cull-bezier-pieces.js.map +1 -0
  7. package/node/{mat/closest-boundary-point → closest-boundary-point}/cull-by-loose-bounding-box.d.ts +2 -2
  8. package/node/{mat/closest-boundary-point → closest-boundary-point}/cull-by-loose-bounding-box.js +2 -2
  9. package/node/closest-boundary-point/cull-by-loose-bounding-box.js.map +1 -0
  10. package/node/{mat/closest-boundary-point → closest-boundary-point}/cull-by-tight-boundary-box.d.ts +2 -2
  11. package/node/{mat/closest-boundary-point → closest-boundary-point}/cull-by-tight-boundary-box.js +1 -1
  12. package/node/closest-boundary-point/cull-by-tight-boundary-box.js.map +1 -0
  13. package/node/closest-boundary-point/dd-deflate-with-running-error.d.ts +25 -0
  14. package/node/closest-boundary-point/dd-deflate-with-running-error.js +68 -0
  15. package/node/closest-boundary-point/dd-deflate-with-running-error.js.map +1 -0
  16. package/node/closest-boundary-point/foot-and-endpoint-info.d.ts +10 -0
  17. package/node/closest-boundary-point/foot-and-endpoint-info.js +2 -0
  18. package/node/closest-boundary-point/foot-and-endpoint-info.js.map +1 -0
  19. package/node/{mat/closest-boundary-point → closest-boundary-point}/get-best-distance-squared.d.ts +2 -2
  20. package/node/{mat/closest-boundary-point → closest-boundary-point}/get-best-distance-squared.js +2 -3
  21. package/node/closest-boundary-point/get-best-distance-squared.js.map +1 -0
  22. package/node/closest-boundary-point/get-close-boundary-points-certified.d.ts +15 -0
  23. package/node/closest-boundary-point/get-close-boundary-points-certified.js +40 -0
  24. package/node/closest-boundary-point/get-close-boundary-points-certified.js.map +1 -0
  25. package/node/closest-boundary-point/get-closest-boundary-point-certified.d.ts +15 -0
  26. package/node/closest-boundary-point/get-closest-boundary-point-certified.js +42 -0
  27. package/node/closest-boundary-point/get-closest-boundary-point-certified.js.map +1 -0
  28. package/node/closest-boundary-point/get-p-from-box.d.ts +3 -0
  29. package/node/closest-boundary-point/get-p-from-box.js +11 -0
  30. package/node/closest-boundary-point/get-p-from-box.js.map +1 -0
  31. package/node/closest-boundary-point/get-potential-closest-points-on-curve-certified.d.ts +12 -0
  32. package/node/closest-boundary-point/get-potential-closest-points-on-curve-certified.js +93 -0
  33. package/node/closest-boundary-point/get-potential-closest-points-on-curve-certified.js.map +1 -0
  34. package/node/closest-boundary-point/root-interval-to-distance-squared-interval.d.ts +13 -0
  35. package/node/closest-boundary-point/root-interval-to-distance-squared-interval.js +58 -0
  36. package/node/closest-boundary-point/root-interval-to-distance-squared-interval.js.map +1 -0
  37. package/node/{contact-point.d.ts → contact-point/contact-point.d.ts} +3 -3
  38. package/node/{contact-point.js → contact-point/contact-point.js} +1 -5
  39. package/node/contact-point/contact-point.js.map +1 -0
  40. package/node/{compare-curvatures-at-interface.js → corner/compare-curvatures-at-interface.js} +2 -2
  41. package/node/corner/compare-curvatures-at-interface.js.map +1 -0
  42. package/node/{mat → corner}/corner.d.ts +1 -1
  43. package/node/{mat → corner}/corner.js.map +1 -1
  44. package/node/corner/get-corner.d.ts +15 -0
  45. package/node/{curve.js → corner/get-corner.js} +6 -17
  46. package/node/corner/get-corner.js.map +1 -0
  47. package/node/{get-interface-ccw.js → corner/get-interface-ccw.js} +18 -33
  48. package/node/corner/get-interface-ccw.js.map +1 -0
  49. package/node/cp-node/clone.d.ts +1 -1
  50. package/node/cp-node/clone.js +6 -4
  51. package/node/cp-node/clone.js.map +1 -1
  52. package/node/cp-node/cp-node.d.ts +196 -0
  53. package/node/cp-node/cp-node.js +249 -0
  54. package/node/cp-node/cp-node.js.map +1 -0
  55. package/node/cp-node/create-cp-node.d.ts +4 -0
  56. package/node/cp-node/create-cp-node.js +8 -0
  57. package/node/cp-node/create-cp-node.js.map +1 -0
  58. package/node/cp-node/enhance-cp-node.d.ts +24 -0
  59. package/node/cp-node/enhance-cp-node.js +20 -0
  60. package/node/cp-node/enhance-cp-node.js.map +1 -0
  61. package/node/{get-boundary-bezier-parts-to-next.js → cp-node/get-boundary-bezier-parts-to-next.js} +1 -1
  62. package/node/cp-node/get-boundary-bezier-parts-to-next.js.map +1 -0
  63. package/node/{get-boundary-beziers-to-next.d.ts → cp-node/get-boundary-beziers-to-next.d.ts} +1 -1
  64. package/node/{get-boundary-beziers-to-next.js → cp-node/get-boundary-beziers-to-next.js} +1 -1
  65. package/node/cp-node/get-boundary-beziers-to-next.js.map +1 -0
  66. package/node/cp-node/get-cp-node-ordering.d.ts +8 -0
  67. package/node/cp-node/get-cp-node-ordering.js +12 -0
  68. package/node/cp-node/get-cp-node-ordering.js.map +1 -0
  69. package/node/{get-curve-to-next.js → cp-node/get-curve-to-next.js} +1 -1
  70. package/node/cp-node/get-curve-to-next.js.map +1 -0
  71. package/node/cp-node/remove.d.ts +1 -1
  72. package/node/cp-node/traverse-cp.d.ts +12 -0
  73. package/node/cp-node/traverse-cp.js +26 -0
  74. package/node/cp-node/traverse-cp.js.map +1 -0
  75. package/node/{traverse-edges.js → cp-node/traverse-edges.js} +4 -3
  76. package/node/cp-node/traverse-edges.js.map +1 -0
  77. package/node/{traverse-vertices.js → cp-node/traverse-vertices.js} +4 -3
  78. package/node/cp-node/traverse-vertices.js.map +1 -0
  79. package/node/{curve.d.ts → curve/curve.d.ts} +4 -17
  80. package/node/curve/curve.js +14 -0
  81. package/node/curve/curve.js.map +1 -0
  82. package/node/debug/cp-node-for-debugging.d.ts +2 -2
  83. package/node/debug/debug-elem-types.d.ts +8 -8
  84. package/node/debug/debug.d.ts +6 -6
  85. package/node/debug/debug.js +2 -2
  86. package/node/debug/debug.js.map +1 -1
  87. package/node/debug/functions/draw-elem/bounding-hull.d.ts +2 -2
  88. package/node/debug/functions/draw-elem/bounding-hull.js +3 -3
  89. package/node/debug/functions/draw-elem/bounding-hull.js.map +1 -1
  90. package/node/debug/functions/draw-elem/branch.d.ts +2 -2
  91. package/node/debug/functions/draw-elem/branch.js +4 -3
  92. package/node/debug/functions/draw-elem/branch.js.map +1 -1
  93. package/node/debug/functions/draw-elem/culls.d.ts +2 -2
  94. package/node/debug/functions/draw-elem/culls.js +2 -2
  95. package/node/debug/functions/draw-elem/culls.js.map +1 -1
  96. package/node/debug/functions/draw-elem/draw-circle-percent.d.ts +1 -1
  97. package/node/debug/functions/draw-elem/draw-circle-percent.js +1 -1
  98. package/node/debug/functions/draw-elem/draw-circle-percent.js.map +1 -1
  99. package/node/debug/functions/draw-elem/draw-elem.d.ts +3 -3
  100. package/node/debug/functions/draw-elem/draw-elem.js +3 -3
  101. package/node/debug/functions/draw-elem/draw-elem.js.map +1 -1
  102. package/node/debug/functions/draw-elem/dull-corner.d.ts +3 -3
  103. package/node/debug/functions/draw-elem/dull-corner.js +3 -4
  104. package/node/debug/functions/draw-elem/dull-corner.js.map +1 -1
  105. package/node/debug/functions/draw-elem/leaves.d.ts +2 -2
  106. package/node/debug/functions/draw-elem/leaves.js +1 -1
  107. package/node/debug/functions/draw-elem/leaves.js.map +1 -1
  108. package/node/debug/functions/draw-elem/loop.d.ts +2 -2
  109. package/node/debug/functions/draw-elem/loop.js +1 -2
  110. package/node/debug/functions/draw-elem/loop.js.map +1 -1
  111. package/node/debug/functions/draw-elem/loops.d.ts +1 -1
  112. package/node/debug/functions/draw-elem/loops.js +0 -1
  113. package/node/debug/functions/draw-elem/loops.js.map +1 -1
  114. package/node/debug/functions/draw-elem/loose-bounding-box.d.ts +2 -2
  115. package/node/debug/functions/draw-elem/loose-bounding-box.js +3 -3
  116. package/node/debug/functions/draw-elem/loose-bounding-box.js.map +1 -1
  117. package/node/debug/functions/draw-elem/mat.d.ts +3 -3
  118. package/node/debug/functions/draw-elem/mat.js +9 -7
  119. package/node/debug/functions/draw-elem/mat.js.map +1 -1
  120. package/node/debug/functions/draw-elem/max-vertex.d.ts +2 -2
  121. package/node/debug/functions/draw-elem/max-vertex.js +1 -1
  122. package/node/debug/functions/draw-elem/max-vertex.js.map +1 -1
  123. package/node/debug/functions/draw-elem/min-y.d.ts +3 -3
  124. package/node/debug/functions/draw-elem/min-y.js +2 -6
  125. package/node/debug/functions/draw-elem/min-y.js.map +1 -1
  126. package/node/debug/functions/draw-elem/one-prong-at-dull-corner.d.ts +2 -2
  127. package/node/debug/functions/draw-elem/one-prong-at-dull-corner.js +2 -2
  128. package/node/debug/functions/draw-elem/one-prong-at-dull-corner.js.map +1 -1
  129. package/node/debug/functions/draw-elem/one-prong.d.ts +2 -2
  130. package/node/debug/functions/draw-elem/one-prong.js +6 -11
  131. package/node/debug/functions/draw-elem/one-prong.js.map +1 -1
  132. package/node/debug/functions/draw-elem/sharp-corner.d.ts +3 -3
  133. package/node/debug/functions/draw-elem/sharp-corner.js +3 -4
  134. package/node/debug/functions/draw-elem/sharp-corner.js.map +1 -1
  135. package/node/debug/functions/draw-elem/three-prong.d.ts +2 -2
  136. package/node/debug/functions/draw-elem/three-prong.js +8 -10
  137. package/node/debug/functions/draw-elem/three-prong.js.map +1 -1
  138. package/node/debug/functions/draw-elem/tight-bounding-box.d.ts +2 -2
  139. package/node/debug/functions/draw-elem/tight-bounding-box.js +3 -3
  140. package/node/debug/functions/draw-elem/tight-bounding-box.js.map +1 -1
  141. package/node/debug/functions/draw-elem/two-prong.d.ts +2 -2
  142. package/node/debug/functions/draw-elem/two-prong.js +7 -8
  143. package/node/debug/functions/draw-elem/two-prong.js.map +1 -1
  144. package/node/debug/functions/draw-elem/vertex.d.ts +4 -3
  145. package/node/debug/functions/draw-elem/vertex.js +11 -9
  146. package/node/debug/functions/draw-elem/vertex.js.map +1 -1
  147. package/node/debug/functions/general.d.ts +8 -8
  148. package/node/debug/functions/general.js +8 -8
  149. package/node/debug/functions/general.js.map +1 -1
  150. package/node/debug/functions/three-prong.d.ts +2 -2
  151. package/node/debug/functions/three-prong.js +10 -13
  152. package/node/debug/functions/three-prong.js.map +1 -1
  153. package/node/debug/functions/two-prong.d.ts +16 -5
  154. package/node/debug/functions/two-prong.js +56 -58
  155. package/node/debug/functions/two-prong.js.map +1 -1
  156. package/node/debug/three-prong-for-debugging.d.ts +6 -6
  157. package/node/debug/three-prong-for-debugging.js +1 -1
  158. package/node/debug/three-prong-for-debugging.js.map +1 -1
  159. package/node/debug/two-prong-for-debugging.d.ts +7 -7
  160. package/node/error-analysis/gamma.d.ts +26 -0
  161. package/node/error-analysis/gamma.js +35 -0
  162. package/node/error-analysis/gamma.js.map +1 -0
  163. package/node/find-2-prong/add-1-prong.d.ts +12 -0
  164. package/node/{mat/find-mat → find-2-prong}/add-1-prong.js +11 -11
  165. package/node/find-2-prong/add-1-prong.js.map +1 -0
  166. package/node/{mat/find-mat → find-2-prong}/add-2-prong.d.ts +6 -9
  167. package/node/{mat/find-mat → find-2-prong}/add-2-prong.js +26 -74
  168. package/node/find-2-prong/add-2-prong.js.map +1 -0
  169. package/node/find-2-prong/add-debug-info.d.ts +8 -0
  170. package/node/{mat/find-mat/find-2-prong → find-2-prong}/add-debug-info.js +5 -4
  171. package/node/find-2-prong/add-debug-info.js.map +1 -0
  172. package/node/find-2-prong/cull-bezier-pieces.d.ts +11 -0
  173. package/node/find-2-prong/cull-bezier-pieces.js +28 -0
  174. package/node/find-2-prong/cull-bezier-pieces.js.map +1 -0
  175. package/node/{mat/find-mat/find-2-prong → find-2-prong}/find-2-prong.d.ts +9 -13
  176. package/node/find-2-prong/find-2-prong.js +144 -0
  177. package/node/find-2-prong/find-2-prong.js.map +1 -0
  178. package/node/find-2-prong/find-and-add-2-prongs-on-all-paths.d.ts +15 -0
  179. package/node/{mat/find-mat → find-2-prong}/find-and-add-2-prongs-on-all-paths.js +5 -4
  180. package/node/find-2-prong/find-and-add-2-prongs-on-all-paths.js.map +1 -0
  181. package/node/{mat/find-mat → find-2-prong}/find-and-add-2-prongs.d.ts +5 -5
  182. package/node/find-2-prong/find-and-add-2-prongs.js +60 -0
  183. package/node/find-2-prong/find-and-add-2-prongs.js.map +1 -0
  184. package/node/{mat/find-mat → find-2-prong}/find-and-add-hole-closing-2-prongs.d.ts +3 -3
  185. package/node/{mat/find-mat → find-2-prong}/find-and-add-hole-closing-2-prongs.js +5 -5
  186. package/node/find-2-prong/find-and-add-hole-closing-2-prongs.js.map +1 -0
  187. package/node/find-2-prong/find-equidistant-point-on-line-dd.d.ts +10 -0
  188. package/node/find-2-prong/find-equidistant-point-on-line-dd.js +56 -0
  189. package/node/find-2-prong/find-equidistant-point-on-line-dd.js.map +1 -0
  190. package/node/find-2-prong/get-initial-bezier-pieces.d.ts +15 -0
  191. package/node/find-2-prong/get-initial-bezier-pieces.js +40 -0
  192. package/node/find-2-prong/get-initial-bezier-pieces.js.map +1 -0
  193. package/node/find-2-prong/reduce-radius.d.ts +8 -0
  194. package/node/find-2-prong/reduce-radius.js +72 -0
  195. package/node/find-2-prong/reduce-radius.js.map +1 -0
  196. package/node/find-2-prong/squared-distance-between-dd.d.ts +2 -0
  197. package/node/find-2-prong/squared-distance-between-dd.js +17 -0
  198. package/node/find-2-prong/squared-distance-between-dd.js.map +1 -0
  199. package/node/find-2-prong/x-for-debugging.d.ts +9 -0
  200. package/node/find-2-prong/x-for-debugging.js.map +1 -0
  201. package/node/{mat/find-mat → find-3-prong.ts}/add-3-prong.d.ts +12 -7
  202. package/node/find-3-prong.ts/add-3-prong.js +82 -0
  203. package/node/find-3-prong.ts/add-3-prong.js.map +1 -0
  204. package/node/{mat/find-mat/find-3-prong → find-3-prong.ts}/calc-better-x.d.ts +4 -4
  205. package/node/{mat/find-mat/find-3-prong → find-3-prong.ts}/calc-better-x.js +1 -1
  206. package/node/find-3-prong.ts/calc-better-x.js.map +1 -0
  207. package/node/{mat/find-mat/find-3-prong → find-3-prong.ts}/calc-initial-3-prong-center.d.ts +3 -3
  208. package/node/{mat/find-mat/find-3-prong → find-3-prong.ts}/calc-initial-3-prong-center.js +5 -7
  209. package/node/find-3-prong.ts/calc-initial-3-prong-center.js.map +1 -0
  210. package/node/{mat/find-mat/find-3-prong → find-3-prong.ts}/find-3-prong-for-delta3s.d.ts +6 -6
  211. package/node/{mat/find-mat/find-3-prong → find-3-prong.ts}/find-3-prong-for-delta3s.js +11 -12
  212. package/node/find-3-prong.ts/find-3-prong-for-delta3s.js.map +1 -0
  213. package/node/{mat/find-mat/find-3-prong → find-3-prong.ts}/find-3-prong.d.ts +5 -5
  214. package/node/{mat/find-mat/find-3-prong → find-3-prong.ts}/find-3-prong.js +52 -39
  215. package/node/find-3-prong.ts/find-3-prong.js.map +1 -0
  216. package/node/find-3-prong.ts/find-and-add-3-prongs.d.ts +5 -0
  217. package/node/find-3-prong.ts/find-and-add-3-prongs.js +74 -0
  218. package/node/find-3-prong.ts/find-and-add-3-prongs.js.map +1 -0
  219. package/node/{mat/find-mat/find-and-add-3-prongs.d.ts → find-3-prong.ts/find-and-add-all-3-prongs.d.ts} +3 -3
  220. package/node/find-3-prong.ts/find-and-add-all-3-prongs.js +66 -0
  221. package/node/find-3-prong.ts/find-and-add-all-3-prongs.js.map +1 -0
  222. package/node/{mat/find-mat/find-3-prong → find-3-prong.ts}/get-closest-points.d.ts +3 -3
  223. package/node/find-3-prong.ts/get-closest-points.js +14 -0
  224. package/node/find-3-prong.ts/get-closest-points.js.map +1 -0
  225. package/node/{mat/find-mat → find-mat}/add-debug-info.d.ts +4 -4
  226. package/node/{mat/find-mat → find-mat}/add-debug-info.js +6 -6
  227. package/node/find-mat/add-debug-info.js.map +1 -0
  228. package/node/{mat/find-mat → find-mat}/create-initial-cp-graph.d.ts +5 -5
  229. package/node/{mat/find-mat → find-mat}/create-initial-cp-graph.js +5 -6
  230. package/node/find-mat/create-initial-cp-graph.js.map +1 -0
  231. package/node/find-mat/find-mat.d.ts +10 -0
  232. package/node/find-mat/find-mat.js +57 -0
  233. package/node/find-mat/find-mat.js.map +1 -0
  234. package/node/{find-mats.d.ts → find-mat/find-mats.d.ts} +1 -1
  235. package/node/find-mat/find-mats.js +58 -0
  236. package/node/find-mat/find-mats.js.map +1 -0
  237. package/node/find-mat/fix-ordering.d.ts +8 -0
  238. package/node/find-mat/fix-ordering.js +59 -0
  239. package/node/find-mat/fix-ordering.js.map +1 -0
  240. package/node/find-mat/get-dull-corners.d.ts +5 -0
  241. package/node/find-mat/get-dull-corners.js +22 -0
  242. package/node/find-mat/get-dull-corners.js.map +1 -0
  243. package/node/find-mat/get-for-1-prongs-on-loop.d.ts +11 -0
  244. package/node/find-mat/get-for-1-prongs-on-loop.js +28 -0
  245. package/node/find-mat/get-for-1-prongs-on-loop.js.map +1 -0
  246. package/node/find-mat/get-for-2-prongs-on-loop.d.ts +11 -0
  247. package/node/find-mat/get-for-2-prongs-on-loop.js +30 -0
  248. package/node/find-mat/get-for-2-prongs-on-loop.js.map +1 -0
  249. package/node/find-mat/get-sharp-corners.d.ts +5 -0
  250. package/node/find-mat/get-sharp-corners.js +21 -0
  251. package/node/find-mat/get-sharp-corners.js.map +1 -0
  252. package/node/find-mat/get-size-params.d.ts +7 -0
  253. package/node/find-mat/get-size-params.js +33 -0
  254. package/node/find-mat/get-size-params.js.map +1 -0
  255. package/node/geometry/circle.js.map +1 -0
  256. package/node/geometry/get-bounding-box-.js.map +1 -0
  257. package/node/{mat/geometry → geometry}/get-closest-square-distance-to-rect.d.ts +1 -1
  258. package/node/{mat/geometry → geometry}/get-closest-square-distance-to-rect.js +1 -1
  259. package/node/geometry/get-closest-square-distance-to-rect.js.map +1 -0
  260. package/node/{mat/geometry → geometry}/get-closest-squared-distance-to-rotated-rect.d.ts +1 -1
  261. package/node/{mat/geometry → geometry}/get-closest-squared-distance-to-rotated-rect.js +1 -1
  262. package/node/geometry/get-closest-squared-distance-to-rotated-rect.js.map +1 -0
  263. package/node/get-curve/get-curve-between.d.ts +1 -1
  264. package/node/get-curve/get-curve-between.js +2 -2
  265. package/node/get-curve/get-curve-between.js.map +1 -1
  266. package/node/get-curve/get-edge-direction.d.ts +2 -2
  267. package/node/get-curve/get-edge-direction.js +2 -4
  268. package/node/get-curve/get-edge-direction.js.map +1 -1
  269. package/node/index.d.ts +24 -20
  270. package/node/index.js +21 -16
  271. package/node/index.js.map +1 -1
  272. package/node/loop/get-max-coordinate.d.ts +1 -1
  273. package/node/loop/get-max-coordinate.js +1 -1
  274. package/node/mat/add-to-cp-graph.d.ts +8 -7
  275. package/node/mat/add-to-cp-graph.js +6 -4
  276. package/node/mat/add-to-cp-graph.js.map +1 -1
  277. package/node/mat/bezier-piece.d.ts +2 -2
  278. package/node/mat/create-new-cp-tree.d.ts +3 -3
  279. package/node/mat/create-new-cp-tree.js +5 -7
  280. package/node/mat/create-new-cp-tree.js.map +1 -1
  281. package/node/mat/elem-type-two-prong.d.ts +1 -1
  282. package/node/mat/get-boundary-piece-beziers.d.ts +2 -2
  283. package/node/mat/get-boundary-piece-beziers.js +4 -4
  284. package/node/mat/get-boundary-piece-beziers.js.map +1 -1
  285. package/node/{get-branches.d.ts → mat/get-branches.d.ts} +1 -1
  286. package/node/{get-branches.js → mat/get-branches.js} +7 -6
  287. package/node/mat/get-branches.js.map +1 -0
  288. package/node/mat/get-largest-vertex.d.ts +2 -2
  289. package/node/mat/get-largest-vertex.js +1 -1
  290. package/node/mat/get-largest-vertex.js.map +1 -1
  291. package/node/mat/get-neighboring-cps.d.ts +6 -4
  292. package/node/mat/get-neighboring-cps.js +5 -3
  293. package/node/mat/get-neighboring-cps.js.map +1 -1
  294. package/node/mat/get-two-prong-type.d.ts +1 -1
  295. package/node/mat/get-two-prong-type.js +1 -1
  296. package/node/mat/get-two-prong-type.js.map +1 -1
  297. package/node/mat/is-another-cp-closeby.d.ts +9 -8
  298. package/node/mat/is-another-cp-closeby.js +21 -29
  299. package/node/mat/is-another-cp-closeby.js.map +1 -1
  300. package/node/{mat.d.ts → mat/mat.d.ts} +2 -2
  301. package/node/mat/mat.js.map +1 -0
  302. package/node/mat/simplify-mat-map-only.d.ts +1 -1
  303. package/node/mat/simplify-mat-map-only.js +4 -3
  304. package/node/mat/simplify-mat-map-only.js.map +1 -1
  305. package/node/{simplify-mat.d.ts → mat/simplify-mat.d.ts} +3 -5
  306. package/node/{simplify-mat.js → mat/simplify-mat.js} +11 -13
  307. package/node/mat/simplify-mat.js.map +1 -0
  308. package/node/mat/trim-mat.d.ts +1 -1
  309. package/node/mat/trim-mat.js +1 -1
  310. package/node/mat/trim-mat.js.map +1 -1
  311. package/node/point-on-shape/calc-pos-order.d.ts +13 -0
  312. package/node/point-on-shape/calc-pos-order.js +27 -0
  313. package/node/point-on-shape/calc-pos-order.js.map +1 -0
  314. package/node/point-on-shape/compare-poss.d.ts +10 -0
  315. package/node/point-on-shape/compare-poss.js +18 -0
  316. package/node/point-on-shape/compare-poss.js.map +1 -0
  317. package/node/point-on-shape/create-pos.d.ts +4 -0
  318. package/node/point-on-shape/create-pos.js +12 -0
  319. package/node/point-on-shape/create-pos.js.map +1 -0
  320. package/node/point-on-shape/get-osculating-circle.d.ts +10 -0
  321. package/node/point-on-shape/get-osculating-circle.js +25 -0
  322. package/node/point-on-shape/get-osculating-circle.js.map +1 -0
  323. package/node/point-on-shape/get-pos-corner.d.ts +7 -0
  324. package/node/point-on-shape/get-pos-corner.js +9 -0
  325. package/node/point-on-shape/get-pos-corner.js.map +1 -0
  326. package/node/point-on-shape/is-pos-corner.d.ts +6 -0
  327. package/node/point-on-shape/is-pos-corner.js +8 -0
  328. package/node/point-on-shape/is-pos-corner.js.map +1 -0
  329. package/node/point-on-shape/is-pos-dull-corner.d.ts +6 -0
  330. package/node/point-on-shape/is-pos-dull-corner.js +14 -0
  331. package/node/point-on-shape/is-pos-dull-corner.js.map +1 -0
  332. package/node/point-on-shape/is-pos-quite-sharp-corner.d.ts +6 -0
  333. package/node/point-on-shape/is-pos-quite-sharp-corner.js +14 -0
  334. package/node/point-on-shape/is-pos-quite-sharp-corner.js.map +1 -0
  335. package/node/point-on-shape/is-pos-sharp-corner.d.ts +6 -0
  336. package/node/point-on-shape/is-pos-sharp-corner.js +14 -0
  337. package/node/point-on-shape/is-pos-sharp-corner.js.map +1 -0
  338. package/node/point-on-shape/point-on-shape.d.ts +11 -0
  339. package/node/point-on-shape/point-on-shape.js +2 -0
  340. package/node/point-on-shape/point-on-shape.js.map +1 -0
  341. package/node/point-on-shape/pos-to-human-string.d.ts +8 -0
  342. package/node/point-on-shape/pos-to-human-string.js +12 -0
  343. package/node/point-on-shape/pos-to-human-string.js.map +1 -0
  344. package/node/{mat/to-scale-axis → sat}/add-debug-info.d.ts +2 -2
  345. package/node/{mat/to-scale-axis → sat}/add-debug-info.js +1 -1
  346. package/node/sat/add-debug-info.js.map +1 -0
  347. package/node/{mat/to-scale-axis → sat}/cull-non-cycles.d.ts +3 -3
  348. package/node/{mat/to-scale-axis → sat}/cull-non-cycles.js +6 -6
  349. package/node/sat/cull-non-cycles.js.map +1 -0
  350. package/node/{mat/to-scale-axis → sat}/cull.d.ts +3 -3
  351. package/node/{mat/to-scale-axis → sat}/cull.js +4 -4
  352. package/node/sat/cull.js.map +1 -0
  353. package/node/{mat → sat}/get-leaves.d.ts +2 -2
  354. package/node/sat/get-leaves.js +14 -0
  355. package/node/sat/get-leaves.js.map +1 -0
  356. package/node/{to-scale-axis.d.ts → sat/to-scale-axis.d.ts} +2 -2
  357. package/node/{to-scale-axis.js → sat/to-scale-axis.js} +11 -10
  358. package/node/sat/to-scale-axis.js.map +1 -0
  359. package/node/svg/get-loop-bounds.d.ts +7 -7
  360. package/node/svg/get-loop-bounds.js +11 -7
  361. package/node/svg/get-loop-bounds.js.map +1 -1
  362. package/node/svg/get-min-y-pos.d.ts +4 -4
  363. package/node/svg/get-min-y-pos.js +1 -1
  364. package/node/svg/get-shape-bounds.d.ts +6 -5
  365. package/node/svg/get-shape-bounds.js +6 -2
  366. package/node/svg/get-shape-bounds.js.map +1 -1
  367. package/node/sweep-line/sweep-line.d.ts +1 -1
  368. package/node/sweep-line/sweep-line.js +4 -4
  369. package/node/sweep-line/sweep-line.js.map +1 -1
  370. package/package.json +10 -10
  371. package/src/closest-boundary-point/closest-points-on-curve-precise.ts +75 -0
  372. package/src/closest-boundary-point/closest-points-on-curve.ts +72 -0
  373. package/src/closest-boundary-point/cull-bezier-pieces.ts +35 -0
  374. package/src/{mat/closest-boundary-point → closest-boundary-point}/cull-by-loose-bounding-box.ts +4 -3
  375. package/src/{mat/closest-boundary-point → closest-boundary-point}/cull-by-tight-boundary-box.ts +2 -2
  376. package/src/closest-boundary-point/dd-deflate-with-running-error.ts +88 -0
  377. package/src/closest-boundary-point/foot-and-endpoint-info.ts +16 -0
  378. package/src/{mat/closest-boundary-point → closest-boundary-point}/get-best-distance-squared.ts +3 -4
  379. package/src/closest-boundary-point/get-close-boundary-points-certified.ts +69 -0
  380. package/src/closest-boundary-point/get-closest-boundary-point-certified.ts +70 -0
  381. package/src/closest-boundary-point/get-p-from-box.ts +14 -0
  382. package/src/closest-boundary-point/get-potential-closest-points-on-curve-certified.ts +122 -0
  383. package/src/closest-boundary-point/root-interval-to-distance-squared-interval.ts +75 -0
  384. package/src/{contact-point.ts → contact-point/contact-point.ts} +4 -6
  385. package/src/{compare-curvatures-at-interface.ts → corner/compare-curvatures-at-interface.ts} +2 -2
  386. package/src/{mat → corner}/corner.ts +1 -1
  387. package/src/{curve.ts → corner/get-corner.ts} +10 -49
  388. package/src/{get-interface-ccw.ts → corner/get-interface-ccw.ts} +28 -35
  389. package/src/cp-node/clone.ts +17 -6
  390. package/src/cp-node/cp-node.ts +422 -0
  391. package/src/cp-node/create-cp-node.ts +21 -0
  392. package/src/cp-node/enhance-cp-node.ts +27 -0
  393. package/src/{get-boundary-bezier-parts-to-next.ts → cp-node/get-boundary-bezier-parts-to-next.ts} +3 -3
  394. package/src/{get-boundary-beziers-to-next.ts → cp-node/get-boundary-beziers-to-next.ts} +2 -2
  395. package/src/cp-node/get-cp-node-ordering.ts +17 -0
  396. package/src/{get-curve-to-next.ts → cp-node/get-curve-to-next.ts} +1 -1
  397. package/src/cp-node/remove.ts +1 -1
  398. package/src/cp-node/traverse-cp.ts +35 -0
  399. package/src/{traverse-edges.ts → cp-node/traverse-edges.ts} +5 -5
  400. package/src/{traverse-vertices.ts → cp-node/traverse-vertices.ts} +5 -5
  401. package/src/curve/curve.ts +46 -0
  402. package/src/debug/cp-node-for-debugging.ts +2 -2
  403. package/src/debug/debug-elem-types.ts +8 -8
  404. package/src/debug/debug.ts +11 -11
  405. package/src/debug/functions/draw-elem/bounding-hull.ts +5 -3
  406. package/src/debug/functions/draw-elem/branch.ts +4 -4
  407. package/src/debug/functions/draw-elem/culls.ts +3 -3
  408. package/src/debug/functions/draw-elem/draw-circle-percent.ts +1 -1
  409. package/src/debug/functions/draw-elem/draw-elem.ts +10 -6
  410. package/src/debug/functions/draw-elem/dull-corner.ts +10 -6
  411. package/src/debug/functions/draw-elem/leaves.ts +2 -2
  412. package/src/debug/functions/draw-elem/loop.ts +4 -3
  413. package/src/debug/functions/draw-elem/loops.ts +1 -2
  414. package/src/debug/functions/draw-elem/loose-bounding-box.ts +8 -3
  415. package/src/debug/functions/draw-elem/mat.ts +16 -8
  416. package/src/debug/functions/draw-elem/max-vertex.ts +2 -2
  417. package/src/debug/functions/draw-elem/min-y.ts +4 -9
  418. package/src/debug/functions/draw-elem/one-prong-at-dull-corner.ts +10 -2
  419. package/src/debug/functions/draw-elem/one-prong.ts +12 -15
  420. package/src/debug/functions/draw-elem/sharp-corner.ts +10 -6
  421. package/src/debug/functions/draw-elem/three-prong.ts +13 -11
  422. package/src/debug/functions/draw-elem/tight-bounding-box.ts +9 -3
  423. package/src/debug/functions/draw-elem/two-prong.ts +12 -8
  424. package/src/debug/functions/draw-elem/vertex.ts +12 -11
  425. package/src/debug/functions/general.ts +10 -10
  426. package/src/debug/functions/three-prong.ts +16 -20
  427. package/src/debug/functions/two-prong.ts +89 -77
  428. package/src/debug/three-prong-for-debugging.ts +17 -16
  429. package/src/debug/two-prong-for-debugging.ts +7 -7
  430. package/src/error-analysis/gamma.ts +41 -0
  431. package/src/{mat/find-mat → find-2-prong}/add-1-prong.ts +19 -16
  432. package/src/{mat/find-mat → find-2-prong}/add-2-prong.ts +45 -91
  433. package/src/find-2-prong/add-debug-info.ts +49 -0
  434. package/src/{mat/find-mat/find-2-prong → find-2-prong}/cull-bezier-pieces.ts +9 -11
  435. package/src/find-2-prong/find-2-prong.ts +191 -0
  436. package/src/{mat/find-mat → find-2-prong}/find-and-add-2-prongs-on-all-paths.ts +12 -9
  437. package/src/find-2-prong/find-and-add-2-prongs.ts +88 -0
  438. package/src/{mat/find-mat → find-2-prong}/find-and-add-hole-closing-2-prongs.ts +7 -7
  439. package/src/find-2-prong/find-equidistant-point-on-line-dd.ts +77 -0
  440. package/src/{mat/find-mat/find-2-prong → find-2-prong}/find-equidistant-point-on-line.ts +1 -1
  441. package/src/find-2-prong/get-initial-bezier-pieces.ts +61 -0
  442. package/src/find-2-prong/pyth-trips.ts +146 -0
  443. package/src/find-2-prong/reduce-radius.ts +98 -0
  444. package/src/find-2-prong/squared-distance-between-dd.ts +25 -0
  445. package/src/find-2-prong/x-for-debugging.ts +13 -0
  446. package/src/find-3-prong.ts/add-3-prong.ts +110 -0
  447. package/src/{mat/find-mat/find-3-prong → find-3-prong.ts}/calc-better-x.ts +5 -5
  448. package/src/{mat/find-mat/find-3-prong → find-3-prong.ts}/calc-initial-3-prong-center.ts +11 -12
  449. package/src/{mat/find-mat/find-3-prong → find-3-prong.ts}/find-3-prong-for-delta3s.ts +28 -28
  450. package/src/find-3-prong.ts/find-3-prong.ts +148 -0
  451. package/src/find-3-prong.ts/find-and-add-3-prongs.ts +111 -0
  452. package/src/find-3-prong.ts/find-and-add-all-3-prongs.ts +109 -0
  453. package/src/find-3-prong.ts/get-closest-points.ts +24 -0
  454. package/src/{mat/find-mat → find-mat}/add-debug-info.ts +10 -10
  455. package/src/{mat/find-mat → find-mat}/create-initial-cp-graph.ts +11 -12
  456. package/src/find-mat/find-mat.ts +89 -0
  457. package/src/find-mat/find-mats.ts +83 -0
  458. package/src/find-mat/fix-ordering.ts +69 -0
  459. package/src/find-mat/get-dull-corners.ts +34 -0
  460. package/src/find-mat/get-for-1-prongs-on-loop.ts +40 -0
  461. package/src/find-mat/get-for-2-prongs-on-loop.ts +44 -0
  462. package/src/find-mat/get-sharp-corners.ts +33 -0
  463. package/src/find-mat/get-size-params.ts +34 -0
  464. package/src/{mat/find-mat → find-mat}/get-total-by.ts +4 -4
  465. package/src/{mat/geometry → geometry}/get-closest-square-distance-to-rect.ts +1 -1
  466. package/src/{mat/geometry → geometry}/get-closest-squared-distance-to-rotated-rect.ts +2 -2
  467. package/src/get-curve/get-curve-between.ts +7 -7
  468. package/src/get-curve/get-edge-direction.ts +11 -11
  469. package/src/index.ts +64 -21
  470. package/src/loop/get-max-coordinate.ts +1 -1
  471. package/src/mat/add-to-cp-graph.ts +15 -12
  472. package/src/mat/bezier-piece.ts +2 -2
  473. package/src/mat/cmp-cp-on-delta.ts +6 -3
  474. package/src/mat/create-new-cp-tree.ts +6 -9
  475. package/src/mat/elem-type-two-prong.ts +1 -1
  476. package/src/mat/get-boundary-piece-beziers.ts +7 -7
  477. package/src/{get-branches.ts → mat/get-branches.ts} +8 -8
  478. package/src/mat/get-edges-as-array.ts +2 -2
  479. package/src/mat/get-largest-three-prong.ts +3 -3
  480. package/src/mat/get-largest-vertex.ts +2 -2
  481. package/src/mat/get-neighboring-cps.ts +9 -6
  482. package/src/mat/get-two-prong-type.ts +1 -1
  483. package/src/mat/is-another-cp-closeby.ts +29 -44
  484. package/src/{mat.ts → mat/mat.ts} +2 -2
  485. package/src/mat/simplify-mat-map-only.ts +5 -5
  486. package/src/{simplify-mat.ts → mat/simplify-mat.ts} +12 -14
  487. package/src/mat/trim-mat.ts +3 -3
  488. package/src/point-on-shape/calc-pos-order.ts +35 -0
  489. package/src/point-on-shape/compare-poss.ts +26 -0
  490. package/src/point-on-shape/create-pos.ts +21 -0
  491. package/src/point-on-shape/get-osculating-circle.ts +39 -0
  492. package/src/point-on-shape/get-pos-corner.ts +16 -0
  493. package/src/point-on-shape/is-pos-corner.ts +12 -0
  494. package/src/point-on-shape/is-pos-dull-corner.ts +16 -0
  495. package/src/point-on-shape/is-pos-quite-dull-corner.ts +17 -0
  496. package/src/point-on-shape/is-pos-quite-sharp-corner.ts +17 -0
  497. package/src/point-on-shape/is-pos-sharp-corner.ts +17 -0
  498. package/src/point-on-shape/point-on-shape.ts +15 -0
  499. package/src/point-on-shape/pos-to-human-string.ts +16 -0
  500. package/src/{mat/to-scale-axis → sat}/add-debug-info.ts +3 -3
  501. package/src/{mat/to-scale-axis → sat}/cull-non-cycles.ts +7 -7
  502. package/src/{mat/to-scale-axis → sat}/cull.ts +6 -6
  503. package/src/{mat → sat}/get-leaves.ts +4 -4
  504. package/src/{mat/to-scale-axis → sat}/t-tree.ts +2 -2
  505. package/src/{to-scale-axis.ts → sat/to-scale-axis.ts} +16 -16
  506. package/src/{mat/to-scale-axis → sat}/traverse-spacial-tree.ts +5 -5
  507. package/src/svg/get-loop-bounds.ts +22 -17
  508. package/src/svg/get-min-y-pos.ts +3 -3
  509. package/src/svg/get-shape-bounds.ts +12 -9
  510. package/src/sweep-line/are-boxes-intersecting.ts +1 -1
  511. package/src/sweep-line/sweep-line.ts +7 -7
  512. package/tsconfig.json +3 -7
  513. package/wallaby.mjs +32 -0
  514. package/node/circle.js.map +0 -1
  515. package/node/compare-curvatures-at-interface.js.map +0 -1
  516. package/node/contact-point.js.map +0 -1
  517. package/node/cp-node.d.ts +0 -202
  518. package/node/cp-node.js +0 -321
  519. package/node/cp-node.js.map +0 -1
  520. package/node/curve.js.map +0 -1
  521. package/node/find-mats.js +0 -123
  522. package/node/find-mats.js.map +0 -1
  523. package/node/get-boundary-bezier-parts-to-next.js.map +0 -1
  524. package/node/get-boundary-beziers-to-next.js.map +0 -1
  525. package/node/get-bounding-box-.js.map +0 -1
  526. package/node/get-branches.js.map +0 -1
  527. package/node/get-curve-to-next.js.map +0 -1
  528. package/node/get-interface-ccw.js.map +0 -1
  529. package/node/loop.d.ts +0 -16
  530. package/node/loop.js +0 -35
  531. package/node/loop.js.map +0 -1
  532. package/node/mat/closest-boundary-point/closest-points-on-curve.d.ts +0 -14
  533. package/node/mat/closest-boundary-point/closest-points-on-curve.js +0 -73
  534. package/node/mat/closest-boundary-point/closest-points-on-curve.js.map +0 -1
  535. package/node/mat/closest-boundary-point/cull-bezier-pieces.d.ts +0 -9
  536. package/node/mat/closest-boundary-point/cull-bezier-pieces.js +0 -20
  537. package/node/mat/closest-boundary-point/cull-bezier-pieces.js.map +0 -1
  538. package/node/mat/closest-boundary-point/cull-by-loose-bounding-box.js.map +0 -1
  539. package/node/mat/closest-boundary-point/cull-by-tight-boundary-box.js.map +0 -1
  540. package/node/mat/closest-boundary-point/get-best-distance-squared.js.map +0 -1
  541. package/node/mat/closest-boundary-point/get-close-boundary-points.d.ts +0 -17
  542. package/node/mat/closest-boundary-point/get-close-boundary-points.js +0 -81
  543. package/node/mat/closest-boundary-point/get-close-boundary-points.js.map +0 -1
  544. package/node/mat/closest-boundary-point/get-closest-boundary-point.d.ts +0 -18
  545. package/node/mat/closest-boundary-point/get-closest-boundary-point.js +0 -41
  546. package/node/mat/closest-boundary-point/get-closest-boundary-point.js.map +0 -1
  547. package/node/mat/find-mat/add-1-prong.d.ts +0 -12
  548. package/node/mat/find-mat/add-1-prong.js.map +0 -1
  549. package/node/mat/find-mat/add-2-prong.js.map +0 -1
  550. package/node/mat/find-mat/add-3-prong.js +0 -55
  551. package/node/mat/find-mat/add-3-prong.js.map +0 -1
  552. package/node/mat/find-mat/add-debug-info.js.map +0 -1
  553. package/node/mat/find-mat/create-get-interesting-points-on-loop.d.ts +0 -11
  554. package/node/mat/find-mat/create-get-interesting-points-on-loop.js +0 -52
  555. package/node/mat/find-mat/create-get-interesting-points-on-loop.js.map +0 -1
  556. package/node/mat/find-mat/create-initial-cp-graph.js.map +0 -1
  557. package/node/mat/find-mat/find-2-prong/add-debug-info.d.ts +0 -8
  558. package/node/mat/find-mat/find-2-prong/add-debug-info.js.map +0 -1
  559. package/node/mat/find-mat/find-2-prong/cull-bezier-pieces.d.ts +0 -11
  560. package/node/mat/find-mat/find-2-prong/cull-bezier-pieces.js +0 -30
  561. package/node/mat/find-mat/find-2-prong/cull-bezier-pieces.js.map +0 -1
  562. package/node/mat/find-mat/find-2-prong/find-2-prong.js +0 -233
  563. package/node/mat/find-mat/find-2-prong/find-2-prong.js.map +0 -1
  564. package/node/mat/find-mat/find-2-prong/find-equidistant-point-on-line.d.ts +0 -9
  565. package/node/mat/find-mat/find-2-prong/find-equidistant-point-on-line.js +0 -40
  566. package/node/mat/find-mat/find-2-prong/find-equidistant-point-on-line.js.map +0 -1
  567. package/node/mat/find-mat/find-2-prong/get-initial-bezier-pieces.d.ts +0 -11
  568. package/node/mat/find-mat/find-2-prong/get-initial-bezier-pieces.js +0 -38
  569. package/node/mat/find-mat/find-2-prong/get-initial-bezier-pieces.js.map +0 -1
  570. package/node/mat/find-mat/find-2-prong/x-for-debugging.d.ts +0 -9
  571. package/node/mat/find-mat/find-2-prong/x-for-debugging.js.map +0 -1
  572. package/node/mat/find-mat/find-3-prong/calc-better-x.js.map +0 -1
  573. package/node/mat/find-mat/find-3-prong/calc-initial-3-prong-center.js.map +0 -1
  574. package/node/mat/find-mat/find-3-prong/find-3-prong-for-delta3s.js.map +0 -1
  575. package/node/mat/find-mat/find-3-prong/find-3-prong.js.map +0 -1
  576. package/node/mat/find-mat/find-3-prong/get-closest-points.js +0 -17
  577. package/node/mat/find-mat/find-3-prong/get-closest-points.js.map +0 -1
  578. package/node/mat/find-mat/find-and-add-2-prongs-on-all-paths.d.ts +0 -15
  579. package/node/mat/find-mat/find-and-add-2-prongs-on-all-paths.js.map +0 -1
  580. package/node/mat/find-mat/find-and-add-2-prongs.js +0 -74
  581. package/node/mat/find-mat/find-and-add-2-prongs.js.map +0 -1
  582. package/node/mat/find-mat/find-and-add-3-prongs.js +0 -147
  583. package/node/mat/find-mat/find-and-add-3-prongs.js.map +0 -1
  584. package/node/mat/find-mat/find-and-add-hole-closing-2-prongs.js.map +0 -1
  585. package/node/mat/find-mat/get-potential-2-prongs.d.ts +0 -4
  586. package/node/mat/find-mat/get-potential-2-prongs.js +0 -17
  587. package/node/mat/find-mat/get-potential-2-prongs.js.map +0 -1
  588. package/node/mat/find-mat/get-sharp-corners.d.ts +0 -4
  589. package/node/mat/find-mat/get-sharp-corners.js +0 -18
  590. package/node/mat/find-mat/get-sharp-corners.js.map +0 -1
  591. package/node/mat/geometry/get-closest-square-distance-to-rect.js.map +0 -1
  592. package/node/mat/geometry/get-closest-squared-distance-to-rotated-rect.js.map +0 -1
  593. package/node/mat/get-contact-circles-at-interface.d.ts +0 -8
  594. package/node/mat/get-contact-circles-at-interface.js +0 -21
  595. package/node/mat/get-contact-circles-at-interface.js.map +0 -1
  596. package/node/mat/get-leaves.js +0 -13
  597. package/node/mat/get-leaves.js.map +0 -1
  598. package/node/mat/to-scale-axis/add-debug-info.js.map +0 -1
  599. package/node/mat/to-scale-axis/cull-non-cycles.js.map +0 -1
  600. package/node/mat/to-scale-axis/cull.js.map +0 -1
  601. package/node/mat.js.map +0 -1
  602. package/node/point-on-shape.d.ts +0 -73
  603. package/node/point-on-shape.js +0 -168
  604. package/node/point-on-shape.js.map +0 -1
  605. package/node/simplify-mat.js.map +0 -1
  606. package/node/to-scale-axis.js.map +0 -1
  607. package/node/traverse-edges.js.map +0 -1
  608. package/node/traverse-vertices.js.map +0 -1
  609. package/src/cp-node.ts +0 -388
  610. package/src/find-mats.ts +0 -171
  611. package/src/loop.ts +0 -56
  612. package/src/mat/closest-boundary-point/closest-point-on-curve-old.ts_ +0 -88
  613. package/src/mat/closest-boundary-point/closest-point-on-curve.ts_ +0 -95
  614. package/src/mat/closest-boundary-point/closest-points-on-curve.ts +0 -84
  615. package/src/mat/closest-boundary-point/cull-bezier-pieces.ts +0 -38
  616. package/src/mat/closest-boundary-point/get-close-boundary-points.ts +0 -107
  617. package/src/mat/closest-boundary-point/get-closest-boundary-point.ts +0 -64
  618. package/src/mat/find-mat/add-3-prong.ts +0 -75
  619. package/src/mat/find-mat/create-get-interesting-points-on-loop.ts +0 -73
  620. package/src/mat/find-mat/find-2-prong/add-debug-info.ts +0 -46
  621. package/src/mat/find-mat/find-2-prong/find-2-prong.ts +0 -316
  622. package/src/mat/find-mat/find-2-prong/get-initial-bezier-pieces.ts +0 -52
  623. package/src/mat/find-mat/find-2-prong/x-for-debugging.ts +0 -13
  624. package/src/mat/find-mat/find-3-prong/find-3-prong.ts +0 -106
  625. package/src/mat/find-mat/find-3-prong/get-closest-points.ts +0 -28
  626. package/src/mat/find-mat/find-and-add-2-prongs.ts +0 -108
  627. package/src/mat/find-mat/find-and-add-3-prongs.ts +0 -218
  628. package/src/mat/find-mat/get-potential-2-prongs.ts +0 -24
  629. package/src/mat/find-mat/get-sharp-corners.ts +0 -25
  630. package/src/mat/find-mat/get-total-abs-curvature.ts +0 -17
  631. package/src/mat/get-contact-circles-at-interface.ts +0 -26
  632. package/src/mat/to-scale-axis/add-to-tree.ts +0 -66
  633. package/src/mat/to-scale-axis/calc-groups.ts +0 -82
  634. package/src/mat/to-scale-axis/create-spacial-tree.ts +0 -41
  635. package/src/mat/to-scale-axis/get-engulfed-vertices.ts +0 -135
  636. package/src/point-on-shape.ts +0 -231
  637. package/src/svg/get-curvature-at-interface.ts +0 -55
  638. /package/node/{compare-curvatures-at-interface.d.ts → corner/compare-curvatures-at-interface.d.ts} +0 -0
  639. /package/node/{mat → corner}/corner.js +0 -0
  640. /package/node/{get-interface-ccw.d.ts → corner/get-interface-ccw.d.ts} +0 -0
  641. /package/node/{get-boundary-bezier-parts-to-next.d.ts → cp-node/get-boundary-bezier-parts-to-next.d.ts} +0 -0
  642. /package/node/{get-curve-to-next.d.ts → cp-node/get-curve-to-next.d.ts} +0 -0
  643. /package/node/{traverse-edges.d.ts → cp-node/traverse-edges.d.ts} +0 -0
  644. /package/node/{traverse-vertices.d.ts → cp-node/traverse-vertices.d.ts} +0 -0
  645. /package/node/{mat/find-mat/find-2-prong → find-2-prong}/x-for-debugging.js +0 -0
  646. /package/node/{circle.d.ts → geometry/circle.d.ts} +0 -0
  647. /package/node/{circle.js → geometry/circle.js} +0 -0
  648. /package/node/{get-bounding-box-.d.ts → geometry/get-bounding-box-.d.ts} +0 -0
  649. /package/node/{get-bounding-box-.js → geometry/get-bounding-box-.js} +0 -0
  650. /package/node/{mat.js → mat/mat.js} +0 -0
  651. /package/src/{circle.ts → geometry/circle.ts} +0 -0
  652. /package/src/{get-bounding-box-.ts → geometry/get-bounding-box-.ts} +0 -0
@@ -1 +0,0 @@
1
- {"version":3,"file":"add-3-prong.js","sourceRoot":"","sources":["../../../src/mat/find-mat/add-3-prong.ts"],"names":[],"mappings":"AAKA,OAAO,EAAE,YAAY,EAAE,MAAM,uBAAuB,CAAC;AACrD,OAAO,EAAE,kBAAkB,EAAE,MAAM,6BAA6B,CAAC;AAGjE;;;;;;;GAOG;AACH,SAAS,SAAS,CAChB,OAAmC,EACnC,MAAgB,EAChB,UAIC;IAEF,MAAM,EAAE,MAAM,EAAE,EAAE,EAAE,IAAI,EAAE,GAAG,EAAE,GAAG,UAAU,CAAC;IAE7C,uCAAuC;IACvC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;MAgCE;IAEF,+CAA+C;IAC/C,kBAAkB,CAAC,OAAO,EAAE,IAAI,CAAC,CAAC,CAAC,EAAE,MAAM,EAAE,MAAM,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,IAAI,EAAE,MAAM,CAAC,CAAC;IACzE,kBAAkB,CAAC,OAAO,EAAE,IAAI,CAAC,CAAC,CAAC,EAAE,MAAM,EAAE,MAAM,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,IAAI,EAAE,MAAM,CAAC,CAAC;IACzE,kBAAkB,CAAC,OAAO,EAAE,IAAI,CAAC,CAAC,CAAC,EAAE,MAAM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C,GAAQ;IAC3B,IAAI,OAAO,OAAO,KAAK,WAAW,EAAE;QAAE,OAAO;KAAE;IAE/C,MAAM,SAAS,GAAG,OAAO,CAAC,SAAS,CAAC;IACpC,MAAM,MAAM,GAAG,SAAS,CAAC,MAAM,CAAC;IAEhC,SAAS,CAAC,KAAK,CAAC,GAAG,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;IAE9B,MAAM,CAAC,WAAW,IAAI,WAAW,CAAC,GAAG,EAAE,GAAG,WAAW,CAAC;AAC1D,CAAC;AAGD,OAAO,EAAE,aAAa,EAAE,aAAa,EAAE,aAAa,EAAE,aAAa,EAAE,CAAA"}
@@ -1,11 +0,0 @@
1
- import { Loop } from '../../loop.js';
2
- import { IPointOnShape } from '../../point-on-shape.js';
3
- /**
4
- * @hidden
5
- * Get useful points on the shape - these incude points of maximum curvature and
6
- * points at the bezier-bezier interfaces.
7
- * @param loop
8
- * @param additionalPointCount
9
- */
10
- declare function getInterestingPointsOnLoop(minBezLength: number, maxCurviness: number, maxLength: number): (loop: Loop) => IPointOnShape[];
11
- export { getInterestingPointsOnLoop };
@@ -1,52 +0,0 @@
1
- import { getCurvatureExtrema, splitByCurvatureAndLength, controlPointLinesLength } from 'flo-bezier3';
2
- import { getContactCirclesAtInterface } from '../get-contact-circles-at-interface.js';
3
- import { PointOnShape, comparePoss } from '../../point-on-shape.js';
4
- /**
5
- * @hidden
6
- * Get useful points on the shape - these incude points of maximum curvature and
7
- * points at the bezier-bezier interfaces.
8
- * @param loop
9
- * @param additionalPointCount
10
- */
11
- function getInterestingPointsOnLoop(minBezLength, maxCurviness, maxLength) {
12
- return function (loop) {
13
- const allPoints = [];
14
- for (let i = 0; i < loop.curves.length; i++) {
15
- const curve = loop.curves[i];
16
- // qqq if (lengthSquaredUpperBound(curve.ps) < minBezLength) {
17
- if (controlPointLinesLength(curve.ps) < minBezLength) {
18
- continue;
19
- }
20
- /*
21
- let { maxCurvatureTs, maxNegativeCurvatureTs } =
22
- getCurvatureExtrema(curve.ps);
23
- let maxCurvatures = maxCurvatureTs.map(t => new PointOnShape(curve, t));
24
- let maxNegativeCurvatures = maxNegativeCurvatureTs.map(t => new PointOnShape(curve, t));
25
-
26
- allPoints.push(
27
- ...getContactCirclesAtInterface(curve),
28
- ...maxCurvatures,
29
- ...maxNegativeCurvatures
30
- );
31
- */
32
- // let { maxima } = getCurvatureExtrema(curve.ps);
33
- // qqq let { maxCurvatureTs, maxNegativeCurvatureTs } = getCurvatureExtrema(curve.ps);
34
- const { maxima } = getCurvatureExtrema(curve.ps);
35
- // let maxAbsCurvatures = maxima.map(t => new PointOnShape(curve, t));
36
- // qqq let maxAbsCurvatures = [...maxCurvatureTs, ...maxNegativeCurvatureTs].map(t => new PointOnShape(curve, t));
37
- const maxAbsCurvatures = [...maxima].map(t => new PointOnShape(curve, t));
38
- allPoints.push(...getContactCirclesAtInterface(curve), ...maxAbsCurvatures);
39
- let ts = splitByCurvatureAndLength(curve.ps, maxCurviness, maxLength);
40
- if (ts.length === 2) {
41
- ts = [0, 0.5, 1];
42
- }
43
- for (let i = 1; i < ts.length - 1; i++) {
44
- allPoints.push(new PointOnShape(curve, ts[i]));
45
- }
46
- }
47
- allPoints.sort(comparePoss);
48
- return allPoints;
49
- };
50
- }
51
- export { getInterestingPointsOnLoop };
52
- //# sourceMappingURL=create-get-interesting-points-on-loop.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"create-get-interesting-points-on-loop.js","sourceRoot":"","sources":["../../../src/mat/find-mat/create-get-interesting-points-on-loop.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,mBAAmB,EAAE,yBAAyB,EAAE,uBAAuB,EAAE,MAAM,aAAa,CAAC;AACtG,OAAO,EAAE,4BAA4B,EAAE,MAAM,wCAAwC,CAAC;AAEtF,OAAO,EAAE,YAAY,EAAE,WAAW,EAAiB,MAAM,yBAAyB,CAAC;AAGnF;;;;;;GAMG;AACH,SAAS,0BAA0B,CAC3B,YAAoB,EACpB,YAAoB,EACp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AAE,CAAC,EAAE,CAAC;YAE9E,OAAO,GAAG,MAAM,CAAC,MAAM,CAAC,KAAK,EAAE,kBAAkB,CAAC,KAAK,EAAE,MAAM,EAAE,GAAG,EAAE,OAAO,CAAC,CAAC;YAC/E,OAAO,GAAG,MAAM,CAAC,MAAM,CAAC,KAAK,EAAE,kBAAkB,CAAC,KAAK,EAAE,MAAM,EAAE,GAAG,EAAE,OAAO,CAAC,CAAC;YAE/E,OAAO,CAAC,YAAY,GAAG,OAAO,CAAC;YAC/B,OAAO,CAAC,YAAY,GAAG,OAAO,CAAC;YAE/B,OAAO,CAAC,YAAY,GAAG,OAAO,CAAC;YAC/B,OAAO,CAAC,YAAY,GAAG,OAAO,CAAC;SAClC;QAED,IAAI,CAAC,MAAM,EAAE;YAAE,MAAM,GAAG,OAAO,CAAC;SAAE;QAElC,MAAM,IAAI,GAAG,KAAK,CAAC,CAAC,CAAC,CAAC;QACtB,OAAO,CAAC,GAAG,CAAC,IAAI,EAAE,MAAM,CAAC,CAAC;KAC7B;IAED,OAAO,MAAM,CAAC;AAClB,CAAC;AAGD,OAAO,EAAE,oBAAoB,EAAE,CAAA"}
@@ -1,8 +0,0 @@
1
- import { IPointOnShape } from '../../../point-on-shape.js';
2
- import { Circle } from '../../../circle.js';
3
- import { CpNode } from '../../../cp-node.js';
4
- import { BezierPiece } from '../../bezier-piece.js';
5
- import { TXForDebugging } from './x-for-debugging.js';
6
- /** @hidden */
7
- declare function addDebugInfo(bezierPieces: BezierPiece[], failed: boolean, pos: IPointOnShape, circle: Circle, z: IPointOnShape, δ: CpNode[], xs: TXForDebugging[], holeClosing: boolean): void;
8
- export { addDebugInfo };
@@ -1 +0,0 @@
1
- {"version":3,"file":"add-debug-info.js","sourceRoot":"","sources":["../../../../src/mat/find-mat/find-2-prong/add-debug-info.ts"],"names":[],"mappings":"AASA,OAAO,EAAE,eAAe,EAAE,MAAM,6BAA6B,CAAC;AAK9D,cAAc;AACd,SAAS,YAAY,CACb,YAA2B,EAC3B,MAAe,EACf,GAAkB,EAClB,MAAc,EACd,CAAgB,EAChB,CAAW,EACX,EAAoB,EACpB,WAAoB;IAExB,MAAM,QAAQ,GAAyB;QAC/B,SAAS,EAAE,OAAO,CAAC,SAAS;QAC5B,YAAY;QACZ,GAAG;QACH,CAAC;QACD,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,SAAS;QACtB,MAAM;QACN,EAAE;QACF,MAAM;QACN,WAAW;QACX,QAAQ,EAAE,KAAK;QACf,OAAO,EAAE,KAAK;QACd,MAAM,EAAE,SAAS;KACxB,CAAC;IAEF,MAAM,YAAY,GAAG,eAAe,CAAC,QAAQ,CAAsB,CAAC;IACpE,OAAO,CAAC,SAAS,CAAC,KAAK,CAAC,YAAY,CAAC,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC;AACzD,CAAC;AAGD,OAAO,EAAE,YAAY,EAAE,CAAA"}
@@ -1,11 +0,0 @@
1
- import { BezierPiece } from '../../bezier-piece.js';
2
- /**
3
- * @hidden
4
- * Cull all bezierPieces not within given radius of a given point.
5
- * @param extreme
6
- * @param bezierPieces
7
- * @param p
8
- * @param rSquared
9
- */
10
- declare function cullBezierPieces(bezierPieces: BezierPiece[], p: number[], rSquared: number): BezierPiece[];
11
- export { cullBezierPieces };
@@ -1,30 +0,0 @@
1
- import { getClosestSquareDistanceToRect } from '../../geometry/get-closest-square-distance-to-rect.js';
2
- import { getBoundingBox_ } from '../../../get-bounding-box-.js';
3
- /**
4
- * @hidden
5
- * Cull all bezierPieces not within given radius of a given point.
6
- * @param extreme
7
- * @param bezierPieces
8
- * @param p
9
- * @param rSquared
10
- */
11
- function cullBezierPieces(bezierPieces, p, rSquared) {
12
- const CULL_THRESHOLD = 5;
13
- // TODO - base delta on theory
14
- const TOLERANCE = 1 + 1e-3;
15
- if (bezierPieces.length <= CULL_THRESHOLD) {
16
- return bezierPieces;
17
- }
18
- const newPieces = [];
19
- for (const bezierPiece of bezierPieces) {
20
- const ps = bezierPiece.curve.ps;
21
- const rect = getBoundingBox_(ps);
22
- const bd = getClosestSquareDistanceToRect(rect, p);
23
- if (bd <= rSquared * TOLERANCE) {
24
- newPieces.push(bezierPiece);
25
- }
26
- }
27
- return newPieces;
28
- }
29
- export { cullBezierPieces };
30
- //# sourceMappingURL=cull-bezier-pieces.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"cull-bezier-pieces.js","sourceRoot":"","sources":["../../../../src/mat/find-mat/find-2-prong/cull-bezier-pieces.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,8BAA8B,EAAE,MAAM,uDAAuD,CAAC;AAEvG,OAAO,EAAE,eAAe,EAAE,MAAM,+BAA+B,CAAC;AAGhE;;;;;;;GAOG;AACH,SAAS,gBAAgB,CACjB,YAA2B,EAC3B,CAAW,EACX,QAAgB;IAEpB,MAAM,cAAc,GAAG,CAAC,CAAC;IACzB,8BAA8B;IAC9B,MAAM,SAAS,GAAG,CAAC,GAAC,IAAI,CAAC;IAEzB,IAAI,YAAY,CAAC,MAAM,IAAI,cAAc,EAAE;QACvC,OAAO,YAAY,CAAC;KACvB;IAGD,MAAM,SAAS,GAAG,EAAE,CAAC;IACrB,KAAK,MAAM,WAAW,IAAI,YAAY,EAAE;QACpC,MAAM,EAAE,GAAG,WAAW,CAAC,KAAK,CAAC,EAAE,CAAC;QAEhC,MAAM,IAAI,GAAG,eAAe,CAAC,EAAE,CAAC,CAAC;QACjC,MAAM,EAAE,GAAG,8BAA8B,CAAC,IAAI,EAAE,CAAC,CAAC,CAAC;QACnD,IAAI,EAAE,IAAI,QAAQ,GAAG,SAAS,EAAE;YAC5B,SAAS,CAAC,IAAI,CAAC,WAAW,CAAC,CAAC;SAC/B;KACJ;IAED,OAAO,SAAS,CAAC;AACrB,CAAC;AAGD,OAAO,EAAE,gBAAgB,EAAE,CAAA"}
@@ -1,233 +0,0 @@
1
- import { lineLineIntersection, distanceBetween, squaredDistanceBetween, interpolate, dot } from 'flo-vector2d';
2
- import { evalDeCasteljau as evalDeCasteljau_ } from 'flo-bezier3';
3
- import { getClosestBoundaryPoint } from '../../closest-boundary-point/get-closest-boundary-point.js';
4
- import { getOsculatingCircle } from '../../../point-on-shape.js';
5
- import { add1Prong } from '../add-1-prong.js';
6
- import { addDebugInfo } from './add-debug-info.js';
7
- import { cullBezierPieces } from './cull-bezier-pieces.js';
8
- import { findEquidistantPointOnLine } from './find-equidistant-point-on-line.js';
9
- import { getInitialBezierPieces } from './get-initial-bezier-pieces.js';
10
- import { getCloseBoundaryPoints } from '../../closest-boundary-point/get-close-boundary-points.js';
11
- const evalDeCasteljau = evalDeCasteljau_;
12
- /**
13
- * @hidden
14
- * Adds a 2-prong to the MAT. The first point on the shape boundary is given and
15
- * the second one is found by the algorithm.
16
- *
17
- * A 2-prong is defined as a MAT circle that touches the shape at exactly 2
18
- * points.
19
- *
20
- * Before any 2-prongs are added the entire shape is our δΩ (1-prongs do not
21
- * reduce the boundary).
22
- *
23
- * As per the paper by Choi, Choi, Moon and Wee:
24
- * "The starting point of this algorithm is a choice of a circle Br(x)
25
- * centered at an interior point x which contains two boundary portions c and
26
- * d of dΩ as in Fig. 19."
27
- * In fact, we (and they) start by fixing one point on the boundary beforehand.
28
- * @param loops A shape represented by path loops
29
- * @param extreme The extreme coordinate value of the shape
30
- * @param squaredDiagonalLength The squared diagonal length of the shape
31
- * bounding box.
32
- * @param y The source point of the 2-prong to be found
33
- * @param isHoleClosing True if this is a hole-closing two-prong, false otherwise
34
- * @param k The loop array index
35
- */
36
- function find2Prong(loops, extreme, squaredDiagonalLength, cpTrees, y, isHoleClosing, k) {
37
- const MAX_ITERATIONS = 25;
38
- const squaredSeperationTolerance = (1e-6 * extreme) ** 2;
39
- // TODO - base deltas on theory or remove
40
- const oneProngTolerance = (1e-4) ** 2;
41
- const squaredErrorTolerance = 1e-2 * squaredSeperationTolerance;
42
- const maxOsculatingCircleRadiusSquared = squaredDiagonalLength;
43
- // The boundary piece that should contain the other point of
44
- // the 2-prong circle. (Defined by start and end points).
45
- const { bezierPieces, δ } = getInitialBezierPieces(isHoleClosing, k, loops, cpTrees, y);
46
- //console.log(bezierPieces.length)
47
- /** The center of the two-prong (successively refined) */
48
- let x;
49
- let p;
50
- let r;
51
- if (isHoleClosing) {
52
- p = [y.p[0], y.p[1]];
53
- x = [p[0], p[1] - Math.sqrt(maxOsculatingCircleRadiusSquared)];
54
- r = maxOsculatingCircleRadiusSquared;
55
- }
56
- else {
57
- p = y.p;
58
- //x = PointOnShape.getOsculatingCircle(maxOsculatingCircleRadiusSquared, y).center;
59
- x = getOsculatingCircle(maxOsculatingCircleRadiusSquared, y).center;
60
- r = squaredDistanceBetween(p, x);
61
- }
62
- // The lines below is an optimization.
63
- const r_ = reduceRadius(extreme, bezierPieces, p, x);
64
- if (r > r_) {
65
- x = interpolate(p, x, Math.sqrt(r_ / r));
66
- }
67
- /** Trace the convergence (for debugging). */
68
- const xs = [];
69
- /** The antipode of the two-prong (successively refined) */
70
- let z;
71
- let i = 0;
72
- let done = 0;
73
- let failed = false; // The failed flag is set if a 2-prong cannot be found.
74
- let bezierPieces_ = bezierPieces;
75
- // ---> for (let b of bezierPieces) { d.fs.draw.bezierPiece(document.getElementsByTagName('g')[0], b.curve.ps, b.ts, 'nofill thin10 red', 100); }
76
- do {
77
- i++;
78
- /** squared distance between source boundary point and circle center */
79
- const r = squaredDistanceBetween(x, y.p);
80
- bezierPieces_ = cullBezierPieces(bezierPieces_, x, r);
81
- z = getClosestBoundaryPoint(bezierPieces_, x, y.curve, y.t);
82
- if (z === undefined) {
83
- if (typeof _debug_ !== 'undefined') {
84
- const elems = _debug_.generated.elems;
85
- const elem = isHoleClosing
86
- ? elems.twoProng_holeClosing
87
- : elems.twoProng_regular;
88
- const elemStr = isHoleClosing
89
- ? 'hole-closing: ' + elem.length
90
- : 'regular: ' + elem.length;
91
- console.log('failed: no closest point - ' + elemStr);
92
- }
93
- failed = true;
94
- break;
95
- }
96
- if (typeof _debug_ !== 'undefined') {
97
- xs.push({ x, y, z: z.pos, t: y.t });
98
- }
99
- /** squared distance between anti-pode boundary point and circle center */
100
- const d = squaredDistanceBetween(x, z.pos.p);
101
- //if (i === 1 && d*oneProngTolerance >= r) {
102
- if (i === 1 && r < d + oneProngTolerance) {
103
- // It is a 1-prong.
104
- add1Prong(Math.sqrt(maxOsculatingCircleRadiusSquared), cpTrees, y);
105
- return undefined;
106
- }
107
- // TODO - squaredSeperationTolerance should in future be replaced with
108
- // a relative error, i.e. distance between y (or z) / length(y (or z)).
109
- if (!isHoleClosing && squaredDistanceBetween(y.p, z.pos.p) <= squaredSeperationTolerance) {
110
- if (typeof _debug_ !== 'undefined') {
111
- /*
112
- let elems = _debug_.generated.elems;
113
- let elem = isHoleClosing
114
- ? elems.twoProng_holeClosing
115
- : elems.twoProng_regular
116
- let elemStr = isHoleClosing
117
- ? 'hole-closing: ' + elem.length
118
- : 'regular: ' + elem.length;
119
- console.log(
120
- 'failed: two-prong radius too small - ' + elemStr
121
- );
122
- */
123
- }
124
- failed = true;
125
- break;
126
- }
127
- // TODO - Accuracy optimization: tolerance should not be between x and
128
- // nextX, but rather (distance from x to y) - (distance from x to z)
129
- // Find the point on the line connecting y with x that is
130
- // equidistant from y and z. This will be our next x.
131
- const nextX = findEquidistantPointOnLine(x, y.p, z.pos.p);
132
- const squaredError = squaredDistanceBetween(x, nextX);
133
- x = nextX;
134
- if (squaredError < squaredErrorTolerance) {
135
- done++; // Do one more iteration
136
- }
137
- else if (i === MAX_ITERATIONS) {
138
- // Convergence was too slow.
139
- failed = true;
140
- break; // We're done
141
- }
142
- } while (done < 1);
143
- // TODO - Optimization: only do this if second closest point is within the
144
- // tolerance which can be checked in getClosestBoundaryPoint algorithm
145
- let zs = [];
146
- if (!failed) {
147
- zs = getCloseBoundaryPoints(bezierPieces_, x, y, distanceBetween(x, z.pos.p));
148
- if (!zs.length) {
149
- // TODO - Numerical issue - fix
150
- zs.push(z);
151
- }
152
- }
153
- let circle;
154
- if (z !== undefined) {
155
- circle = { center: x, radius: distanceBetween(x, z.pos.p) };
156
- }
157
- if (typeof _debug_ !== 'undefined' && !failed) {
158
- xs.push({ x, y, z: z.pos, t: y.t });
159
- addDebugInfo(bezierPieces, failed, y, circle, z.pos, δ, xs, isHoleClosing);
160
- }
161
- return failed ? undefined : { circle, zs };
162
- }
163
- /**
164
- * @hidden
165
- * Reduces the circle radius initially as an optimization step.
166
- */
167
- function reduceRadius(extreme, bezierPieces, p, x) {
168
- const TOLERANCE = extreme * 1e-3;
169
- let prevP = undefined;
170
- let minRadius = Number.POSITIVE_INFINITY;
171
- for (let i = 0; i < bezierPieces.length; i++) {
172
- const bezierPiece = bezierPieces[i];
173
- const ps = bezierPiece.curve.ps;
174
- const p1 = evalDeCasteljau(ps, bezierPiece.ts[0]);
175
- let r1 = Number.POSITIVE_INFINITY;
176
- // Prevent evaluating the same points twice
177
- if (!prevP || prevP[0] !== p1[0] || prevP[1] !== p1[1]) {
178
- const cc1 = getCircleCenterFrom2PointsAndNormal(extreme, p, x, p1);
179
- if (cc1) {
180
- r1 = squaredDistanceBetween(p, cc1);
181
- }
182
- }
183
- let r2 = Number.POSITIVE_INFINITY;
184
- const p2 = evalDeCasteljau(ps, bezierPiece.ts[1]);
185
- const cc2 = getCircleCenterFrom2PointsAndNormal(extreme, p, x, p2);
186
- if (cc2) {
187
- r2 = squaredDistanceBetween(p, cc2);
188
- }
189
- prevP = p2;
190
- const d = Math.min(r1, r2);
191
- if (d < minRadius) {
192
- minRadius = d;
193
- }
194
- }
195
- // The extra bit is to account for floating point precision.
196
- // TODO - base delta on theory
197
- return minRadius + TOLERANCE;
198
- }
199
- /**
200
- * @hidden
201
- * @param p A point on the circle with normal pointing to x towards the center
202
- * of the circle.
203
- * @param x
204
- * @param p1 Another point on the circle.
205
- */
206
- function getCircleCenterFrom2PointsAndNormal(extreme, p, x, p1) {
207
- // TODO - remove delta
208
- const TOLERANCE = (1e-4 * extreme) ** 2;
209
- // Ignore if p and p1 are too close together
210
- if (squaredDistanceBetween(p, p1) < TOLERANCE) {
211
- return undefined;
212
- }
213
- /** The perpindicular bisector between the two given points on the circle */
214
- const pb = [
215
- (p[0] + p1[0]) / 2,
216
- (p[1] + p1[1]) / 2,
217
- ];
218
- const tan = [p1[0] - p[0], p1[1] - p[1]];
219
- const norm = [-tan[1], tan[0]]; // Rotate by 90 degrees
220
- const pb2 = [pb[0] + norm[0], pb[1] + norm[1]];
221
- const res = lineLineIntersection([p, x], [pb, pb2]);
222
- if (!res) {
223
- return undefined;
224
- }
225
- const resO = [res[0] - p[0], res[1] - p[1]];
226
- const xO = [x[0] - p[0], x[1] - p[1]];
227
- if (dot(resO, xO) < 0) {
228
- return undefined;
229
- }
230
- return res;
231
- }
232
- export { find2Prong };
233
- //# sourceMappingURL=find-2-prong.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"find-2-prong.js","sourceRoot":"","sources":["../../../../src/mat/find-mat/find-2-prong/find-2-prong.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,oBAAoB,EAAE,eAAe,EAAE,sBAAsB,EAAE,WAAW,EAAE,GAAG,EAAE,MAAM,cAAc,CAAC;AAC/G,OAAO,EAAE,eAAe,IAAI,gBAAgB,EAAE,MAAM,aAAa,CAAC;AAElE,OAAO,EAAE,uBAAuB,EAAE,MAC9B,4DAA4D,CAAC;AAIjE,OAAO,EAAE,mBAAmB,EAAiB,MAAM,4BAA4B,CAAC;AAEhF,OAAO,EAAE,SAAS,EAAE,MAAM,mBAAmB,CAAC;AAC9C,OAAO,EAAE,YAAY,EAAE,MAAM,qBAAqB,CAAC;AAEnD,OAAO,EAAE,gBAAgB,EAAE,MAAM,yBAAyB,CAAC;AAC3D,OAAO,EAAE,0BAA0B,EAAE,MAAM,qCAAqC,CAAC;AACjF,OAAO,EAAE,sBAAsB,EAAE,MAAM,gCAAgC,CAAC;AACxE,OAAO,EAAE,sBAAsB,EAAE,MAAM,2DAA2D,CAAC;AAGnG,MAAM,eA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AC,CAAC,CAAC,EAAC,CAAC,CAAC,EAAE,CAAC,EAAE,EAAE,GAAG,CAAC,CAAC,CAAC;IAEnD,IAAI,CAAC,GAAG,EAAE;QAAE,OAAO,SAAS,CAAC;KAAE;IAE/B,MAAM,IAAI,GAAG,CAAC,GAAG,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,EAAE,GAAG,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;IAC5C,MAAM,EAAE,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;IACtC,IAAI,GAAG,CAAC,IAAI,EAAE,EAAE,CAAC,GAAG,CAAC,EAAE;QACtB,OAAO,SAAS,CAAC;KACjB;IAED,OAAO,GAAG,CAAC;AACZ,CAAC;AAGD,OAAO,EAAE,UAAU,EAAE,CAAA"}
@@ -1,9 +0,0 @@
1
- /**
2
- * @hidden
3
- * @param x
4
- * @param y
5
- * @param z
6
- * @returns The point on the line from y to x that is equidistant from y and z.
7
- */
8
- declare function findEquidistantPointOnLine(x: number[], y: number[], z: number[]): number[];
9
- export { findEquidistantPointOnLine };
@@ -1,40 +0,0 @@
1
- /**
2
- * @hidden
3
- * @param x
4
- * @param y
5
- * @param z
6
- * @returns The point on the line from y to x that is equidistant from y and z.
7
- */
8
- function findEquidistantPointOnLine(x, y, z) {
9
- // Some basic algebra (not shown) finds the required point.
10
- // Swap axes if x and y are more aligned to y-axis than to x-axis.
11
- const swapAxes = Math.abs((x[1] - y[1]) / (x[0] - y[0])) > 1;
12
- // Cache
13
- let x1, x2, y1, y2, z1, z2;
14
- if (swapAxes) {
15
- x1 = x[1];
16
- x2 = x[0];
17
- y1 = y[1];
18
- y2 = y[0];
19
- z1 = z[1];
20
- z2 = z[0];
21
- }
22
- else {
23
- x1 = x[0];
24
- x2 = x[1];
25
- y1 = y[0];
26
- y2 = y[1];
27
- z1 = z[0];
28
- z2 = z[1];
29
- }
30
- // a <= 1 (due to swapped axes)
31
- const a = (x2 - y2) / (x1 - y1);
32
- const b = y2 - a * y1;
33
- const c = (y1 * y1 + y2 * y2 - z1 * z1 - z2 * z2) + 2 * b * (z2 - y2);
34
- const d = y1 - z1 + a * (y2 - z2);
35
- const t1 = c / (2 * d);
36
- const t2 = a * t1 + b;
37
- return swapAxes ? [t2, t1] : [t1, t2];
38
- }
39
- export { findEquidistantPointOnLine };
40
- //# sourceMappingURL=find-equidistant-point-on-line.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"find-equidistant-point-on-line.js","sourceRoot":"","sources":["../../../../src/mat/find-mat/find-2-prong/find-equidistant-point-on-line.ts"],"names":[],"mappings":"AACA;;;;;;GAMG;AACH,SAAS,0BAA0B,CAAC,CAAW,EAAE,CAAW,EAAE,CAAW;IACxE,2DAA2D;IAE3D,kEAAkE;IAClE,MAAM,QAAQ,GAAG,IAAI,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC;IAE7D,QAAQ;IACR,IAAI,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,CAAC;IAE3B,IAAI,QAAQ,EAAE;QACb,EAAE,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC;QAAC,EAAE,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC;QACrB,EAAE,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC;QAAC,EAAE,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC;QACrB,EAAE,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC;QAAC,EAAE,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC;KACrB;SAAM;QACN,EAAE,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC;QAAC,EAAE,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC;QACrB,EAAE,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC;QAAC,EAAE,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC;QACrB,EAAE,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC;QAAC,EAAE,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC;KACrB;IAED,+BAA+B;IAC/B,MAAM,CAAC,GAAG,CAAC,EAAE,GAAG,EAAE,CAAC,GAAG,CAAC,EAAE,GAAG,EAAE,CAAC,CAAC;IAChC,MAAM,CAAC,GAAG,EAAE,GAAG,CAAC,GAAC,EAAE,CAAC;IACpB,MAAM,CAAC,GAAG,CAAC,EAAE,GAAC,EAAE,GAAG,EAAE,GAAC,EAAE,GAAG,EAAE,GAAC,EAAE,GAAG,EAAE,GAAC,EAAE,CAAC,GAAG,CAAC,GAAC,CAAC,GAAC,CAAC,EAAE,GAAG,EAAE,CAAC,CAAC;IAC1D,MAAM,CAAC,GAAG,EAAE,GAAG,EAAE,GAAG,CAAC,GAAC,CAAC,EAAE,GAAG,EAAE,CAAC,CAAC;IAChC,MAAM,EAAE,GAAG,CAAC,GAAC,CAAC,CAAC,GAAC,CAAC,CAAC,CAAC;IACnB,MAAM,EAAE,GAAG,CAAC,GAAC,EAAE,GAAG,CAAC,CAAC;IAEpB,OAAO,QAAQ,CAAC,CAAC,CAAC,CAAC,EAAE,EAAC,EAAE,CAAC,CAAC,CAAC,CAAC,CAAC,EAAE,EAAC,EAAE,CAAC,CAAC;AACrC,CAAC;AAGD,OAAO,EAAE,0BAA0B,EAAE,CAAA"}
@@ -1,11 +0,0 @@
1
- import { LlRbTree } from 'flo-ll-rb-tree';
2
- import { BezierPiece } from '../../bezier-piece.js';
3
- import { Loop } from '../../../loop.js';
4
- import { CpNode } from '../../../cp-node.js';
5
- import { IPointOnShape } from '../../../point-on-shape.js';
6
- /** @hidden */
7
- declare function getInitialBezierPieces(isHoleClosing: boolean, k: number, loops: Loop[], cpTrees: Map<Loop, LlRbTree<CpNode>>, y: IPointOnShape): {
8
- bezierPieces: BezierPiece[];
9
- δ: CpNode[];
10
- };
11
- export { getInitialBezierPieces };
@@ -1,38 +0,0 @@
1
- import { getNeighbouringPoints } from '../../get-neighboring-cps.js';
2
- import { getBoundaryPieceBeziers } from '../../get-boundary-piece-beziers.js';
3
- import { isPosDullCorner } from '../../../point-on-shape.js';
4
- /** @hidden */
5
- function getInitialBezierPieces(isHoleClosing, k, loops, cpTrees, y) {
6
- let bezierPieces;
7
- let δ;
8
- if (isHoleClosing) {
9
- bezierPieces = [];
10
- for (let k2 = 0; k2 < k; k2++) {
11
- const pieces = loops[k2].curves
12
- .map(curve => ({ curve, ts: [0, 1] }));
13
- bezierPieces.push(...pieces);
14
- }
15
- }
16
- else {
17
- //let order = PointOnShape.isDullCorner(y)
18
- const order = isPosDullCorner(y)
19
- ? y.t === 1 ? -1 : +1
20
- : 0;
21
- const loop = loops[k];
22
- const cpNode = getNeighbouringPoints(cpTrees.get(loop), y, order, 0)[0];
23
- δ = [cpNode, cpNode];
24
- if (!cpNode ||
25
- // The special case if there is only a single sharp corner or
26
- // terminating 2-prong currently in the MAT. Don't remove!
27
- (cpNode === cpNode.next.next)) {
28
- bezierPieces = loop.curves
29
- .map(curve => ({ curve, ts: [0, 1] }));
30
- }
31
- else {
32
- bezierPieces = getBoundaryPieceBeziers(δ);
33
- }
34
- }
35
- return { bezierPieces, δ };
36
- }
37
- export { getInitialBezierPieces };
38
- //# sourceMappingURL=get-initial-bezier-pieces.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"get-initial-bezier-pieces.js","sourceRoot":"","sources":["../../../../src/mat/find-mat/find-2-prong/get-initial-bezier-pieces.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,qBAAqB,EAAE,MAAM,8BAA8B,CAAC;AACrE,OAAO,EAAE,uBAAuB,E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M;iBACrB,GAAG,CAAC,KAAK,CAAC,EAAE,CAAC,CAAC,EAAE,KAAK,EAAE,EAAE,EAAE,CAAC,CAAC,EAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAA;SAC5C;aAAM;YACH,YAAY,GAAG,uBAAuB,CAAC,CAAC,CAAC,CAAC;SAC7C;KACJ;IAED,OAAO,EAAE,YAAY,EAAE,CAAC,EAAE,CAAC;AAC/B,CAAC;AAGD,OAAO,EAAE,sBAAsB,EAAE,CAAA"}
@@ -1,9 +0,0 @@
1
- import { IPointOnShape } from '../../../point-on-shape.js';
2
- /** @hidden */
3
- type TXForDebugging = {
4
- x: number[];
5
- y: IPointOnShape;
6
- z: IPointOnShape;
7
- t: number;
8
- };
9
- export { TXForDebugging };
@@ -1 +0,0 @@
1
- {"version":3,"file":"x-for-debugging.js","sourceRoot":"","sources":["../../../../src/mat/find-mat/find-2-prong/x-for-debugging.ts"],"names":[],"mappings":""}
@@ -1 +0,0 @@
1
- {"version":3,"file":"calc-better-x.js","sourceRoot":"","sources":["../../../../src/mat/find-mat/find-3-prong/calc-better-x.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,YAAY,EAAE,GAAG,EAAE,KAAK,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AAG3E,OAAO,EAAE,gBAAgB,EAAE,MAAM,yBAAyB,CAAC;AAG3D;;;;;;;;;;GAUG;AACH,SAAS,WAAW,CACZ,aAA8B,EAC9B,CAAW,EACX,aAAuB;IAE3B,MAAM,CAAC,GAAG,GAAG,CAAC,aAAa,CAAC,CAAC;IAE7B,IAAI,EAAE,GAAG,CAAC,CAAC;IACX,IAAI,MAAM,CAAC;IACX,IAAI,IAAI,CAAC;IACT,IAAI,KAAsB,CAAC;IAC3B,IAAI,IAAI,CAAC;IACT,IAAI,CAAC,GAAG,CAAC,CAAC,CAAC,YAAY;IACvB,GAAG;QACC,MAAM,KAAK,GAAG,KAAK,CAAC,aAAa,EAAE,EAAE,CAAC,CAAC;QACvC,IAAI,GAAG,SAAS,CAAC,KAAK,EAAE,CAAC,CAAC,CAAC;QAG3B,KAAK,GAAG,gBAAgB,CAAC,IAAI,EAAE,aAAa,CAAC,CAAC;QAE9C,kBAAkB;QAClB,MAAM,eAAe,GAAG,YAAY,CAAC,KAAK,CAAC,GAAG,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC;QAC9D,MAAM,gBAAgB,GAAG,MAAM,CAAC,IAAI,EAAE,eAAe,CAAC,CAAC;QACvD,IAAI,GAAG,GAAG,CAAC,gBAAgB,CAAC,CAAC;QAE7B,MAAM,GAAG,IAAI,GAAG,CAAC,CAAC;QAElB,EAAE,GAAG,EAAE,GAAC,CAAC,CAAC;QAEV,CAAC,EAAE,CAAC;KACP,QAAQ,CAAC,MAAM,IAAI,CAAC,GAAG,CAAC,EAAE;IAE3B,OAAO,EAAE,IAAI,EAAE,IAAI,EAAE,KAAK,EAAE,CAAA;AAChC,CAAC;AAGD,OAAO,EAAE,WAAW,EAAE,CAAA"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"calc-initial-3-prong-center.js","sourceRoot":"","sources":["../../../../src/mat/find-mat/find-3-prong/calc-initial-3-prong-center.ts"],"names":[],"mappings":"AAAA,cAAc;AACd,OAAO,EAAE,YAAY,EAAE,MAAM,cAAc,CAAC;AAG5C,OAAO,EAAE,uBAAuB,EAAE,MAAM,4DAA4D,CAAC;AAGrG;;;;;;;;GAQG;AACH,SAAS,uBAAuB,CACxB,GAAe,EACf,aAA8B;IAElC,MAAM,oBAAoB,GAAG,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC,MAAM,CAAC,MAAM,CAAC;IAExD,MAAM,OAAO,GAAG,uBAAuB,CAC/B,aAAa,CAAC,CAAC,CAAC,EAChB,oBAAoB,EACpB,SAAS,EAAE,QAAQ;IACnB,SAAS,CAAE,IAAI;KACtB,CAAC;IAEF,MAAM,UAAU,GAAG;QACf,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC,YAAY,CAAC,CAAC;QAC3B,OAAO,CAAC,GAAG,CAAC,CAAC;QACb,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC,YAAY,CAAC,CAAC;KAC9B,CAAC;IAEF,OAAO,YAAY,CAAC,UAAU,CAAC,CAAC;AACpC,CAAC;AAGD,OAAO,EAAE,uBAAuB,EAAE,CAAA"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"find-3-prong-for-delta3s.js","sourceRoot":"","sources":["../../../../src/mat/find-mat/find-3-prong/find-3-prong-for-delta3s.ts"],"names":[],"mappings":"AAGA,OAAO,EACH,MAAM,EAAE,YAAY,EAAE,GAAG,EAAE,eAAe,EAAE,YAAY,EAAE,eAAe,EACzE,KAAK,EACR,MAAM,cAAc,CAAC;AACtB,OAAO,EAAE,OAAO,EAAE,MAAM,aAAa,CAAC;AAItC,OAAO,EAAE,eAAe,EAAiB,MAAM,4BAA4B,CAAC;AAC5E,OAAO,EAAE,uBAAuB,EAAE,MAAM,4DAA4D,CAAC;AACrG,OAAO,EAAE,uBAAuB,EAAE,MAAM,kCAAkC,CAAC;AAC3E,OAAO,EAAE,gBAAgB,EAAE,MAAM,yBAAyB,CAAC;AAC3D,OAAO,EAAE,WAAW,EAAE,MAAM,oBAAoB,CAAC;AACjD,OAAO,EAAS,cAAc,EAAE,MAAM,mBAAmB,CAAC;AAG1D,cAAc;AACd,MAAM,8BAA8B,GAAG,MAAM,CAAC;AAG9C;;;;;;;;GAQG;AACH,SAAS,oBAAoB,CACrB,EAAc,EACd,GAAW,EACX,CAAS,EACT,aAA8B,EAC9B,OAAe;IAEnB,MAAM,SAAS,GAAG,OAAO,GAAG,KAAK,CAAC;IAClC,MAAM,cAAc,GAAG,EAAE,CAAC;IAE1B,MAAM,GAAG,GAAG;QACR,EAAE,CAAC,CAAC,CAAC;QACL,EAAE,C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C,CAAC,CAAC,CAAC;QAE5C,CAAC,CAAC,SAAS,GAAG,OAAO,CAAC,SAAS,CAAC;QAChC,CAAC,CAAC,MAAM,GAAG,UAAU,CAAC,MAAM,CAAC;QAC7B,CAAC,CAAC,IAAI,GAAG,UAAU,CAAC,EAAE,CAAC;QACvB,CAAC,CAAC,KAAK,GAAG,UAAU,CAAC,GAAG,CAAC;QACzB,CAAC,CAAC,IAAI,GAAG,EAAE,CAAC;QACZ,CAAC,CAAC,QAAQ,GAAG,QAAQ,CAAC;QACtB,CAAC,CAAC,oBAAoB,GAAG,oBAAoB,CAAC;KAC9C;IAED,OAAO,UAAU,CAAC;AACnB,CAAC;AAGD,OAAO,EAAE,UAAU,EAAE,CAAA"}
@@ -1,17 +0,0 @@
1
- import { getClosestBoundaryPoint } from '../../closest-boundary-point/get-closest-boundary-point.js';
2
- /**
3
- * @hidden
4
- * @param x
5
- * @param bezierPiece3s
6
- * @param extreme
7
- */
8
- function getClosestPoints(x, bezierPiece3s) {
9
- return bezierPiece3s.map(bezierPieces => {
10
- const posInfo = getClosestBoundaryPoint(bezierPieces, x, undefined, // curve
11
- undefined // t
12
- );
13
- return posInfo ? posInfo.pos : undefined;
14
- });
15
- }
16
- export { getClosestPoints };
17
- //# sourceMappingURL=get-closest-points.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"get-closest-points.js","sourceRoot":"","sources":["../../../../src/mat/find-mat/find-3-prong/get-closest-points.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,uBAAuB,EAAE,MAAM,4DAA4D,CAAC;AAGrG;;;;;GAKG;AACH,SAAS,gBAAgB,CACjB,CAAW,EACX,aAA8B;IAElC,OAAO,aAAa,CAAC,GAAG,CAAC,YAAY,CAAC,EAAE;QACpC,MAAM,OAAO,GAAG,uBAAuB,CAC/B,YAAY,EACZ,CAAC,EACD,SAAS,EAAE,QAAQ;QACnB,SAAS,CAAE,IAAI;SACtB,CAAC;QAEF,OAAO,OAAO,CAAC,CAAC,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC,CAAC,SAAS,CAAC;IAC7C,CAAC,CAAC,CAAC;AACP,CAAC;AAGD,OAAO,EAAE,gBAAgB,EAAE,CAAA"}
@@ -1,15 +0,0 @@
1
- import { LlRbTree } from 'flo-ll-rb-tree';
2
- import { Loop } from '../../loop.js';
3
- import { CpNode } from '../../cp-node.js';
4
- import { IPointOnShape } from '../../point-on-shape.js';
5
- /**
6
- * @hidden
7
- * Add 2 prongs. See comments on the add2Prong function.
8
- * @param loops
9
- * @param cpGraphs
10
- * @param for2Prongss
11
- * @param extreme The maximum coordinate value used to calculate floating point
12
- * tolerances.
13
- */
14
- declare function findAndAdd2ProngsOnAllPaths(loops: Loop[], cpGraphs: Map<Loop, LlRbTree<CpNode>>, for2Prongss: IPointOnShape[][], extreme: number): CpNode;
15
- export { findAndAdd2ProngsOnAllPaths };
@@ -1 +0,0 @@
1
- {"version":3,"file":"find-and-add-2-prongs-on-all-paths.js","sourceRoot":"","sources":["../../../src/mat/find-mat/find-and-add-2-prongs-on-all-paths.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,iBAAiB,EAAE,MAAM,4BAA4B,CAAC;AAG/D;;;;;;;;GAQG;AACH,SAAS,2BAA2B,CAC5B,KAAa,EACb,QAAoC,EACpC,WAA8B,EAC9B,OAAe;IAEnB,IAAI,MAAM,CAAC;IAEX,KAAK,IAAI,CAAC,GAAC,CAAC,EAAE,CAAC,GAAC,WAAW,CAAC,MAAM,EAAE,CAAC,EAAE,EAAE;QACrC,MAAM,UAAU,GAAG,WAAW,CAAC,CAAC,CAAC,CAAC;QAClC,MAAM,OAAO,GAAG,iBAAiB,CAAC,KAAK,EAAE,QAAQ,EAAE,CAAC,EAAE,UAAU,EAAE,OAAO,CAAC,CAAC;QAC3E,MAAM,GAAG,MAAM,IAAI,OAAO,CAAC;KAC9B;IAED,OAAO,MAAM,CAAC;AAClB,CAAC;AAGD,OAAO,EAAE,2BAA2B,EAAE,CAAA"}