flo-mat 1.2.0 → 2.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 (469) hide show
  1. package/.mocharc.cjs +17 -0
  2. package/README.md +12 -1
  3. package/browser/index.js +7348 -0
  4. package/browser/index.min.js +2 -1
  5. package/browser/index.min.js.LICENSE.txt +2907 -0
  6. package/browser/index.module.js +7369 -0
  7. package/browser/index.module.min.js +2 -0
  8. package/browser/index.module.min.js.LICENSE.txt +2907 -0
  9. package/node/circle.js +3 -7
  10. package/node/circle.js.map +1 -1
  11. package/node/compare-curvatures-at-interface.d.ts +19 -0
  12. package/node/compare-curvatures-at-interface.js +125 -0
  13. package/node/compare-curvatures-at-interface.js.map +1 -0
  14. package/node/contact-point.d.ts +2 -2
  15. package/node/contact-point.js +3 -6
  16. package/node/contact-point.js.map +1 -1
  17. package/node/cp-node/clone.d.ts +1 -1
  18. package/node/cp-node/clone.js +4 -7
  19. package/node/cp-node/clone.js.map +1 -1
  20. package/node/cp-node/remove.d.ts +2 -2
  21. package/node/cp-node/remove.js +1 -4
  22. package/node/cp-node/remove.js.map +1 -1
  23. package/node/cp-node.d.ts +4 -5
  24. package/node/cp-node.js +8 -12
  25. package/node/cp-node.js.map +1 -1
  26. package/node/curve.d.ts +2 -2
  27. package/node/curve.js +10 -14
  28. package/node/curve.js.map +1 -1
  29. package/node/debug/cp-node-for-debugging.d.ts +2 -2
  30. package/node/debug/cp-node-for-debugging.js +1 -2
  31. package/node/debug/debug-elem-types.d.ts +8 -8
  32. package/node/debug/debug-elem-types.js +1 -2
  33. package/node/debug/debug.d.ts +5 -7
  34. package/node/debug/debug.js +67 -10
  35. package/node/debug/debug.js.map +1 -1
  36. package/node/debug/functions/draw-elem/bounding-hull.js +3 -6
  37. package/node/debug/functions/draw-elem/bounding-hull.js.map +1 -1
  38. package/node/debug/functions/draw-elem/branch.d.ts +1 -1
  39. package/node/debug/functions/draw-elem/branch.js +5 -8
  40. package/node/debug/functions/draw-elem/branch.js.map +1 -1
  41. package/node/debug/functions/draw-elem/culls.d.ts +1 -1
  42. package/node/debug/functions/draw-elem/culls.js +1 -4
  43. package/node/debug/functions/draw-elem/culls.js.map +1 -1
  44. package/node/debug/functions/draw-elem/draw-circle-percent.js +1 -4
  45. package/node/debug/functions/draw-elem/draw-circle-percent.js.map +1 -1
  46. package/node/debug/functions/draw-elem/draw-elem.d.ts +1 -1
  47. package/node/debug/functions/draw-elem/draw-elem.js +34 -37
  48. package/node/debug/functions/draw-elem/draw-elem.js.map +1 -1
  49. package/node/debug/functions/draw-elem/dull-corner.d.ts +1 -1
  50. package/node/debug/functions/draw-elem/dull-corner.js +5 -7
  51. package/node/debug/functions/draw-elem/dull-corner.js.map +1 -1
  52. package/node/debug/functions/draw-elem/leaves.d.ts +1 -1
  53. package/node/debug/functions/draw-elem/leaves.js +3 -6
  54. package/node/debug/functions/draw-elem/leaves.js.map +1 -1
  55. package/node/debug/functions/draw-elem/loop.d.ts +1 -1
  56. package/node/debug/functions/draw-elem/loop.js +1 -4
  57. package/node/debug/functions/draw-elem/loop.js.map +1 -1
  58. package/node/debug/functions/draw-elem/loops.d.ts +1 -1
  59. package/node/debug/functions/draw-elem/loops.js +1 -4
  60. package/node/debug/functions/draw-elem/loops.js.map +1 -1
  61. package/node/debug/functions/draw-elem/loose-bounding-box.js +3 -6
  62. package/node/debug/functions/draw-elem/loose-bounding-box.js.map +1 -1
  63. package/node/debug/functions/draw-elem/mat.d.ts +1 -1
  64. package/node/debug/functions/draw-elem/mat.js +7 -10
  65. package/node/debug/functions/draw-elem/mat.js.map +1 -1
  66. package/node/debug/functions/draw-elem/max-vertex.d.ts +1 -1
  67. package/node/debug/functions/draw-elem/max-vertex.js +3 -6
  68. package/node/debug/functions/draw-elem/max-vertex.js.map +1 -1
  69. package/node/debug/functions/draw-elem/min-y.d.ts +1 -1
  70. package/node/debug/functions/draw-elem/min-y.js +9 -12
  71. package/node/debug/functions/draw-elem/min-y.js.map +1 -1
  72. package/node/debug/functions/draw-elem/one-prong-at-dull-corner.d.ts +1 -1
  73. package/node/debug/functions/draw-elem/one-prong-at-dull-corner.js +7 -10
  74. package/node/debug/functions/draw-elem/one-prong-at-dull-corner.js.map +1 -1
  75. package/node/debug/functions/draw-elem/one-prong.d.ts +1 -1
  76. package/node/debug/functions/draw-elem/one-prong.js +9 -12
  77. package/node/debug/functions/draw-elem/one-prong.js.map +1 -1
  78. package/node/debug/functions/draw-elem/sharp-corner.d.ts +1 -1
  79. package/node/debug/functions/draw-elem/sharp-corner.js +3 -6
  80. package/node/debug/functions/draw-elem/sharp-corner.js.map +1 -1
  81. package/node/debug/functions/draw-elem/three-prong.d.ts +1 -1
  82. package/node/debug/functions/draw-elem/three-prong.js +9 -12
  83. package/node/debug/functions/draw-elem/three-prong.js.map +1 -1
  84. package/node/debug/functions/draw-elem/tight-bounding-box.js +3 -6
  85. package/node/debug/functions/draw-elem/tight-bounding-box.js.map +1 -1
  86. package/node/debug/functions/draw-elem/two-prong.d.ts +1 -1
  87. package/node/debug/functions/draw-elem/two-prong.js +9 -12
  88. package/node/debug/functions/draw-elem/two-prong.js.map +1 -1
  89. package/node/debug/functions/draw-elem/vertex.d.ts +1 -1
  90. package/node/debug/functions/draw-elem/vertex.js +7 -10
  91. package/node/debug/functions/draw-elem/vertex.js.map +1 -1
  92. package/node/debug/functions/general.d.ts +1 -1
  93. package/node/debug/functions/general.js +3 -6
  94. package/node/debug/functions/general.js.map +1 -1
  95. package/node/debug/functions/three-prong.js +24 -27
  96. package/node/debug/functions/three-prong.js.map +1 -1
  97. package/node/debug/functions/two-prong.d.ts +1 -1
  98. package/node/debug/functions/two-prong.js +10 -13
  99. package/node/debug/functions/two-prong.js.map +1 -1
  100. package/node/debug/three-prong-for-debugging.d.ts +4 -4
  101. package/node/debug/three-prong-for-debugging.js +4 -7
  102. package/node/debug/three-prong-for-debugging.js.map +1 -1
  103. package/node/debug/two-prong-for-debugging.d.ts +5 -5
  104. package/node/debug/two-prong-for-debugging.js +1 -2
  105. package/node/find-mats.d.ts +12 -9
  106. package/node/find-mats.js +47 -53
  107. package/node/find-mats.js.map +1 -1
  108. package/node/get-boundary-bezier-parts-to-next.d.ts +3 -3
  109. package/node/get-boundary-bezier-parts-to-next.js +1 -4
  110. package/node/get-boundary-bezier-parts-to-next.js.map +1 -1
  111. package/node/get-boundary-beziers-to-next.d.ts +1 -1
  112. package/node/get-boundary-beziers-to-next.js +8 -8
  113. package/node/get-boundary-beziers-to-next.js.map +1 -1
  114. package/node/get-bounding-box-.d.ts +2 -0
  115. package/node/get-bounding-box-.js +5 -0
  116. package/node/get-bounding-box-.js.map +1 -0
  117. package/node/get-branches.d.ts +1 -1
  118. package/node/get-branches.js +7 -10
  119. package/node/get-branches.js.map +1 -1
  120. package/node/get-curve/get-curve-between.d.ts +1 -1
  121. package/node/get-curve/get-curve-between.js +21 -24
  122. package/node/get-curve/get-curve-between.js.map +1 -1
  123. package/node/get-curve/get-edge-direction.d.ts +1 -1
  124. package/node/get-curve/get-edge-direction.js +12 -15
  125. package/node/get-curve/get-edge-direction.js.map +1 -1
  126. package/node/get-curve-to-next.d.ts +1 -1
  127. package/node/get-curve-to-next.js +3 -6
  128. package/node/get-curve-to-next.js.map +1 -1
  129. package/node/get-interface-ccw.d.ts +24 -0
  130. package/node/get-interface-ccw.js +98 -0
  131. package/node/get-interface-ccw.js.map +1 -0
  132. package/node/index.d.ts +35 -36
  133. package/node/index.js +32 -56
  134. package/node/index.js.map +1 -1
  135. package/node/loop/get-max-coordinate.js +1 -4
  136. package/node/loop/get-max-coordinate.js.map +1 -1
  137. package/node/loop.d.ts +1 -1
  138. package/node/loop.js +1 -4
  139. package/node/loop.js.map +1 -1
  140. package/node/mat/add-to-cp-graph.d.ts +5 -5
  141. package/node/mat/add-to-cp-graph.js +5 -8
  142. package/node/mat/add-to-cp-graph.js.map +1 -1
  143. package/node/mat/bezier-piece.d.ts +1 -1
  144. package/node/mat/bezier-piece.js +1 -2
  145. package/node/mat/closest-boundary-point/closest-points-on-curve.d.ts +1 -1
  146. package/node/mat/closest-boundary-point/closest-points-on-curve.js +15 -14
  147. package/node/mat/closest-boundary-point/closest-points-on-curve.js.map +1 -1
  148. package/node/mat/closest-boundary-point/cull-bezier-pieces.d.ts +1 -1
  149. package/node/mat/closest-boundary-point/cull-bezier-pieces.js +7 -10
  150. package/node/mat/closest-boundary-point/cull-bezier-pieces.js.map +1 -1
  151. package/node/mat/closest-boundary-point/cull-by-loose-bounding-box.d.ts +1 -1
  152. package/node/mat/closest-boundary-point/cull-by-loose-bounding-box.js +5 -8
  153. package/node/mat/closest-boundary-point/cull-by-loose-bounding-box.js.map +1 -1
  154. package/node/mat/closest-boundary-point/cull-by-tight-boundary-box.d.ts +1 -1
  155. package/node/mat/closest-boundary-point/cull-by-tight-boundary-box.js +7 -8
  156. package/node/mat/closest-boundary-point/cull-by-tight-boundary-box.js.map +1 -1
  157. package/node/mat/closest-boundary-point/get-best-distance-squared.d.ts +1 -1
  158. package/node/mat/closest-boundary-point/get-best-distance-squared.js +6 -9
  159. package/node/mat/closest-boundary-point/get-best-distance-squared.js.map +1 -1
  160. package/node/mat/closest-boundary-point/get-close-boundary-points.d.ts +2 -2
  161. package/node/mat/closest-boundary-point/get-close-boundary-points.js +9 -12
  162. package/node/mat/closest-boundary-point/get-close-boundary-points.js.map +1 -1
  163. package/node/mat/closest-boundary-point/get-closest-boundary-point.d.ts +3 -3
  164. package/node/mat/closest-boundary-point/get-closest-boundary-point.js +10 -13
  165. package/node/mat/closest-boundary-point/get-closest-boundary-point.js.map +1 -1
  166. package/node/mat/corner.js +1 -2
  167. package/node/mat/create-new-cp-tree.d.ts +3 -3
  168. package/node/mat/create-new-cp-tree.js +5 -7
  169. package/node/mat/create-new-cp-tree.js.map +1 -1
  170. package/node/mat/elem-type-two-prong.js +1 -2
  171. package/node/mat/find-mat/add-1-prong.d.ts +4 -4
  172. package/node/mat/find-mat/add-1-prong.js +9 -12
  173. package/node/mat/find-mat/add-1-prong.js.map +1 -1
  174. package/node/mat/find-mat/add-2-prong.d.ts +5 -5
  175. package/node/mat/find-mat/add-2-prong.js +19 -22
  176. package/node/mat/find-mat/add-2-prong.js.map +1 -1
  177. package/node/mat/find-mat/add-3-prong.d.ts +5 -5
  178. package/node/mat/find-mat/add-3-prong.js +7 -10
  179. package/node/mat/find-mat/add-3-prong.js.map +1 -1
  180. package/node/mat/find-mat/add-debug-info.d.ts +2 -2
  181. package/node/mat/find-mat/add-debug-info.js +8 -13
  182. package/node/mat/find-mat/add-debug-info.js.map +1 -1
  183. package/node/mat/find-mat/create-get-interesting-points-on-loop.d.ts +3 -3
  184. package/node/mat/find-mat/create-get-interesting-points-on-loop.js +29 -16
  185. package/node/mat/find-mat/create-get-interesting-points-on-loop.js.map +1 -1
  186. package/node/mat/find-mat/create-initial-cp-graph.d.ts +4 -4
  187. package/node/mat/find-mat/create-initial-cp-graph.js +7 -9
  188. package/node/mat/find-mat/create-initial-cp-graph.js.map +1 -1
  189. package/node/mat/find-mat/find-2-prong/add-debug-info.d.ts +5 -5
  190. package/node/mat/find-mat/find-2-prong/add-debug-info.js +3 -6
  191. package/node/mat/find-mat/find-2-prong/add-debug-info.js.map +1 -1
  192. package/node/mat/find-mat/find-2-prong/cull-bezier-pieces.d.ts +1 -1
  193. package/node/mat/find-mat/find-2-prong/cull-bezier-pieces.js +5 -8
  194. package/node/mat/find-mat/find-2-prong/cull-bezier-pieces.js.map +1 -1
  195. package/node/mat/find-mat/find-2-prong/find-2-prong.d.ts +5 -5
  196. package/node/mat/find-mat/find-2-prong/find-2-prong.js +37 -39
  197. package/node/mat/find-mat/find-2-prong/find-2-prong.js.map +1 -1
  198. package/node/mat/find-mat/find-2-prong/find-equidistant-point-on-line.js +1 -4
  199. package/node/mat/find-mat/find-2-prong/find-equidistant-point-on-line.js.map +1 -1
  200. package/node/mat/find-mat/find-2-prong/get-initial-bezier-pieces.d.ts +5 -5
  201. package/node/mat/find-mat/find-2-prong/get-initial-bezier-pieces.js +7 -10
  202. package/node/mat/find-mat/find-2-prong/get-initial-bezier-pieces.js.map +1 -1
  203. package/node/mat/find-mat/find-2-prong/x-for-debugging.d.ts +1 -1
  204. package/node/mat/find-mat/find-2-prong/x-for-debugging.js +1 -2
  205. package/node/mat/find-mat/find-3-prong/calc-better-x.d.ts +2 -2
  206. package/node/mat/find-mat/find-3-prong/calc-better-x.js +10 -13
  207. package/node/mat/find-mat/find-3-prong/calc-better-x.js.map +1 -1
  208. package/node/mat/find-mat/find-3-prong/calc-initial-3-prong-center.d.ts +2 -2
  209. package/node/mat/find-mat/find-3-prong/calc-initial-3-prong-center.js +6 -8
  210. package/node/mat/find-mat/find-3-prong/calc-initial-3-prong-center.js.map +1 -1
  211. package/node/mat/find-mat/find-3-prong/find-3-prong-for-delta3s.d.ts +3 -3
  212. package/node/mat/find-mat/find-3-prong/find-3-prong-for-delta3s.js +29 -32
  213. package/node/mat/find-mat/find-3-prong/find-3-prong-for-delta3s.js.map +1 -1
  214. package/node/mat/find-mat/find-3-prong/find-3-prong.d.ts +3 -3
  215. package/node/mat/find-mat/find-3-prong/find-3-prong.js +14 -12
  216. package/node/mat/find-mat/find-3-prong/find-3-prong.js.map +1 -1
  217. package/node/mat/find-mat/find-3-prong/get-closest-points.d.ts +2 -2
  218. package/node/mat/find-mat/find-3-prong/get-closest-points.js +3 -6
  219. package/node/mat/find-mat/find-3-prong/get-closest-points.js.map +1 -1
  220. package/node/mat/find-mat/find-and-add-2-prongs-on-all-paths.d.ts +4 -4
  221. package/node/mat/find-mat/find-and-add-2-prongs-on-all-paths.js +3 -6
  222. package/node/mat/find-mat/find-and-add-2-prongs-on-all-paths.js.map +1 -1
  223. package/node/mat/find-mat/find-and-add-2-prongs.d.ts +4 -4
  224. package/node/mat/find-mat/find-and-add-2-prongs.js +9 -12
  225. package/node/mat/find-mat/find-and-add-2-prongs.js.map +1 -1
  226. package/node/mat/find-mat/find-and-add-3-prongs.d.ts +3 -3
  227. package/node/mat/find-mat/find-and-add-3-prongs.js +8 -11
  228. package/node/mat/find-mat/find-and-add-3-prongs.js.map +1 -1
  229. package/node/mat/find-mat/find-and-add-hole-closing-2-prongs.d.ts +3 -3
  230. package/node/mat/find-mat/find-and-add-hole-closing-2-prongs.js +11 -14
  231. package/node/mat/find-mat/find-and-add-hole-closing-2-prongs.js.map +1 -1
  232. package/node/mat/find-mat/get-potential-2-prongs.d.ts +1 -1
  233. package/node/mat/find-mat/get-potential-2-prongs.js +3 -6
  234. package/node/mat/find-mat/get-potential-2-prongs.js.map +1 -1
  235. package/node/mat/find-mat/get-sharp-corners.d.ts +1 -1
  236. package/node/mat/find-mat/get-sharp-corners.js +3 -6
  237. package/node/mat/find-mat/get-sharp-corners.js.map +1 -1
  238. package/node/mat/geometry/get-closest-square-distance-to-rect.js +21 -15
  239. package/node/mat/geometry/get-closest-square-distance-to-rect.js.map +1 -1
  240. package/node/mat/geometry/get-closest-squared-distance-to-rotated-rect.js +5 -8
  241. package/node/mat/geometry/get-closest-squared-distance-to-rotated-rect.js.map +1 -1
  242. package/node/mat/get-boundary-piece-beziers.d.ts +2 -2
  243. package/node/mat/get-boundary-piece-beziers.js +6 -9
  244. package/node/mat/get-boundary-piece-beziers.js.map +1 -1
  245. package/node/mat/get-contact-circles-at-interface.d.ts +2 -2
  246. package/node/mat/get-contact-circles-at-interface.js +7 -10
  247. package/node/mat/get-contact-circles-at-interface.js.map +1 -1
  248. package/node/mat/get-largest-vertex.d.ts +1 -1
  249. package/node/mat/get-largest-vertex.js +1 -4
  250. package/node/mat/get-largest-vertex.js.map +1 -1
  251. package/node/mat/get-leaves.d.ts +1 -1
  252. package/node/mat/get-leaves.js +1 -4
  253. package/node/mat/get-leaves.js.map +1 -1
  254. package/node/mat/get-neighboring-cps.d.ts +3 -3
  255. package/node/mat/get-neighboring-cps.js +5 -8
  256. package/node/mat/get-neighboring-cps.js.map +1 -1
  257. package/node/mat/get-two-prong-type.d.ts +2 -2
  258. package/node/mat/get-two-prong-type.js +1 -4
  259. package/node/mat/get-two-prong-type.js.map +1 -1
  260. package/node/mat/is-another-cp-closeby.d.ts +5 -5
  261. package/node/mat/is-another-cp-closeby.js +8 -11
  262. package/node/mat/is-another-cp-closeby.js.map +1 -1
  263. package/node/mat/simplify-mat-map-only.d.ts +1 -1
  264. package/node/mat/simplify-mat-map-only.js +10 -14
  265. package/node/mat/simplify-mat-map-only.js.map +1 -1
  266. package/node/mat/to-scale-axis/add-debug-info.d.ts +1 -1
  267. package/node/mat/to-scale-axis/add-debug-info.js +1 -4
  268. package/node/mat/to-scale-axis/add-debug-info.js.map +1 -1
  269. package/node/mat/to-scale-axis/cull-non-cycles.d.ts +1 -1
  270. package/node/mat/to-scale-axis/cull-non-cycles.js +5 -8
  271. package/node/mat/to-scale-axis/cull-non-cycles.js.map +1 -1
  272. package/node/mat/to-scale-axis/cull.d.ts +2 -2
  273. package/node/mat/to-scale-axis/cull.js +75 -8
  274. package/node/mat/to-scale-axis/cull.js.map +1 -1
  275. package/node/mat/trim-mat.d.ts +1 -1
  276. package/node/mat/trim-mat.js +6 -9
  277. package/node/mat/trim-mat.js.map +1 -1
  278. package/node/mat.d.ts +3 -3
  279. package/node/mat.js +1 -2
  280. package/node/point-on-shape.d.ts +2 -2
  281. package/node/point-on-shape.js +23 -34
  282. package/node/point-on-shape.js.map +1 -1
  283. package/node/simplify-mat.d.ts +4 -3
  284. package/node/simplify-mat.js +14 -16
  285. package/node/simplify-mat.js.map +1 -1
  286. package/node/svg/get-loop-bounds.d.ts +2 -2
  287. package/node/svg/get-loop-bounds.js +11 -13
  288. package/node/svg/get-loop-bounds.js.map +1 -1
  289. package/node/svg/get-min-y-pos.d.ts +3 -2
  290. package/node/svg/get-min-y-pos.js +3 -6
  291. package/node/svg/get-min-y-pos.js.map +1 -1
  292. package/node/svg/get-shape-bounds.d.ts +5 -5
  293. package/node/svg/get-shape-bounds.js +5 -8
  294. package/node/svg/get-shape-bounds.js.map +1 -1
  295. package/node/sweep-line/sweep-line.js +1 -4
  296. package/node/sweep-line/sweep-line.js.map +1 -1
  297. package/node/to-scale-axis.d.ts +2 -1
  298. package/node/to-scale-axis.js +18 -21
  299. package/node/to-scale-axis.js.map +1 -1
  300. package/node/traverse-edges.d.ts +1 -1
  301. package/node/traverse-edges.js +1 -4
  302. package/node/traverse-edges.js.map +1 -1
  303. package/node/traverse-vertices.d.ts +1 -1
  304. package/node/traverse-vertices.js +1 -4
  305. package/node/traverse-vertices.js.map +1 -1
  306. package/package.json +34 -31
  307. package/src/circle.ts +0 -6
  308. package/src/compare-curvatures-at-interface.ts +197 -0
  309. package/src/contact-point.ts +2 -3
  310. package/src/cp-node/clone.ts +1 -2
  311. package/src/cp-node/remove.ts +2 -3
  312. package/src/cp-node.ts +6 -8
  313. package/src/curve.ts +3 -4
  314. package/src/debug/cp-node-for-debugging.ts +2 -3
  315. package/src/debug/debug-elem-types.ts +8 -10
  316. package/src/debug/debug.ts +22 -17
  317. package/src/debug/functions/draw-elem/bounding-hull.ts +0 -1
  318. package/src/debug/functions/draw-elem/branch.ts +2 -3
  319. package/src/debug/functions/draw-elem/culls.ts +1 -2
  320. package/src/debug/functions/draw-elem/draw-elem.ts +18 -19
  321. package/src/debug/functions/draw-elem/dull-corner.ts +3 -3
  322. package/src/debug/functions/draw-elem/leaves.ts +2 -4
  323. package/src/debug/functions/draw-elem/loop.ts +1 -2
  324. package/src/debug/functions/draw-elem/loops.ts +1 -2
  325. package/src/debug/functions/draw-elem/loose-bounding-box.ts +0 -1
  326. package/src/debug/functions/draw-elem/mat.ts +3 -5
  327. package/src/debug/functions/draw-elem/max-vertex.ts +1 -2
  328. package/src/debug/functions/draw-elem/min-y.ts +5 -7
  329. package/src/debug/functions/draw-elem/one-prong-at-dull-corner.ts +1 -2
  330. package/src/debug/functions/draw-elem/one-prong.ts +2 -3
  331. package/src/debug/functions/draw-elem/sharp-corner.ts +1 -2
  332. package/src/debug/functions/draw-elem/three-prong.ts +2 -4
  333. package/src/debug/functions/draw-elem/tight-bounding-box.ts +0 -1
  334. package/src/debug/functions/draw-elem/two-prong.ts +2 -3
  335. package/src/debug/functions/draw-elem/vertex.ts +1 -2
  336. package/src/debug/functions/general.ts +2 -3
  337. package/src/debug/functions/three-prong.ts +3 -4
  338. package/src/debug/functions/two-prong.ts +6 -14
  339. package/src/debug/three-prong-for-debugging.ts +4 -5
  340. package/src/debug/two-prong-for-debugging.ts +5 -6
  341. package/src/find-mats.ts +34 -39
  342. package/src/get-boundary-bezier-parts-to-next.ts +5 -6
  343. package/src/get-boundary-beziers-to-next.ts +8 -7
  344. package/src/get-bounding-box-.ts +7 -0
  345. package/src/get-branches.ts +2 -3
  346. package/src/get-curve/get-curve-between.ts +2 -3
  347. package/src/get-curve/get-edge-direction.ts +2 -5
  348. package/src/get-curve-to-next.ts +2 -3
  349. package/src/get-interface-ccw.ts +112 -0
  350. package/src/index.ts +34 -48
  351. package/src/loop/get-max-coordinate.ts +0 -1
  352. package/src/loop.ts +1 -2
  353. package/src/mat/add-to-cp-graph.ts +7 -8
  354. package/src/mat/bezier-piece.ts +1 -2
  355. package/src/mat/closest-boundary-point/closest-points-on-curve.ts +19 -17
  356. package/src/mat/closest-boundary-point/cull-bezier-pieces.ts +4 -5
  357. package/src/mat/closest-boundary-point/cull-by-loose-bounding-box.ts +4 -5
  358. package/src/mat/closest-boundary-point/cull-by-tight-boundary-box.ts +7 -5
  359. package/src/mat/closest-boundary-point/get-best-distance-squared.ts +1 -2
  360. package/src/mat/closest-boundary-point/get-close-boundary-points.ts +4 -11
  361. package/src/mat/closest-boundary-point/get-closest-boundary-point.ts +5 -6
  362. package/src/mat/cmp-cp-on-delta.ts +2 -3
  363. package/src/mat/create-new-cp-tree.ts +5 -5
  364. package/src/mat/find-mat/add-1-prong.ts +7 -8
  365. package/src/mat/find-mat/add-2-prong.ts +11 -12
  366. package/src/mat/find-mat/add-3-prong.ts +7 -8
  367. package/src/mat/find-mat/add-debug-info.ts +8 -7
  368. package/src/mat/find-mat/create-get-interesting-points-on-loop.ts +22 -8
  369. package/src/mat/find-mat/create-initial-cp-graph.ts +7 -8
  370. package/src/mat/find-mat/find-2-prong/add-debug-info.ts +9 -10
  371. package/src/mat/find-mat/find-2-prong/cull-bezier-pieces.ts +4 -7
  372. package/src/mat/find-mat/find-2-prong/find-2-prong.ts +19 -17
  373. package/src/mat/find-mat/find-2-prong/get-initial-bezier-pieces.ts +7 -8
  374. package/src/mat/find-mat/find-2-prong/x-for-debugging.ts +1 -2
  375. package/src/mat/find-mat/find-3-prong/calc-better-x.ts +3 -6
  376. package/src/mat/find-mat/find-3-prong/calc-initial-3-prong-center.ts +3 -8
  377. package/src/mat/find-mat/find-3-prong/find-3-prong-for-delta3s.ts +10 -14
  378. package/src/mat/find-mat/find-3-prong/find-3-prong.ts +13 -8
  379. package/src/mat/find-mat/find-3-prong/get-closest-points.ts +2 -5
  380. package/src/mat/find-mat/find-and-add-2-prongs-on-all-paths.ts +5 -6
  381. package/src/mat/find-mat/find-and-add-2-prongs.ts +9 -10
  382. package/src/mat/find-mat/find-and-add-3-prongs.ts +8 -9
  383. package/src/mat/find-mat/find-and-add-hole-closing-2-prongs.ts +7 -8
  384. package/src/mat/find-mat/get-potential-2-prongs.ts +1 -2
  385. package/src/mat/find-mat/get-sharp-corners.ts +1 -2
  386. package/src/mat/find-mat/get-total-abs-curvature.ts +2 -3
  387. package/src/mat/find-mat/get-total-by.ts +2 -3
  388. package/src/mat/geometry/get-closest-square-distance-to-rect.ts +15 -4
  389. package/src/mat/geometry/get-closest-squared-distance-to-rotated-rect.ts +0 -1
  390. package/src/mat/get-boundary-piece-beziers.ts +5 -6
  391. package/src/mat/get-contact-circles-at-interface.ts +3 -4
  392. package/src/mat/get-edges-as-array.ts +2 -3
  393. package/src/mat/get-largest-three-prong.ts +1 -2
  394. package/src/mat/get-largest-vertex.ts +1 -2
  395. package/src/mat/get-leaves.ts +1 -2
  396. package/src/mat/get-neighboring-cps.ts +5 -6
  397. package/src/mat/get-two-prong-type.ts +2 -3
  398. package/src/mat/is-another-cp-closeby.ts +6 -7
  399. package/src/mat/simplify-mat-map-only.ts +5 -7
  400. package/src/mat/to-scale-axis/add-debug-info.ts +2 -3
  401. package/src/mat/to-scale-axis/add-to-tree.ts +3 -4
  402. package/src/mat/to-scale-axis/calc-groups.ts +1 -2
  403. package/src/mat/to-scale-axis/create-spacial-tree.ts +3 -4
  404. package/src/mat/to-scale-axis/cull-non-cycles.ts +2 -3
  405. package/src/mat/to-scale-axis/cull.ts +3 -4
  406. package/src/mat/to-scale-axis/get-engulfed-vertices.ts +3 -4
  407. package/src/mat/to-scale-axis/t-tree.ts +1 -2
  408. package/src/mat/to-scale-axis/traverse-spacial-tree.ts +2 -4
  409. package/src/mat/trim-mat.ts +4 -5
  410. package/src/mat.ts +3 -5
  411. package/src/point-on-shape.ts +10 -12
  412. package/src/simplify-mat.ts +11 -13
  413. package/src/svg/get-curvature-at-interface.ts +1 -3
  414. package/src/svg/get-extreme.ts +2 -3
  415. package/src/svg/get-loop-bounds.ts +4 -4
  416. package/src/svg/get-min-y-pos.ts +2 -6
  417. package/src/svg/get-shape-bounds.ts +2 -3
  418. package/src/sweep-line/are-boxes-intersecting.ts +1 -1
  419. package/src/to-scale-axis.ts +15 -16
  420. package/src/traverse-edges.ts +1 -2
  421. package/src/traverse-vertices.ts +1 -2
  422. package/test/lib-load.spec.ts +0 -1
  423. package/tsconfig.json +6 -31
  424. package/webpack.config.cjs +132 -0
  425. package/.nycrc +0 -4
  426. package/node/mat/cmp-cp-on-delta.d.ts +0 -14
  427. package/node/mat/cmp-cp-on-delta.js +0 -45
  428. package/node/mat/cmp-cp-on-delta.js.map +0 -1
  429. package/node/mat/find-mat/get-total-abs-curvature.d.ts +0 -5
  430. package/node/mat/find-mat/get-total-abs-curvature.js +0 -13
  431. package/node/mat/find-mat/get-total-abs-curvature.js.map +0 -1
  432. package/node/mat/find-mat/get-total-by.d.ts +0 -10
  433. package/node/mat/find-mat/get-total-by.js +0 -22
  434. package/node/mat/find-mat/get-total-by.js.map +0 -1
  435. package/node/mat/get-edges-as-array.d.ts +0 -4
  436. package/node/mat/get-edges-as-array.js +0 -12
  437. package/node/mat/get-edges-as-array.js.map +0 -1
  438. package/node/mat/get-largest-three-prong.d.ts +0 -4
  439. package/node/mat/get-largest-three-prong.js +0 -13
  440. package/node/mat/get-largest-three-prong.js.map +0 -1
  441. package/node/mat/to-scale-axis/add-to-tree.d.ts +0 -13
  442. package/node/mat/to-scale-axis/add-to-tree.js +0 -39
  443. package/node/mat/to-scale-axis/add-to-tree.js.map +0 -1
  444. package/node/mat/to-scale-axis/calc-groups.d.ts +0 -28
  445. package/node/mat/to-scale-axis/calc-groups.js +0 -66
  446. package/node/mat/to-scale-axis/calc-groups.js.map +0 -1
  447. package/node/mat/to-scale-axis/create-spacial-tree.d.ts +0 -9
  448. package/node/mat/to-scale-axis/create-spacial-tree.js +0 -24
  449. package/node/mat/to-scale-axis/create-spacial-tree.js.map +0 -1
  450. package/node/mat/to-scale-axis/get-engulfed-vertices.d.ts +0 -12
  451. package/node/mat/to-scale-axis/get-engulfed-vertices.js +0 -95
  452. package/node/mat/to-scale-axis/get-engulfed-vertices.js.map +0 -1
  453. package/node/mat/to-scale-axis/t-tree.d.ts +0 -6
  454. package/node/mat/to-scale-axis/t-tree.js +0 -3
  455. package/node/mat/to-scale-axis/t-tree.js.map +0 -1
  456. package/node/mat/to-scale-axis/traverse-spacial-tree.d.ts +0 -11
  457. package/node/mat/to-scale-axis/traverse-spacial-tree.js +0 -25
  458. package/node/mat/to-scale-axis/traverse-spacial-tree.js.map +0 -1
  459. package/node/svg/get-curvature-at-interface.d.ts +0 -9
  460. package/node/svg/get-curvature-at-interface.js +0 -49
  461. package/node/svg/get-curvature-at-interface.js.map +0 -1
  462. package/node/svg/get-extreme.d.ts +0 -9
  463. package/node/svg/get-extreme.js +0 -16
  464. package/node/svg/get-extreme.js.map +0 -1
  465. package/node/sweep-line/are-boxes-intersecting.d.ts +0 -11
  466. package/node/sweep-line/are-boxes-intersecting.js +0 -42
  467. package/node/sweep-line/are-boxes-intersecting.js.map +0 -1
  468. package/test/mocha.opts +0 -4
  469. package/webpack.config.js +0 -25
@@ -1,8 +1,5 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.cullByLooseBoundingBox = void 0;
4
- const flo_bezier3_1 = require("flo-bezier3");
5
- const get_closest_square_distance_to_rect_1 = require("../geometry/get-closest-square-distance-to-rect");
1
+ import { getBoundingBox_ } from '../../get-bounding-box-.js';
2
+ import { getClosestSquareDistanceToRect } from '../geometry/get-closest-square-distance-to-rect.js';
6
3
  /**
7
4
  * @hidden
8
5
  * When checking distances, ignore all those with closest possible distance
@@ -16,13 +13,13 @@ function cullByLooseBoundingBox(bezierPieces, p, dSquared) {
16
13
  for (let i = 0; i < bezierPieces.length; i++) {
17
14
  let bezierPiece = bezierPieces[i];
18
15
  let ps = bezierPiece.curve.ps;
19
- let boundingBox = flo_bezier3_1.getBoundingBox(ps);
20
- let d = get_closest_square_distance_to_rect_1.getClosestSquareDistanceToRect(boundingBox, p);
16
+ let boundingBox = getBoundingBox_(ps);
17
+ let d = getClosestSquareDistanceToRect(boundingBox, p);
21
18
  if (d <= dSquared) {
22
19
  candidateBezierPieces.push(bezierPiece);
23
20
  }
24
21
  }
25
22
  return candidateBezierPieces;
26
23
  }
27
- exports.cullByLooseBoundingBox = cullByLooseBoundingBox;
24
+ export { cullByLooseBoundingBox };
28
25
  //# sourceMappingURL=cull-by-loose-bounding-box.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"cull-by-loose-bounding-box.js","sourceRoot":"","sources":["../../../src/mat/closest-boundary-point/cull-by-loose-bounding-box.ts"],"names":[],"mappings":";;;AACA,6CAA6C;AAE7C,yGAAiG;AAGjG;;;;;;;GAOG;AACH,SAAS,sBAAsB,CACvB,YAA2B,EAC3B,CAAW,EACX,QAAgB;IAEpB,IAAI,qBAAqB,GAAG,EAAE,CAAC;IAE/B,KAAK,IAAI,CAAC,GAAC,CAAC,EAAE,CAAC,GAAC,YAAY,CAAC,MAAM,EAAE,CAAC,EAAE,EAAE;QACtC,IAAI,WAAW,GAAG,YAAY,CAAC,CAAC,CAAC,CAAC;QAClC,IAAI,EAAE,GAAG,WAAW,CAAC,KAAK,CAAC,EAAE,CAAC;QAE9B,IAAI,WAAW,GAAG,4BAAc,CAAC,EAAE,CAAC,CAAC;QAErC,IAAI,CAAC,GAAG,oEAA8B,CAClC,WAAW,EACX,CAAC,CACJ,CAAC;QACF,IAAI,CAAC,IAAI,QAAQ,EAAE;YACf,qBAAqB,CAAC,IAAI,CAAC,WAAW,CAAC,CAAC;SAC3C;KACJ;IAED,OAAO,qBAAqB,CAAC;AACjC,CAAC;AAGQ,wDAAsB"}
1
+ {"version":3,"file":"cull-by-loose-bounding-box.js","sourceRoot":"","sources":["../../../src/mat/closest-boundary-point/cull-by-loose-bounding-box.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,MAAM,4BAA4B,CAAC;AAE7D,OAAO,EAAE,8BAA8B,EAAE,MAAM,oDAAoD,CAAC;AAGpG;;;;;;;GAOG;AACH,SAAS,sBAAsB,CACvB,YAA2B,EAC3B,CAAW,EACX,QAAgB;IAEpB,IAAI,qBAAqB,GAAG,EAAE,CAAC;IAE/B,KAAK,IAAI,CAAC,GAAC,CAAC,EAAE,CAAC,GAAC,YAAY,CAAC,MAAM,EAAE,CAAC,EAAE,EAAE;QACtC,IAAI,WAAW,GAAG,YAAY,CAAC,CAAC,CAAC,CAAC;QAClC,IAAI,EAAE,GAAG,WAAW,CAAC,KAAK,CAAC,EAAE,CAAC;QAE9B,IAAI,WAAW,GAAG,eAAe,CAAC,EAAE,CAAC,CAAC;QAEtC,IAAI,CAAC,GAAG,8BAA8B,CAClC,WAAW,EACX,CAAC,CACJ,CAAC;QACF,IAAI,CAAC,IAAI,QAAQ,EAAE;YACf,qBAAqB,CAAC,IAAI,CAAC,WAAW,CAAC,CAAC;SAC3C;KACJ;IAED,OAAO,qBAAqB,CAAC;AACjC,CAAC;AAGD,OAAO,EAAE,sBAAsB,EAAE,CAAA"}
@@ -1,4 +1,4 @@
1
- import { BezierPiece } from "../bezier-piece";
1
+ import { BezierPiece } from "../bezier-piece.js";
2
2
  /**
3
3
  * @hidden
4
4
  * When checking distances, ignore all those with closest possible distance
@@ -1,8 +1,7 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.cullByTightBoundingBox = void 0;
4
- const flo_bezier3_1 = require("flo-bezier3");
5
- const get_closest_squared_distance_to_rotated_rect_1 = require("../geometry/get-closest-squared-distance-to-rotated-rect");
1
+ import { getBoundingBoxTight } from "flo-bezier3";
2
+ import { memoize } from "flo-memoize";
3
+ import { getClosestSquaredDistanceToRotatedRect } from '../geometry/get-closest-squared-distance-to-rotated-rect.js';
4
+ const getBoundingBoxTight_ = memoize(getBoundingBoxTight);
6
5
  /**
7
6
  * @hidden
8
7
  * When checking distances, ignore all those with closest possible distance
@@ -16,13 +15,13 @@ function cullByTightBoundingBox(bezierPieces, p, bestSquaredDistance) {
16
15
  for (let i = 0; i < bezierPieces.length; i++) {
17
16
  let bezierPiece = bezierPieces[i];
18
17
  let ps = bezierPiece.curve.ps;
19
- let tightBoundingBox = flo_bezier3_1.getBoundingBoxTight(ps);
20
- let d = get_closest_squared_distance_to_rotated_rect_1.getClosestSquaredDistanceToRotatedRect(tightBoundingBox, p);
18
+ let tightBoundingBox = getBoundingBoxTight_(ps);
19
+ let d = getClosestSquaredDistanceToRotatedRect(tightBoundingBox, p);
21
20
  if (d <= bestSquaredDistance) {
22
21
  candidateBezierPieces.push(bezierPiece);
23
22
  }
24
23
  }
25
24
  return candidateBezierPieces;
26
25
  }
27
- exports.cullByTightBoundingBox = cullByTightBoundingBox;
26
+ export { cullByTightBoundingBox };
28
27
  //# sourceMappingURL=cull-by-tight-boundary-box.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"cull-by-tight-boundary-box.js","sourceRoot":"","sources":["../../../src/mat/closest-boundary-point/cull-by-tight-boundary-box.ts"],"names":[],"mappings":";;;AACA,6CAAkD;AAElD,2HAC+D;AAG/D;;;;;;;GAOG;AACH,SAAS,sBAAsB,CACvB,YAA2B,EAC3B,CAAW,EACX,mBAA2B;IAE/B,IAAI,qBAAqB,GAAG,EAAE,CAAC;IAE/B,KAAK,IAAI,CAAC,GAAC,CAAC,EAAE,CAAC,GAAC,YAAY,CAAC,MAAM,EAAE,CAAC,EAAE,EAAE;QACtC,IAAI,WAAW,GAAG,YAAY,CAAC,CAAC,CAAC,CAAC;QAClC,IAAI,EAAE,GAAG,WAAW,CAAC,KAAK,CAAC,EAAE,CAAC;QAE9B,IAAI,gBAAgB,GAAG,iCAAmB,CAAC,EAAE,CAAC,CAAC;QAC/C,IAAI,CAAC,GAAG,qFAAsC,CACtC,gBAAgB,EAChB,CAAC,CACR,CAAC;QACF,IAAI,CAAC,IAAI,mBAAmB,EAAE;YAC1B,qBAAqB,CAAC,IAAI,CAAC,WAAW,CAAC,CAAC;SAC3C;KACJ;IAED,OAAO,qBAAqB,CAAC;AACjC,CAAC;AAGQ,wDAAsB"}
1
+ {"version":3,"file":"cull-by-tight-boundary-box.js","sourceRoot":"","sources":["../../../src/mat/closest-boundary-point/cull-by-tight-boundary-box.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,mBAAmB,EAAE,MAAM,aAAa,CAAC;AAClD,OAAO,EAAE,OAAO,EAAE,MAAM,aAAa,CAAC;AAEtC,OAAO,EAAE,sCAAsC,EAAE,MAAM,6DAA6D,CAAC;AAGrH,MAAM,oBAAoB,GAAG,OAAO,CAAC,mBAAmB,CAAC,CAAC;AAG1D;;;;;;;GAOG;AACH,SAAS,sBAAsB,CACvB,YAA2B,EAC3B,CAAW,EACX,mBAA2B;IAE/B,IAAI,qBAAqB,GAAG,EAAE,CAAC;IAE/B,KAAK,IAAI,CAAC,GAAC,CAAC,EAAE,CAAC,GAAC,YAAY,CAAC,MAAM,EAAE,CAAC,EAAE,EAAE;QACtC,IAAI,WAAW,GAAG,YAAY,CAAC,CAAC,CAAC,CAAC;QAClC,IAAI,EAAE,GAAG,WAAW,CAAC,KAAK,CAAC,EAAE,CAAC;QAE9B,IAAI,gBAAgB,GAAG,oBAAoB,CAAC,EAAE,CAAC,CAAC;QAChD,IAAI,CAAC,GAAG,sCAAsC,CACtC,gBAAgB,EAChB,CAAC,CACR,CAAC;QACF,IAAI,CAAC,IAAI,mBAAmB,EAAE;YAC1B,qBAAqB,CAAC,IAAI,CAAC,WAAW,CAAC,CAAC;SAC3C;KACJ;IAED,OAAO,qBAAqB,CAAC;AACjC,CAAC;AAGD,OAAO,EAAE,sBAAsB,EAAE,CAAA"}
@@ -1,4 +1,4 @@
1
- import { BezierPiece } from "../bezier-piece";
1
+ import { BezierPiece } from "../bezier-piece.js";
2
2
  /**
3
3
  * @hidden
4
4
  * Finds an initial distance such that the closest point can not be further than
@@ -1,8 +1,5 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.getBestDistanceSquared = void 0;
4
- const flo_bezier3_1 = require("flo-bezier3");
5
- const flo_vector2d_1 = require("flo-vector2d");
1
+ import { evalDeCasteljau } from 'flo-bezier3';
2
+ import { squaredDistanceBetween } from 'flo-vector2d';
6
3
  /**
7
4
  * @hidden
8
5
  * Finds an initial distance such that the closest point can not be further than
@@ -13,9 +10,9 @@ function getBestDistanceSquared(bezierPieces, p) {
13
10
  for (let i = 0; i < bezierPieces.length; i++) {
14
11
  let bezierPiece = bezierPieces[i];
15
12
  let ps = bezierPiece.curve.ps;
16
- let p1 = flo_bezier3_1.evalDeCasteljau(ps, bezierPiece.ts[0]);
17
- let p2 = flo_bezier3_1.evalDeCasteljau(ps, bezierPiece.ts[1]);
18
- let d = Math.min(flo_vector2d_1.squaredDistanceBetween(p, p1), flo_vector2d_1.squaredDistanceBetween(p, p2));
13
+ let p1 = evalDeCasteljau(ps, bezierPiece.ts[0]);
14
+ let p2 = evalDeCasteljau(ps, bezierPiece.ts[1]);
15
+ let d = Math.min(squaredDistanceBetween(p, p1), squaredDistanceBetween(p, p2));
19
16
  if (d < bestSquaredDistance) {
20
17
  bestSquaredDistance = d;
21
18
  }
@@ -24,5 +21,5 @@ function getBestDistanceSquared(bezierPieces, p) {
24
21
  // TODO - remove delta (or base it on theory)
25
22
  return bestSquaredDistance * 1.01;
26
23
  }
27
- exports.getBestDistanceSquared = getBestDistanceSquared;
24
+ export { getBestDistanceSquared };
28
25
  //# sourceMappingURL=get-best-distance-squared.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"get-best-distance-squared.js","sourceRoot":"","sources":["../../../src/mat/closest-boundary-point/get-best-distance-squared.ts"],"names":[],"mappings":";;;AACA,6CAA8C;AAC9C,+CAAsD;AAItD;;;;GAIG;AACH,SAAS,sBAAsB,CACvB,YAA2B,EAC3B,CAAW;IAEf,IAAI,mBAAmB,GAAG,MAAM,CAAC,iBAAiB,CAAC;IACnD,KAAK,IAAI,CAAC,GAAC,CAAC,EAAE,CAAC,GAAC,YAAY,CAAC,MAAM,EAAE,CAAC,EAAE,EAAE;QACtC,IAAI,WAAW,GAAG,YAAY,CAAC,CAAC,CAAC,CAAC;QAElC,IAAI,EAAE,GAAG,WAAW,CAAC,KAAK,CAAC,EAAE,CAAC;QAE9B,IAAI,EAAE,GAAG,6BAAe,CAAC,EAAE,EAAE,WAAW,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,CAAC;QAChD,IAAI,EAAE,GAAG,6BAAe,CAAC,EAAE,EAAE,WAAW,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,CAAC;QAEhD,IAAI,CAAC,GAAG,IAAI,CAAC,GAAG,CACZ,qCAAsB,CAAC,CAAC,EAAE,EAAE,CAAC,EAC7B,qCAAsB,CAAC,CAAC,EAAE,EAAE,CAAC,CAChC,CAAC;QAEF,IAAI,CAAC,GAAG,mBAAmB,EAAE;YACzB,mBAAmB,GAAG,CAAC,CAAC;SAC3B;KACJ;IAED,mEAAmE;IACnE,6CAA6C;IAC7C,OAAO,mBAAmB,GAAG,IAAI,CAAC;AACtC,CAAC;AAGQ,wDAAsB"}
1
+ {"version":3,"file":"get-best-distance-squared.js","sourceRoot":"","sources":["../../../src/mat/closest-boundary-point/get-best-distance-squared.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,MAAM,aAAa,CAAC;AAC9C,OAAO,EAAE,sBAAsB,EAAE,MAAM,cAAc,CAAC;AAItD;;;;GAIG;AACH,SAAS,sBAAsB,CACvB,YAA2B,EAC3B,CAAW;IAEf,IAAI,mBAAmB,GAAG,MAAM,CAAC,iBAAiB,CAAC;IACnD,KAAK,IAAI,CAAC,GAAC,CAAC,EAAE,CAAC,GAAC,YAAY,CAAC,MAAM,EAAE,CAAC,EAAE,EAAE;QACtC,IAAI,WAAW,GAAG,YAAY,CAAC,CAAC,CAAC,CAAC;QAElC,IAAI,EAAE,GAAG,WAAW,CAAC,KAAK,CAAC,EAAE,CAAC;QAE9B,IAAI,EAAE,GAAG,eAAe,CAAC,EAAE,EAAE,WAAW,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,CAAC;QAChD,IAAI,EAAE,GAAG,eAAe,CAAC,EAAE,EAAE,WAAW,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,CAAC;QAEhD,IAAI,CAAC,GAAG,IAAI,CAAC,GAAG,CACZ,sBAAsB,CAAC,CAAC,EAAE,EAAE,CAAC,EAC7B,sBAAsB,CAAC,CAAC,EAAE,EAAE,CAAC,CAChC,CAAC;QAEF,IAAI,CAAC,GAAG,mBAAmB,EAAE;YACzB,mBAAmB,GAAG,CAAC,CAAC;SAC3B;KACJ;IAED,mEAAmE;IACnE,6CAA6C;IAC7C,OAAO,mBAAmB,GAAG,IAAI,CAAC;AACtC,CAAC;AAGD,OAAO,EAAE,sBAAsB,EAAE,CAAA"}
@@ -1,5 +1,5 @@
1
- import { IPointOnShape } from '../../point-on-shape';
2
- import { BezierPiece } from '../bezier-piece';
1
+ import { IPointOnShape } from '../../point-on-shape.js';
2
+ import { BezierPiece } from '../bezier-piece.js';
3
3
  /**
4
4
  * @hidden
5
5
  * Returns the closest boundary point to the given point, limited to the given
@@ -1,10 +1,7 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.getCloseBoundaryPoints = void 0;
4
- const flo_vector2d_1 = require("flo-vector2d");
5
- const point_on_shape_1 = require("../../point-on-shape");
6
- const cull_bezier_pieces_1 = require("./cull-bezier-pieces");
7
- const closest_points_on_curve_1 = require("./closest-points-on-curve");
1
+ import { distanceBetween } from 'flo-vector2d';
2
+ import { PointOnShape } from '../../point-on-shape.js';
3
+ import { cullBezierPieces } from './cull-bezier-pieces.js';
4
+ import { closestPointsOnCurve } from './closest-points-on-curve.js';
8
5
  /**
9
6
  * @hidden
10
7
  * Returns the closest boundary point to the given point, limited to the given
@@ -19,18 +16,18 @@ function getCloseBoundaryPoints(bezierPieces, point, y, distance) {
19
16
  let touchedCurve = y.curve;
20
17
  let t = y.t;
21
18
  let p_ = y.p;
22
- bezierPieces = cull_bezier_pieces_1.cullBezierPieces(bezierPieces, point);
19
+ bezierPieces = cullBezierPieces(bezierPieces, point);
23
20
  // TODO - integrate with is-another-cp-closeby - we MUST check angle too!
24
21
  let DISTANCE_TOLERANCE = 1e-9;
25
22
  let posInfos = [];
26
23
  for (let i = 0; i < bezierPieces.length; i++) {
27
24
  let bezierPiece = bezierPieces[i];
28
25
  // TOOD - important - should be able to return multiple points
29
- let ps = closest_points_on_curve_1.closestPointsOnCurve(bezierPiece.curve, point, bezierPiece.ts, touchedCurve, t);
26
+ let ps = closestPointsOnCurve(bezierPiece.curve, point, bezierPiece.ts, touchedCurve, t);
30
27
  //if (ps === undefined) { continue; }
31
28
  for (let j = 0; j < ps.length; j++) {
32
29
  let p = ps[j];
33
- let d = flo_vector2d_1.distanceBetween(p.p, point);
30
+ let d = distanceBetween(p.p, point);
34
31
  let curve = bezierPiece.curve;
35
32
  let t_ = p.t;
36
33
  if (Math.abs(d - distance) < DISTANCE_TOLERANCE) {
@@ -38,7 +35,7 @@ function getCloseBoundaryPoints(bezierPieces, point, y, distance) {
38
35
  t_ = 1;
39
36
  curve = bezierPiece.curve.prev;
40
37
  }
41
- posInfos.push({ pos: new point_on_shape_1.PointOnShape(curve, t_), d });
38
+ posInfos.push({ pos: new PointOnShape(curve, t_), d });
42
39
  }
43
40
  }
44
41
  }
@@ -80,5 +77,5 @@ function getCloseBoundaryPoints(bezierPieces, point, y, distance) {
80
77
  }
81
78
  return posInfos;
82
79
  }
83
- exports.getCloseBoundaryPoints = getCloseBoundaryPoints;
80
+ export { getCloseBoundaryPoints };
84
81
  //# sourceMappingURL=get-close-boundary-points.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"get-close-boundary-points.js","sourceRoot":"","sources":["../../../src/mat/closest-boundary-point/get-close-boundary-points.ts"],"names":[],"mappings":";;;AAKA,+CAA+C;AAE/C,yDAAmE;AAGnE,6DAAwD;AACxD,uEAAiE;AAGjE;;;;;;;;;GASG;AACH,SAAS,sBAAsB,CACvB,YAA2B,EAC3B,KAAe,EACrB,CAAgB,EAChB,QAAgB;IAEjB,IAAI,YAAY,GAAG,CAAC,CAAC,KAAK,CAAC;IAC3B,IAAI,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC;IACZ,IAAI,EAAE,GAAG,CAAC,CAAC,CAAC,CAAC;IAEb,YAAY,GAAG,qCAAgB,CAAC,YAAY,EAAE,KAAK,CAAC,CAAC;IAErD,yEAAyE;IACzE,IAAI,kBAAkB,GAAG,IAAI,CAAC;IAC9B,IAAI,QAAQ,GAAwC,EAAE,CAAC;IACvD,KAAK,IAAI,CAAC,GAAC,CAAC,EAAE,CAAC,GAAC,YAAY,CAAC,MAAM,EAAE,CAAC,EAAE,EAAE;QACzC,IAAI,WAAW,GAAG,YAAY,CAAC,CAAC,CAAC,CAAC;QAElC,8DAA8D;QAC9D,IAAI,EAAE,GAAG,8CAAoB,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AC,CAAC;SACzC;KACD;IAED,OAAO,QAAQ,CAAC;AACjB,CAAC;AAGQ,wDAAsB"}
1
+ {"version":3,"file":"get-close-boundary-points.js","sourceRoot":"","sources":["../../../src/mat/closest-boundary-point/get-close-boundary-points.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,MAAM,cAAc,CAAC;AAC/C,OAAO,EAAiB,YAAY,EAAE,MAAM,yBAAyB,CAAC;AAEtE,OAAO,EAAE,gBAAgB,EAAE,MAAM,yBAAyB,CAAC;AAC3D,OAAO,EAAE,oBAAoB,EAAE,MAAM,8BAA8B,CAAC;AAGpE;;;;;;;;;GASG;AACH,SAAS,sBAAsB,CACvB,YAA2B,EAC3B,KAAe,EACrB,CAAgB,EAChB,QAAgB;IAEjB,IAAI,YAAY,GAAG,CAAC,CAAC,KAAK,CAAC;IAC3B,IAAI,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC;IACZ,IAAI,EAAE,GAAG,CAAC,CAAC,CAAC,CAAC;IAEb,YAAY,GAAG,gBAAgB,CAAC,YAAY,EAAE,KAAK,CAAC,CAAC;IAErD,yEAAyE;IACzE,IAAI,kBAAkB,GAAG,IAAI,CAAC;IAC9B,IAAI,QAAQ,GAAwC,EAAE,CAAC;IACvD,KAAK,IAAI,CAAC,GAAC,CAAC,EAAE,CAAC,GAAC,YAAY,CAAC,MAAM,EAAE,CAAC,EAAE,EAAE;QACzC,IAAI,WAAW,GAAG,YAAY,CAAC,CAAC,CAAC,CAAC;QAElC,8DAA8D;QAC9D,IAAI,EAAE,GAAG,oBAAoB,CAC3B,WAAW,CAAC,KAAK,EACjB,KAAK,EACL,WAAW,CAAC,EAAE,EACd,YAAY,EACZ,CAAC,CACF,CAAC;QAEF,qCAAqC;QAErC,KAAK,IAAI,CAAC,GAAC,CAAC,EAAE,CAAC,GAAC,EAAE,CAAC,MAAM,EAAE,CAAC,EAAE,EAAE;YAC/B,IAAI,CAAC,GAAG,EAAE,CAAC,CAAC,CAAC,CA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AI,EAAE,GAAG,QAAQ,CAAC,cAAc,CAAC,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC;gBAC3C,IAAI,EAAE,GAAG,QAAQ,CAAC,cAAc,CAAC,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC;gBAC3C,kDAAkD;gBAClD,qBAAqB;gBACrB,IAAI,EAAE,GAAG,EAAE,CAAC;gBACZ,IAAI,CAAC,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,CAAC,CAAC,GAAG,EAAE,CAAC,CAAC,CAAC,CAAC,GAAG,IAAI;oBACjC,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,CAAC,CAAC,GAAG,EAAE,CAAC,CAAC,CAAC,CAAC,GAAG,IAAI,CAAC;oBAE/B,CAAC,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,CAAC,CAAC,GAAG,EAAE,CAAC,CAAC,CAAC,CAAC,GAAG,IAAI;wBAC9B,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,CAAC,CAAC,GAAG,EAAE,CAAC,CAAC,CAAC,CAAC,GAAG,IAAI,CAAC,EAC/B;oBAEF,eAAe,CAAC,IAAI,CAAC,cAAc,CAAC,CAAC,CAAC,CAAC,CAAC;iBACxC;aACD;SACD;QACD,KAAK,IAAI,CAAC,GAAC,eAAe,CAAC,MAAM,GAAE,CAAC,EAAE,CAAC,IAAI,CAAC,EAAE,CAAC,EAAE,EAAE;YAChD,QAAQ,CAAC,MAAM,CAAC,eAAe,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC;SACzC;KACD;IAED,OAAO,QAAQ,CAAC;AACjB,CAAC;AAGD,OAAO,EAAE,sBAAsB,EAAE,CAAC"}
@@ -1,6 +1,6 @@
1
- import { Curve } from '../../curve';
2
- import { IPointOnShape } from '../../point-on-shape';
3
- import { BezierPiece } from '../bezier-piece';
1
+ import { Curve } from '../../curve.js';
2
+ import { IPointOnShape } from '../../point-on-shape.js';
3
+ import { BezierPiece } from '../bezier-piece.js';
4
4
  /**
5
5
  * @hidden
6
6
  * Returns the closest boundary point to the given point, limited to the given
@@ -1,10 +1,7 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.getClosestBoundaryPoint = void 0;
4
- const flo_vector2d_1 = require("flo-vector2d");
5
- const point_on_shape_1 = require("../../point-on-shape");
6
- const cull_bezier_pieces_1 = require("./cull-bezier-pieces");
7
- const closest_points_on_curve_1 = require("./closest-points-on-curve");
1
+ import { distanceBetween, getObjClosestTo } from 'flo-vector2d';
2
+ import { PointOnShape } from '../../point-on-shape.js';
3
+ import { cullBezierPieces } from './cull-bezier-pieces.js';
4
+ import { closestPointsOnCurve } from './closest-points-on-curve.js';
8
5
  /**
9
6
  * @hidden
10
7
  * Returns the closest boundary point to the given point, limited to the given
@@ -16,17 +13,17 @@ const closest_points_on_curve_1 = require("./closest-points-on-curve");
16
13
  * @param extreme
17
14
  */
18
15
  function getClosestBoundaryPoint(bezierPieces, point, touchedCurve, t) {
19
- bezierPieces = cull_bezier_pieces_1.cullBezierPieces(bezierPieces, point);
16
+ bezierPieces = cullBezierPieces(bezierPieces, point);
20
17
  let bestDistance = Number.POSITIVE_INFINITY;
21
18
  let posInfo;
22
19
  for (let i = 0; i < bezierPieces.length; i++) {
23
20
  let bezierPiece = bezierPieces[i];
24
- let ps = closest_points_on_curve_1.closestPointsOnCurve(bezierPiece.curve, point, bezierPiece.ts, touchedCurve, t);
25
- let p = flo_vector2d_1.getObjClosestTo(point, ps, p => p.p);
21
+ let ps = closestPointsOnCurve(bezierPiece.curve, point, bezierPiece.ts, touchedCurve, t);
22
+ let p = getObjClosestTo(point, ps, p => p.p);
26
23
  if (p === undefined) {
27
24
  continue;
28
25
  }
29
- let d = flo_vector2d_1.distanceBetween(p.p, point);
26
+ let d = distanceBetween(p.p, point);
30
27
  let curve = bezierPiece.curve;
31
28
  let t_ = p.t;
32
29
  if (d < bestDistance) {
@@ -34,11 +31,11 @@ function getClosestBoundaryPoint(bezierPieces, point, touchedCurve, t) {
34
31
  t_ = 1;
35
32
  curve = bezierPiece.curve.prev;
36
33
  }
37
- posInfo = { pos: new point_on_shape_1.PointOnShape(curve, t_), d };
34
+ posInfo = { pos: new PointOnShape(curve, t_), d };
38
35
  bestDistance = d;
39
36
  }
40
37
  }
41
38
  return posInfo;
42
39
  }
43
- exports.getClosestBoundaryPoint = getClosestBoundaryPoint;
40
+ export { getClosestBoundaryPoint };
44
41
  //# sourceMappingURL=get-closest-boundary-point.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"get-closest-boundary-point.js","sourceRoot":"","sources":["../../../src/mat/closest-boundary-point/get-closest-boundary-point.ts"],"names":[],"mappings":";;;AACA,+CAAgE;AAEhE,yDAAmE;AAEnE,6DAAwD;AACxD,uEAAiE;AAGjE;;;;;;;;;GASG;AACH,SAAS,uBAAuB,CACxB,YAA2B,EAC3B,KAAe,EACrB,YAAmB,EACnB,CAAS;IAEV,YAAY,GAAG,qCAAgB,CAAC,YAAY,EAAE,KAAK,CAAC,CAAC;IAErD,IAAI,YAAY,GAAG,MAAM,CAAC,iBAAiB,CAAC;IAC5C,IAAI,OAA0C,CAAC;IAC/C,KAAK,IAAI,CAAC,GAAC,CAAC,EAAE,CAAC,GAAC,YAAY,CAAC,MAAM,EAAE,CAAC,EAAE,EAAE;QACzC,IAAI,WAAW,GAAG,YAAY,CAAC,CAAC,CAAC,CAAC;QAElC,IAAI,EAAE,GAAG,8CAAoB,CAC3B,WAAW,CAAC,KAAK,EACjB,KAAK,EACL,WAAW,CAAC,EAAE,EACd,YAAY,EACZ,CAAC,CACF,CAAC;QAEF,IAAI,CAAC,GAAG,8BAAe,CAAC,KAAK,EAAE,EAAE,EAAE,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,CAAC,CAAA;QAE5C,IAAI,CAAC,KAAK,SAAS,EAAE;YAAE,SAAS;SAAE;QAElC,IAAI,CAAC,GAAG,8BAAe,CAAC,CAAC,CAAC,CAAC,EAAE,KAAK,CAAC,CAAC;QAEpC,IAAI,KAAK,GAAG,WAAW,CAAC,KAAK,CAAC;QAC9B,IAAI,EAAE,GAAE,CAAC,CAAC,CAAC,CAAC;QAEZ,IAAI,CAAC,GAAG,YAAY,EAAE;YACrB,IAAI,EAAE,KAAK,CAAC,EAAE;gBACb,EAAE,GAAG,CAAC,CAAC;gBACP,KAAK,GAAG,WAAW,CAAC,KAAK,CAAC,IAAI,CAAC;aAC/B;YAED,OAAO,GAAG,EAAE,GAAG,EAAE,IAAI,6BAAY,CAAC,KAAK,EAAE,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC;YAClD,YAAY,GAAG,CAAC,CAAC;SACjB;KACD;IAED,OAAO,OAAO,CAAC;AAChB,CAAC;AAGQ,0DAAuB"}
1
+ {"version":3,"file":"get-closest-boundary-point.js","sourceRoot":"","sources":["../../../src/mat/closest-boundary-point/get-closest-boundary-point.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,eAAe,EAAE,MAAM,cAAc,CAAC;AAEhE,OAAO,EAAE,YAAY,EAAiB,MAAM,yBAAyB,CAAC;AAEtE,OAAO,EAAE,gBAAgB,EAAE,MAAM,yBAAyB,CAAC;AAC3D,OAAO,EAAE,oBAAoB,EAAE,MAAM,8BAA8B,CAAC;AAGpE;;;;;;;;;GASG;AACH,SAAS,uBAAuB,CACxB,YAA2B,EAC3B,KAAe,EACrB,YAAmB,EACnB,CAAS;IAEV,YAAY,GAAG,gBAAgB,CAAC,YAAY,EAAE,KAAK,CAAC,CAAC;IAErD,IAAI,YAAY,GAAG,MAAM,CAAC,iBAAiB,CAAC;IAC5C,IAAI,OAA0C,CAAC;IAC/C,KAAK,IAAI,CAAC,GAAC,CAAC,EAAE,CAAC,GAAC,YAAY,CAAC,MAAM,EAAE,CAAC,EAAE,EAAE;QACzC,IAAI,WAAW,GAAG,YAAY,CAAC,CAAC,CAAC,CAAC;QAElC,IAAI,EAAE,GAAG,oBAAoB,CAC3B,WAAW,CAAC,KAAK,EACjB,KAAK,EACL,WAAW,CAAC,EAAE,EACd,YAAY,EACZ,CAAC,CACF,CAAC;QAEF,IAAI,CAAC,GAAG,eAAe,CAAC,KAAK,EAAE,EAAE,EAAE,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,CAAC,CAAA;QAE5C,IAAI,CAAC,KAAK,SAAS,EAAE;YAAE,SAAS;SAAE;QAElC,IAAI,CAAC,GAAG,eAAe,CAAC,CAAC,CAAC,CAAC,EAAE,KAAK,CAAC,CAAC;QAEpC,IAAI,KAAK,GAAG,WAAW,CAAC,KAAK,CAAC;QAC9B,IAAI,EAAE,GAAE,CAAC,CAAC,CAAC,CAAC;QAEZ,IAAI,CAAC,GAAG,YAAY,EAAE;YACrB,IAAI,EAAE,KAAK,CAAC,EAAE;gBACb,EAAE,GAAG,CAAC,CAAC;gBACP,KAAK,GAAG,WAAW,CAAC,KAAK,CAAC,IAAI,CAAC;aAC/B;YAED,OAAO,GAAG,EAAE,GAAG,EAAE,IAAI,YAAY,CAAC,KAAK,EAAE,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC;YAClD,YAAY,GAAG,CAAC,CAAC;SACjB;KACD;IAED,OAAO,OAAO,CAAC;AAChB,CAAC;AAGD,OAAO,EAAE,uBAAuB,EAAE,CAAC"}
@@ -1,3 +1,2 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
1
+ export {};
3
2
  //# sourceMappingURL=corner.js.map
@@ -1,6 +1,6 @@
1
- import LlRbTree from 'flo-ll-rb-tree';
2
- import { CpNode } from '../cp-node';
3
- import { Loop } from '../loop';
1
+ import { LlRbTree } from 'flo-ll-rb-tree';
2
+ import { CpNode } from '../cp-node.js';
3
+ import { Loop } from '../loop.js';
4
4
  /**
5
5
  * @hidden
6
6
  * @param cpNode
@@ -1,8 +1,5 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.createNewCpTree = void 0;
4
- const flo_ll_rb_tree_1 = require("flo-ll-rb-tree");
5
- const cp_node_1 = require("../cp-node");
1
+ import { LlRbTree } from 'flo-ll-rb-tree';
2
+ import { CpNode } from '../cp-node.js';
6
3
  /**
7
4
  * @hidden
8
5
  * @param cpNode
@@ -15,12 +12,13 @@ function createNewCpTree(cpNode) {
15
12
  let loop = cpNode.cp.pointOnShape.curve.loop;
16
13
  let cpTree = newCpTrees.get(loop);
17
14
  if (!cpTree) {
18
- cpTree = new flo_ll_rb_tree_1.default(cp_node_1.CpNode.comparator, [], true);
15
+ // qqq cpTree = new LlRbTree(CpNode.comparator, [], true);
16
+ cpTree = new LlRbTree(CpNode.comparator, false);
19
17
  newCpTrees.set(loop, cpTree);
20
18
  }
21
19
  cpTree.insert(cpNode);
22
20
  }
23
21
  return newCpTrees;
24
22
  }
25
- exports.createNewCpTree = createNewCpTree;
23
+ export { createNewCpTree };
26
24
  //# sourceMappingURL=create-new-cp-tree.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"create-new-cp-tree.js","sourceRoot":"","sources":["../../src/mat/create-new-cp-tree.ts"],"names":[],"mappings":";;;AACA,mDAAsC;AACtC,wCAAoC;AAIpC;;;GAGG;AACH,SAAS,eAAe,CAAC,MAAc;IACtC,IAAI,UAAU,GAA+B,IAAI,GAAG,EAAE,CAAC;IAEvD,IAAI,GAAG,GAAG,MAAM,CAAC,YAAY,EAAE,CAAC;IAEhC,GAAG,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC;IAEf,SAAS,CAAC,CAAC,MAAc;QACxB,IAAI,IAAI,GAAG,MAAM,CAAC,EAAE,CAAC,YAAY,CAAC,KAAK,CAAC,IAAI,CAAC;QAC7C,IAAI,MAAM,GAAG,UAAU,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC;QAClC,IAAI,CAAC,MAAM,EAAE;YACZ,MAAM,GAAG,IAAI,wBAAQ,CAAC,gBAAM,CAAC,UAAU,EAAE,EAAE,EAAE,IAAI,CAAC,CAAC;YACnD,UAAU,CAAC,GAAG,CAAC,IAAI,EAAE,MAAM,CAAC,CAAC;SAC7B;QACD,MAAM,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC;IACvB,CAAC;IAED,OAAO,UAAU,CAAC;AACnB,CAAC;AAGQ,0CAAe"}
1
+ {"version":3,"file":"create-new-cp-tree.js","sourceRoot":"","sources":["../../src/mat/create-new-cp-tree.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,gBAAgB,CAAC;AAC1C,OAAO,EAAE,MAAM,EAAE,MAAM,eAAe,CAAC;AAIvC;;;GAGG;AACH,SAAS,eAAe,CAAC,MAAc;IACtC,IAAI,UAAU,GAA+B,IAAI,GAAG,EAAE,CAAC;IAEvD,IAAI,GAAG,GAAG,MAAM,CAAC,YAAY,EAAE,CAAC;IAEhC,GAAG,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC;IAEf,SAAS,CAAC,CAAC,MAAc;QACxB,IAAI,IAAI,GAAG,MAAM,CAAC,EAAE,CAAC,YAAY,CAAC,KAAK,CAAC,IAAI,CAAC;QAC7C,IAAI,MAAM,GAAG,UAAU,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC;QAClC,IAAI,CAAC,MAAM,EAAE;YACZ,2DAA2D;YAC3D,MAAM,GAAG,IAAI,QAAQ,CAAC,MAAM,CAAC,UAAU,EAAE,KAAK,CAAC,CAAC;YAChD,UAAU,CAAC,GAAG,CAAC,IAAI,EAAE,MAAM,CAAC,CAAC;SAC7B;QACD,MAAM,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC;IACvB,CAAC;IAED,OAAO,UAAU,CAAC;AACnB,CAAC;AAGD,OAAO,EAAE,eAAe,EAAE,CAAA"}
@@ -1,3 +1,2 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
1
+ export {};
3
2
  //# sourceMappingURL=elem-type-two-prong.js.map
@@ -1,7 +1,7 @@
1
- import LlRbTree from 'flo-ll-rb-tree';
2
- import { Loop } from '../../loop';
3
- import { IPointOnShape } from '../../point-on-shape';
4
- import { CpNode } from '../../cp-node';
1
+ import { LlRbTree } from 'flo-ll-rb-tree';
2
+ import { Loop } from '../../loop.js';
3
+ import { IPointOnShape } from '../../point-on-shape.js';
4
+ import { CpNode } from '../../cp-node.js';
5
5
  /**
6
6
  * @hidden
7
7
  * Add a 1-prong to the MAT.
@@ -1,9 +1,6 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.add1Prong = void 0;
4
- const point_on_shape_1 = require("../../point-on-shape");
5
- const add_to_cp_graph_1 = require("../add-to-cp-graph");
6
- const is_another_cp_closeby_1 = require("../is-another-cp-closeby");
1
+ import { getOsculatingCircle, calcPosOrder, isPosDullCorner } from '../../point-on-shape.js';
2
+ import { addToCpGraph } from '../add-to-cp-graph.js';
3
+ import { isAnotherCpCloseby } from '../is-another-cp-closeby.js';
7
4
  /**
8
5
  * @hidden
9
6
  * Add a 1-prong to the MAT.
@@ -12,7 +9,7 @@ const is_another_cp_closeby_1 = require("../is-another-cp-closeby");
12
9
  */
13
10
  function add1Prong(maxOsculatingCircleRadius, cpGraphs, pos) {
14
11
  //if (PointOnShape.isDullCorner(pos)) {
15
- if (point_on_shape_1.isPosDullCorner(pos)) {
12
+ if (isPosDullCorner(pos)) {
16
13
  // This is a 1-prong at a dull corner.
17
14
  // TODO IMPORTANT
18
15
  // Remove this line, uncomment piece below it and implement the
@@ -29,18 +26,18 @@ function add1Prong(maxOsculatingCircleRadius, cpGraphs, pos) {
29
26
  return;
30
27
  }
31
28
  //let circle = PointOnShape.getOsculatingCircle(maxOsculatingCircleRadius, pos);
32
- let circle = point_on_shape_1.getOsculatingCircle(maxOsculatingCircleRadius, pos);
29
+ let circle = getOsculatingCircle(maxOsculatingCircleRadius, pos);
33
30
  //let order = PointOnShape.calcOrder(circle, pos);
34
- let order = point_on_shape_1.calcPosOrder(circle, pos);
31
+ let order = calcPosOrder(circle, pos);
35
32
  // Make sure there isn't already a ContactPoint close by - it can cause
36
33
  // floating point stability issues.
37
- if (is_another_cp_closeby_1.isAnotherCpCloseby(cpGraphs, pos, circle, order, 0, 1000, 'magenta')) {
34
+ if (isAnotherCpCloseby(cpGraphs, pos, circle, order, 0, 1000, 'magenta')) {
38
35
  return;
39
36
  }
40
- add_to_cp_graph_1.addToCpGraph(circle, [-0.5, +0.5], cpGraphs, [pos, pos]);
37
+ addToCpGraph(circle, [-0.5, +0.5], cpGraphs, [pos, pos]);
41
38
  if (typeof _debug_ !== 'undefined') {
42
39
  _debug_.generated.elems.oneProng.push(pos);
43
40
  }
44
41
  }
45
- exports.add1Prong = add1Prong;
42
+ export { add1Prong };
46
43
  //# sourceMappingURL=add-1-prong.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"add-1-prong.js","sourceRoot":"","sources":["../../../src/mat/find-mat/add-1-prong.ts"],"names":[],"mappings":";;;AAOA,yDAAyG;AAEzG,wDAAkD;AAClD,oEAA8D;AAG9D;;;;;GAKG;AACH,SAAS,SAAS,CAChB,yBAAiC,EAC3B,QAAoC,EACpC,GAAkB;IAEzB,uCAAuC;IACpC,IAAI,gCAAe,CAAC,GAAG,CAAC,EAAE;QAC5B,sCAAsC;QAEtC,kBAAkB;QAClB,gEAAgE;QAChE,wEAAwE;QACxE,mEAAmE;QACnE,mEAAmE;QACnE,qEAAqE;QAC/D,kEAAkE;QAClE,oEAAoE;QAE1E,kCAAkC;QAElC,IAAI,OAAO,OAAO,KAAK,WAAW,EAAE;YAC1B,OAAO,CAAC,SAAS,CAAC,KAAK,CAAC,oBAAoB,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;SAC1D;QAEP,OAAO;KACP;IAED,gFAAgF;IAChF,IAAI,MAAM,GAAG,oCAAmB,CAAC,yBAAyB,EAAE,GAAG,CAAC,CAAC;IAEjE,kDAAkD;IAClD,IAAI,KAAK,GAAG,6BAAY,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC;IACtC,uEAAuE;IACvE,mCAAmC;IACnC,IA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IAClD,IAAI,KAAK,GAAG,YAAY,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC;IACtC,uEAAuE;IACvE,mCAAmC;IACnC,IAAI,kBAAkB,CAAC,QAAQ,EAAE,GAAG,EAAE,MAAM,EAAE,KAAK,EAAE,CAAC,EAAE,IAAI,EAAE,SAAS,CAAC,EAAE;QACzE,OAAO;KACP;IAEE,YAAY,CAAC,MAAM,EAAE,CAAC,CAAC,GAAG,EAAE,CAAC,GAAG,CAAC,EAAE,QAAQ,EAAE,CAAC,GAAG,EAAE,GAAG,CAAC,CAAC,CAAC;IAE5D,IAAI,OAAO,OAAO,KAAK,WAAW,EAAE;QAC7B,OAAO,CAAC,SAAS,CAAC,KAAK,CAAC,QAAQ,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;KAC9C;AACL,CAAC;AAGD,OAAO,EAAE,SAAS,EAAE,CAAA"}
@@ -1,8 +1,8 @@
1
- import LlRbTree from 'flo-ll-rb-tree';
2
- import { Loop } from '../../loop';
3
- import { CpNode } from '../../cp-node';
4
- import { Circle } from '../../circle';
5
- import { IPointOnShape } from '../../point-on-shape';
1
+ import { LlRbTree } from 'flo-ll-rb-tree';
2
+ import { Loop } from '../../loop.js';
3
+ import { CpNode } from '../../cp-node.js';
4
+ import { Circle } from '../../circle.js';
5
+ import { IPointOnShape } from '../../point-on-shape.js';
6
6
  /**
7
7
  * @hidden
8
8
  * Adds a 2-prong contact circle to the shape.
@@ -1,11 +1,8 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.add2Prong = void 0;
4
- const flo_numerical_1 = require("flo-numerical");
5
- const cp_node_1 = require("../../cp-node");
6
- const point_on_shape_1 = require("../../point-on-shape");
7
- const is_another_cp_closeby_1 = require("../is-another-cp-closeby");
8
- const get_neighboring_cps_1 = require("../get-neighboring-cps");
1
+ import { exponent } from 'big-float-ts';
2
+ import { CpNode } from '../../cp-node.js';
3
+ import { PointOnShape, calcPosOrder } from '../../point-on-shape.js';
4
+ import { isAnotherCpCloseby } from '../is-another-cp-closeby.js';
5
+ import { getNeighbouringPoints } from '../get-neighboring-cps.js';
9
6
  /**
10
7
  * @hidden
11
8
  * Adds a 2-prong contact circle to the shape.
@@ -19,18 +16,18 @@ const get_neighboring_cps_1 = require("../get-neighboring-cps");
19
16
  */
20
17
  function add2Prong(cpGraphs, circle, posSource, posAntipodes, holeClosing, extreme) {
21
18
  //let orderSource = PointOnShape.calcOrder(circle, posSource);
22
- let orderSource = point_on_shape_1.calcPosOrder(circle, posSource);
19
+ let orderSource = calcPosOrder(circle, posSource);
23
20
  let orderAntipodes = posAntipodes.map(posAntipode => {
24
21
  //console.log(circle.center)
25
22
  //return PointOnShape.calcOrder(circle, posAntipode.pos);
26
- return point_on_shape_1.calcPosOrder(circle, posAntipode.pos);
23
+ return calcPosOrder(circle, posAntipode.pos);
27
24
  });
28
25
  let t_s = posSource.t;
29
26
  let curve;
30
27
  if (t_s === 0) {
31
28
  t_s = 1;
32
29
  curve = posSource.curve.prev;
33
- posSource = new point_on_shape_1.PointOnShape(curve, t_s);
30
+ posSource = new PointOnShape(curve, t_s);
34
31
  }
35
32
  // Make sure there isn't already a ContactPoint close by - it can cause
36
33
  // floating point stability issues.
@@ -39,12 +36,12 @@ function add2Prong(cpGraphs, circle, posSource, posAntipodes, holeClosing, extre
39
36
  for (let i = 0; i < posAntipodes.length; i++) {
40
37
  let posAntipode = posAntipodes[i];
41
38
  let orderAntipode = orderAntipodes[i];
42
- if (is_another_cp_closeby_1.isAnotherCpCloseby(cpGraphs, posAntipode.pos, circle, orderAntipode, 0, extreme, 'red')) {
39
+ if (isAnotherCpCloseby(cpGraphs, posAntipode.pos, circle, orderAntipode, 0, extreme, 'red')) {
43
40
  isCloseByAntipodes = true;
44
41
  break;
45
42
  }
46
43
  }
47
- if (is_another_cp_closeby_1.isAnotherCpCloseby(cpGraphs, posSource, circle, orderSource, 0, extreme, 'red') ||
44
+ if (isAnotherCpCloseby(cpGraphs, posSource, circle, orderSource, 0, extreme, 'red') ||
48
45
  isCloseByAntipodes) {
49
46
  if (typeof _debug_ !== 'undefined') {
50
47
  if (holeClosing) {
@@ -71,16 +68,16 @@ function add2Prong(cpGraphs, circle, posSource, posAntipodes, holeClosing, extre
71
68
  loopAntipodes.push(loopAntipode);
72
69
  let cpTreeAntipode = cpGraphs.get(loopAntipode);
73
70
  cpTreeAntipodes.push(cpTreeAntipode);
74
- let deltaAntipode = get_neighboring_cps_1.getNeighbouringPoints(cpTreeAntipode, posAntipode.pos, orderAntipode, 0);
71
+ let deltaAntipode = getNeighbouringPoints(cpTreeAntipode, posAntipode.pos, orderAntipode, 0);
75
72
  deltaAntipodes.push(deltaAntipode);
76
- newCpAntipodes.push(cp_node_1.CpNode.insert(holeClosing, false, cpTreeAntipode, cpAntipode, deltaAntipode[0]));
73
+ newCpAntipodes.push(CpNode.insert(holeClosing, false, cpTreeAntipode, cpAntipode, deltaAntipode[0]));
77
74
  }
78
75
  // Source
79
76
  let cpSource = { pointOnShape: posSource, circle, order: orderSource, order2: 0 };
80
77
  let loopSource = posSource.curve.loop;
81
78
  let cpTreeSource = cpGraphs.get(loopSource);
82
- let deltaSource = get_neighboring_cps_1.getNeighbouringPoints(cpTreeSource, posSource, orderSource, 0);
83
- let newCpSource = cp_node_1.CpNode.insert(holeClosing, false, cpTreeSource, cpSource, deltaSource[0]);
79
+ let deltaSource = getNeighbouringPoints(cpTreeSource, posSource, orderSource, 0);
80
+ let newCpSource = CpNode.insert(holeClosing, false, cpTreeSource, cpSource, deltaSource[0]);
84
81
  // Connect graph
85
82
  if (newCpAntipodes.length === 1) {
86
83
  newCpSource.prevOnCircle = newCpAntipodes[0];
@@ -107,9 +104,9 @@ function add2Prong(cpGraphs, circle, posSource, posAntipodes, holeClosing, extre
107
104
  // TODO - important - take care of case where there are more than 1 antipode
108
105
  // Duplicate ContactPoints
109
106
  let cpB2 = { pointOnShape: posAntipodes[0].pos, circle, order: cpAntipodes[0].order, order2: +1 };
110
- let newCpB2Node = cp_node_1.CpNode.insert(true, false, cpTreeAntipodes[0], cpB2, newCpAntipodes[0]);
107
+ let newCpB2Node = CpNode.insert(true, false, cpTreeAntipodes[0], cpB2, newCpAntipodes[0]);
111
108
  let cpB1 = { pointOnShape: posSource, circle, order: cpSource.order, order2: -1 };
112
- let newCpB1Node = cp_node_1.CpNode.insert(true, false, cpTreeSource, cpB1, newCpSource.prev);
109
+ let newCpB1Node = CpNode.insert(true, false, cpTreeSource, cpB1, newCpSource.prev);
113
110
  // Connect graph
114
111
  newCpB1Node.prevOnCircle = newCpB2Node;
115
112
  newCpB1Node.nextOnCircle = newCpB2Node;
@@ -136,10 +133,9 @@ function add2Prong(cpGraphs, circle, posSource, posAntipodes, holeClosing, extre
136
133
  }
137
134
  return newCpSource;
138
135
  }
139
- exports.add2Prong = add2Prong;
140
136
  /** @hidden */
141
137
  function scale(n, exp) {
142
- return n * (Math.pow(2, -(exp + 1)));
138
+ return n * (2 ** -(exp + 1));
143
139
  }
144
140
  /** @hidden */
145
141
  function getSize(x, y) {
@@ -175,7 +171,7 @@ function getSize(x, y) {
175
171
  function byAngle(circle) {
176
172
  let c = circle.center;
177
173
  let r = circle.radius;
178
- let exp = flo_numerical_1.exponent(r);
174
+ let exp = exponent(r);
179
175
  return function (_a, _b) {
180
176
  let a = _a.cp.pointOnShape.p;
181
177
  let b = _b.cp.pointOnShape.p;
@@ -193,4 +189,5 @@ function byAngle(circle) {
193
189
  return sb - sa;
194
190
  };
195
191
  }
192
+ export { add2Prong };
196
193
  //# sourceMappingURL=add-2-prong.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"add-2-prong.js","sourceRoot":"","sources":["../../../src/mat/find-mat/add-2-prong.ts"],"names":[],"mappings":";;;AAMA,iDAAyC;AAEzC,2CAA6C;AAG7C,yDAAiF;AACjF,oEAA8D;AAC9D,gEAA+D;AAI/D;;;;;;;;;;GAUG;AACH,SAAS,SAAS,CAChB,QAA0C,EACpC,MAAsB,EACtB,SAA6B,E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ACzB,IAAI,EAAE,GAAG,OAAO,CAAC,EAAE,EAAE,EAAE,CAAC,CAAC;QAEzB,OAAO,EAAE,GAAG,EAAE,CAAC;IAChB,CAAC,CAAA;AACF,CAAC;AAGD,OAAO,EAAE,SAAS,EAAE,CAAA"}
@@ -1,8 +1,8 @@
1
- import LlRbTree from 'flo-ll-rb-tree';
2
- import { CpNode } from '../../cp-node';
3
- import { Loop } from '../../loop';
4
- import { Circle } from '../../circle';
5
- import { IPointOnShape } from '../../point-on-shape';
1
+ import { LlRbTree } from 'flo-ll-rb-tree';
2
+ import { CpNode } from '../../cp-node.js';
3
+ import { Loop } from '../../loop.js';
4
+ import { Circle } from '../../circle.js';
5
+ import { IPointOnShape } from '../../point-on-shape.js';
6
6
  /**
7
7
  * @hidden
8
8
  * Adds a 3-prong MAT circle according to the 3 given (previously calculated)
@@ -1,8 +1,5 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.add3Prong = void 0;
4
- const add_to_cp_graph_1 = require("../add-to-cp-graph");
5
- const is_another_cp_closeby_1 = require("../is-another-cp-closeby");
1
+ import { addToCpGraph } from '../add-to-cp-graph.js';
2
+ import { isAnotherCpCloseby } from '../is-another-cp-closeby.js';
6
3
  /**
7
4
  * @hidden
8
5
  * Adds a 3-prong MAT circle according to the 3 given (previously calculated)
@@ -48,11 +45,11 @@ function add3Prong(cpTrees, orders, threeProng) {
48
45
  }
49
46
  */
50
47
  // TODO - replace 1000 below with correct value
51
- is_another_cp_closeby_1.isAnotherCpCloseby(cpTrees, poss[0], circle, orders[0], 0, 1000, 'blue');
52
- is_another_cp_closeby_1.isAnotherCpCloseby(cpTrees, poss[1], circle, orders[1], 0, 1000, 'blue');
53
- is_another_cp_closeby_1.isAnotherCpCloseby(cpTrees, poss[2], circle, orders[2], 0, 1000, 'blue');
54
- add_to_cp_graph_1.addToCpGraph(circle, orders, cpTrees, poss, δ3s);
48
+ isAnotherCpCloseby(cpTrees, poss[0], circle, orders[0], 0, 1000, 'blue');
49
+ isAnotherCpCloseby(cpTrees, poss[1], circle, orders[1], 0, 1000, 'blue');
50
+ isAnotherCpCloseby(cpTrees, poss[2], circle, orders[2], 0, 1000, 'blue');
51
+ addToCpGraph(circle, orders, cpTrees, poss, δ3s);
55
52
  return circle;
56
53
  }
57
- exports.add3Prong = add3Prong;
54
+ export { add3Prong };
58
55
  //# sourceMappingURL=add-3-prong.js.map