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 +1 @@
1
- {"version":3,"file":"three-prong-for-debugging.js","sourceRoot":"","sources":["../../src/debug/three-prong-for-debugging.ts"],"names":[],"mappings":";;;AAEA,sDAAoE;AAgCpE,SAAS,iCAAiC;IACtC,OAAO;QACH,SAAS,EAAI,SAAS;QACtB,MAAM,EAAO,SAAS;QACtB,IAAI,EAAS,SAAS;QACtB,KAAK,EAAQ,SAAS;QACtB,IAAI,EAAS,SAAS;QACtB,QAAQ,EAAK,SAAS;QACtB,oBAAoB,EAAG,SAAS;QAChC,UAAU,EAAG,SAAS;QACtB,UAAU,EAAG,SAAS;QACtB,MAAM,EAAO,SAAS;KACzB,CAAA;AACL,CAAC;AAUgC,8EAAiC;AARlE,SAAS,SAAS,CAAC,sBAA8C;IAC7D,OAAO,sBAAsB,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,CACvC,CAAC,iCAAgB,CAAE,CAAC,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC,YAAY,CAAE;QACxC,iCAAgB,CAAE,CAAC,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC,YAAY,CAAE,CAAC,CAC7C,CAAC;AACN,CAAC"}
1
+ {"version":3,"file":"three-prong-for-debugging.js","sourceRoot":"","sources":["../../src/debug/three-prong-for-debugging.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,gBAAgB,EAAiB,MAAM,sBAAsB,CAAC;AAgCvE,SAAS,iCAAiC;IACtC,OAAO;QACH,SAAS,EAAI,SAAS;QACtB,MAAM,EAAO,SAAS;QACtB,IAAI,EAAS,SAAS;QACtB,KAAK,EAAQ,SAAS;QACtB,IAAI,EAAS,SAAS;QACtB,QAAQ,EAAK,SAAS;QACtB,oBAAoB,EAAG,SAAS;QAChC,UAAU,EAAG,SAAS;QACtB,UAAU,EAAG,SAAS;QACtB,MAAM,EAAO,SAAS;KACzB,CAAA;AACL,CAAC;AAED,SAAS,SAAS,CAAC,sBAA8C;IAC7D,OAAO,sBAAsB,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,CACvC,CAAC,gBAAgB,CAAE,CAAC,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC,YAAY,CAAE;QACxC,gBAAgB,CAAE,CAAC,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC,YAAY,CAAE,CAAC,CAC7C,CAAC;AACN,CAAC;AAGD,OAAO,EAA0B,iCAAiC,EAAE,CAAA"}
@@ -1,8 +1,8 @@
1
- import { CpNode } from '../cp-node';
2
- import { IPointOnShape } from '../point-on-shape';
3
- import { Circle } from '../circle';
4
- import { BezierPiece } from '../mat/bezier-piece';
5
- import { Generated } from './debug';
1
+ import { CpNode } from '../cp-node.js';
2
+ import { IPointOnShape } from '../point-on-shape.js';
3
+ import { Circle } from '../circle.js';
4
+ import { BezierPiece } from '../mat/bezier-piece.js';
5
+ import { Generated } from './debug.js';
6
6
  /** @hidden */
7
7
  interface TwoProngForDebugging {
8
8
  generated: Generated;
@@ -1,3 +1,2 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
1
+ export {};
3
2
  //# sourceMappingURL=two-prong-for-debugging.js.map
@@ -1,23 +1,26 @@
1
- import { Mat } from './mat';
1
+ import { Mat } from './mat.js';
2
2
  /**
3
3
  * Finds and returns the Medial Axis Transforms (MATs) from the given array of
4
4
  * bezier loops representing shape boundaries.
5
+ *
5
6
  * @param bezierLoops An array of (possibly intersecting) loops with each loop
6
7
  * representing one or more piecewise smooth closed curves (i.e. shapes). Each
7
8
  * loop consists of an array of beziers represented by an array of control
8
9
  * points with 2,3 or 4 elements corresponding to linear, quadratic and cubic
9
10
  * beziers respectively. Each point is a two-element array (ordered pair), the
10
11
  * first of which is the x-coordinate and the second the y-coordinate.
11
- * @param maxFlatness The maximum value the flatness of a curve can have before
12
- * an additional MAT point is added in between. Defaults to 1.01. (Flatness is
13
- * measured as the total distance between control points of a curve divided by
14
- * the length of the curve.) The is clipped in [1.001,2]..
12
+ *
13
+ * @param maxCurviness The maximum value the 'curviness' of a curve can have
14
+ * before an additional MAT point is inserted in between. Defaults to 0.4.
15
+ * (Curviness is measured as the total angle in radians between the consecutive
16
+ * vectors formed by the ordered control points of th bezier curve). The value
17
+ * is clipped in the range `[0.05,3]`.
15
18
  * @param maxLength The maximum length a curve can have before an additional MAT
16
- * point is added in between. This value is scaled to a reference 1024 x 1024
17
- * grid (e.g. if the shape fits in a 512 x 512 axis-aligned box the will be
18
- * halved, e.g. from 10 to 5). Together with maxFlatness it represents a
19
+ * point is inserted. This value is scaled to a reference 1024 x 1024
20
+ * grid (e.g. if the shape fits in a 512 x 512 axis-aligned box the value will be
21
+ * halved, e.g. from 10 to 5). Together with maxCurviness it represents a
19
22
  * tolerance for the accuracy of the MAT. Defaults to 4. The value is clipped
20
23
  * in [1,100].
21
24
  */
22
- declare function findMats(bezierLoops: number[][][][], maxFlatness?: number, maxLength?: number): Mat[];
25
+ declare function findMats(bezierLoops: number[][][][], maxCurviness?: number, maxLength?: number): Mat[];
23
26
  export { findMats };
package/node/find-mats.js CHANGED
@@ -1,76 +1,71 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.findMats = void 0;
4
- const flo_boolean_1 = require("flo-boolean");
5
- const find_and_add_3_prongs_1 = require("./mat/find-mat/find-and-add-3-prongs");
6
- const create_initial_cp_graph_1 = require("./mat/find-mat/create-initial-cp-graph");
1
+ import { simplifyPaths } from 'flo-boolean';
2
+ import { findAndAddAll3Prongs } from './mat/find-mat/find-and-add-3-prongs.js';
3
+ import { createInitialCpGraph } from './mat/find-mat/create-initial-cp-graph.js';
7
4
  ;
8
- const add_debug_info_1 = require("./mat/find-mat/add-debug-info");
9
- const get_potential_2_prongs_1 = require("./mat/find-mat/get-potential-2-prongs");
10
- const get_sharp_corners_1 = require("./mat/find-mat/get-sharp-corners");
11
- const find_and_add_2_prongs_on_all_paths_1 = require("./mat/find-mat/find-and-add-2-prongs-on-all-paths");
12
- const create_get_interesting_points_on_loop_1 = require("./mat/find-mat/create-get-interesting-points-on-loop");
13
- const find_and_add_hole_closing_2_prongs_1 = require("./mat/find-mat/find-and-add-hole-closing-2-prongs");
14
- const get_max_coordinate_1 = require("./loop/get-max-coordinate");
5
+ import { addDebugInfo1, addDebugInfo2, addDebugInfo3, addDebugInfo4 } from './mat/find-mat/add-debug-info.js';
6
+ import { getPotential2Prongs } from './mat/find-mat/get-potential-2-prongs.js';
7
+ import { getSharpCorners } from './mat/find-mat/get-sharp-corners.js';
8
+ import { findAndAdd2ProngsOnAllPaths } from './mat/find-mat/find-and-add-2-prongs-on-all-paths.js';
9
+ import { getInterestingPointsOnLoop } from './mat/find-mat/create-get-interesting-points-on-loop.js';
10
+ import { findAndAddHoleClosing2Prongs } from './mat/find-mat/find-and-add-hole-closing-2-prongs.js';
11
+ import { getLoopsMetrics } from './loop/get-max-coordinate.js';
15
12
  /**
16
13
  * Finds and returns the Medial Axis Transforms (MATs) from the given array of
17
14
  * bezier loops representing shape boundaries.
15
+ *
18
16
  * @param bezierLoops An array of (possibly intersecting) loops with each loop
19
17
  * representing one or more piecewise smooth closed curves (i.e. shapes). Each
20
18
  * loop consists of an array of beziers represented by an array of control
21
19
  * points with 2,3 or 4 elements corresponding to linear, quadratic and cubic
22
20
  * beziers respectively. Each point is a two-element array (ordered pair), the
23
21
  * first of which is the x-coordinate and the second the y-coordinate.
24
- * @param maxFlatness The maximum value the flatness of a curve can have before
25
- * an additional MAT point is added in between. Defaults to 1.01. (Flatness is
26
- * measured as the total distance between control points of a curve divided by
27
- * the length of the curve.) The is clipped in [1.001,2]..
22
+ *
23
+ * @param maxCurviness The maximum value the 'curviness' of a curve can have
24
+ * before an additional MAT point is inserted in between. Defaults to 0.4.
25
+ * (Curviness is measured as the total angle in radians between the consecutive
26
+ * vectors formed by the ordered control points of th bezier curve). The value
27
+ * is clipped in the range `[0.05,3]`.
28
28
  * @param maxLength The maximum length a curve can have before an additional MAT
29
- * point is added in between. This value is scaled to a reference 1024 x 1024
30
- * grid (e.g. if the shape fits in a 512 x 512 axis-aligned box the will be
31
- * halved, e.g. from 10 to 5). Together with maxFlatness it represents a
29
+ * point is inserted. This value is scaled to a reference 1024 x 1024
30
+ * grid (e.g. if the shape fits in a 512 x 512 axis-aligned box the value will be
31
+ * halved, e.g. from 10 to 5). Together with maxCurviness it represents a
32
32
  * tolerance for the accuracy of the MAT. Defaults to 4. The value is clipped
33
33
  * in [1,100].
34
34
  */
35
- function findMats(bezierLoops, maxFlatness = 1.01, maxLength = 4) {
35
+ function findMats(bezierLoops, maxCurviness = 0.4, maxLength = 4) {
36
36
  if (typeof _debug_ !== 'undefined') {
37
37
  var timingStart = performance.now();
38
38
  }
39
39
  let maxCoordinate;
40
40
  let minBezLength;
41
- ({ maxFlatness, maxLength, maxCoordinate, minBezLength } =
42
- getSizeParams(bezierLoops, maxFlatness, maxLength));
43
- let loopss = flo_boolean_1.simplifyPaths(bezierLoops, maxCoordinate);
44
- if (typeof _debug_ !== 'undefined') {
45
- let timing = _debug_.generated.timing;
46
- timing.simplifyPaths = performance.now() - timingStart;
47
- }
41
+ ({ maxCurviness, maxLength, maxCoordinate, minBezLength } =
42
+ getSizeParams(bezierLoops, maxCurviness, maxLength));
43
+ let loopss = simplifyPaths(bezierLoops, maxCoordinate);
48
44
  let mats = [];
49
45
  for (let loops of loopss) {
50
- let mat = findMat(loops, minBezLength, maxFlatness, maxLength, maxCoordinate);
46
+ let mat = findMat(loops, minBezLength, maxCurviness, maxLength, maxCoordinate);
51
47
  if (mat) {
52
48
  mats.push(mat);
53
49
  }
54
50
  }
55
51
  return mats;
56
52
  }
57
- exports.findMats = findMats;
58
- function getSizeParams(bezierLoops, maxFlatness, maxLength) {
53
+ function getSizeParams(bezierLoops, maxCurviness, maxLength) {
59
54
  // Gather some shape metrics
60
- let { maxCoordinate, maxRadius } = get_max_coordinate_1.getLoopsMetrics(bezierLoops);
55
+ let { maxCoordinate, maxRadius } = getLoopsMetrics(bezierLoops);
61
56
  let expMax = Math.ceil(Math.log2(maxCoordinate));
62
57
  let minBezLengthSigBits = 14;
63
58
  /**
64
59
  * If a curve is shorter than this value then no points on it will be
65
60
  * selected for the purpose of finding the MAT.
66
61
  */
67
- let minBezLength = Math.pow(2, expMax) * Math.pow(2, (-minBezLengthSigBits));
62
+ let minBezLength = 2 ** expMax * 2 ** (-minBezLengthSigBits);
68
63
  // Limit the tolerance to a reasonable level
69
- if (maxFlatness < 1.001) {
70
- maxFlatness = 1.001;
64
+ if (maxCurviness < 0.05) {
65
+ maxCurviness = 0.05;
71
66
  }
72
- if (maxFlatness > 2) {
73
- maxFlatness = 2;
67
+ if (maxCurviness > 3) {
68
+ maxCurviness = 3;
74
69
  }
75
70
  // Limit the tolerance to a reasonable level
76
71
  if (maxLength < 0.1) {
@@ -82,35 +77,33 @@ function getSizeParams(bezierLoops, maxFlatness, maxLength) {
82
77
  // Adjust length tolerance according to a reference max coordinate
83
78
  let expMaxRadius = Math.ceil(Math.log2(maxRadius));
84
79
  let maxLengthSigBits = 10; // 1024 x 1024
85
- maxLength = maxLength * (Math.pow(2, expMaxRadius) * Math.pow(2, (-maxLengthSigBits)));
86
- return { maxFlatness, maxLength, maxCoordinate, minBezLength };
80
+ maxLength = maxLength * (2 ** expMaxRadius * 2 ** (-maxLengthSigBits));
81
+ return { maxCurviness, maxLength, maxCoordinate, minBezLength };
87
82
  }
88
83
  /**
89
84
  * @hidden
90
85
  * Find the MAT of the given loops.
91
86
  * @param loops The loops (that as a precondition must be ordered from highest
92
87
  * (i.e. smallest y-value) topmost point loops to lowest)
93
- * @param xMap Intersection point map.
94
- * @param additionalPointCount
95
88
  */
96
- function findMat(loops, minBezLength, maxFlatness, maxLength, maxCoordinate) {
97
- add_debug_info_1.addDebugInfo1(loops);
89
+ function findMat(loops, minBezLength, maxCurviness, maxLength, maxCoordinate) {
90
+ addDebugInfo1(loops);
98
91
  // Gets interesting points on the shape, i.e. those that makes sense to use
99
92
  // for the 2-prong procedure.
100
- let pointsPerLoop = loops.map(create_get_interesting_points_on_loop_1.getInterestingPointsOnLoop(minBezLength, maxFlatness, maxLength));
101
- let for2ProngsPerLoop = get_potential_2_prongs_1.getPotential2Prongs(pointsPerLoop);
102
- let sharpCornersPerLoop = get_sharp_corners_1.getSharpCorners(pointsPerLoop);
93
+ let pointsPerLoop = loops.map(getInterestingPointsOnLoop(minBezLength, maxCurviness, maxLength));
94
+ let for2ProngsPerLoop = getPotential2Prongs(pointsPerLoop);
95
+ let sharpCornersPerLoop = getSharpCorners(pointsPerLoop);
103
96
  let cpTrees = new Map();
104
- let cpNode = create_initial_cp_graph_1.createInitialCpGraph(loops, cpTrees, sharpCornersPerLoop);
105
- find_and_add_hole_closing_2_prongs_1.findAndAddHoleClosing2Prongs(loops, cpTrees, maxCoordinate);
97
+ let cpNode = createInitialCpGraph(loops, cpTrees, sharpCornersPerLoop);
98
+ findAndAddHoleClosing2Prongs(loops, cpTrees, maxCoordinate);
106
99
  if (typeof _debug_ !== 'undefined') {
107
100
  if (_debug_.directives.stopAfterHoleClosers) {
108
101
  return undefined;
109
102
  }
110
103
  }
111
- add_debug_info_1.addDebugInfo2();
112
- cpNode = find_and_add_2_prongs_on_all_paths_1.findAndAdd2ProngsOnAllPaths(loops, cpTrees, for2ProngsPerLoop, maxCoordinate);
113
- add_debug_info_1.addDebugInfo3();
104
+ addDebugInfo2();
105
+ cpNode = findAndAdd2ProngsOnAllPaths(loops, cpTrees, for2ProngsPerLoop, maxCoordinate);
106
+ addDebugInfo3();
114
107
  if (typeof _debug_ !== 'undefined') {
115
108
  if (_debug_.directives.stopAfterTwoProngs) {
116
109
  return undefined;
@@ -119,14 +112,15 @@ function findMat(loops, minBezLength, maxFlatness, maxLength, maxCoordinate) {
119
112
  if (cpNode === undefined) {
120
113
  return undefined;
121
114
  }
122
- find_and_add_3_prongs_1.findAndAddAll3Prongs(cpTrees, cpNode, maxCoordinate);
115
+ findAndAddAll3Prongs(cpTrees, cpNode, maxCoordinate);
123
116
  if (typeof _debug_ !== 'undefined') {
124
117
  if (_debug_.directives.stopAfterThreeProngs) {
125
118
  return undefined;
126
119
  }
127
120
  }
128
121
  let mat = { cpNode, cpTrees };
129
- add_debug_info_1.addDebugInfo4(mat);
122
+ addDebugInfo4(mat);
130
123
  return mat;
131
124
  }
125
+ export { findMats };
132
126
  //# sourceMappingURL=find-mats.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"find-mats.js","sourceRoot":"","sources":["../src/find-mats.ts"],"names":[],"mappings":";;;AAMA,6CAA4C;AAI5C,gFAA4E;AAC5E,oFAA8E;AAAA,CAAC;AAC/E,kEAA2G;AAC3G,kFAA4E;AAC5E,wEAAmE;AACnE,0GAAgG;AAChG,gHAAkG;AAClG,0GAAiG;AACjG,kEAA4D;AAG5D;;;;;;;;;;;;;;;;;;;GAmBG;AACH,SAAS,QAAQ,CACf,WAA2B,EAC3B,WAAW,GAAG,IAAI,EACZ,SAAS,GAAG,CAAC;IAEpB,IAAI,OAAO,OAAO,KAAK,WAAW,EAAE;QAAE,IAAI,WAAW,GAAG,WAAW,CAAC,GAAG,EAAE,CAAC;KAAE;IAE5E,IAAI,aAAqB,CAAC;IAC1B,IAAI,YAAoB,CAAC;IACzB,CAAC,EAAE,WAAW,EAAE,SAAS,EAAE,aAAa,EAAE,YAAY,EAAE;QACvD,aAAa,CAAC,WAAW,EAAE,WAAW,EAAE,SAAS,CAAC,CAAC,CAAC;IAErD,IAAI,MAAM,GAAG,2BAAa,CAAC,WAAW,EAAE,aAAa,CAAC,CAAC;IAEvD,IAAI,OAAO,OAAO,KAAK,WAAW,EAAE;QACnC,IAAI,MAAM,GAAG,OAAO,CAAC,SAAS,CAAC,MAAM,CAAC;QACtC,MAAM,CAAC,aAAa,GAAG,WAAW,CAAC,GAAG,EAAE,GAAG,WAAW,CAAC;KACvD;IAED,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IAEhB,IAAI,OAAO,OAAO,KAAK,WAAW,EAAE;QACnC,IAAI,OAAO,CAAC,UAAU,CAAC,kBAAkB,EAAE;YAC1C,OAAO,SAAS,CAAC;SACjB;KACD;IAED,IAAI,MAAM,KAAK,SAAS,EAAE;QAAE,OAAO,SAAS,CAAC;KAAE;IAE/C,oBAAoB,CAAC,OAAO,EAAE,MAAM,EAAE,aAAa,CAAC,CAAC;IAErD,IAAI,OAAO,OAAO,KAAK,WAAW,EAAE;QACnC,IAAI,OAAO,CAAC,UAAU,CAAC,oBAAoB,EAAE;YAC5C,OAAO,SAAS,CAAC;SACjB;KACD;IAED,IAAI,GAAG,GAAG,EAAE,MAAM,EAAE,OAAO,EAAE,CAAC;IAE9B,aAAa,CAAC,GAAG,CAAC,CAAC;IAEnB,OAAO,GAAG,CAAC;AACZ,CAAC;AAGD,OAAO,EAAE,QAAQ,EAAE,CAAA"}
@@ -1,9 +1,9 @@
1
- import { BezierPart } from 'flo-bezier3';
2
- import { CpNode } from './cp-node';
1
+ import { BezierPiece } from 'flo-bezier3';
2
+ import { CpNode } from './cp-node.js';
3
3
  /**
4
4
  * Returns the ordered bezier curves from this CpNode to the next CpNode
5
5
  * on the boundary.
6
6
  * @param cpNode
7
7
  */
8
- declare function getBoundaryBezierPartsToNext(cpNode: CpNode): BezierPart[];
8
+ declare function getBoundaryBezierPartsToNext(cpNode: CpNode): BezierPiece[];
9
9
  export { getBoundaryBezierPartsToNext };
@@ -1,6 +1,3 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.getBoundaryBezierPartsToNext = void 0;
4
1
  /**
5
2
  * Returns the ordered bezier curves from this CpNode to the next CpNode
6
3
  * on the boundary.
@@ -28,7 +25,6 @@ function getBoundaryBezierPartsToNext(cpNode) {
28
25
  }
29
26
  return bezierParts;
30
27
  }
31
- exports.getBoundaryBezierPartsToNext = getBoundaryBezierPartsToNext;
32
28
  /**
33
29
  * @hidden
34
30
  * Adds pieces of skipped beziers.
@@ -43,4 +39,5 @@ function addSkippedBeziers(bezierParts, curveStart, curveEnd, t1) {
43
39
  bezierParts.push(bezierPart);
44
40
  } while (curveThis !== curveEnd);
45
41
  }
42
+ export { getBoundaryBezierPartsToNext };
46
43
  //# sourceMappingURL=get-boundary-bezier-parts-to-next.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"get-boundary-bezier-parts-to-next.js","sourceRoot":"","sources":["../src/get-boundary-bezier-parts-to-next.ts"],"names":[],"mappings":";;;AAMA;;;;GAIG;AACH,SAAS,4BAA4B,CAAC,MAAc;IAChD,IAAI,MAAM,GAAG,MAAM,CAAC;IACpB,IAAI,MAAM,GAAG,MAAM,CAAC,IAAI,CAAC;IAEzB,IAAI,OAAO,GAAG,MAAM,CAAC,EAAE,CAAC,YAAY,CAAC;IACrC,IAAI,OAAO,GAAG,MAAM,CAAC,EAAE,CAAC,YAAY,CAAC;IAErC,IAAI,SAAS,GAAG,OAAO,CAAC,KAAK,CAAC;IAC9B,IAAI,SAAS,GAAG,OAAO,CAAC,KAAK,CAAC;IAE9B,IAAI,SAAS,CAAC,IAAI,KAAK,SAAS,CAAC,IAAI,EAAE;QACnC,wEAAwE;QACxE,UAAU;QACV,OAAO,SAAS,CAAC;KACpB;IAED,IAAI,WAAW,GAAiB,EAAE,CAAC;IAEnC,IAAI,SAAS,KAAK,SAAS,EAAE;QACzB,WAAW,CAAC,IAAI,CACZ,EAAE,EAAE,EAAE,OAAO,CAAC,KAAK,CAAC,EAAE,EAAE,EAAE,EAAE,CAAC,OAAO,CAAC,CAAC,EAAE,OAAO,CAAC,CAAC,CAAC,EAAE,CACvD,CAAC;KACL;SAAM;QACH,WAAW,CAAC,IAAI,CACZ,EAAE,EAAE,EAAE,OAAO,CAAC,KAAK,CAAC,EAAE,EAAE,EAAE,EAAE,CAAC,OAAO,CAAC,CAAC,EAAE,CAAC,CAAC,EAAE,CAC/C,CAAC;QAEF,iBAAiB,CACT,WAAW,EACX,OAAO,CAAC,KAAK,EACb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ier curves from this CpNode to the next CpNode
4
4
  * on the boundary.
@@ -1,7 +1,5 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.getBoundaryBeziersToNext = void 0;
4
- const flo_bezier3_1 = require("flo-bezier3");
1
+ // qqq import { fromTo, fromTTo1, from0ToT } from 'flo-bezier3';
2
+ import { fromTo } from 'flo-bezier3';
5
3
  /**
6
4
  * Returns the ordered bezier curves from this CpNode to the next CpNode
7
5
  * on the boundary.
@@ -21,15 +19,14 @@ function getBoundaryBeziersToNext(cpNode) {
21
19
  }
22
20
  let beziers = [];
23
21
  if (curveNext === curveThis) {
24
- beziers.push(flo_bezier3_1.fromTo(posThis.curve.ps)(posThis.t, posNext.t));
22
+ beziers.push(fromTo(posThis.curve.ps, posThis.t, posNext.t));
25
23
  }
26
24
  else {
27
- beziers.push(flo_bezier3_1.fromTTo1(posThis.curve.ps, posThis.t));
25
+ beziers.push(fromTo(posThis.curve.ps, posThis.t, 1));
28
26
  addSkippedBeziers(beziers, posThis.curve, posNext.curve, posNext.t);
29
27
  }
30
28
  return beziers;
31
29
  }
32
- exports.getBoundaryBeziersToNext = getBoundaryBeziersToNext;
33
30
  /**
34
31
  * Adds pieces of skipped beziers.
35
32
  * @hidden
@@ -39,7 +36,10 @@ function addSkippedBeziers(beziers, curveStart, curveEnd, t1) {
39
36
  do {
40
37
  curveThis = curveThis.next;
41
38
  let tEnd = curveThis === curveEnd ? t1 : 1;
42
- beziers.push(flo_bezier3_1.from0ToT(curveThis.ps, tEnd));
39
+ beziers.push(
40
+ // qqq from0ToT(curveThis.ps, tEnd)
41
+ fromTo(curveThis.ps, 0, tEnd));
43
42
  } while (curveThis !== curveEnd);
44
43
  }
44
+ export { getBoundaryBeziersToNext };
45
45
  //# sourceMappingURL=get-boundary-beziers-to-next.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"get-boundary-beziers-to-next.js","sourceRoot":"","sources":["../src/get-boundary-beziers-to-next.ts"],"names":[],"mappings":";;;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,CAAC,CAChB,CAAC;KACL;IAED,OAAO,OAAO,CAAC;AACnB,CAAC;AAGD;;;GAGG;AACH,SAAS,iBAAiB,CAClB,OAAyB,EACzB,UAAkB,EAClB,QAAkB,EAClB,EAAmB;IAEvB,IAAI,SAAS,GAAG,UAAU,CAAC;IAC3B,GAAG;QACC,SAAS,GAAG,SAAS,CAAC,IAAI,CAAC;QAC3B,IAAI,IAAI,GAAG,SAAS,KAAK,QAAQ,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,CAAC;QAC3C,OAAO,CAAC,IAAI;QACR,oCAAoC;QACpC,MAAM,CAAC,SAAS,CAAC,EAAE,EAAE,CAAC,EAAE,IAAI,CAAC,CAChC,CAAC;KACL,QAAQ,SAAS,KAAK,QAAQ,EAAE;AACrC,CAAC;AAGD,OAAO,EAAE,wBAAwB,EAAE,CAAA"}
@@ -0,0 +1,2 @@
1
+ declare const getBoundingBox_: (a: number[][]) => number[][];
2
+ export { getBoundingBox_ };
@@ -0,0 +1,5 @@
1
+ import { getBoundingBox } from "flo-bezier3";
2
+ import { memoize } from "flo-memoize";
3
+ const getBoundingBox_ = memoize(getBoundingBox);
4
+ export { getBoundingBox_ };
5
+ //# sourceMappingURL=get-bounding-box-.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"get-bounding-box-.js","sourceRoot":"","sources":["../src/get-bounding-box-.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,aAAa,CAAC;AAC7C,OAAO,EAAE,OAAO,EAAE,MAAM,aAAa,CAAC;AAEtC,MAAM,eAAe,GAAG,OAAO,CAAC,cAAc,CAAC,CAAC;AAGhD,OAAO,EAAE,eAAe,EAAE,CAAA"}
@@ -1,4 +1,4 @@
1
- import { CpNode } from './cp-node';
1
+ import { CpNode } from './cp-node.js';
2
2
  /**
3
3
  * Traverses all edges (depth first) of the given MAT tree starting at the given
4
4
  * vertex (represented by a [[CpNode]]). Returns the result as an array of
@@ -1,9 +1,6 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.getBranches = void 0;
4
- const flo_bezier3_1 = require("flo-bezier3");
5
- const flo_vector2d_1 = require("flo-vector2d");
6
- const get_curve_to_next_1 = require("./get-curve-to-next");
1
+ import { tangent } from 'flo-bezier3';
2
+ import { cross, toUnitVector } from 'flo-vector2d';
3
+ import { getCurveToNext } from './get-curve-to-next.js';
7
4
  /** @hidden */
8
5
  const defaultTolerance = 1; // 1 degree
9
6
  /**
@@ -53,9 +50,9 @@ function getBranches(cpNode, tolerance = defaultTolerance) {
53
50
  cps.push(...children);
54
51
  continue;
55
52
  }
56
- let backPointingTan = flo_vector2d_1.toUnitVector(flo_bezier3_1.tangent(get_curve_to_next_1.getCurveToNext(cp.next.prevOnCircle), 0));
57
- let forwardPointingTan = flo_vector2d_1.toUnitVector(flo_bezier3_1.tangent(get_curve_to_next_1.getCurveToNext(children[0]), 0));
58
- let cross_ = flo_vector2d_1.cross(backPointingTan, forwardPointingTan);
53
+ let backPointingTan = toUnitVector(tangent(getCurveToNext(cp.next.prevOnCircle), 0));
54
+ let forwardPointingTan = toUnitVector(tangent(getCurveToNext(children[0]), 0));
55
+ let cross_ = cross(backPointingTan, forwardPointingTan);
59
56
  let angle = Math.abs(Math.asin(cross_) * (180 / Math.PI));
60
57
  if (angle > tolerance) {
61
58
  branches.push(branchCpNodes);
@@ -68,5 +65,5 @@ function getBranches(cpNode, tolerance = defaultTolerance) {
68
65
  }
69
66
  return branches;
70
67
  }
71
- exports.getBranches = getBranches;
68
+ export { getBranches };
72
69
  //# sourceMappingURL=get-branches.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"get-branches.js","sourceRoot":"","sources":["../src/get-branches.ts"],"names":[],"mappings":";;;AAEA,6CAAsC;AACtC,+CAAmD;AACnD,2DAAqD;AAGrD,cAAc;AACd,MAAM,gBAAgB,GAAG,CAAC,CAAC,CAAC,WAAW;AAGvC;;;;;;;;GAQG;AACH,SAAS,WA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ACnB,GAAG,CAAC,IAAI,CAAC,GAAG,QAAQ,CAAC,CAAC;YACtB,SAAS;SACT;QAED,IAAI,eAAe,GAAG,YAAY,CAAC,OAAO,CACzC,cAAc,CAAC,EAAE,CAAC,IAAI,CAAC,YAAY,CAAC,EACpC,CAAC,CACD,CAAC,CAAC;QACH,IAAI,kBAAkB,GAAG,YAAY,CAAC,OAAO,CAC5C,cAAc,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC,EAC3B,CAAC,CACD,CAAC,CAAC;QAEH,IAAI,MAAM,GAAG,KAAK,CAAC,eAAe,EAAE,kBAAkB,CAAC,CAAC;QACxD,IAAI,KAAK,GAAG,IAAI,CAAC,GAAG,CAAC,IAAI,CAAC,IAAI,CAAE,MAAM,CAAE,GAAG,CAAC,GAAG,GAAC,IAAI,CAAC,EAAE,CAAC,CAAC,CAAC;QAE1D,IAAI,KAAK,GAAG,SAAS,EAAE;YACtB,QAAQ,CAAC,IAAI,CAAC,aAAa,CAAC,CAAC;YAC7B,aAAa,GAAG,EAAE,CAAC;SACnB;QAED,GAAG,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC,CAAC;KACtB;IAED,IAAI,aAAa,CAAC,MAAM,EAAE;QAAE,QAAQ,CAAC,IAAI,CAAC,aAAa,CAAC,CAAC;KAAE;IAE3D,OAAO,QAAQ,CAAC;AACjB,CAAC;AAGD,OAAO,EAAE,WAAW,EAAE,CAAA"}
@@ -1,4 +1,4 @@
1
- import { CpNode } from '../cp-node';
1
+ import { CpNode } from '../cp-node.js';
2
2
  /**
3
3
  * Returns the bezier curve from the maximal disk of one [[CpNode]] to another
4
4
  * [[CpNode]]'s maximal disk.
@@ -1,8 +1,5 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.getCurveBetween = void 0;
4
- const flo_vector2d_1 = require("flo-vector2d");
5
- const get_edge_direction_1 = require("./get-edge-direction");
1
+ import { fromTo, dot, cross, rotate90Degrees, interpolate, translate, lineLineIntersection } from 'flo-vector2d';
2
+ import { getEdgeDirection } from './get-edge-direction.js';
6
3
  /** @hidden */
7
4
  const TOLERANCE_ADD_2PRONG = 0.01;
8
5
  /** @hidden */
@@ -15,46 +12,46 @@ const TOLERANCE_USE_LINE = 0.0001; // else cubic
15
12
  */
16
13
  function getCurveBetween(cpNodeFrom, cpNodeTo) {
17
14
  let fromCc = cpNodeFrom.cp.circle.center;
18
- let fromL = get_edge_direction_1.getEdgeDirection(cpNodeFrom);
15
+ let fromL = getEdgeDirection(cpNodeFrom);
19
16
  let toCc = cpNodeTo.cp.circle.center;
20
- let toL = get_edge_direction_1.getEdgeDirection(cpNodeTo.prevOnCircle);
21
- let mid = flo_vector2d_1.lineLineIntersection(fromL, toL);
22
- let c = flo_vector2d_1.fromTo(fromCc, toCc);
17
+ let toL = getEdgeDirection(cpNodeTo.prevOnCircle);
18
+ let mid = lineLineIntersection(fromL, toL);
19
+ let c = fromTo(fromCc, toCc);
23
20
  let twisted;
24
21
  if (!mid) {
25
22
  twisted = true;
26
23
  }
27
24
  else {
28
- let a = flo_vector2d_1.fromTo(fromCc, mid);
29
- let b = flo_vector2d_1.fromTo(toCc, mid);
30
- twisted = flo_vector2d_1.dot(a, c) < 0 || flo_vector2d_1.dot(b, c) > 0;
25
+ let a = fromTo(fromCc, mid);
26
+ let b = fromTo(toCc, mid);
27
+ twisted = dot(a, c) < 0 || dot(b, c) > 0;
31
28
  }
32
29
  if (!twisted) {
33
30
  return [fromCc, mid, toCc];
34
31
  }
35
- let r = flo_vector2d_1.rotate90Degrees(c);
36
- let w1 = flo_vector2d_1.fromTo(fromL[0], fromL[1]); // This is a unit vector
37
- let w2 = flo_vector2d_1.fromTo(toL[0], toL[1]); // This is a unit vector
38
- let d1 = Math.abs(flo_vector2d_1.cross(c, w1)) / (3 * 3);
39
- let d2 = Math.abs(flo_vector2d_1.cross(c, w2)) / (3 * 3);
32
+ let r = rotate90Degrees(c);
33
+ let w1 = fromTo(fromL[0], fromL[1]); // This is a unit vector
34
+ let w2 = fromTo(toL[0], toL[1]); // This is a unit vector
35
+ let d1 = Math.abs(cross(c, w1)) / (3 * 3);
36
+ let d2 = Math.abs(cross(c, w2)) / (3 * 3);
40
37
  if (d1 > TOLERANCE_ADD_2PRONG || d2 > TOLERANCE_ADD_2PRONG) {
41
38
  // TODO - not within tolerance - must add additional 2-prong
42
39
  return [fromCc, toCc];
43
40
  }
44
41
  if (d1 > TOLERANCE_USE_LINE || d2 > TOLERANCE_USE_LINE) {
45
42
  // approximate with cubic bezier
46
- let m1 = flo_vector2d_1.interpolate(fromCc, toCc, 1 / 3);
47
- let m2 = flo_vector2d_1.interpolate(fromCc, toCc, 2 / 3);
48
- let v1 = flo_vector2d_1.translate(r, m1);
49
- let v2 = flo_vector2d_1.translate(r, m2);
43
+ let m1 = interpolate(fromCc, toCc, 1 / 3);
44
+ let m2 = interpolate(fromCc, toCc, 2 / 3);
45
+ let v1 = translate(r, m1);
46
+ let v2 = translate(r, m2);
50
47
  let l1 = [m1, v1];
51
48
  let l2 = [m2, v2];
52
- let mid1 = flo_vector2d_1.lineLineIntersection(fromL, l1);
53
- let mid2 = flo_vector2d_1.lineLineIntersection(toL, l2);
49
+ let mid1 = lineLineIntersection(fromL, l1);
50
+ let mid2 = lineLineIntersection(toL, l2);
54
51
  return [fromCc, mid1, mid2, toCc];
55
52
  }
56
53
  // Within tolerance - approximate with a straight line.
57
54
  return [fromCc, toCc];
58
55
  }
59
- exports.getCurveBetween = getCurveBetween;
56
+ export { getCurveBetween };
60
57
  //# sourceMappingURL=get-curve-between.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"get-curve-between.js","sourceRoot":"","sources":["../../src/get-curve/get-curve-between.ts"],"names":[],"mappings":";;;AACA,+CAGsB;AAEtB,6DAAwD;AAGxD,cAAc;AACd,MAAM,oBAAoB,GAAG,IAAI,CAAC;AAClC,cAAc;AACd,MAAM,kBAAkB,GAAG,MAAM,CAAC,CAAC,aAAa;AAGhD;;;;;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EAAC,EAAE,CAAC,CAAC;QACjB,IAAI,IAAI,GAAG,oBAAoB,CAAC,KAAK,EAAE,EAAE,CAAC,CAAC;QAC3C,IAAI,IAAI,GAAG,oBAAoB,CAAC,GAAG,EAAI,EAAE,CAAC,CAAC;QAE3C,OAAO,CAAC,MAAM,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,CAAC,CAAC;KACrC;IAED,uDAAuD;IACvD,OAAO,CAAC,MAAM,EAAE,IAAI,CAAC,CAAC;AAC1B,CAAC;AAGD,OAAO,EAAE,eAAe,EAAE,CAAA"}
@@ -1,4 +1,4 @@
1
- import { CpNode } from '../cp-node';
1
+ import { CpNode } from '../cp-node.js';
2
2
  /**
3
3
  * @hidden
4
4
  * Returns a line segment of unit length starting in the given Vertex center and
@@ -1,9 +1,6 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.getEdgeDirection = void 0;
4
- const flo_vector2d_1 = require("flo-vector2d");
5
- const flo_bezier3_1 = require("flo-bezier3");
6
- const point_on_shape_1 = require("../point-on-shape");
1
+ import { toUnitVector, fromTo, rotate, translate, rotate90Degrees, reverse, dot } from 'flo-vector2d';
2
+ import { tangent } from 'flo-bezier3';
3
+ import { isPosSharpCorner } from '../point-on-shape.js';
7
4
  /**
8
5
  * @hidden
9
6
  * Returns a line segment of unit length starting in the given Vertex center and
@@ -20,12 +17,12 @@ function getEdgeDirection(cpNode) {
20
17
  let p2 = pos2.p;
21
18
  let vDir;
22
19
  //if (!PointOnShape.isSharpCorner(pos1)) {
23
- if (!point_on_shape_1.isPosSharpCorner(pos1)) {
20
+ if (!isPosSharpCorner(pos1)) {
24
21
  if (p1[0] === p2[0] && p1[1] === p2[1]) {
25
- vDir = flo_vector2d_1.fromTo(p1, circleCenter); // A 1-prong
22
+ vDir = fromTo(p1, circleCenter); // A 1-prong
26
23
  }
27
24
  else {
28
- vDir = flo_vector2d_1.rotate90Degrees(flo_vector2d_1.fromTo(p1, p2)); // not a 1-prong.
25
+ vDir = rotate90Degrees(fromTo(p1, p2)); // not a 1-prong.
29
26
  }
30
27
  }
31
28
  else {
@@ -40,18 +37,18 @@ function getEdgeDirection(cpNode) {
40
37
  curve1 = pos1.curve.next;
41
38
  curve2 = pos1.curve;
42
39
  }
43
- let tan1 = flo_vector2d_1.toUnitVector(flo_bezier3_1.tangent(curve1.ps, 0));
44
- let tan2 = flo_vector2d_1.reverse(flo_vector2d_1.toUnitVector(flo_bezier3_1.tangent(curve2.ps, 1)));
45
- let x = flo_vector2d_1.dot(tan1, tan2);
40
+ let tan1 = toUnitVector(tangent(curve1.ps, 0));
41
+ let tan2 = reverse(toUnitVector(tangent(curve2.ps, 1)));
42
+ let x = dot(tan1, tan2);
46
43
  // Recall the identities sin(acos(x)) = sqrt(1-x^2), etc. Also
47
44
  // recall the half angle formulas. Then the rotation matrix, R, can
48
45
  // be calculated.
49
46
  let cosθ = Math.sqrt((1 + x) / 2);
50
47
  let sinθ = Math.sqrt((1 - x) / 2);
51
- vDir = flo_vector2d_1.rotate(sinθ, cosθ, tan2);
48
+ vDir = rotate(sinθ, cosθ, tan2);
52
49
  }
53
- let v = flo_vector2d_1.translate(flo_vector2d_1.toUnitVector(vDir), circleCenter);
50
+ let v = translate(toUnitVector(vDir), circleCenter);
54
51
  return [circleCenter, v];
55
52
  }
56
- exports.getEdgeDirection = getEdgeDirection;
53
+ export { getEdgeDirection };
57
54
  //# sourceMappingURL=get-edge-direction.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"get-edge-direction.js","sourceRoot":"","sources":["../../src/get-curve/get-edge-direction.ts"],"names":[],"mappings":";;;AACA,+CAEsB;AAEtB,6CAAsC;AAGtC,sDAAqD;AAGrD;;;;;GAKG;AACH,SAAS,gBAAgB,CAAC,MAAc;IAEpC,IAAI,YAAY,GAAG,MAAM,CAAC,EAAE,CAAC,MAAM,CAAC,MAAM,CAAC;IAE3C,IAAI,GAAG,GAAG,MAAM,CAAC;IACjB,IAAI,GAAG,GAAG,MAAM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AC,CAAC,CAAC,GAAC,CAAC,CAAC,CAAC;QAC9B,IAAI,IAAI,GAAG,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC,GAAC,CAAC,CAAC,GAAC,CAAC,CAAC,CAAC;QAE9B,IAAI,GAAG,MAAM,CAAC,IAAI,EAAE,IAAI,EAAE,IAAI,CAAC,CAAC;KACnC;IAED,IAAI,CAAC,GAAG,SAAS,CACb,YAAY,CAAC,IAAI,CAAC,EAClB,YAAY,CACf,CAAC;IAEF,OAAO,CAAC,YAAY,EAAE,CAAC,CAAC,CAAC;AAC7B,CAAC;AAGD,OAAO,EAAE,gBAAgB,EAAE,CAAA"}
@@ -1,4 +1,4 @@
1
- import { CpNode } from "./cp-node";
1
+ import { CpNode } from './cp-node.js';
2
2
  /**
3
3
  * Returns the bezier curve from the maximal disk of the given [[CpNode]] to the
4
4
  * next [[CpNode]]'s maximal disk and thus directly represents a piece of the