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
package/node/circle.js CHANGED
@@ -1,7 +1,4 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.engulfsCircle = exports.scaleCircle = void 0;
4
- const flo_vector2d_1 = require("flo-vector2d");
1
+ import { squaredDistanceBetween } from 'flo-vector2d';
5
2
  /**
6
3
  * Returns a scaled version of the given circle without changing its center.
7
4
  * @param circle
@@ -10,7 +7,6 @@ const flo_vector2d_1 = require("flo-vector2d");
10
7
  function scaleCircle(circle, s) {
11
8
  return { center: circle.center, radius: s * circle.radius };
12
9
  }
13
- exports.scaleCircle = scaleCircle;
14
10
  /**
15
11
  * Returns true if the first circle engulfs the second.
16
12
  * @param c1
@@ -20,12 +16,11 @@ function engulfsCircle(c1, c2) {
20
16
  if (c1.radius <= c2.radius) {
21
17
  return false;
22
18
  }
23
- let d = flo_vector2d_1.squaredDistanceBetween(c1.center, c2.center);
19
+ let d = squaredDistanceBetween(c1.center, c2.center);
24
20
  let dr = c1.radius - c2.radius;
25
21
  let δ = dr * dr;
26
22
  return δ > d;
27
23
  }
28
- exports.engulfsCircle = engulfsCircle;
29
24
  /**
30
25
  * Returns a human-readable string description of the given circle.
31
26
  * @param circle
@@ -33,4 +28,5 @@ exports.engulfsCircle = engulfsCircle;
33
28
  function toString(circle) {
34
29
  return 'c: ' + circle.center + ' r: ' + circle.radius;
35
30
  }
31
+ export { scaleCircle, engulfsCircle };
36
32
  //# sourceMappingURL=circle.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"circle.js","sourceRoot":"","sources":["../src/circle.ts"],"names":[],"mappings":";;;AACA,+CAAsD;AAiBtD;;;;GAIG;AACH,SAAS,WAAW,CAAC,MAAc,EAAE,CAAS;IAC1C,OAAO,EAAE,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,EAAE,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,MAAM,CAAC;IAC/B,IAAI,CAAC,GAAG,EAAE,GAAC,EAAE,CAAC;IAEd,OAAO,CAAC,GAAG,CAAC,CAAC;AACjB,CAAC;AAGD;;;GAGG;AACH,SAAS,QAAQ,CAAC,MAAc;IAC5B,OAAO,KAAK,GAAG,MAAM,CAAC,MAAM,GAAG,MAAM,GAAG,MAAM,CAAC,MAAM,CAAC;AAC1D,CAAC;AAED,OAAO,EAAU,WAAW,EAAE,aAAa,EAAE,CAAA"}
@@ -0,0 +1,19 @@
1
+ /**
2
+ * Compare the curvature, κ, between two curves at t === 0.
3
+ *
4
+ * Returns a positive number if κ for psI > κ for psO, negative if κ for psI < κ
5
+ * for psO or zero if the curve extensions are identical (i.e. in same K-family).
6
+ *
7
+ * Precondition: The point psI evaluated at zero must === the point psO
8
+ * evaluated at zero.
9
+ *
10
+ * // TODO - is this correct?
11
+ * Exact: Returns the exact result if the bithlength of all
12
+ * coordinates <= 53 - 5 === 48 and are bit-aligned.
13
+ *
14
+ * @param psI An order 1, 2 or 3 bezier, e.g. [[0,0],[1,1],[2,1],[2,0]]
15
+ * representing the incoming curve
16
+ * @param psO Another bezier representing the outgoing curve
17
+ */
18
+ declare function compareCurvaturesAtInterface(psI: number[][], psO: number[][]): number;
19
+ export { compareCurvaturesAtInterface };
@@ -0,0 +1,125 @@
1
+ import { eSign, twoProduct, eDiff, expansionProduct, fastExpansionSum, scaleExpansion } from "big-float-ts";
2
+ import { tangentAt0, evaluate2ndDerivativeAt0, toPowerBasis_3rdDerivative } from "flo-bezier3";
3
+ /**
4
+ * Compare the curvature, κ, between two curves at t === 0.
5
+ *
6
+ * Returns a positive number if κ for psI > κ for psO, negative if κ for psI < κ
7
+ * for psO or zero if the curve extensions are identical (i.e. in same K-family).
8
+ *
9
+ * Precondition: The point psI evaluated at zero must === the point psO
10
+ * evaluated at zero.
11
+ *
12
+ * // TODO - is this correct?
13
+ * Exact: Returns the exact result if the bithlength of all
14
+ * coordinates <= 53 - 5 === 48 and are bit-aligned.
15
+ *
16
+ * @param psI An order 1, 2 or 3 bezier, e.g. [[0,0],[1,1],[2,1],[2,0]]
17
+ * representing the incoming curve
18
+ * @param psO Another bezier representing the outgoing curve
19
+ */
20
+ function compareCurvaturesAtInterface(psI, psO) {
21
+ // Get x' and y' for incoming curve evaluated at 0
22
+ let [dxI, dyI] = tangentAt0(psI); // max bitlength increase / max shift === 3
23
+ // Get x'' and y'' for incoming curve evaluated at 0
24
+ let [ddxI, ddyI] = evaluate2ndDerivativeAt0(psI); // max bitlength increase / max shift === 5
25
+ // Get x' and y' for outgoing curve evaluated at 0
26
+ let [dxO, dyO] = tangentAt0(psO); // max bitlength increase / max shift === 3
27
+ // Get x'' and y'' for outgoing curve evaluated at 0
28
+ let [ddxO, ddyO] = evaluate2ndDerivativeAt0(psO); // max bitlength increase / max shift === 5
29
+ //console.log('κI: ', κ(psI, 0));
30
+ //console.log('κO: ', κ(psO, 0));
31
+ // Remember the formula for the signed curvature of a parametric curve:
32
+ // κ = x′y′′ - y′x′′ / sqrt(x′² + y′²)³
33
+ // κ² = (x′y′′ - y′x′′)² / (x′² + y′²)³
34
+ // This allows us to do an exact comparison of curvatures
35
+ // Simplifying the above gives (denoting the incoming curve with a subscript
36
+ // of 1 and the outgoing with a 2):
37
+ // κIncoming > κOutgoing
38
+ // <=> (x₁′y₁′′ - y₁′x₁′′)²(x₂′² + y₂′²)³ > (x₂′y₂′′ - y₂′x₂′′)²(x₁′² + y₁′²)³
39
+ // <=> a²b³ > c²d³
40
+ // Note b³ > 0 and d³ > 0
41
+ // max aggregate bitlength increase (let original bitlength === p):
42
+ // a -> 2 x ((p+3)+(p+5) + 1) === 4p + 18 -> max p in double precision === 8 -> too low
43
+ //let a = (dxI*ddyI - dyI*ddxI)**2;
44
+ // b -> 3 x ((p+3) + 1) === 3p + 12
45
+ //let b = (dxO*dxO + dyO*dyO )**3;
46
+ // c -> 2 x ((p+3)+(p+5) + 1) === 4p + 18
47
+ //let c = (dxO*ddyO - dyO*ddxO)**2;
48
+ // d -> 3 x ((p+3) + 1) === 3p + 12
49
+ //let d = (dxI*dxI + dyI*dyI )**3;
50
+ // We need to resort to exact floating point arithmetic at this point
51
+ let a = eDiff(twoProduct(dxI, ddyI), twoProduct(dyI, ddxI));
52
+ let c = eDiff(twoProduct(dxO, ddyO), twoProduct(dyO, ddxO));
53
+ let signA = eSign(a);
54
+ let signC = eSign(c);
55
+ if (signA !== signC) {
56
+ //console.log('branch 3');
57
+ return signA - signC;
58
+ }
59
+ let b = fastExpansionSum(twoProduct(dxO, dxO), twoProduct(dyO, dyO));
60
+ let d = fastExpansionSum(twoProduct(dxI, dxI), twoProduct(dyI, dyI));
61
+ let b2 = expansionProduct(b, b);
62
+ let b3 = expansionProduct(b2, b);
63
+ let d2 = expansionProduct(d, d);
64
+ let d3 = expansionProduct(d2, d);
65
+ if (signA !== 0 || signC !== 0) {
66
+ //console.log('branch 4');
67
+ let a2 = expansionProduct(a, a);
68
+ let c2 = expansionProduct(c, c);
69
+ // max aggregate bitlength increase (let original bitlength === p):
70
+ // κ -> (2 x ((p+3)+(p+5) + 1)) + (3 x ((p+3) + 1)) === 7p + 30
71
+ // e.g. for bit-aligned input bitlength p of 10 we get output bitlength
72
+ // of 100, or for p === 3 (the max exact bitlength allowed to have exact
73
+ // results without resorting to infinite precision) we get 51 bits.
74
+ let κI = expansionProduct(a2, b3);
75
+ let κO = expansionProduct(c2, d3);
76
+ let δκ = eSign(eDiff(κI, κO));
77
+ if (δκ !== 0) {
78
+ //console.log('branch 5');
79
+ // At this point signA === signC, both +tive or -tive
80
+ return signA > 0 ? δκ : -δκ;
81
+ }
82
+ }
83
+ // At this point signA === signC, both +tive or -tive or 0
84
+ // Now we have to look at the change of curvature w.r.t. the parameter t,
85
+ // i.e.
86
+ // κ′ = [(x′²+y′²)(x′y′′′-y′x′′′) - 3(x′y′′-y′x′′)(x′x′′+y′y′′)] / (x′²+y′²)^(5/2)
87
+ // Therefore: (denoting the incoming curve with a subscript of 1 and the outgoing with a 2)
88
+ // κ′Incoming > κ′Outgoing
89
+ // <=> [(x₁′²+y₁′²)(x₁′y₁′′′-y₁′x₁′′′) - 3(x₁′y₁′′-y₁′x₁′′)(x₁′x₁′′+y₁′y₁′′)]²(x₂′²+y₂′²)⁵ >
90
+ // [(x₂′²+y₂′²)(x₂′y₂′′′-y₂′x₂′′′) - 3(x₂′y₂′′-y₂′x₂′′)(x₂′x₂′′+y₂′y₂′′)]²(x₁′²+y₁′²)⁵
91
+ // <=> (de - 3af)²b⁵ > (bg - 3ch)²d⁵
92
+ // <=> i²b⁵ > j²d⁵
93
+ // Get x′′′ and y′′′ for incoming curve evaluated at 1
94
+ let [dddxI, dddyI] = toPowerBasis_3rdDerivative(psI); // max bitlength increase === max shift === 6
95
+ let [dddxO, dddyO] = toPowerBasis_3rdDerivative(psO); // max bitlength increase === max shift === 6
96
+ let e = eDiff(twoProduct(dxI, dddyI), twoProduct(dyI, dddxI));
97
+ let f = fastExpansionSum(twoProduct(dxI, ddxI), twoProduct(dyI, ddyI));
98
+ let g = eDiff(twoProduct(dxO, dddyO), twoProduct(dyO, dddxO));
99
+ let h = fastExpansionSum(twoProduct(dxO, ddxO), twoProduct(dyO, ddyO));
100
+ // (de - 3af)²b⁵ > (bg - 3ch)²d⁵
101
+ // i²b⁵ > j²d⁵
102
+ let i = eDiff(expansionProduct(d, e), scaleExpansion(expansionProduct(a, f), 3));
103
+ let j = eDiff(expansionProduct(b, g), scaleExpansion(expansionProduct(c, h), 3));
104
+ let signI = eSign(i);
105
+ let signJ = eSign(j);
106
+ if (signA !== signC) {
107
+ return signI - signJ;
108
+ }
109
+ if (signI === 0 && signJ === 0) {
110
+ // Both curve extensions are identical, i.e. in the same K-family
111
+ return 0;
112
+ }
113
+ let i2 = expansionProduct(i, i);
114
+ let b5 = expansionProduct(b2, b3);
115
+ let j2 = expansionProduct(j, j);
116
+ let d5 = expansionProduct(d2, d3);
117
+ let dκI = expansionProduct(i2, b5);
118
+ let dκO = expansionProduct(j2, d5);
119
+ let sgn = eSign(eDiff(dκI, dκO));
120
+ return signI > 0 ? sgn : -sgn;
121
+ // If the above returned value is still zero then the two curve extensions
122
+ // are identical, i.e. in the same K-family
123
+ }
124
+ export { compareCurvaturesAtInterface };
125
+ //# sourceMappingURL=compare-curvatures-at-interface.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"compare-curvatures-at-interface.js","sourceRoot":"","sources":["../src/compare-curvatures-at-interface.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,UAAU,EAAE,KAAK,EAAE,gBAAgB,EAAE,gBAAgB,EAAE,cAAc,EAAE,MAAM,cAAc,CAAC;AAC5G,OAAO,EAAE,UAAU,EAAE,wBAAwB,EAAE,0BAA0B,EAAE,MAAM,aAAa,CAAC;AAG/F;;;;;;;;;;;;;;;;GAgBG;AACH,SAAS,4BAA4B,CAC7B,GAAe,EACf,GAAe;IAEnB,kDAAkD;IAClD,IAAI,CAAC,GAAG,EAAE,GAAG,CAAC,GAAG,UAAU,CAAC,GAAG,CAAC,CAAC,CAAC,2CAA2C;IAC7E,oDAAoD;IACpD,IAAI,CAAC,IAAI,EAAE,IAAI,CAAC,GAAG,wBAAwB,CAAC,GAAG,CAAC,CAAC,CAAC,2CAA2C;IAE7F,kDAAkD;IAClD,IAAI,CAAC,GAAG,EAAE,GAAG,CAAC,GAAG,UAAU,CAAC,GAAG,CAAC,CAAC,CAAC,2CAA2C;IAC7E,oDAAoD;IACpD,IAAI,CAAC,IAAI,EAAE,IAAI,CAAC,GAAG,wBAAwB,CAAC,GAAG,CAAC,CAAC,CAAC,2CAA2C;IAE7F,iCAAiC;IACjC,iCAAiC;IAEjC,uEAAuE;IACvE,uCAAuC;IACvC,uCAAuC;IAEvC,yDAAyD;IACzD,4EAA4E;IAC5E,mCAAmC;IACnC,6BAA6B;IAC7B,+EAA+E;IAC/E,mBAAmB;IACnB,yBAAyB;IAEzB,mEAAmE;IACnE,uFAAuF;IACvF,mCAAm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AG,KAAK,CAAC,KAAK,CAAC,GAAG,EAAE,GAAG,CAAC,CAAC,CAAC;IAEjC,OAAO,KAAK,GAAG,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC;IAE9B,2EAA2E;IAC3E,2CAA2C;AAC/C,CAAC;AAGD,OAAO,EAAE,4BAA4B,EAAE,CAAA"}
@@ -1,5 +1,5 @@
1
- import { IPointOnShape } from './point-on-shape';
2
- import { Circle } from './circle';
1
+ import { IPointOnShape } from './point-on-shape.js';
2
+ import { Circle } from './circle.js';
3
3
  /**
4
4
  * Represents a point on the shape boundary for which MAT data has been
5
5
  * calculated.
@@ -1,7 +1,4 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.compareCps = void 0;
4
- const point_on_shape_1 = require("./point-on-shape");
1
+ import { comparePoss } from './point-on-shape.js';
5
2
  /**
6
3
  * Primarily for internal use.
7
4
  *
@@ -12,7 +9,7 @@ const point_on_shape_1 = require("./point-on-shape");
12
9
  */
13
10
  function compareCps(a, b) {
14
11
  //let res = PointOnShape.compare(a.pointOnShape, b.pointOnShape);
15
- let res = point_on_shape_1.comparePoss(a.pointOnShape, b.pointOnShape);
12
+ let res = comparePoss(a.pointOnShape, b.pointOnShape);
16
13
  if (res === undefined) {
17
14
  return undefined;
18
15
  }
@@ -25,5 +22,5 @@ function compareCps(a, b) {
25
22
  }
26
23
  return a.order2 - b.order2;
27
24
  }
28
- exports.compareCps = compareCps;
25
+ export { compareCps };
29
26
  //# sourceMappingURL=contact-point.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"contact-point.js","sourceRoot":"","sources":["../src/contact-point.ts"],"names":[],"mappings":";;;AACA,qDAA8D;AAoB9D;;;;;;;GAOG;AACH,SAAS,UAAU,CAAC,CAAe,EAAE,CAAe;IACnD,iEAAiE;IACjE,IAAI,GAAG,GAAG,4BAAW,CAAC,CAAC,CAAC,YAAY,EAAE,CAAC,CAAC,YAAY,CAAC,CAAC;IAEtD,IAAI,GAAG,KAAK,SAAS,EAAE;QAAE,OAAO,SAAS,CAAC;KAAE;IAE5C,IAAI,GAAG,KAAK,CAAC,EAAE;QAAE,OAAO,GAAG,CAAC;KAAE;IAE9B,GAAG,GAAG,CAAC,CAAC,KAAK,GAAG,CAAC,CAAC,KAAK,CAAC;IACxB,IAAI,GAAG,KAAK,CAAC,EAAE;QAAE,OAAO,GAAG,CAAC;KAAE;IAE9B,OAAO,CAAC,CAAC,MAAM,GAAG,CAAC,CAAC,MAAM,CAAC;AAC5B,CAAC;AAGsB,gCAAU"}
1
+ {"version":3,"file":"contact-point.js","sourceRoot":"","sources":["../src/contact-point.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAiB,MAAM,qBAAqB,CAAC;AAoBjE;;;;;;;GAOG;AACH,SAAS,UAAU,CAAC,CAAe,EAAE,CAAe;IACnD,iEAAiE;IACjE,IAAI,GAAG,GAAG,WAAW,CAAC,CAAC,CAAC,YAAY,EAAE,CAAC,CAAC,YAAY,CAAC,CAAC;IAEtD,IAAI,GAAG,KAAK,SAAS,EAAE;QAAE,OAAO,SAAS,CAAC;KAAE;IAE5C,IAAI,GAAG,KAAK,CAAC,EAAE;QAAE,OAAO,GAAG,CAAC;KAAE;IAE9B,GAAG,GAAG,CAAC,CAAC,KAAK,GAAG,CAAC,CAAC,KAAK,CAAC;IACxB,IAAI,GAAG,KAAK,CAAC,EAAE;QAAE,OAAO,GAAG,CAAC;KAAE;IAE9B,OAAO,CAAC,CAAC,MAAM,GAAG,CAAC,CAAC,MAAM,CAAC;AAC5B,CAAC;AAGD,OAAO,EAAgB,UAAU,EAAE,CAAA"}
@@ -1,4 +1,4 @@
1
- import { CpNode } from "../cp-node";
1
+ import { CpNode } from "../cp-node.js";
2
2
  /**
3
3
  * Returns a deep clone of this [[CpNode]]. Can be used to copy the MAT
4
4
  * since cloning a single [[CpNode]] necessarily implies cloning all
@@ -1,7 +1,4 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.clone = void 0;
4
- const cp_node_1 = require("../cp-node");
1
+ import { CpNode } from "../cp-node.js";
5
2
  /** @hidden */
6
3
  const EDGES = ['prev', 'next', 'prevOnCircle', 'nextOnCircle'];
7
4
  /**
@@ -13,7 +10,7 @@ function clone(cpNode) {
13
10
  // Don't change this function to be recursive, the call stack may
14
11
  // overflow if there are too many CpNodes.
15
12
  let nodeMap = new Map();
16
- let newCpNode = new cp_node_1.CpNode(cpNode.cp, cpNode.isHoleClosing, cpNode.isIntersection);
13
+ let newCpNode = new CpNode(cpNode.cp, cpNode.isHoleClosing, cpNode.isIntersection);
17
14
  nodeMap.set(cpNode, newCpNode);
18
15
  let cpStack = [{ cpNode, newCpNode }];
19
16
  while (cpStack.length) {
@@ -22,7 +19,7 @@ function clone(cpNode) {
22
19
  let node = cpNode[edge];
23
20
  let newNode = nodeMap.get(node);
24
21
  if (!newNode) {
25
- newNode = new cp_node_1.CpNode(node.cp, node.isHoleClosing, node.isIntersection);
22
+ newNode = new CpNode(node.cp, node.isHoleClosing, node.isIntersection);
26
23
  nodeMap.set(node, newNode);
27
24
  cpStack.push({ cpNode: node, newCpNode: newNode });
28
25
  }
@@ -31,5 +28,5 @@ function clone(cpNode) {
31
28
  }
32
29
  return newCpNode;
33
30
  }
34
- exports.clone = clone;
31
+ export { clone };
35
32
  //# sourceMappingURL=clone.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"clone.js","sourceRoot":"","sources":["../../src/cp-node/clone.ts"],"names":[],"mappings":";;;AACA,wCAAoC;AAUpC,cAAc;AACd,MAAM,KAAK,GAAW,CAAC,MAAM,EAAE,MAAM,EAAE,cAAc,EAAE,cAAc,CAAC,CAAC;AAGvE;;;;GAIG;AACH,SAAS,KAAK,CAAC,MAAc;IACzB,kEAAkE;IAClE,0CAA0C;IAE1C,IAAI,OAAO,GAAwB,IAAI,GAAG,EAAE,CAAC;IAE7C,IAAI,SAAS,GAAG,IAAI,gBAA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,GAAwB,IAAI,GAAG,EAAE,CAAC;IAE7C,IAAI,SAAS,GAAG,IAAI,MAAM,CAAC,MAAM,CAAC,EAAE,EAAE,MAAM,CAAC,aAAa,EAAE,MAAM,CAAC,cAAc,CAAC,CAAC;IAEnF,OAAO,CAAC,GAAG,CAAC,MAAM,EAAE,SAAS,CAAC,CAAC;IAC/B,IAAI,OAAO,GAAG,CAAC,EAAE,MAAM,EAAE,SAAS,EAAE,CAAC,CAAC;IAEtC,OAAO,OAAO,CAAC,MAAM,EAAE;QACnB,IAAI,EAAE,MAAM,EAAE,SAAS,EAAE,GAAG,OAAO,CAAC,GAAG,EAAE,CAAC;QAE1C,KAAK,IAAI,IAAI,IAAI,KAAK,EAAE;YACpB,IAAI,IAAI,GAAG,MAAM,CAAC,IAAI,CAAC,CAAC;YACxB,IAAI,OAAO,GAAG,OAAO,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC;YAChC,IAAI,CAAC,OAAO,EAAE;gBACV,OAAO,GAAG,IAAI,MAAM,CAAC,IAAI,CAAC,EAAE,EAAE,IAAI,CAAC,aAAa,EAAE,IAAI,CAAC,cAAc,CAAC,CAAC;gBACvE,OAAO,CAAC,GAAG,CAAC,IAAI,EAAE,OAAO,CAAC,CAAC;gBAC3B,OAAO,CAAC,IAAI,CAAC,EAAC,MAAM,EAAE,IAAI,EAAE,SAAS,EAAE,OAAO,EAAE,CAAC,CAAC;aACrD;YACD,SAAS,CAAC,IAAI,CAAC,GAAG,OAAO,CAAC;SAC7B;KACJ;IAED,OAAO,SAAS,CAAC;AACrB,CAAC;AAGD,OAAO,EAAE,KAAK,EAAE,CAAA"}
@@ -1,5 +1,5 @@
1
- import LlRbTree from "flo-ll-rb-tree";
2
- import { CpNode } from "../cp-node";
1
+ import { LlRbTree } from 'flo-ll-rb-tree';
2
+ import { CpNode } from "../cp-node.js";
3
3
  /**
4
4
  * Removes a cpNode from the MAT.
5
5
  * @param cpTree The tree graph holding the [[CpNodes]] of the MAT.
@@ -1,6 +1,3 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.removeCpNode = void 0;
4
1
  /**
5
2
  * Removes a cpNode from the MAT.
6
3
  * @param cpTree The tree graph holding the [[CpNodes]] of the MAT.
@@ -19,5 +16,5 @@ function removeCpNode(cpNode, cpTree) {
19
16
  cpTree.remove(cpNode, false);
20
17
  }
21
18
  }
22
- exports.removeCpNode = removeCpNode;
19
+ export { removeCpNode };
23
20
  //# sourceMappingURL=remove.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"remove.js","sourceRoot":"","sources":["../../src/cp-node/remove.ts"],"names":[],"mappings":";;;AAKA;;;;GAIG;AACH,SAAS,YAAY,CAAC,MAAc,EAAE,MAAyB;IAC3D,IAAI,IAAI,GAAG,MAAM,CAAC,IAAI,CAAC;IACvB,IAAI,IAAI,GAAG,MAAM,CAAC,IAAI,CAAC;IACvB,IAAI,CAAC,IAAI,GAAG,IAAI,CAAC;IACjB,IAAI,CAAC,IAAI,GAAG,IAAI,CAAC;IAEjB,IAAI,YAAY,GAAG,IAAI,CAAC,YAAY,CAAC;IACrC,IAAI,YAAY,GAAG,IAAI,CAAC,YAAY,CAAC;IACrC,YAAY,CAAC,IAAI,GAAG,YAAY,CAAC;IACjC,YAAY,CAAC,IAAI,GAAG,YAAY,CAAC;IAEjC,IAAI,MAAM,EAAE;QACR,MAAM,CAAC,MAAM,CAAC,MAAM,EAAE,KAAK,CAAC,CAAC;KAChC;AACL,CAAC;AAGQ,oCAAY"}
1
+ {"version":3,"file":"remove.js","sourceRoot":"","sources":["../../src/cp-node/remove.ts"],"names":[],"mappings":"AAIA;;;;GAIG;AACH,SAAS,YAAY,CAAC,MAAc,EAAE,MAAyB;IAC3D,IAAI,IAAI,GAAG,MAAM,CAAC,IAAI,CAAC;IACvB,IAAI,IAAI,GAAG,MAAM,CAAC,IAAI,CAAC;IACvB,IAAI,CAAC,IAAI,GAAG,IAAI,CAAC;IACjB,IAAI,CAAC,IAAI,GAAG,IAAI,CAAC;IAEjB,IAAI,YAAY,GAAG,IAAI,CAAC,YAAY,CAAC;IACrC,IAAI,YAAY,GAAG,IAAI,CAAC,YAAY,CAAC;IACrC,YAAY,CAAC,IAAI,GAAG,YAAY,CAAC;IACjC,YAAY,CAAC,IAAI,GAAG,YAAY,CAAC;IAEjC,IAAI,MAAM,EAAE;QACR,MAAM,CAAC,MAAM,CAAC,MAAM,EAAE,KAAK,CAAC,CAAC;KAChC;AACL,CAAC;AAGD,OAAO,EAAE,YAAY,EAAE,CAAA"}
package/node/cp-node.d.ts CHANGED
@@ -1,6 +1,6 @@
1
- import LlRbTree from 'flo-ll-rb-tree';
2
- import { ContactPoint } from './contact-point';
3
- import { removeCpNode } from './cp-node/remove';
1
+ import { LlRbTree } from 'flo-ll-rb-tree';
2
+ import { ContactPoint } from './contact-point.js';
3
+ import { removeCpNode } from './cp-node/remove.js';
4
4
  /**
5
5
  * The primary class of the library.
6
6
  *
@@ -147,8 +147,7 @@ declare class CpNode {
147
147
  *
148
148
  * This is always the case for sharp corners and maximal disks with
149
149
  * a single contact point. Note, however, that even in these cases there are
150
- * two contact points stored (s
151
- * itting 'on top' of each other) for the
150
+ * two contact points stored (sitting 'on top' of each other) for the
152
151
  * maximal disk. It can be seen as a limiting case of a two-prong where the
153
152
  * distance between two of the contact points tend to zero. One point
154
153
  * (represented by a [[CpNode]] of course) will be terminating with the
package/node/cp-node.js CHANGED
@@ -1,9 +1,6 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.CpNode = void 0;
4
- const contact_point_1 = require("./contact-point");
5
- const remove_1 = require("./cp-node/remove");
6
- const get_curve_to_next_1 = require("./get-curve-to-next");
1
+ import { compareCps } from './contact-point.js';
2
+ import { removeCpNode } from './cp-node/remove.js';
3
+ import { getCurveToNext } from './get-curve-to-next.js';
7
4
  /**
8
5
  * The primary class of the library.
9
6
  *
@@ -87,7 +84,7 @@ class CpNode {
87
84
  * @param cpNode
88
85
  */
89
86
  get matCurveToNextVertex() {
90
- return get_curve_to_next_1.getCurveToNext(this);
87
+ return getCurveToNext(this);
91
88
  }
92
89
  /**
93
90
  * Returns the children of this [[CpNode]] when seen as a MAT edge. Only
@@ -218,8 +215,7 @@ class CpNode {
218
215
  *
219
216
  * This is always the case for sharp corners and maximal disks with
220
217
  * a single contact point. Note, however, that even in these cases there are
221
- * two contact points stored (s
222
- * itting 'on top' of each other) for the
218
+ * two contact points stored (sitting 'on top' of each other) for the
223
219
  * maximal disk. It can be seen as a limiting case of a two-prong where the
224
220
  * distance between two of the contact points tend to zero. One point
225
221
  * (represented by a [[CpNode]] of course) will be terminating with the
@@ -313,13 +309,13 @@ class CpNode {
313
309
  return this.getProngCount();
314
310
  }
315
311
  }
316
- exports.CpNode = CpNode;
317
312
  /**
318
313
  * Primarily for internal use.
319
314
  *
320
315
  * Compares the order of two [[CpNode]]s. The order is cyclic and depends
321
316
  * on a [[CpNode]]'s relative position along the shape boundary.
322
317
  */
323
- CpNode.comparator = (a, b) => contact_point_1.compareCps(a.cp, b.cp);
324
- CpNode.remove = remove_1.removeCpNode;
318
+ CpNode.comparator = (a, b) => compareCps(a.cp, b.cp);
319
+ CpNode.remove = removeCpNode;
320
+ export { CpNode };
325
321
  //# sourceMappingURL=cp-node.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"cp-node.js","sourceRoot":"","sources":["../src/cp-node.ts"],"names":[],"mappings":";;;AAMA,mDAA2D;AAC3D,6CAAgD;AAChD,2DAAqD;AAGrD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA+CG;AACH,MAAM,MAAM;IAEX;;;;;;;;;;;;;;;;OAgBG;IACA,YACe,EAAoB,EAC7B,aAAwB,EACxB,cAAwB,EACxB,OAA0B,SAAS,EACnC,OAA0B,SAAS,EACnC,eAA0B,SAAS,EACnC,eAA0B,SAAS;QAN1B,OAAE,GAAF,EAAE,CAAkB;QAC7B,kBAAa,GAAb,aAAa,CAAW;QACx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AAC,CAAC;IACV,CAAC;IAGD;;;;;OAKG;IACI,iBAAiB;QACvB,IAAI,IAAI,CAAC,UAAU,EAAE,EAAE;YAAE,OAAO,CAAC,CAAC;SAAE;QAEpC,OAAO,IAAI,CAAC,aAAa,EAAE,CAAC;IAC7B,CAAC;;AA3RD;;;;;GAKG;AACI,iBAAU,GAChB,CAAC,CAAS,EAAE,CAAS,EAAE,EAAE,CAAC,UAAU,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,EAAE,CAAC,CAAC;AAsB3C,aAAM,GAAG,YAAY,CAAC;AAkQ9B,OAAO,EAAE,MAAM,EAAE,CAAA"}
package/node/curve.d.ts CHANGED
@@ -1,5 +1,5 @@
1
- import { Loop } from './loop';
2
- import { Corner } from './mat/corner';
1
+ import { Loop } from './loop.js';
2
+ import { Corner } from './mat/corner.js';
3
3
  /**
4
4
  * Represents a bezier curve on the shape boundary / loop.
5
5
  */
package/node/curve.js CHANGED
@@ -1,9 +1,6 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.getCornerAtEnd = exports.getCorner = void 0;
4
- const flo_memoize_1 = require("flo-memoize");
5
- const flo_vector2d_1 = require("flo-vector2d");
6
- const flo_bezier3_1 = require("flo-bezier3");
1
+ import { memoize } from 'flo-memoize';
2
+ import { cross, dot, toUnitVector } from 'flo-vector2d';
3
+ import { getInterfaceCcw } from './get-interface-ccw.js';
7
4
  /**
8
5
  * @hidden
9
6
  * Angle in degrees to radians.
@@ -34,7 +31,7 @@ const DEGREE_LIMIT = DEGREES[4];
34
31
  function getCorner(psI, psO) {
35
32
  // getInterfaceCcw must return a number !== 0 if psI and psO are not the
36
33
  // same as seen as a curve extension with t ∈ [-∞,+∞]
37
- let ccw = flo_bezier3_1.getInterfaceCcw(psI, psO);
34
+ let ccw = getInterfaceCcw(psI, psO);
38
35
  let isSharp = ccw < 0;
39
36
  let isDull = ccw > 0;
40
37
  // Find (non-normalized) tangent of curve.ps at t === 1
@@ -51,15 +48,15 @@ function getCorner(psI, psO) {
51
48
  let tangentAtStart = [xS, yS];
52
49
  // These use square root and are thus not exact
53
50
  let tangents_ = [
54
- flo_vector2d_1.toUnitVector(tangentAtEnd),
55
- flo_vector2d_1.toUnitVector(tangentAtStart),
51
+ toUnitVector(tangentAtEnd),
52
+ toUnitVector(tangentAtStart),
56
53
  ];
57
54
  // The cross calculated below should be exact due to beziers having been
58
55
  // normalized!
59
- let crossTangents = flo_vector2d_1.cross(tangents_[0], tangents_[1]);
56
+ let crossTangents = cross(tangents_[0], tangents_[1]);
60
57
  let isQuiteSharp;
61
58
  let isQuiteDull;
62
- let dotTangents = flo_vector2d_1.dot(tangentAtEnd, tangentAtStart);
59
+ let dotTangents = dot(tangentAtEnd, tangentAtStart);
63
60
  if (dotTangents > 0) {
64
61
  // Curves go in same direction
65
62
  isQuiteSharp = crossTangents < -DEGREE_LIMIT;
@@ -78,16 +75,15 @@ function getCorner(psI, psO) {
78
75
  isQuiteDull
79
76
  };
80
77
  }
81
- exports.getCorner = getCorner;
82
78
  /**
83
79
  * @hidden
84
80
  * Returns information about the corner created at the end of this curve
85
81
  * (at t === 1) and the start of the next curve (at t === 0).
86
82
  */
87
- let getCornerAtEnd = flo_memoize_1.memoize(function (curve) {
83
+ let getCornerAtEnd = memoize(function (curve) {
88
84
  let psE = curve.ps;
89
85
  let psS = curve.next.ps;
90
86
  return getCorner(psE, psS);
91
87
  });
92
- exports.getCornerAtEnd = getCornerAtEnd;
88
+ export { getCorner, getCornerAtEnd };
93
89
  //# sourceMappingURL=curve.js.map
package/node/curve.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"curve.js","sourceRoot":"","sources":["../src/curve.ts"],"names":[],"mappings":";;;AACA,6CAAsC;AACtC,+CAAwD;AAGxD,6CAA8C;AA8B9C;;;GAGG;AACH,MAAM,OAAO,GAAG;IACf,kBAAkB;IAClB,IAAI,EAAG,MAAM;IACb,CAAC,EAAM,MAAM;IACb,CAAC,EAAM,M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AAY,CAAC;QAC1B,YAAY,CAAC,cAAc,CAAC;KAC5B,CAAC;IAEF,wEAAwE;IACxE,cAAc;IACd,IAAI,aAAa,GAAG,KAAK,CAAC,SAAS,CAAC,CAAC,CAAC,EAAE,SAAS,CAAC,CAAC,CAAC,CAAC,CAAC;IAEtD,IAAI,YAAqB,CAAC;IAC1B,IAAI,WAAoB,CAAC;IACzB,IAAI,WAAW,GAAG,GAAG,CAAC,YAAY,EAAE,cAAc,CAAC,CAAC;IACpD,IAAI,WAAW,GAAG,CAAC,EAAE;QACpB,8BAA8B;QAC9B,YAAY,GAAG,aAAa,GAAG,CAAC,YAAY,CAAC;QAC7C,WAAW,GAAG,aAAa,GAAG,CAAC,YAAY,CAAC;KAC5C;SAAM;QACN,YAAY,GAAG,OAAO,CAAC;QACvB,WAAW,GAAI,MAAM,CAAC;KACtB;IAED,OAAO;QACN,QAAQ,EAAE,SAAS;QACnB,aAAa;QACb,OAAO;QACP,MAAM;QACN,YAAY;QACZ,WAAW;KACX,CAAC;AACH,CAAC;AAGD;;;;GAIG;AACH,IAAI,cAAc,GAAG,OAAO,CAAC,UAAS,KAAY;IACjD,IAAI,GAAG,GAAG,KAAK,CAAC,EAAE,CAAC;IACnB,IAAI,GAAG,GAAG,KAAK,CAAC,IAAI,CAAC,EAAE,CAAC;IAExB,OAAO,SAAS,CAAC,GAAG,EAAE,GAAG,CAAC,CAAC;AAC5B,CAAC,CAAC,CAAC;AAGH,OAAO,EAAS,SAAS,EAAE,cAAc,EAAE,CAAA"}
@@ -1,5 +1,5 @@
1
- import { CpNode } from '../cp-node';
2
- import { Generated } from './debug';
1
+ import { CpNode } from '../cp-node.js';
2
+ import { Generated } from './debug.js';
3
3
  /**
4
4
  * @hidden
5
5
  * Used for debugging only.
@@ -1,3 +1,2 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
1
+ export {};
3
2
  //# sourceMappingURL=cp-node-for-debugging.js.map
@@ -1,11 +1,11 @@
1
- import { IPointOnShape } from "../point-on-shape";
2
- import { TwoProngForDebugging } from "./two-prong-for-debugging";
3
- import { ThreeProngForDebugging } from "./three-prong-for-debugging";
4
- import { Curve } from "../curve";
5
- import { Mat } from "../mat";
6
- import { CpNode } from "../cp-node";
7
- import { Circle } from "../circle";
8
- import { ICpNodeForDebugging } from "./cp-node-for-debugging";
1
+ import { IPointOnShape } from '../point-on-shape.js';
2
+ import { TwoProngForDebugging } from './two-prong-for-debugging.js';
3
+ import { ThreeProngForDebugging } from './three-prong-for-debugging.js';
4
+ import { Curve } from '../curve.js';
5
+ import { Mat } from '../mat.js';
6
+ import { CpNode } from '../cp-node.js';
7
+ import { Circle } from '../circle.js';
8
+ import { ICpNodeForDebugging } from './cp-node-for-debugging.js';
9
9
  /** @hidden */
10
10
  interface IDebugElems {
11
11
  oneProng: IPointOnShape;
@@ -1,3 +1,2 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
1
+ export {};
3
2
  //# sourceMappingURL=debug-elem-types.js.map
@@ -1,8 +1,8 @@
1
- import { IGeneralDebugFunctions } from './functions/general';
2
- import { ITwoProngDebugFunctions } from './functions/two-prong';
3
- import { IThreeProngDebugFunctions } from './functions/three-prong';
4
- import { TDrawElemFunctions } from './functions/draw-elem/draw-elem';
5
- import { IDebugElems } from './debug-elem-types';
1
+ import { IGeneralDebugFunctions } from './functions/general.js';
2
+ import { ITwoProngDebugFunctions } from './functions/two-prong.js';
3
+ import { IThreeProngDebugFunctions } from './functions/three-prong.js';
4
+ import { TDrawElemFunctions } from './functions/draw-elem/draw-elem.js';
5
+ import { IDebugElems } from './debug-elem-types.js';
6
6
  /** @hidden */
7
7
  interface Debug {
8
8
  /** Generated by debug object for later inspection */
@@ -20,8 +20,6 @@ declare type GeneratedElems = {
20
20
  };
21
21
  /** @hidden */
22
22
  interface ITiming {
23
- normalize: number;
24
- simplifyPaths: number;
25
23
  holeClosers: number;
26
24
  oneAnd2Prongs: number;
27
25
  threeProngs: number;