flo-mat 1.1.2 → 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 (470) hide show
  1. package/.mocharc.cjs +17 -0
  2. package/README.md +13 -2
  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.d.ts +1 -4
  10. package/node/circle.js +3 -6
  11. package/node/circle.js.map +1 -1
  12. package/node/compare-curvatures-at-interface.d.ts +19 -0
  13. package/node/compare-curvatures-at-interface.js +125 -0
  14. package/node/compare-curvatures-at-interface.js.map +1 -0
  15. package/node/contact-point.d.ts +2 -2
  16. package/node/contact-point.js +3 -5
  17. package/node/contact-point.js.map +1 -1
  18. package/node/cp-node/clone.d.ts +1 -1
  19. package/node/cp-node/clone.js +4 -6
  20. package/node/cp-node/clone.js.map +1 -1
  21. package/node/cp-node/remove.d.ts +2 -2
  22. package/node/cp-node/remove.js +1 -3
  23. package/node/cp-node/remove.js.map +1 -1
  24. package/node/cp-node.d.ts +4 -5
  25. package/node/cp-node.js +8 -11
  26. package/node/cp-node.js.map +1 -1
  27. package/node/curve.d.ts +2 -2
  28. package/node/curve.js +10 -13
  29. package/node/curve.js.map +1 -1
  30. package/node/debug/cp-node-for-debugging.d.ts +2 -2
  31. package/node/debug/cp-node-for-debugging.js +1 -2
  32. package/node/debug/debug-elem-types.d.ts +8 -8
  33. package/node/debug/debug-elem-types.js +1 -2
  34. package/node/debug/debug.d.ts +5 -7
  35. package/node/debug/debug.js +67 -9
  36. package/node/debug/debug.js.map +1 -1
  37. package/node/debug/functions/draw-elem/bounding-hull.js +3 -5
  38. package/node/debug/functions/draw-elem/bounding-hull.js.map +1 -1
  39. package/node/debug/functions/draw-elem/branch.d.ts +1 -1
  40. package/node/debug/functions/draw-elem/branch.js +5 -7
  41. package/node/debug/functions/draw-elem/branch.js.map +1 -1
  42. package/node/debug/functions/draw-elem/culls.d.ts +1 -1
  43. package/node/debug/functions/draw-elem/culls.js +1 -3
  44. package/node/debug/functions/draw-elem/culls.js.map +1 -1
  45. package/node/debug/functions/draw-elem/draw-circle-percent.js +1 -3
  46. package/node/debug/functions/draw-elem/draw-circle-percent.js.map +1 -1
  47. package/node/debug/functions/draw-elem/draw-elem.d.ts +1 -1
  48. package/node/debug/functions/draw-elem/draw-elem.js +34 -36
  49. package/node/debug/functions/draw-elem/draw-elem.js.map +1 -1
  50. package/node/debug/functions/draw-elem/dull-corner.d.ts +1 -1
  51. package/node/debug/functions/draw-elem/dull-corner.js +5 -6
  52. package/node/debug/functions/draw-elem/dull-corner.js.map +1 -1
  53. package/node/debug/functions/draw-elem/leaves.d.ts +1 -1
  54. package/node/debug/functions/draw-elem/leaves.js +3 -5
  55. package/node/debug/functions/draw-elem/leaves.js.map +1 -1
  56. package/node/debug/functions/draw-elem/loop.d.ts +1 -1
  57. package/node/debug/functions/draw-elem/loop.js +1 -3
  58. package/node/debug/functions/draw-elem/loop.js.map +1 -1
  59. package/node/debug/functions/draw-elem/loops.d.ts +1 -1
  60. package/node/debug/functions/draw-elem/loops.js +1 -3
  61. package/node/debug/functions/draw-elem/loops.js.map +1 -1
  62. package/node/debug/functions/draw-elem/loose-bounding-box.js +3 -5
  63. package/node/debug/functions/draw-elem/loose-bounding-box.js.map +1 -1
  64. package/node/debug/functions/draw-elem/mat.d.ts +1 -1
  65. package/node/debug/functions/draw-elem/mat.js +7 -9
  66. package/node/debug/functions/draw-elem/mat.js.map +1 -1
  67. package/node/debug/functions/draw-elem/max-vertex.d.ts +1 -1
  68. package/node/debug/functions/draw-elem/max-vertex.js +3 -5
  69. package/node/debug/functions/draw-elem/max-vertex.js.map +1 -1
  70. package/node/debug/functions/draw-elem/min-y.d.ts +1 -1
  71. package/node/debug/functions/draw-elem/min-y.js +9 -11
  72. package/node/debug/functions/draw-elem/min-y.js.map +1 -1
  73. package/node/debug/functions/draw-elem/one-prong-at-dull-corner.d.ts +1 -1
  74. package/node/debug/functions/draw-elem/one-prong-at-dull-corner.js +7 -9
  75. package/node/debug/functions/draw-elem/one-prong-at-dull-corner.js.map +1 -1
  76. package/node/debug/functions/draw-elem/one-prong.d.ts +1 -1
  77. package/node/debug/functions/draw-elem/one-prong.js +9 -11
  78. package/node/debug/functions/draw-elem/one-prong.js.map +1 -1
  79. package/node/debug/functions/draw-elem/sharp-corner.d.ts +1 -1
  80. package/node/debug/functions/draw-elem/sharp-corner.js +3 -5
  81. package/node/debug/functions/draw-elem/sharp-corner.js.map +1 -1
  82. package/node/debug/functions/draw-elem/three-prong.d.ts +1 -1
  83. package/node/debug/functions/draw-elem/three-prong.js +9 -11
  84. package/node/debug/functions/draw-elem/three-prong.js.map +1 -1
  85. package/node/debug/functions/draw-elem/tight-bounding-box.js +3 -5
  86. package/node/debug/functions/draw-elem/tight-bounding-box.js.map +1 -1
  87. package/node/debug/functions/draw-elem/two-prong.d.ts +1 -1
  88. package/node/debug/functions/draw-elem/two-prong.js +9 -11
  89. package/node/debug/functions/draw-elem/two-prong.js.map +1 -1
  90. package/node/debug/functions/draw-elem/vertex.d.ts +1 -1
  91. package/node/debug/functions/draw-elem/vertex.js +7 -9
  92. package/node/debug/functions/draw-elem/vertex.js.map +1 -1
  93. package/node/debug/functions/general.d.ts +1 -1
  94. package/node/debug/functions/general.js +3 -5
  95. package/node/debug/functions/general.js.map +1 -1
  96. package/node/debug/functions/three-prong.js +24 -26
  97. package/node/debug/functions/three-prong.js.map +1 -1
  98. package/node/debug/functions/two-prong.d.ts +1 -1
  99. package/node/debug/functions/two-prong.js +10 -12
  100. package/node/debug/functions/two-prong.js.map +1 -1
  101. package/node/debug/three-prong-for-debugging.d.ts +4 -4
  102. package/node/debug/three-prong-for-debugging.js +4 -6
  103. package/node/debug/three-prong-for-debugging.js.map +1 -1
  104. package/node/debug/two-prong-for-debugging.d.ts +5 -5
  105. package/node/debug/two-prong-for-debugging.js +1 -2
  106. package/node/find-mats.d.ts +12 -9
  107. package/node/find-mats.js +47 -52
  108. package/node/find-mats.js.map +1 -1
  109. package/node/get-boundary-bezier-parts-to-next.d.ts +3 -5
  110. package/node/get-boundary-bezier-parts-to-next.js +1 -3
  111. package/node/get-boundary-bezier-parts-to-next.js.map +1 -1
  112. package/node/get-boundary-beziers-to-next.d.ts +1 -1
  113. package/node/get-boundary-beziers-to-next.js +8 -7
  114. package/node/get-boundary-beziers-to-next.js.map +1 -1
  115. package/node/get-bounding-box-.d.ts +2 -0
  116. package/node/get-bounding-box-.js +5 -0
  117. package/node/get-bounding-box-.js.map +1 -0
  118. package/node/get-branches.d.ts +1 -1
  119. package/node/get-branches.js +7 -9
  120. package/node/get-branches.js.map +1 -1
  121. package/node/get-curve/get-curve-between.d.ts +1 -1
  122. package/node/get-curve/get-curve-between.js +21 -23
  123. package/node/get-curve/get-curve-between.js.map +1 -1
  124. package/node/get-curve/get-edge-direction.d.ts +1 -1
  125. package/node/get-curve/get-edge-direction.js +12 -14
  126. package/node/get-curve/get-edge-direction.js.map +1 -1
  127. package/node/get-curve-to-next.d.ts +1 -1
  128. package/node/get-curve-to-next.js +3 -5
  129. package/node/get-curve-to-next.js.map +1 -1
  130. package/node/get-interface-ccw.d.ts +24 -0
  131. package/node/get-interface-ccw.js +98 -0
  132. package/node/get-interface-ccw.js.map +1 -0
  133. package/node/index.d.ts +35 -36
  134. package/node/index.js +32 -55
  135. package/node/index.js.map +1 -1
  136. package/node/loop/get-max-coordinate.js +1 -3
  137. package/node/loop/get-max-coordinate.js.map +1 -1
  138. package/node/loop.d.ts +1 -1
  139. package/node/loop.js +1 -3
  140. package/node/loop.js.map +1 -1
  141. package/node/mat/add-to-cp-graph.d.ts +5 -5
  142. package/node/mat/add-to-cp-graph.js +5 -7
  143. package/node/mat/add-to-cp-graph.js.map +1 -1
  144. package/node/mat/bezier-piece.d.ts +1 -1
  145. package/node/mat/bezier-piece.js +1 -2
  146. package/node/mat/closest-boundary-point/closest-points-on-curve.d.ts +1 -1
  147. package/node/mat/closest-boundary-point/closest-points-on-curve.js +15 -13
  148. package/node/mat/closest-boundary-point/closest-points-on-curve.js.map +1 -1
  149. package/node/mat/closest-boundary-point/cull-bezier-pieces.d.ts +1 -1
  150. package/node/mat/closest-boundary-point/cull-bezier-pieces.js +7 -9
  151. package/node/mat/closest-boundary-point/cull-bezier-pieces.js.map +1 -1
  152. package/node/mat/closest-boundary-point/cull-by-loose-bounding-box.d.ts +1 -1
  153. package/node/mat/closest-boundary-point/cull-by-loose-bounding-box.js +5 -7
  154. package/node/mat/closest-boundary-point/cull-by-loose-bounding-box.js.map +1 -1
  155. package/node/mat/closest-boundary-point/cull-by-tight-boundary-box.d.ts +1 -1
  156. package/node/mat/closest-boundary-point/cull-by-tight-boundary-box.js +7 -7
  157. package/node/mat/closest-boundary-point/cull-by-tight-boundary-box.js.map +1 -1
  158. package/node/mat/closest-boundary-point/get-best-distance-squared.d.ts +1 -1
  159. package/node/mat/closest-boundary-point/get-best-distance-squared.js +6 -8
  160. package/node/mat/closest-boundary-point/get-best-distance-squared.js.map +1 -1
  161. package/node/mat/closest-boundary-point/get-close-boundary-points.d.ts +2 -2
  162. package/node/mat/closest-boundary-point/get-close-boundary-points.js +9 -11
  163. package/node/mat/closest-boundary-point/get-close-boundary-points.js.map +1 -1
  164. package/node/mat/closest-boundary-point/get-closest-boundary-point.d.ts +3 -3
  165. package/node/mat/closest-boundary-point/get-closest-boundary-point.js +10 -12
  166. package/node/mat/closest-boundary-point/get-closest-boundary-point.js.map +1 -1
  167. package/node/mat/corner.js +1 -2
  168. package/node/mat/create-new-cp-tree.d.ts +3 -3
  169. package/node/mat/create-new-cp-tree.js +5 -6
  170. package/node/mat/create-new-cp-tree.js.map +1 -1
  171. package/node/mat/elem-type-two-prong.js +1 -2
  172. package/node/mat/find-mat/add-1-prong.d.ts +4 -4
  173. package/node/mat/find-mat/add-1-prong.js +9 -11
  174. package/node/mat/find-mat/add-1-prong.js.map +1 -1
  175. package/node/mat/find-mat/add-2-prong.d.ts +5 -5
  176. package/node/mat/find-mat/add-2-prong.js +19 -21
  177. package/node/mat/find-mat/add-2-prong.js.map +1 -1
  178. package/node/mat/find-mat/add-3-prong.d.ts +5 -5
  179. package/node/mat/find-mat/add-3-prong.js +7 -9
  180. package/node/mat/find-mat/add-3-prong.js.map +1 -1
  181. package/node/mat/find-mat/add-debug-info.d.ts +2 -2
  182. package/node/mat/find-mat/add-debug-info.js +8 -12
  183. package/node/mat/find-mat/add-debug-info.js.map +1 -1
  184. package/node/mat/find-mat/create-get-interesting-points-on-loop.d.ts +3 -3
  185. package/node/mat/find-mat/create-get-interesting-points-on-loop.js +29 -15
  186. package/node/mat/find-mat/create-get-interesting-points-on-loop.js.map +1 -1
  187. package/node/mat/find-mat/create-initial-cp-graph.d.ts +4 -4
  188. package/node/mat/find-mat/create-initial-cp-graph.js +7 -8
  189. package/node/mat/find-mat/create-initial-cp-graph.js.map +1 -1
  190. package/node/mat/find-mat/find-2-prong/add-debug-info.d.ts +5 -5
  191. package/node/mat/find-mat/find-2-prong/add-debug-info.js +3 -5
  192. package/node/mat/find-mat/find-2-prong/add-debug-info.js.map +1 -1
  193. package/node/mat/find-mat/find-2-prong/cull-bezier-pieces.d.ts +1 -1
  194. package/node/mat/find-mat/find-2-prong/cull-bezier-pieces.js +5 -7
  195. package/node/mat/find-mat/find-2-prong/cull-bezier-pieces.js.map +1 -1
  196. package/node/mat/find-mat/find-2-prong/find-2-prong.d.ts +5 -5
  197. package/node/mat/find-mat/find-2-prong/find-2-prong.js +37 -38
  198. package/node/mat/find-mat/find-2-prong/find-2-prong.js.map +1 -1
  199. package/node/mat/find-mat/find-2-prong/find-equidistant-point-on-line.js +1 -3
  200. package/node/mat/find-mat/find-2-prong/find-equidistant-point-on-line.js.map +1 -1
  201. package/node/mat/find-mat/find-2-prong/get-initial-bezier-pieces.d.ts +5 -5
  202. package/node/mat/find-mat/find-2-prong/get-initial-bezier-pieces.js +7 -9
  203. package/node/mat/find-mat/find-2-prong/get-initial-bezier-pieces.js.map +1 -1
  204. package/node/mat/find-mat/find-2-prong/x-for-debugging.d.ts +1 -1
  205. package/node/mat/find-mat/find-2-prong/x-for-debugging.js +1 -2
  206. package/node/mat/find-mat/find-3-prong/calc-better-x.d.ts +2 -2
  207. package/node/mat/find-mat/find-3-prong/calc-better-x.js +10 -12
  208. package/node/mat/find-mat/find-3-prong/calc-better-x.js.map +1 -1
  209. package/node/mat/find-mat/find-3-prong/calc-initial-3-prong-center.d.ts +2 -2
  210. package/node/mat/find-mat/find-3-prong/calc-initial-3-prong-center.js +6 -7
  211. package/node/mat/find-mat/find-3-prong/calc-initial-3-prong-center.js.map +1 -1
  212. package/node/mat/find-mat/find-3-prong/find-3-prong-for-delta3s.d.ts +3 -3
  213. package/node/mat/find-mat/find-3-prong/find-3-prong-for-delta3s.js +29 -31
  214. package/node/mat/find-mat/find-3-prong/find-3-prong-for-delta3s.js.map +1 -1
  215. package/node/mat/find-mat/find-3-prong/find-3-prong.d.ts +3 -3
  216. package/node/mat/find-mat/find-3-prong/find-3-prong.js +14 -11
  217. package/node/mat/find-mat/find-3-prong/find-3-prong.js.map +1 -1
  218. package/node/mat/find-mat/find-3-prong/get-closest-points.d.ts +2 -2
  219. package/node/mat/find-mat/find-3-prong/get-closest-points.js +3 -5
  220. package/node/mat/find-mat/find-3-prong/get-closest-points.js.map +1 -1
  221. package/node/mat/find-mat/find-and-add-2-prongs-on-all-paths.d.ts +4 -4
  222. package/node/mat/find-mat/find-and-add-2-prongs-on-all-paths.js +3 -5
  223. package/node/mat/find-mat/find-and-add-2-prongs-on-all-paths.js.map +1 -1
  224. package/node/mat/find-mat/find-and-add-2-prongs.d.ts +4 -4
  225. package/node/mat/find-mat/find-and-add-2-prongs.js +9 -11
  226. package/node/mat/find-mat/find-and-add-2-prongs.js.map +1 -1
  227. package/node/mat/find-mat/find-and-add-3-prongs.d.ts +3 -3
  228. package/node/mat/find-mat/find-and-add-3-prongs.js +8 -10
  229. package/node/mat/find-mat/find-and-add-3-prongs.js.map +1 -1
  230. package/node/mat/find-mat/find-and-add-hole-closing-2-prongs.d.ts +3 -3
  231. package/node/mat/find-mat/find-and-add-hole-closing-2-prongs.js +11 -13
  232. package/node/mat/find-mat/find-and-add-hole-closing-2-prongs.js.map +1 -1
  233. package/node/mat/find-mat/get-potential-2-prongs.d.ts +1 -1
  234. package/node/mat/find-mat/get-potential-2-prongs.js +3 -5
  235. package/node/mat/find-mat/get-potential-2-prongs.js.map +1 -1
  236. package/node/mat/find-mat/get-sharp-corners.d.ts +1 -1
  237. package/node/mat/find-mat/get-sharp-corners.js +3 -5
  238. package/node/mat/find-mat/get-sharp-corners.js.map +1 -1
  239. package/node/mat/geometry/get-closest-square-distance-to-rect.js +21 -14
  240. package/node/mat/geometry/get-closest-square-distance-to-rect.js.map +1 -1
  241. package/node/mat/geometry/get-closest-squared-distance-to-rotated-rect.js +5 -7
  242. package/node/mat/geometry/get-closest-squared-distance-to-rotated-rect.js.map +1 -1
  243. package/node/mat/get-boundary-piece-beziers.d.ts +2 -2
  244. package/node/mat/get-boundary-piece-beziers.js +6 -8
  245. package/node/mat/get-boundary-piece-beziers.js.map +1 -1
  246. package/node/mat/get-contact-circles-at-interface.d.ts +2 -2
  247. package/node/mat/get-contact-circles-at-interface.js +7 -9
  248. package/node/mat/get-contact-circles-at-interface.js.map +1 -1
  249. package/node/mat/get-largest-vertex.d.ts +1 -1
  250. package/node/mat/get-largest-vertex.js +1 -3
  251. package/node/mat/get-largest-vertex.js.map +1 -1
  252. package/node/mat/get-leaves.d.ts +1 -1
  253. package/node/mat/get-leaves.js +1 -3
  254. package/node/mat/get-leaves.js.map +1 -1
  255. package/node/mat/get-neighboring-cps.d.ts +3 -3
  256. package/node/mat/get-neighboring-cps.js +5 -7
  257. package/node/mat/get-neighboring-cps.js.map +1 -1
  258. package/node/mat/get-two-prong-type.d.ts +2 -2
  259. package/node/mat/get-two-prong-type.js +1 -3
  260. package/node/mat/get-two-prong-type.js.map +1 -1
  261. package/node/mat/is-another-cp-closeby.d.ts +5 -5
  262. package/node/mat/is-another-cp-closeby.js +8 -10
  263. package/node/mat/is-another-cp-closeby.js.map +1 -1
  264. package/node/mat/simplify-mat-map-only.d.ts +1 -1
  265. package/node/mat/simplify-mat-map-only.js +10 -13
  266. package/node/mat/simplify-mat-map-only.js.map +1 -1
  267. package/node/mat/to-scale-axis/add-debug-info.d.ts +1 -1
  268. package/node/mat/to-scale-axis/add-debug-info.js +1 -3
  269. package/node/mat/to-scale-axis/add-debug-info.js.map +1 -1
  270. package/node/mat/to-scale-axis/cull-non-cycles.d.ts +1 -1
  271. package/node/mat/to-scale-axis/cull-non-cycles.js +5 -7
  272. package/node/mat/to-scale-axis/cull-non-cycles.js.map +1 -1
  273. package/node/mat/to-scale-axis/cull.d.ts +2 -2
  274. package/node/mat/to-scale-axis/cull.js +75 -7
  275. package/node/mat/to-scale-axis/cull.js.map +1 -1
  276. package/node/mat/trim-mat.d.ts +1 -1
  277. package/node/mat/trim-mat.js +6 -8
  278. package/node/mat/trim-mat.js.map +1 -1
  279. package/node/mat.d.ts +3 -3
  280. package/node/mat.js +1 -2
  281. package/node/point-on-shape.d.ts +2 -2
  282. package/node/point-on-shape.js +23 -33
  283. package/node/point-on-shape.js.map +1 -1
  284. package/node/simplify-mat.d.ts +4 -3
  285. package/node/simplify-mat.js +16 -37
  286. package/node/simplify-mat.js.map +1 -1
  287. package/node/svg/get-loop-bounds.d.ts +2 -2
  288. package/node/svg/get-loop-bounds.js +11 -12
  289. package/node/svg/get-loop-bounds.js.map +1 -1
  290. package/node/svg/get-min-y-pos.d.ts +3 -2
  291. package/node/svg/get-min-y-pos.js +3 -5
  292. package/node/svg/get-min-y-pos.js.map +1 -1
  293. package/node/svg/get-shape-bounds.d.ts +5 -5
  294. package/node/svg/get-shape-bounds.js +5 -7
  295. package/node/svg/get-shape-bounds.js.map +1 -1
  296. package/node/sweep-line/sweep-line.js +1 -3
  297. package/node/sweep-line/sweep-line.js.map +1 -1
  298. package/node/to-scale-axis.d.ts +2 -1
  299. package/node/to-scale-axis.js +18 -20
  300. package/node/to-scale-axis.js.map +1 -1
  301. package/node/traverse-edges.d.ts +1 -1
  302. package/node/traverse-edges.js +1 -3
  303. package/node/traverse-edges.js.map +1 -1
  304. package/node/traverse-vertices.d.ts +1 -1
  305. package/node/traverse-vertices.js +1 -3
  306. package/node/traverse-vertices.js.map +1 -1
  307. package/package.json +34 -30
  308. package/src/circle.ts +1 -2
  309. package/src/compare-curvatures-at-interface.ts +197 -0
  310. package/src/contact-point.ts +2 -3
  311. package/src/cp-node/clone.ts +1 -2
  312. package/src/cp-node/remove.ts +2 -3
  313. package/src/cp-node.ts +6 -8
  314. package/src/curve.ts +3 -4
  315. package/src/debug/cp-node-for-debugging.ts +2 -3
  316. package/src/debug/debug-elem-types.ts +8 -10
  317. package/src/debug/debug.ts +22 -17
  318. package/src/debug/functions/draw-elem/bounding-hull.ts +0 -1
  319. package/src/debug/functions/draw-elem/branch.ts +2 -3
  320. package/src/debug/functions/draw-elem/culls.ts +1 -2
  321. package/src/debug/functions/draw-elem/draw-elem.ts +18 -19
  322. package/src/debug/functions/draw-elem/dull-corner.ts +3 -3
  323. package/src/debug/functions/draw-elem/leaves.ts +2 -4
  324. package/src/debug/functions/draw-elem/loop.ts +1 -2
  325. package/src/debug/functions/draw-elem/loops.ts +1 -2
  326. package/src/debug/functions/draw-elem/loose-bounding-box.ts +0 -1
  327. package/src/debug/functions/draw-elem/mat.ts +3 -5
  328. package/src/debug/functions/draw-elem/max-vertex.ts +1 -2
  329. package/src/debug/functions/draw-elem/min-y.ts +5 -7
  330. package/src/debug/functions/draw-elem/one-prong-at-dull-corner.ts +1 -2
  331. package/src/debug/functions/draw-elem/one-prong.ts +2 -3
  332. package/src/debug/functions/draw-elem/sharp-corner.ts +1 -2
  333. package/src/debug/functions/draw-elem/three-prong.ts +2 -4
  334. package/src/debug/functions/draw-elem/tight-bounding-box.ts +0 -1
  335. package/src/debug/functions/draw-elem/two-prong.ts +2 -3
  336. package/src/debug/functions/draw-elem/vertex.ts +1 -2
  337. package/src/debug/functions/general.ts +2 -3
  338. package/src/debug/functions/three-prong.ts +3 -5
  339. package/src/debug/functions/two-prong.ts +6 -14
  340. package/src/debug/three-prong-for-debugging.ts +4 -5
  341. package/src/debug/two-prong-for-debugging.ts +5 -6
  342. package/src/find-mats.ts +34 -39
  343. package/src/get-boundary-bezier-parts-to-next.ts +5 -6
  344. package/src/get-boundary-beziers-to-next.ts +8 -7
  345. package/src/get-bounding-box-.ts +7 -0
  346. package/src/get-branches.ts +2 -3
  347. package/src/get-curve/get-curve-between.ts +2 -3
  348. package/src/get-curve/get-edge-direction.ts +2 -5
  349. package/src/get-curve-to-next.ts +2 -3
  350. package/src/get-interface-ccw.ts +112 -0
  351. package/src/index.ts +34 -48
  352. package/src/loop/get-max-coordinate.ts +0 -1
  353. package/src/loop.ts +1 -2
  354. package/src/mat/add-to-cp-graph.ts +7 -8
  355. package/src/mat/bezier-piece.ts +1 -2
  356. package/src/mat/closest-boundary-point/closest-points-on-curve.ts +19 -17
  357. package/src/mat/closest-boundary-point/cull-bezier-pieces.ts +4 -5
  358. package/src/mat/closest-boundary-point/cull-by-loose-bounding-box.ts +4 -5
  359. package/src/mat/closest-boundary-point/cull-by-tight-boundary-box.ts +7 -5
  360. package/src/mat/closest-boundary-point/get-best-distance-squared.ts +1 -2
  361. package/src/mat/closest-boundary-point/get-close-boundary-points.ts +4 -11
  362. package/src/mat/closest-boundary-point/get-closest-boundary-point.ts +5 -6
  363. package/src/mat/cmp-cp-on-delta.ts +2 -3
  364. package/src/mat/create-new-cp-tree.ts +5 -5
  365. package/src/mat/find-mat/add-1-prong.ts +7 -8
  366. package/src/mat/find-mat/add-2-prong.ts +11 -12
  367. package/src/mat/find-mat/add-3-prong.ts +7 -8
  368. package/src/mat/find-mat/add-debug-info.ts +8 -7
  369. package/src/mat/find-mat/create-get-interesting-points-on-loop.ts +22 -8
  370. package/src/mat/find-mat/create-initial-cp-graph.ts +7 -8
  371. package/src/mat/find-mat/find-2-prong/add-debug-info.ts +9 -10
  372. package/src/mat/find-mat/find-2-prong/cull-bezier-pieces.ts +4 -7
  373. package/src/mat/find-mat/find-2-prong/find-2-prong.ts +19 -17
  374. package/src/mat/find-mat/find-2-prong/get-initial-bezier-pieces.ts +7 -8
  375. package/src/mat/find-mat/find-2-prong/x-for-debugging.ts +1 -2
  376. package/src/mat/find-mat/find-3-prong/calc-better-x.ts +3 -6
  377. package/src/mat/find-mat/find-3-prong/calc-initial-3-prong-center.ts +3 -8
  378. package/src/mat/find-mat/find-3-prong/find-3-prong-for-delta3s.ts +10 -14
  379. package/src/mat/find-mat/find-3-prong/find-3-prong.ts +13 -8
  380. package/src/mat/find-mat/find-3-prong/get-closest-points.ts +2 -5
  381. package/src/mat/find-mat/find-and-add-2-prongs-on-all-paths.ts +5 -6
  382. package/src/mat/find-mat/find-and-add-2-prongs.ts +9 -10
  383. package/src/mat/find-mat/find-and-add-3-prongs.ts +8 -9
  384. package/src/mat/find-mat/find-and-add-hole-closing-2-prongs.ts +7 -8
  385. package/src/mat/find-mat/get-potential-2-prongs.ts +1 -2
  386. package/src/mat/find-mat/get-sharp-corners.ts +1 -2
  387. package/src/mat/find-mat/get-total-abs-curvature.ts +2 -3
  388. package/src/mat/find-mat/get-total-by.ts +2 -3
  389. package/src/mat/geometry/get-closest-square-distance-to-rect.ts +15 -4
  390. package/src/mat/geometry/get-closest-squared-distance-to-rotated-rect.ts +0 -1
  391. package/src/mat/get-boundary-piece-beziers.ts +5 -6
  392. package/src/mat/get-contact-circles-at-interface.ts +3 -4
  393. package/src/mat/get-edges-as-array.ts +2 -3
  394. package/src/mat/get-largest-three-prong.ts +1 -2
  395. package/src/mat/get-largest-vertex.ts +1 -2
  396. package/src/mat/get-leaves.ts +1 -2
  397. package/src/mat/get-neighboring-cps.ts +5 -6
  398. package/src/mat/get-two-prong-type.ts +2 -3
  399. package/src/mat/is-another-cp-closeby.ts +6 -7
  400. package/src/mat/simplify-mat-map-only.ts +5 -7
  401. package/src/mat/to-scale-axis/add-debug-info.ts +2 -3
  402. package/src/mat/to-scale-axis/add-to-tree.ts +3 -4
  403. package/src/mat/to-scale-axis/calc-groups.ts +1 -2
  404. package/src/mat/to-scale-axis/create-spacial-tree.ts +3 -4
  405. package/src/mat/to-scale-axis/cull-non-cycles.ts +2 -3
  406. package/src/mat/to-scale-axis/cull.ts +3 -4
  407. package/src/mat/to-scale-axis/get-engulfed-vertices.ts +3 -4
  408. package/src/mat/to-scale-axis/t-tree.ts +1 -2
  409. package/src/mat/to-scale-axis/traverse-spacial-tree.ts +2 -4
  410. package/src/mat/trim-mat.ts +4 -5
  411. package/src/mat.ts +3 -5
  412. package/src/point-on-shape.ts +10 -12
  413. package/src/simplify-mat.ts +15 -41
  414. package/src/svg/get-curvature-at-interface.ts +1 -3
  415. package/src/svg/get-extreme.ts +2 -3
  416. package/src/svg/get-loop-bounds.ts +4 -4
  417. package/src/svg/get-min-y-pos.ts +2 -6
  418. package/src/svg/get-shape-bounds.ts +2 -3
  419. package/src/sweep-line/are-boxes-intersecting.ts +1 -1
  420. package/src/to-scale-axis.ts +15 -16
  421. package/src/traverse-edges.ts +1 -2
  422. package/src/traverse-vertices.ts +1 -2
  423. package/test/lib-load.spec.ts +0 -1
  424. package/tsconfig.json +6 -31
  425. package/webpack.config.cjs +132 -0
  426. package/.nycrc +0 -4
  427. package/node/mat/cmp-cp-on-delta.d.ts +0 -14
  428. package/node/mat/cmp-cp-on-delta.js +0 -44
  429. package/node/mat/cmp-cp-on-delta.js.map +0 -1
  430. package/node/mat/find-mat/get-total-abs-curvature.d.ts +0 -5
  431. package/node/mat/find-mat/get-total-abs-curvature.js +0 -12
  432. package/node/mat/find-mat/get-total-abs-curvature.js.map +0 -1
  433. package/node/mat/find-mat/get-total-by.d.ts +0 -10
  434. package/node/mat/find-mat/get-total-by.js +0 -21
  435. package/node/mat/find-mat/get-total-by.js.map +0 -1
  436. package/node/mat/get-edges-as-array.d.ts +0 -4
  437. package/node/mat/get-edges-as-array.js +0 -11
  438. package/node/mat/get-edges-as-array.js.map +0 -1
  439. package/node/mat/get-largest-three-prong.d.ts +0 -4
  440. package/node/mat/get-largest-three-prong.js +0 -12
  441. package/node/mat/get-largest-three-prong.js.map +0 -1
  442. package/node/mat/to-scale-axis/add-to-tree.d.ts +0 -13
  443. package/node/mat/to-scale-axis/add-to-tree.js +0 -38
  444. package/node/mat/to-scale-axis/add-to-tree.js.map +0 -1
  445. package/node/mat/to-scale-axis/calc-groups.d.ts +0 -28
  446. package/node/mat/to-scale-axis/calc-groups.js +0 -65
  447. package/node/mat/to-scale-axis/calc-groups.js.map +0 -1
  448. package/node/mat/to-scale-axis/create-spacial-tree.d.ts +0 -9
  449. package/node/mat/to-scale-axis/create-spacial-tree.js +0 -23
  450. package/node/mat/to-scale-axis/create-spacial-tree.js.map +0 -1
  451. package/node/mat/to-scale-axis/get-engulfed-vertices.d.ts +0 -12
  452. package/node/mat/to-scale-axis/get-engulfed-vertices.js +0 -94
  453. package/node/mat/to-scale-axis/get-engulfed-vertices.js.map +0 -1
  454. package/node/mat/to-scale-axis/t-tree.d.ts +0 -6
  455. package/node/mat/to-scale-axis/t-tree.js +0 -3
  456. package/node/mat/to-scale-axis/t-tree.js.map +0 -1
  457. package/node/mat/to-scale-axis/traverse-spacial-tree.d.ts +0 -11
  458. package/node/mat/to-scale-axis/traverse-spacial-tree.js +0 -24
  459. package/node/mat/to-scale-axis/traverse-spacial-tree.js.map +0 -1
  460. package/node/svg/get-curvature-at-interface.d.ts +0 -9
  461. package/node/svg/get-curvature-at-interface.js +0 -48
  462. package/node/svg/get-curvature-at-interface.js.map +0 -1
  463. package/node/svg/get-extreme.d.ts +0 -9
  464. package/node/svg/get-extreme.js +0 -15
  465. package/node/svg/get-extreme.js.map +0 -1
  466. package/node/sweep-line/are-boxes-intersecting.d.ts +0 -11
  467. package/node/sweep-line/are-boxes-intersecting.js +0 -41
  468. package/node/sweep-line/are-boxes-intersecting.js.map +0 -1
  469. package/test/mocha.opts +0 -4
  470. package/webpack.config.js +0 -25
@@ -1,6 +1,4 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- const get_curve_between_1 = require("./get-curve/get-curve-between");
1
+ import { getCurveBetween } from './get-curve/get-curve-between.js';
4
2
  /**
5
3
  * Returns the bezier curve from the maximal disk of the given [[CpNode]] to the
6
4
  * next [[CpNode]]'s maximal disk and thus directly represents a piece of the
@@ -8,7 +6,7 @@ const get_curve_between_1 = require("./get-curve/get-curve-between");
8
6
  * @param cpNode
9
7
  */
10
8
  function getCurveToNext(cpNode) {
11
- return get_curve_between_1.getCurveBetween(cpNode, cpNode.next);
9
+ return getCurveBetween(cpNode, cpNode.next);
12
10
  }
13
- exports.getCurveToNext = getCurveToNext;
11
+ export { getCurveToNext };
14
12
  //# sourceMappingURL=get-curve-to-next.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"get-curve-to-next.js","sourceRoot":"","sources":["../src/get-curve-to-next.ts"],"names":[],"mappings":";;AAEA,qEAAgE;AAGhE;;;;;GAKG;AACH,SAAS,cAAc,CAAC,MAAc;IACrC,OAAO,mCAAe,CAAC,MAAM,EAAE,MAAM,CAAC,IAAI,CAAC,CAAC;AAC7C,CAAC;AAGQ,wCAAc"}
1
+ {"version":3,"file":"get-curve-to-next.js","sourceRoot":"","sources":["../src/get-curve-to-next.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,eAAe,EAAE,MAAM,kCAAkC,CAAC;AAGnE;;;;;GAKG;AACH,SAAS,cAAc,CAAC,MAAc;IACrC,OAAO,eAAe,CAAC,MAAM,EAAE,MAAM,CAAC,IAAI,CAAC,CAAC;AAC7C,CAAC;AAGD,OAAO,EAAE,cAAc,EAAE,CAAA"}
@@ -0,0 +1,24 @@
1
+ /**
2
+ * Returns a positive value if the second bezier (of order 1, 2 or 3) curves
3
+ * anti-clockwise with respect to the first at the point where the first bezier
4
+ * ends and the second one starts. Returns a negative number if the turn is
5
+ * clockwise. Returns 0 otherwise.
6
+ *
7
+ * The algorithm is a generalization of `ccw`, a.k.a `orient2d`.
8
+ *
9
+ * The above obviously necessitates that their endpoints coincide as described.
10
+ *
11
+ * Preconditions (for robustness):
12
+ * * The beziers has control points with max bit-length of 25 and bit-aligned.
13
+ * * The bezier does not have infinite curvature at either endpoint
14
+ *
15
+ * This is so the vectors between control points can be
16
+ * calculated exactly without resorting to adaptive infinite precision floating
17
+ * point operations. Note: aligned to 'grid' here means if you bitwise-and all
18
+ * values together the resulting bitlength === the max bithlength of any value.
19
+ *
20
+ * @param psI The incoming bezier that ends at the interface
21
+ * @param psO The outgoing bezier that starts at the interface
22
+ */
23
+ declare function getInterfaceCcw(psI: number[][], psO: number[][]): number;
24
+ export { getInterfaceCcw };
@@ -0,0 +1,98 @@
1
+ import { orient2d } from 'big-float-ts';
2
+ import { dot } from "flo-vector2d";
3
+ import { compareCurvaturesAtInterface } from "./compare-curvatures-at-interface.js";
4
+ /**
5
+ * Returns a positive value if the second bezier (of order 1, 2 or 3) curves
6
+ * anti-clockwise with respect to the first at the point where the first bezier
7
+ * ends and the second one starts. Returns a negative number if the turn is
8
+ * clockwise. Returns 0 otherwise.
9
+ *
10
+ * The algorithm is a generalization of `ccw`, a.k.a `orient2d`.
11
+ *
12
+ * The above obviously necessitates that their endpoints coincide as described.
13
+ *
14
+ * Preconditions (for robustness):
15
+ * * The beziers has control points with max bit-length of 25 and bit-aligned.
16
+ * * The bezier does not have infinite curvature at either endpoint
17
+ *
18
+ * This is so the vectors between control points can be
19
+ * calculated exactly without resorting to adaptive infinite precision floating
20
+ * point operations. Note: aligned to 'grid' here means if you bitwise-and all
21
+ * values together the resulting bitlength === the max bithlength of any value.
22
+ *
23
+ * @param psI The incoming bezier that ends at the interface
24
+ * @param psO The outgoing bezier that starts at the interface
25
+ */
26
+ // TODO - improve and make at least 46-bitlength precondition
27
+ function getInterfaceCcw(psI, psO) {
28
+ let lenI = psI.length;
29
+ // second last control point of incoming curve
30
+ let p0 = psI[lenI - 2];
31
+ // last control point of incoming curve / first control point of outgoing
32
+ let p1 = psO[0];
33
+ // second control point of outgoing curve
34
+ let p2 = psO[1];
35
+ /*
36
+ if (typeof _bez_debug_ !== 'undefined') {
37
+ let maxBitLength = 25;
38
+ let p1_ = psI[lenI-1];
39
+ // ---- precondition: does endpoints coincide
40
+ if (p1_[0] !== p1[0] || p1_[1] !== p1[1]) {
41
+ throw new Error('Curve endpoints must coincide.');
42
+ }
43
+ // ---- precondition: are coordinates grid-aligned
44
+ // Get all coordinate values into an array
45
+ let xs: number[] = [];
46
+ [psI, psO].forEach(ps => ps.forEach(p => p.forEach(x => {
47
+ xs.push(x);
48
+ })));
49
+
50
+ let msb = xs.reduce((prevX, x) => Math.max(prevX, msbExponent(x)), Number.NEGATIVE_INFINITY);
51
+ let lsb = xs.reduce((prevX, x) => Math.min(prevX, lsbExponent(x)), Number.POSITIVE_INFINITY);
52
+ let bitlengthAll = msb - lsb + 1;
53
+ if (bitlengthAll > maxBitLength) {
54
+ throw new Error(
55
+ `Curve control point coordinates must be bit-aligned and <= ${maxBitLength}. bitlength === ${bitlengthAll}, coordinates: ${xs}`
56
+ );
57
+ }
58
+ }
59
+ */
60
+ // Max one bit can be added in the calculations below due to bit-alignment
61
+ let xE = p1[0] - p0[0]; // tangent x-coordinate
62
+ let yE = p1[1] - p0[1]; // tangent y-coordinate
63
+ let xS = p2[0] - p1[0]; // tangent x-coordinate
64
+ let yS = p2[1] - p1[1]; // tangent y-coordinate
65
+ // If the tangent is to be found at t === 0 or t === 1 then using a basic
66
+ // property of bezier curves we can find the tangents easily as below
67
+ // (non-normalized) tangent of incoming curve at t === 1
68
+ let tangentAtEnd = [xE, yE];
69
+ // (non-normalized) tangent of outgoing curve at t === 0
70
+ let tangentAtStart = [xS, yS];
71
+ // The cross calculated below will have a max bitlength of
72
+ // (2*(maxBitLength+1))+1 === e.g. (2*(25+1)) + 1 === 53
73
+ // If the preconditions are met it is exact
74
+ //let crossTangents = cross(tangentAtEnd, tangentAtStart);
75
+ // The cross below is exact by adaptive infinite precision
76
+ let crossTangents = orient2d(p0, p1, p2);
77
+ if (crossTangents !== 0) {
78
+ return crossTangents;
79
+ }
80
+ // The dot calculated below will have a max bitlength of
81
+ // (2*(maxBitLength+1))+1 === e.g. (2*(25+1)) + 1 === 53
82
+ // If the preconditions are met it is exact
83
+ let dotTangents = dot(tangentAtEnd, tangentAtStart);
84
+ if (dotTangents > 0) {
85
+ // Curves go in same direction at interface - neither clock or
86
+ // anti-clockwise.
87
+ // Note: The above comment is not strictly true but as this case is not
88
+ // important for the algorithm we return 0
89
+ return 0;
90
+ }
91
+ // Curves go in opposite directions at interface starting off with the exact
92
+ // same tangent - look now at curvature to see which has the largest
93
+ // curvature so we can base the clock or anti-clockwise result on that
94
+ // Look at curvature
95
+ return compareCurvaturesAtInterface(psI.slice().reverse(), psO);
96
+ }
97
+ export { getInterfaceCcw };
98
+ //# sourceMappingURL=get-interface-ccw.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"get-interface-ccw.js","sourceRoot":"","sources":["../src/get-interface-ccw.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,cAAc,CAAC;AACxC,OAAO,EAAE,GAAG,EAAE,MAAM,cAAc,CAAC;AACnC,OAAO,EAAE,4BAA4B,EAAE,MAAM,sCAAsC,CAAC;AAGpF;;;;;;;;;;;;;;;;;;;;;GAqBG;AACH,6DAA6D;AAC7D,SAAS,eAAe,CAAC,GAAe,EAAE,GAAe;IACrD,IAAI,IAAI,GAAG,GAAG,CAAC,MAAM,CAAC;IAEtB,8CAA8C;IAC9C,IAAI,EAAE,GAAG,GAAG,CAAC,IAAI,GAAC,CAAC,CAAC,CAAC;IACrB,yEAAyE;IACzE,IAAI,EAAE,GAAG,GAAG,CAAC,CAAC,CAAC,CAA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OAAO,4BAA4B,CAAC,GAAG,CAAC,KAAK,EAAE,CAAC,OAAO,EAAE,EAAE,GAAG,CAAC,CAAC;AACpE,CAAC;AAGD,OAAO,EAAE,eAAe,EAAE,CAAA"}
package/node/index.d.ts CHANGED
@@ -1,37 +1,36 @@
1
- import { Mat } from './mat';
2
- import { Loop } from './loop';
3
- import { Curve } from './curve';
4
- import { CpNode } from './cp-node';
5
- import { PointOnShape, IPointOnShape } from './point-on-shape';
6
- import { Circle } from './circle';
7
- import { ContactPoint } from './contact-point';
8
- import { BezierPiece } from './mat/bezier-piece';
9
- import { findMats } from './find-mats';
10
- import { trimMat } from './mat/trim-mat';
11
- import { toScaleAxis } from './to-scale-axis';
12
- import { traverseEdges } from './traverse-edges';
13
- import { getBranches } from './get-branches';
14
- import { traverseVertices } from './traverse-vertices';
15
- import { Debug, enableDebugForMat } from './debug/debug';
16
- import { drawBranch } from './debug/functions/draw-elem/branch';
17
- import { drawMat } from './debug/functions/draw-elem/mat';
18
- import { IDebugElems } from './debug/debug-elem-types';
19
- import { TDrawElemFunctions } from './debug/functions/draw-elem/draw-elem';
20
- import { ICpNodeForDebugging } from './debug/cp-node-for-debugging';
21
- import { ITiming } from './debug/debug';
22
- import { getClosestBoundaryPoint } from './mat/closest-boundary-point/get-closest-boundary-point';
23
1
  import { beziersToSvgPathStr, getPathsFromStr } from 'flo-boolean';
24
- import { getShapeBounds } from './svg/get-shape-bounds';
25
- import { getBoundaryBeziersToNext } from './get-boundary-beziers-to-next';
26
- import { getBoundaryBezierPartsToNext } from './get-boundary-bezier-parts-to-next';
27
- import { getBoundaryPieceBeziers } from './mat/get-boundary-piece-beziers';
28
- import { simplifyMat } from './simplify-mat';
29
- import { simplifyMatMapOnly } from './mat/simplify-mat-map-only';
30
- import { drawElemFunctions } from './debug/functions/draw-elem/draw-elem';
31
- import { getCurveToNext } from './get-curve-to-next';
32
- import { getCurveBetween } from './get-curve/get-curve-between';
33
- import { sweepLine } from './sweep-line/sweep-line';
34
- import { areBoxesIntersecting } from './sweep-line/are-boxes-intersecting';
35
- import { getClosestSquareDistanceToRect } from './mat/geometry/get-closest-square-distance-to-rect';
36
- import { loopFromBeziers } from './loop';
37
- export { Mat, PointOnShape, IPointOnShape, Curve, Loop, CpNode, Circle, ContactPoint, BezierPiece, findMats, toScaleAxis, trimMat, traverseVertices, traverseEdges, getBranches, getBoundaryBeziersToNext, getBoundaryBezierPartsToNext, simplifyMat, simplifyMatMapOnly, beziersToSvgPathStr, getPathsFromStr, getShapeBounds, drawBranch, drawMat, getClosestBoundaryPoint, getCurveToNext, getCurveBetween, Debug, IDebugElems, TDrawElemFunctions, ICpNodeForDebugging, ITiming, getBoundaryPieceBeziers, drawElemFunctions, sweepLine, areBoxesIntersecting, getClosestSquareDistanceToRect, loopFromBeziers, enableDebugForMat };
2
+ import { Mat } from './mat.js';
3
+ import { Loop } from './loop.js';
4
+ import { Curve } from './curve.js';
5
+ import { CpNode } from './cp-node.js';
6
+ import { PointOnShape, IPointOnShape } from './point-on-shape.js';
7
+ import { Circle } from './circle.js';
8
+ import { ContactPoint } from './contact-point.js';
9
+ import { BezierPiece } from './mat/bezier-piece.js';
10
+ import { findMats } from './find-mats.js';
11
+ import { trimMat } from './mat/trim-mat.js';
12
+ import { toScaleAxis } from './to-scale-axis.js';
13
+ import { traverseEdges } from './traverse-edges.js';
14
+ import { getBranches } from './get-branches.js';
15
+ import { traverseVertices } from './traverse-vertices.js';
16
+ import { Debug, enableDebugForMat } from './debug/debug.js';
17
+ import { drawBranch } from './debug/functions/draw-elem/branch.js';
18
+ import { drawMat } from './debug/functions/draw-elem/mat.js';
19
+ import { IDebugElems } from './debug/debug-elem-types.js';
20
+ import { TDrawElemFunctions } from './debug/functions/draw-elem/draw-elem.js';
21
+ import { ICpNodeForDebugging } from './debug/cp-node-for-debugging.js';
22
+ import { ITiming } from './debug/debug.js';
23
+ import { getClosestBoundaryPoint } from './mat/closest-boundary-point/get-closest-boundary-point.js';
24
+ import { getShapeBounds } from './svg/get-shape-bounds.js';
25
+ import { getBoundaryBeziersToNext } from './get-boundary-beziers-to-next.js';
26
+ import { getBoundaryBezierPartsToNext } from './get-boundary-bezier-parts-to-next.js';
27
+ import { getBoundaryPieceBeziers } from './mat/get-boundary-piece-beziers.js';
28
+ import { simplifyMat } from './simplify-mat.js';
29
+ import { simplifyMatMapOnly } from './mat/simplify-mat-map-only.js';
30
+ import { drawElemFunctions } from './debug/functions/draw-elem/draw-elem.js';
31
+ import { getCurveToNext } from './get-curve-to-next.js';
32
+ import { getCurveBetween } from './get-curve/get-curve-between.js';
33
+ import { sweepLine } from './sweep-line/sweep-line.js';
34
+ import { getClosestSquareDistanceToRect } from './mat/geometry/get-closest-square-distance-to-rect.js';
35
+ import { loopFromBeziers } from './loop.js';
36
+ export { Mat, PointOnShape, IPointOnShape, Curve, Loop, CpNode, Circle, ContactPoint, BezierPiece, findMats, toScaleAxis, trimMat, traverseVertices, traverseEdges, getBranches, getBoundaryBeziersToNext, getBoundaryBezierPartsToNext, simplifyMat, simplifyMatMapOnly, beziersToSvgPathStr, getPathsFromStr, getShapeBounds, drawBranch, drawMat, getClosestBoundaryPoint, getCurveToNext, getCurveBetween, Debug, IDebugElems, TDrawElemFunctions, ICpNodeForDebugging, ITiming, getBoundaryPieceBeziers, drawElemFunctions, sweepLine, getClosestSquareDistanceToRect, loopFromBeziers, enableDebugForMat };
package/node/index.js CHANGED
@@ -1,56 +1,33 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- const cp_node_1 = require("./cp-node");
4
- exports.CpNode = cp_node_1.CpNode;
5
- const point_on_shape_1 = require("./point-on-shape");
6
- exports.PointOnShape = point_on_shape_1.PointOnShape;
7
- const find_mats_1 = require("./find-mats");
8
- exports.findMats = find_mats_1.findMats;
9
- const trim_mat_1 = require("./mat/trim-mat");
10
- exports.trimMat = trim_mat_1.trimMat;
11
- const to_scale_axis_1 = require("./to-scale-axis");
12
- exports.toScaleAxis = to_scale_axis_1.toScaleAxis;
13
- const traverse_edges_1 = require("./traverse-edges");
14
- exports.traverseEdges = traverse_edges_1.traverseEdges;
15
- const get_branches_1 = require("./get-branches");
16
- exports.getBranches = get_branches_1.getBranches;
17
- const traverse_vertices_1 = require("./traverse-vertices");
18
- exports.traverseVertices = traverse_vertices_1.traverseVertices;
19
- const debug_1 = require("./debug/debug");
20
- exports.enableDebugForMat = debug_1.enableDebugForMat;
21
- const branch_1 = require("./debug/functions/draw-elem/branch");
22
- exports.drawBranch = branch_1.drawBranch;
23
- const mat_1 = require("./debug/functions/draw-elem/mat");
24
- exports.drawMat = mat_1.drawMat;
25
- const get_closest_boundary_point_1 = require("./mat/closest-boundary-point/get-closest-boundary-point");
26
- exports.getClosestBoundaryPoint = get_closest_boundary_point_1.getClosestBoundaryPoint;
27
- const flo_boolean_1 = require("flo-boolean");
28
- exports.beziersToSvgPathStr = flo_boolean_1.beziersToSvgPathStr;
29
- exports.getPathsFromStr = flo_boolean_1.getPathsFromStr;
30
- const get_shape_bounds_1 = require("./svg/get-shape-bounds");
31
- exports.getShapeBounds = get_shape_bounds_1.getShapeBounds;
32
- const get_boundary_beziers_to_next_1 = require("./get-boundary-beziers-to-next");
33
- exports.getBoundaryBeziersToNext = get_boundary_beziers_to_next_1.getBoundaryBeziersToNext;
34
- const get_boundary_bezier_parts_to_next_1 = require("./get-boundary-bezier-parts-to-next");
35
- exports.getBoundaryBezierPartsToNext = get_boundary_bezier_parts_to_next_1.getBoundaryBezierPartsToNext;
36
- const get_boundary_piece_beziers_1 = require("./mat/get-boundary-piece-beziers");
37
- exports.getBoundaryPieceBeziers = get_boundary_piece_beziers_1.getBoundaryPieceBeziers;
38
- const simplify_mat_1 = require("./simplify-mat");
39
- exports.simplifyMat = simplify_mat_1.simplifyMat;
40
- const simplify_mat_map_only_1 = require("./mat/simplify-mat-map-only");
41
- exports.simplifyMatMapOnly = simplify_mat_map_only_1.simplifyMatMapOnly;
42
- const draw_elem_1 = require("./debug/functions/draw-elem/draw-elem");
43
- exports.drawElemFunctions = draw_elem_1.drawElemFunctions;
44
- const get_curve_to_next_1 = require("./get-curve-to-next");
45
- exports.getCurveToNext = get_curve_to_next_1.getCurveToNext;
46
- const get_curve_between_1 = require("./get-curve/get-curve-between");
47
- exports.getCurveBetween = get_curve_between_1.getCurveBetween;
48
- const sweep_line_1 = require("./sweep-line/sweep-line");
49
- exports.sweepLine = sweep_line_1.sweepLine;
50
- const are_boxes_intersecting_1 = require("./sweep-line/are-boxes-intersecting");
51
- exports.areBoxesIntersecting = are_boxes_intersecting_1.areBoxesIntersecting;
52
- const get_closest_square_distance_to_rect_1 = require("./mat/geometry/get-closest-square-distance-to-rect");
53
- exports.getClosestSquareDistanceToRect = get_closest_square_distance_to_rect_1.getClosestSquareDistanceToRect;
54
- const loop_1 = require("./loop");
55
- exports.loopFromBeziers = loop_1.loopFromBeziers;
1
+ import { beziersToSvgPathStr, getPathsFromStr } from 'flo-boolean';
2
+ import { CpNode } from './cp-node.js';
3
+ import { PointOnShape } from './point-on-shape.js';
4
+ import { findMats } from './find-mats.js';
5
+ import { trimMat } from './mat/trim-mat.js';
6
+ import { toScaleAxis } from './to-scale-axis.js';
7
+ import { traverseEdges } from './traverse-edges.js';
8
+ import { getBranches } from './get-branches.js';
9
+ import { traverseVertices } from './traverse-vertices.js';
10
+ import { enableDebugForMat } from './debug/debug.js';
11
+ import { drawBranch } from './debug/functions/draw-elem/branch.js';
12
+ import { drawMat } from './debug/functions/draw-elem/mat.js';
13
+ import { getClosestBoundaryPoint } from './mat/closest-boundary-point/get-closest-boundary-point.js';
14
+ import { getShapeBounds } from './svg/get-shape-bounds.js';
15
+ import { getBoundaryBeziersToNext } from './get-boundary-beziers-to-next.js';
16
+ import { getBoundaryBezierPartsToNext } from './get-boundary-bezier-parts-to-next.js';
17
+ import { getBoundaryPieceBeziers } from './mat/get-boundary-piece-beziers.js';
18
+ import { simplifyMat } from './simplify-mat.js';
19
+ import { simplifyMatMapOnly } from './mat/simplify-mat-map-only.js';
20
+ import { drawElemFunctions } from './debug/functions/draw-elem/draw-elem.js';
21
+ import { getCurveToNext } from './get-curve-to-next.js';
22
+ import { getCurveBetween } from './get-curve/get-curve-between.js';
23
+ import { sweepLine } from './sweep-line/sweep-line.js';
24
+ import { getClosestSquareDistanceToRect } from './mat/geometry/get-closest-square-distance-to-rect.js';
25
+ import { loopFromBeziers } from './loop.js';
26
+ export { PointOnShape, CpNode,
27
+ // Main functions
28
+ findMats, toScaleAxis, trimMat, traverseVertices, traverseEdges, getBranches, getBoundaryBeziersToNext, getBoundaryBezierPartsToNext, simplifyMat, simplifyMatMapOnly,
29
+ // SVG functions
30
+ beziersToSvgPathStr, getPathsFromStr, getShapeBounds, drawBranch, drawMat,
31
+ // Other functions
32
+ getClosestBoundaryPoint, getCurveToNext, getCurveBetween, getBoundaryPieceBeziers, drawElemFunctions, sweepLine, getClosestSquareDistanceToRect, loopFromBeziers, enableDebugForMat };
56
33
  //# sourceMappingURL=index.js.map
package/node/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;AAIA,uCAAmC;AAsDlC,iBAtDQ,gBAAM,CAsDR;AArDP,qDAA+D;AAiD9D,uBAjDQ,6BAAY,CAiDR;AA5Cb,2CAAuC;AAsDtC,mBAtDQ,oBAAQ,CAsDR;AArDT,6CAAyC;AAuDxC,kBAvDQ,kBAAO,CAuDR;AAtDR,mDAA8C;AAqD7C,sBArDQ,2BAAW,CAqDR;AAnDZ,qDAAiD;AAsDhD,wBAtDQ,8BAAa,CAsDR;AArDd,iDAA6C;AAsD5C,sBAtDQ,0BAAW,CAsDR;AArDZ,2DAAuD;AAmDtD,2BAnDQ,oCAAgB,CAmDR;AAjDjB,yCAAyD;AAqFxD,4BArFe,yBAAiB,CAqFf;AApFlB,+DAAgE;AA4D/D,qBA5DQ,mBAAU,CA4DR;AA3DX,yDAA0D;AA4DzD,kBA5DQ,aAAO,CA4DR;AAnDR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AAiB,EAEjB,SAAS,EAET,8BAA8B,EAE9B,eAAe,EACf,iBAAiB,EACjB,CAAA"}
@@ -1,5 +1,3 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
1
  const max = Math.max;
4
2
  const abs = Math.abs;
5
3
  /**
@@ -42,5 +40,5 @@ function getLoopsMetrics(loops) {
42
40
  let maxRadius = max(width, height);
43
41
  return { maxCoordinate, maxRadius };
44
42
  }
45
- exports.getLoopsMetrics = getLoopsMetrics;
43
+ export { getLoopsMetrics };
46
44
  //# sourceMappingURL=get-max-coordinate.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"get-max-coordinate.js","sourceRoot":"","sources":["../../src/loop/get-max-coordinate.ts"],"names":[],"mappings":";;AACA,MAAM,GAAG,GAAG,IAAI,CAAC,GAAG,CAAC;AACrB,MAAM,GAAG,GAAG,IAAI,CAAC,GAAG,CAAC;AAGrB;;;;GAIG;AACH,SAAS,eAAe,CAAC,KAAqB;IAI1C,IAAI,aAAa,GAAG,CAAC,CAAC;IACtB,IAAI,IAAI,GAAG,MAAM,CAAC,iBAAiB,CAAC;IACpC,IAAI,IAAI,GAAG,MAAM,CAAC,iBAAiB,CAAC;IACpC,IAAI,IAAI,GAAG,MAAM,CAAC,iBAAiB,CAAC;IACpC,IAAI,IAAI,GAAG,MAAM,CAAC,iBAAiB,CAAC;IAEpC,KAAK,IAAI,IAAI,IAAI,KAAK,EAAE;QAAE,KAAK,IAAI,EAAE,IAAI,IAAI,EAAE;YAAE,KAAK,IAAI,CAAC,IAAI,EAAE,EAAE;gBAC/D,IAAI,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC;gBACb,IAAI,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC;gBACb,IAAI,CAAC,GAAG,GAAG,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC;gBAC5B,IAAI,CAAC,GAAG,aAAa,EAAE;oBAAE,a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AC,CAAC,CAAC;gBACb,IAAI,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC;gBACb,IAAI,CAAC,GAAG,GAAG,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC;gBAC5B,IAAI,CAAC,GAAG,aAAa,EAAE;oBAAE,aAAa,GAAG,CAAC,CAAC;iBAAE;gBAC7C,IAAI,CAAC,GAAG,IAAI,EAAE;oBAAE,IAAI,GAAG,CAAC,CAAC;iBAAE;gBAC3B,IAAI,CAAC,GAAG,IAAI,EAAE;oBAAE,IAAI,GAAG,CAAC,CAAC;iBAAE;gBAC3B,IAAI,CAAC,GAAG,IAAI,EAAE;oBAAE,IAAI,GAAG,CAAC,CAAC;iBAAE;gBAC3B,IAAI,CAAC,GAAG,IAAI,EAAE;oBAAE,IAAI,GAAG,CAAC,CAAC;iBAAE;aAC9B;SAAE;KAAE;IAEL,IAAI,KAAK,GAAI,IAAI,GAAG,IAAI,CAAC;IACzB,IAAI,MAAM,GAAG,IAAI,GAAG,IAAI,CAAC;IACzB,IAAI,SAAS,GAAG,GAAG,CAAC,KAAK,EAAE,MAAM,CAAC,CAAC;IAEnC,OAAO,EAAE,aAAa,EAAE,SAAS,EAAE,CAAC;AACxC,CAAC;AAGD,OAAO,EAAE,eAAe,EAAE,CAAA"}
package/node/loop.d.ts CHANGED
@@ -1,4 +1,4 @@
1
- import { Curve } from './curve';
1
+ import { Curve } from './curve.js';
2
2
  /**
3
3
  * Represents a two-way linked loop of [[ICurve]]s - mostly used internally to
4
4
  * conveniently represent shape boundaries.
package/node/loop.js CHANGED
@@ -1,5 +1,3 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
1
  /**
4
2
  * @param beziers A pre-ordered array of bezier curves to add initially.
5
3
  */
@@ -33,5 +31,5 @@ function loopFromBeziers(beziers = []) {
33
31
  lastCurve.next = curves[0];
34
32
  return loop;
35
33
  }
36
- exports.loopFromBeziers = loopFromBeziers;
34
+ export { loopFromBeziers };
37
35
  //# sourceMappingURL=loop.js.map
package/node/loop.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"loop.js","sourceRoot":"","sources":["../src/loop.ts"],"names":[],"mappings":";;AAgBA;;GAEG;AACH,SAAS,eAAe,CAAC,UAAwB,EAAE;IAC/C,IAAI,MAAM,GAAY,EAAE,CAAC;IAEzB,IAAI,IAAI,GAAS;QACb,OAAO;QACP,MAAM;KACT,CAAC;IAEF,IAAI,CAAC,OAAO,CAAC,MAAM,EAAE;QAAE,OAAO,IAAI,CAAC;KAAE;IAErC,IAAI,IAAW,CAAC;IAEhB,KAAK,IAAI,CAAC,GAAC,CAAC,EAAE,CAAC,GAAC,OAAO,CAAC,MAAM,EAAE,CAAC,EAAE,EAAE;QAEjC,IAAI,KAAK,GAAU;YACf,IAAI;YACJ,EAAE,EAAE,OAAO,CAAC,CAAC,CAAC;YACd,IAAI;YACJ,IAAI,EAAE,SAAS;YACf,GAAG,EAAE,CAAC;SACT,CAAC;QAEF,IAAI,IAAI,EAAE;YAAE,IAAI,CAAC,IAAI,GAAG,KAAK,CAAC;SAAE;QAChC,IAAI,GAAG,KAAK,CAAC;QAEb,MAAM,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;KACtB;IAED,aAAa;IACb,IAAI,SAAS,GAAG,MAAM,CAAC,MAAM,CAAC,MAAM,GAAC,CAAC,CAAC,CAAC;IACxC,MAAM,CAAC,CAAC,CAAC,CAAC,IAAI,GAAG,SAAS,CAAC;IAC3B,SAAS,CAAC,IAAI,GAAG,MAAM,CAAC,CAAC,CAAC,CAAC;IAE3B,OAAO,IAAI,CAAC;AAChB,CAAC;AAGc,0CAAe"}
1
+ {"version":3,"file":"loop.js","sourceRoot":"","sources":["../src/loop.ts"],"names":[],"mappings":"AAeA;;GAEG;AACH,SAAS,eAAe,CAAC,UAAwB,EAAE;IAC/C,IAAI,MAAM,GAAY,EAAE,CAAC;IAEzB,IAAI,IAAI,GAAS;QACb,OAAO;QACP,MAAM;KACT,CAAC;IAEF,IAAI,CAAC,OAAO,CAAC,MAAM,EAAE;QAAE,OAAO,IAAI,CAAC;KAAE;IAErC,IAAI,IAAW,CAAC;IAEhB,KAAK,IAAI,CAAC,GAAC,CAAC,EAAE,CAAC,GAAC,OAAO,CAAC,MAAM,EAAE,CAAC,EAAE,EAAE;QAEjC,IAAI,KAAK,GAAU;YACf,IAAI;YACJ,EAAE,EAAE,OAAO,CAAC,CAAC,CAAC;YACd,IAAI;YACJ,IAAI,EAAE,SAAS;YACf,GAAG,EAAE,CAAC;SACT,CAAC;QAEF,IAAI,IAAI,EAAE;YAAE,IAAI,CAAC,IAAI,GAAG,KAAK,CAAC;SAAE;QAChC,IAAI,GAAG,KAAK,CAAC;QAEb,MAAM,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;KACtB;IAED,aAAa;IACb,IAAI,SAAS,GAAG,MAAM,CAAC,MAAM,CAAC,MAAM,GAAC,CAAC,CAAC,CAAC;IACxC,MAAM,CAAC,CAAC,CAAC,CAAC,IAAI,GAAG,SAAS,CAAC;IAC3B,SAAS,CAAC,IAAI,GAAG,MAAM,CAAC,CAAC,CAAC,CAAC;IAE3B,OAAO,IAAI,CAAC;AAChB,CAAC;AAGD,OAAO,EAAQ,eAAe,EAAE,CAAA"}
@@ -1,8 +1,8 @@
1
- import LlRbTree from 'flo-ll-rb-tree';
2
- import { Loop } from '../loop';
3
- import { Circle } from '../circle';
4
- import { IPointOnShape } from '../point-on-shape';
5
- import { CpNode } from '../cp-node';
1
+ import { LlRbTree } from 'flo-ll-rb-tree';
2
+ import { Loop } from '../loop.js';
3
+ import { Circle } from '../circle.js';
4
+ import { IPointOnShape } from '../point-on-shape.js';
5
+ import { CpNode } from '../cp-node.js';
6
6
  /**
7
7
  * @hidden
8
8
  * @param circle
@@ -1,7 +1,5 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- const cp_node_1 = require("../cp-node");
4
- const get_neighboring_cps_1 = require("./get-neighboring-cps");
1
+ import { CpNode } from '../cp-node.js';
2
+ import { getNeighbouringPoints } from './get-neighboring-cps.js';
5
3
  /**
6
4
  * @hidden
7
5
  * @param circle
@@ -17,8 +15,8 @@ function addToCpGraph(circle, orders, cpTrees, poss, neighbors) {
17
15
  let newCp_ = { pointOnShape: pos, circle, order: orders[i], order2: 0 };
18
16
  let neighboringCp = neighbors
19
17
  ? neighbors[i]
20
- : get_neighboring_cps_1.getNeighbouringPoints(cpTree, pos, orders[i], 0);
21
- let newCp = cp_node_1.CpNode.insert(false, false, cpTree, newCp_, neighboringCp[0]);
18
+ : getNeighbouringPoints(cpTree, pos, orders[i], 0);
19
+ let newCp = CpNode.insert(false, false, cpTree, newCp_, neighboringCp[0]);
22
20
  return newCp;
23
21
  });
24
22
  let len = poss.length;
@@ -29,5 +27,5 @@ function addToCpGraph(circle, orders, cpTrees, poss, neighbors) {
29
27
  newCps[i].nextOnCircle = newCps[indxNext];
30
28
  }
31
29
  }
32
- exports.addToCpGraph = addToCpGraph;
30
+ export { addToCpGraph };
33
31
  //# sourceMappingURL=add-to-cp-graph.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"add-to-cp-graph.js","sourceRoot":"","sources":["../../src/mat/add-to-cp-graph.ts"],"names":[],"mappings":";;AAMA,wCAAoC;AACpC,+DAA8D;AAG9D;;;;;;;;GAQG;AACH,SAAS,YAAY,CACb,MAAgB,EAChB,MAAkB,EAClB,OAAoC,EACpC,IAAyB,EACzB,SAAuB;IAE3B,IAAI,MAAM,GAAG,IAAI,CAAC,GAAG,CAAC,CAAC,GAAG,EAAE,CAAC,EAAE,EAAE;QAC7B,IAAI,MAAM,GAAG,OAAO,CAAC,GAAG,CAAC,GAAG,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC;QAEzC,IAAI,MAAM,GAAiB,EAAE,YAAY,EAAE,GAAG,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,CAAC,CAAC,CAAC,EAAE,MAAM,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C;AAGD,OAAO,EAAE,YAAY,EAAE,CAAA"}
@@ -1,4 +1,4 @@
1
- import { Curve } from '../curve';
1
+ import { Curve } from '../curve.js';
2
2
  /**
3
3
  * @hidden
4
4
  * Represents a part of a bezier within the shape boundary.
@@ -1,3 +1,2 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
1
+ export {};
3
2
  //# sourceMappingURL=bezier-piece.js.map
@@ -1,4 +1,4 @@
1
- import { Curve } from "../../curve";
1
+ import { Curve } from "../../curve.js";
2
2
  /**
3
3
  * @hidden
4
4
  * @param curve The curve
@@ -1,7 +1,7 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- const flo_poly_1 = require("flo-poly");
4
- const flo_bezier3_1 = require("flo-bezier3");
1
+ // qqq import { deflateQuad, allRootsMultiWithErrBounds, RootInterval } from 'flo-poly';
2
+ // qqq import { getTangentPolyFromPointExact, evalDeCasteljau, evaluate, getFootpointPolyExact } from 'flo-bezier3';
3
+ import { ddDeflate, allRootsCertified } from 'flo-poly';
4
+ import { evaluate, getFootpointPolyDd } from 'flo-bezier3';
5
5
  /**
6
6
  * @hidden
7
7
  * @param curve The curve
@@ -11,13 +11,15 @@ const flo_bezier3_1 = require("flo-bezier3");
11
11
  * @param t The t value of the bezier that locates p
12
12
  */
13
13
  function closestPointsOnCurve(curve, p, [tS, tE] = [0, 1], touchedCurve, t) {
14
- let poly = flo_bezier3_1.getTangentPolyFromPointExact(curve.ps, p);
15
- if (curve === touchedCurve) {
16
- poly = flo_poly_1.deflateQuad(poly, t);
17
- }
18
- let roots = flo_poly_1.allRootsMultiWithErrBounds(poly, poly.map(c => 0), // because all coefficients are exact
19
- undefined, // ...
20
- tS, tE);
14
+ // qqq let poly = getTangentPolyFromPointExact(curve.ps, p);
15
+ const _poly = getFootpointPolyDd(curve.ps, p);
16
+ // qqq poly = deflateQuad(poly, t);
17
+ const poly = curve === touchedCurve
18
+ ? ddDeflate(_poly, t)
19
+ : _poly;
20
+ // let roots: Omit<RootInterval,'multiplicity'>[] = allRootsMultiWithErrBounds(
21
+ let roots;
22
+ roots = allRootsCertified(poly, tS, tE);
21
23
  // Also test the endpoints
22
24
  let push0 = true;
23
25
  let push1 = true;
@@ -63,10 +65,10 @@ function closestPointsOnCurve(curve, p, [tS, tE] = [0, 1], touchedCurve, t) {
63
65
  ? 0
64
66
  : tE > 1 ? 1 : (tS + tE) / 2;
65
67
  // TODO - why does evalDeCasteljau not work here?
66
- return { p: flo_bezier3_1.evaluate(curve.ps, t), t };
68
+ return { p: evaluate(curve.ps, t), t };
67
69
  //return { p: evalDeCasteljau(curve.ps,t), t }
68
70
  });
69
71
  return ps;
70
72
  }
71
- exports.closestPointsOnCurve = closestPointsOnCurve;
73
+ export { closestPointsOnCurve };
72
74
  //# sourceMappingURL=closest-points-on-curve.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"closest-points-on-curve.js","sourceRoot":"","sources":["../../../src/mat/closest-boundary-point/closest-points-on-curve.ts"],"names":[],"mappings":";;AACA,uCAAiF;AACjF,6CAAsF;AAItF;;;;;;;GAOG;AACH,SAAS,oBAAoB,CACrB,KAAY,EACZ,CAAW,EACX,CAAC,EAAE,EAAC,EAAE,IAAc,CAAC,CAAC,EAAC,CAAC,CAAC,EACzB,YAAmB,EACnB,CAAS;IAEb,IAAI,IAAI,GAAG,0CAA4B,CAAC,KAAK,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC;IAErD,IAAI,KAAK,KAAK,YAAY,EAAE;QACxB,IAAI,GAAG,sBAAW,CAAC,IAAI,EAAE,CAAC,CAAC,CAAC;KAC/B;IAED,IAAI,KAAK,GAAwC,qCAA0B,CACvE,IAAI,EACJ,IAAI,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,EAAG,qCAAqC;IACxD,SAAS,EAAU,MAAM;IACzB,EAAE,EACF,EAAE,CACL,CAAC;IAGF,0BAA0B;IAC1B,IAAI,KAAK,GAAG,IAAI,CA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,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,CAAC,CAAC;KAClC;IAED,IAAI,EAAE,GAAG,KAAK,CAAC,GAAG,CACd,IAAI,CAAC,EAAE;QACH,IAAI,EAAE,GAAG,IAAI,CAAC,EAAE,CAAC;QACjB,IAAI,EAAE,GAAG,IAAI,CAAC,EAAE,CAAC;QACjB,wEAAwE;QACxE,IAAI,CAAC,GAAG,EAAE,GAAG,CAAC;YACV,CAAC,CAAC,CAAC;YACH,CAAC,CAAC,EAAE,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,EAAE,GAAG,EAAE,CAAC,GAAC,CAAC,CAAC;QAC/B,iDAAiD;QACjD,OAAO,EAAE,CAAC,EAAE,sBAAQ,CAAC,KAAK,CAAC,EAAE,EAAC,CAAC,CAAC,EAAE,CAAC,EAAE,CAAA;QACrC,8CAA8C;IAClD,CAAC,CACJ,CAAC;IAEF,OAAO,EAAE,CAAC;AACd,CAAC;AAGQ,oDAAoB"}
1
+ {"version":3,"file":"closest-points-on-curve.js","sourceRoot":"","sources":["../../../src/mat/closest-boundary-point/closest-points-on-curve.ts"],"names":[],"mappings":"AAAA,wFAAwF;AACxF,oHAAoH;AACpH,OAAO,EAAE,SAAS,EAAE,iBAAiB,EAAgB,MAAM,UAAU,CAAC;AACtE,OAAO,EAAmB,QAAQ,EAAE,kBAAkB,EAAyB,MAAM,aAAa,CAAC;AAKnG;;;;;;;GAOG;AACH,SAAS,oBAAoB,CACrB,KAAY,EACZ,CAAW,EACX,CAAC,EAAE,EAAC,EAAE,IAAc,CAAC,CAAC,EAAC,CAAC,CAAC,EACzB,YAAmB,EACnB,CAAS;IAKb,4DAA4D;IAC5D,MAAM,KAAK,GAAG,kBAAkB,CAAC,KAAK,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC;IAE9C,mCAAmC;IACnC,MAAM,IAAI,GAAG,KAAK,KAAK,YAAY;QAC/B,CAAC,CAAC,SAAS,CAAC,KAAK,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AAI,EAAE,KAAK,CAAC,EAAE;QACjB,IAAI,KAAK,EAAE;YAAE,KAAK,CAAC,IAAI,CAAC,EAAE,EAAE,EAAE,CAAC,EAAE,EAAE,EAAE,CAAC,EAAE,CAAC,CAAC;SAAE;KAC/C;SAAM;QACH,KAAK,CAAC,IAAI,CAAC,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,CAAC,CAAC;KAClC;IAED,IAAI,EAAE,GAAG,KAAK,CAAC,GAAG,CACd,IAAI,CAAC,EAAE;QACH,IAAI,EAAE,GAAG,IAAI,CAAC,EAAE,CAAC;QACjB,IAAI,EAAE,GAAG,IAAI,CAAC,EAAE,CAAC;QACjB,wEAAwE;QACxE,IAAI,CAAC,GAAG,EAAE,GAAG,CAAC;YACV,CAAC,CAAC,CAAC;YACH,CAAC,CAAC,EAAE,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,EAAE,GAAG,EAAE,CAAC,GAAC,CAAC,CAAC;QAC/B,iDAAiD;QACjD,OAAO,EAAE,CAAC,EAAE,QAAQ,CAAC,KAAK,CAAC,EAAE,EAAC,CAAC,CAAC,EAAE,CAAC,EAAE,CAAA;QACrC,8CAA8C;IAClD,CAAC,CACJ,CAAC;IAEF,OAAO,EAAE,CAAC;AACd,CAAC;AAGD,OAAO,EAAE,oBAAoB,EAAE,CAAA"}
@@ -1,4 +1,4 @@
1
- import { BezierPiece } from "../bezier-piece";
1
+ import { BezierPiece } from '../bezier-piece.js';
2
2
  /**
3
3
  * @hidden
4
4
  * @param bezierPieces
@@ -1,8 +1,6 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- const get_best_distance_squared_1 = require("./get-best-distance-squared");
4
- const cull_by_loose_bounding_box_1 = require("./cull-by-loose-bounding-box");
5
- const cull_by_tight_boundary_box_1 = require("./cull-by-tight-boundary-box");
1
+ import { getBestDistanceSquared } from './get-best-distance-squared.js';
2
+ import { cullByLooseBoundingBox } from './cull-by-loose-bounding-box.js';
3
+ import { cullByTightBoundingBox } from './cull-by-tight-boundary-box.js';
6
4
  /**
7
5
  * @hidden
8
6
  * @param bezierPieces
@@ -12,11 +10,11 @@ const cull_by_tight_boundary_box_1 = require("./cull-by-tight-boundary-box");
12
10
  function cullBezierPieces(bezierPieces, p) {
13
11
  const CULL_THRESHOLD = 0;
14
12
  if (bezierPieces.length > CULL_THRESHOLD) {
15
- let bestSquaredDistance = get_best_distance_squared_1.getBestDistanceSquared(bezierPieces, p);
16
- bezierPieces = cull_by_loose_bounding_box_1.cullByLooseBoundingBox(bezierPieces, p, bestSquaredDistance);
17
- bezierPieces = cull_by_tight_boundary_box_1.cullByTightBoundingBox(bezierPieces, p, bestSquaredDistance);
13
+ let bestSquaredDistance = getBestDistanceSquared(bezierPieces, p);
14
+ bezierPieces = cullByLooseBoundingBox(bezierPieces, p, bestSquaredDistance);
15
+ bezierPieces = cullByTightBoundingBox(bezierPieces, p, bestSquaredDistance);
18
16
  }
19
17
  return bezierPieces;
20
18
  }
21
- exports.cullBezierPieces = cullBezierPieces;
19
+ export { cullBezierPieces };
22
20
  //# sourceMappingURL=cull-bezier-pieces.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"cull-bezier-pieces.js","sourceRoot":"","sources":["../../../src/mat/closest-boundary-point/cull-bezier-pieces.ts"],"names":[],"mappings":";;AAEA,2EAAqE;AACrE,6EAAsE;AACtE,6EAAsE;AAGtE;;;;;GAKG;AACH,SAAS,gBAAgB,CACjB,YAA2B,EAC3B,CAAW;IAEf,MAAM,cAAc,GAAG,CAAC,CAAC;IAEzB,IAAI,YAAY,CAAC,MAAM,GAAG,cAAc,EAAE;QACtC,IAAI,mBAAmB,GAAG,kDAAsB,CAC5C,YAAY,EAAE,CAAC,CAClB,CAAC;QACF,YAAY,GAAG,mDAAsB,CACjC,YAAY,EAAE,CAAC,EACf,mBAAmB,CACtB,CAAC;QAEF,YAAY,GAAG,mDAAsB,CACjC,YAAY,EAAE,CAAC,EACf,mBAAmB,CACtB,CAAC;KACL;IAED,OAAO,YAAY,CAAC;AACxB,CAAC;AAGQ,4CAAgB"}
1
+ {"version":3,"file":"cull-bezier-pieces.js","sourceRoot":"","sources":["../../../src/mat/closest-boundary-point/cull-bezier-pieces.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,sBAAsB,EAAE,MAAM,gCAAgC,CAAC;AACxE,OAAO,EAAE,sBAAsB,EAAE,MAAM,iCAAiC,CAAC;AACzE,OAAO,EAAE,sBAAsB,EAAE,MAAM,iCAAiC,CAAC;AAGzE;;;;;GAKG;AACH,SAAS,gBAAgB,CACjB,YAA2B,EAC3B,CAAW;IAEf,MAAM,cAAc,GAAG,CAAC,CAAC;IAEzB,IAAI,YAAY,CAAC,MAAM,GAAG,cAAc,EAAE;QACtC,IAAI,mBAAmB,GAAG,sBAAsB,CAC5C,YAAY,EAAE,CAAC,CAClB,CAAC;QACF,YAAY,GAAG,sBAAsB,CACjC,YAAY,EAAE,CAAC,EACf,mBAAmB,CACtB,CAAC;QAEF,YAAY,GAAG,sBAAsB,CACjC,YAAY,EAAE,CAAC,EACf,mBAAmB,CACtB,CAAC;KACL;IAED,OAAO,YAAY,CAAC;AACxB,CAAC;AAGD,OAAO,EAAE,gBAAgB,EAAE,CAAA"}
@@ -1,4 +1,4 @@
1
- import { BezierPiece } from "../bezier-piece";
1
+ import { BezierPiece } from '../bezier-piece.js';
2
2
  /**
3
3
  * @hidden
4
4
  * When checking distances, ignore all those with closest possible distance
@@ -1,7 +1,5 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- const flo_bezier3_1 = require("flo-bezier3");
4
- const get_closest_square_distance_to_rect_1 = require("../geometry/get-closest-square-distance-to-rect");
1
+ import { getBoundingBox_ } from '../../get-bounding-box-.js';
2
+ import { getClosestSquareDistanceToRect } from '../geometry/get-closest-square-distance-to-rect.js';
5
3
  /**
6
4
  * @hidden
7
5
  * When checking distances, ignore all those with closest possible distance
@@ -15,13 +13,13 @@ function cullByLooseBoundingBox(bezierPieces, p, dSquared) {
15
13
  for (let i = 0; i < bezierPieces.length; i++) {
16
14
  let bezierPiece = bezierPieces[i];
17
15
  let ps = bezierPiece.curve.ps;
18
- let boundingBox = flo_bezier3_1.getBoundingBox(ps);
19
- let d = get_closest_square_distance_to_rect_1.getClosestSquareDistanceToRect(boundingBox, p);
16
+ let boundingBox = getBoundingBox_(ps);
17
+ let d = getClosestSquareDistanceToRect(boundingBox, p);
20
18
  if (d <= dSquared) {
21
19
  candidateBezierPieces.push(bezierPiece);
22
20
  }
23
21
  }
24
22
  return candidateBezierPieces;
25
23
  }
26
- exports.cullByLooseBoundingBox = cullByLooseBoundingBox;
24
+ export { cullByLooseBoundingBox };
27
25
  //# sourceMappingURL=cull-by-loose-bounding-box.js.map