flo-mat 2.0.1 → 2.0.3

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 (405) hide show
  1. package/.eslintrc.cjs +69 -0
  2. package/README.md +9 -27
  3. package/browser/index.js +29604 -7008
  4. package/browser/index.min.js +1 -2
  5. package/node/circle.d.ts +20 -20
  6. package/node/circle.js +31 -31
  7. package/node/circle.js.map +1 -1
  8. package/node/compare-curvatures-at-interface.d.ts +19 -19
  9. package/node/compare-curvatures-at-interface.js +124 -124
  10. package/node/compare-curvatures-at-interface.js.map +1 -1
  11. package/node/contact-point.d.ts +26 -26
  12. package/node/contact-point.js +25 -25
  13. package/node/cp-node/clone.d.ts +8 -8
  14. package/node/cp-node/clone.js +31 -31
  15. package/node/cp-node/clone.js.map +1 -1
  16. package/node/cp-node/remove.d.ts +9 -9
  17. package/node/cp-node/remove.js +19 -19
  18. package/node/cp-node/remove.js.map +1 -1
  19. package/node/cp-node.d.ts +202 -202
  20. package/node/cp-node.js +320 -320
  21. package/node/cp-node.js.map +1 -1
  22. package/node/curve.d.ts +46 -46
  23. package/node/curve.js +88 -88
  24. package/node/curve.js.map +1 -1
  25. package/node/debug/cp-node-for-debugging.d.ts +11 -11
  26. package/node/debug/cp-node-for-debugging.js +1 -1
  27. package/node/debug/debug-elem-types.d.ts +32 -32
  28. package/node/debug/debug-elem-types.js +1 -1
  29. package/node/debug/debug.d.ts +50 -50
  30. package/node/debug/debug.js +75 -75
  31. package/node/debug/functions/draw-elem/bounding-hull.d.ts +3 -3
  32. package/node/debug/functions/draw-elem/bounding-hull.js +7 -7
  33. package/node/debug/functions/draw-elem/bounding-hull.js.map +1 -1
  34. package/node/debug/functions/draw-elem/branch.d.ts +4 -4
  35. package/node/debug/functions/draw-elem/branch.js +22 -22
  36. package/node/debug/functions/draw-elem/branch.js.map +1 -1
  37. package/node/debug/functions/draw-elem/culls.d.ts +4 -4
  38. package/node/debug/functions/draw-elem/culls.js +21 -21
  39. package/node/debug/functions/draw-elem/culls.js.map +1 -1
  40. package/node/debug/functions/draw-elem/draw-circle-percent.d.ts +3 -3
  41. package/node/debug/functions/draw-elem/draw-circle-percent.js +12 -12
  42. package/node/debug/functions/draw-elem/draw-circle-percent.js.map +1 -1
  43. package/node/debug/functions/draw-elem/draw-elem.d.ts +8 -8
  44. package/node/debug/functions/draw-elem/draw-elem.js +45 -45
  45. package/node/debug/functions/draw-elem/draw-elem.js.map +1 -1
  46. package/node/debug/functions/draw-elem/dull-corner.d.ts +4 -4
  47. package/node/debug/functions/draw-elem/dull-corner.js +10 -10
  48. package/node/debug/functions/draw-elem/dull-corner.js.map +1 -1
  49. package/node/debug/functions/draw-elem/leaves.d.ts +4 -4
  50. package/node/debug/functions/draw-elem/leaves.js +12 -12
  51. package/node/debug/functions/draw-elem/leaves.js.map +1 -1
  52. package/node/debug/functions/draw-elem/loop.d.ts +4 -4
  53. package/node/debug/functions/draw-elem/loop.js +11 -11
  54. package/node/debug/functions/draw-elem/loops.d.ts +4 -4
  55. package/node/debug/functions/draw-elem/loops.js +6 -6
  56. package/node/debug/functions/draw-elem/loose-bounding-box.d.ts +3 -3
  57. package/node/debug/functions/draw-elem/loose-bounding-box.js +9 -9
  58. package/node/debug/functions/draw-elem/loose-bounding-box.js.map +1 -1
  59. package/node/debug/functions/draw-elem/mat.d.ts +4 -4
  60. package/node/debug/functions/draw-elem/mat.js +30 -30
  61. package/node/debug/functions/draw-elem/mat.js.map +1 -1
  62. package/node/debug/functions/draw-elem/max-vertex.d.ts +4 -4
  63. package/node/debug/functions/draw-elem/max-vertex.js +8 -8
  64. package/node/debug/functions/draw-elem/max-vertex.js.map +1 -1
  65. package/node/debug/functions/draw-elem/min-y.d.ts +4 -4
  66. package/node/debug/functions/draw-elem/min-y.js +13 -13
  67. package/node/debug/functions/draw-elem/min-y.js.map +1 -1
  68. package/node/debug/functions/draw-elem/one-prong-at-dull-corner.d.ts +4 -4
  69. package/node/debug/functions/draw-elem/one-prong-at-dull-corner.js +12 -12
  70. package/node/debug/functions/draw-elem/one-prong-at-dull-corner.js.map +1 -1
  71. package/node/debug/functions/draw-elem/one-prong.d.ts +4 -4
  72. package/node/debug/functions/draw-elem/one-prong.js +16 -16
  73. package/node/debug/functions/draw-elem/one-prong.js.map +1 -1
  74. package/node/debug/functions/draw-elem/sharp-corner.d.ts +4 -4
  75. package/node/debug/functions/draw-elem/sharp-corner.js +9 -9
  76. package/node/debug/functions/draw-elem/sharp-corner.js.map +1 -1
  77. package/node/debug/functions/draw-elem/three-prong.d.ts +4 -4
  78. package/node/debug/functions/draw-elem/three-prong.js +16 -16
  79. package/node/debug/functions/draw-elem/three-prong.js.map +1 -1
  80. package/node/debug/functions/draw-elem/tight-bounding-box.d.ts +3 -3
  81. package/node/debug/functions/draw-elem/tight-bounding-box.js +7 -7
  82. package/node/debug/functions/draw-elem/tight-bounding-box.js.map +1 -1
  83. package/node/debug/functions/draw-elem/two-prong.d.ts +4 -4
  84. package/node/debug/functions/draw-elem/two-prong.js +36 -36
  85. package/node/debug/functions/draw-elem/two-prong.js.map +1 -1
  86. package/node/debug/functions/draw-elem/vertex.d.ts +4 -4
  87. package/node/debug/functions/draw-elem/vertex.js +27 -27
  88. package/node/debug/functions/draw-elem/vertex.js.map +1 -1
  89. package/node/debug/functions/general.d.ts +48 -48
  90. package/node/debug/functions/general.js +52 -52
  91. package/node/debug/functions/general.js.map +1 -1
  92. package/node/debug/functions/three-prong.d.ts +11 -11
  93. package/node/debug/functions/three-prong.js +184 -184
  94. package/node/debug/functions/three-prong.js.map +1 -1
  95. package/node/debug/functions/two-prong.d.ts +13 -13
  96. package/node/debug/functions/two-prong.js +117 -117
  97. package/node/debug/functions/two-prong.js.map +1 -1
  98. package/node/debug/three-prong-for-debugging.d.ts +31 -31
  99. package/node/debug/three-prong-for-debugging.js +20 -20
  100. package/node/debug/two-prong-for-debugging.d.ts +26 -26
  101. package/node/debug/two-prong-for-debugging.js +1 -1
  102. package/node/find-mats.d.ts +26 -26
  103. package/node/find-mats.js +122 -125
  104. package/node/find-mats.js.map +1 -1
  105. package/node/get-boundary-bezier-parts-to-next.d.ts +9 -9
  106. package/node/get-boundary-bezier-parts-to-next.js +42 -42
  107. package/node/get-boundary-bezier-parts-to-next.js.map +1 -1
  108. package/node/get-boundary-beziers-to-next.d.ts +8 -8
  109. package/node/get-boundary-beziers-to-next.js +44 -44
  110. package/node/get-boundary-beziers-to-next.js.map +1 -1
  111. package/node/get-bounding-box-.d.ts +2 -2
  112. package/node/get-bounding-box-.js +4 -4
  113. package/node/get-branches.d.ts +12 -12
  114. package/node/get-branches.js +68 -68
  115. package/node/get-branches.js.map +1 -1
  116. package/node/get-curve/get-curve-between.d.ts +9 -9
  117. package/node/get-curve/get-curve-between.js +56 -56
  118. package/node/get-curve/get-curve-between.js.map +1 -1
  119. package/node/get-curve/get-edge-direction.d.ts +9 -9
  120. package/node/get-curve/get-edge-direction.js +53 -53
  121. package/node/get-curve/get-edge-direction.js.map +1 -1
  122. package/node/get-curve-to-next.d.ts +9 -9
  123. package/node/get-curve-to-next.js +11 -11
  124. package/node/get-interface-ccw.d.ts +24 -24
  125. package/node/get-interface-ccw.js +97 -97
  126. package/node/get-interface-ccw.js.map +1 -1
  127. package/node/index.d.ts +36 -36
  128. package/node/index.js +32 -32
  129. package/node/loop/get-max-coordinate.d.ts +10 -10
  130. package/node/loop/get-max-coordinate.js +43 -43
  131. package/node/loop/get-max-coordinate.js.map +1 -1
  132. package/node/loop.d.ts +16 -16
  133. package/node/loop.js +34 -34
  134. package/node/loop.js.map +1 -1
  135. package/node/mat/add-to-cp-graph.d.ts +16 -16
  136. package/node/mat/add-to-cp-graph.js +30 -30
  137. package/node/mat/add-to-cp-graph.js.map +1 -1
  138. package/node/mat/bezier-piece.d.ts +12 -12
  139. package/node/mat/bezier-piece.js +1 -1
  140. package/node/mat/closest-boundary-point/closest-points-on-curve.d.ts +14 -14
  141. package/node/mat/closest-boundary-point/closest-points-on-curve.js +72 -73
  142. package/node/mat/closest-boundary-point/closest-points-on-curve.js.map +1 -1
  143. package/node/mat/closest-boundary-point/cull-bezier-pieces.d.ts +9 -9
  144. package/node/mat/closest-boundary-point/cull-bezier-pieces.js +19 -19
  145. package/node/mat/closest-boundary-point/cull-bezier-pieces.js.map +1 -1
  146. package/node/mat/closest-boundary-point/cull-by-loose-bounding-box.d.ts +11 -11
  147. package/node/mat/closest-boundary-point/cull-by-loose-bounding-box.js +24 -24
  148. package/node/mat/closest-boundary-point/cull-by-loose-bounding-box.js.map +1 -1
  149. package/node/mat/closest-boundary-point/cull-by-tight-boundary-box.d.ts +11 -11
  150. package/node/mat/closest-boundary-point/cull-by-tight-boundary-box.js +26 -26
  151. package/node/mat/closest-boundary-point/cull-by-tight-boundary-box.js.map +1 -1
  152. package/node/mat/closest-boundary-point/get-best-distance-squared.d.ts +8 -8
  153. package/node/mat/closest-boundary-point/get-best-distance-squared.js +24 -24
  154. package/node/mat/closest-boundary-point/get-best-distance-squared.js.map +1 -1
  155. package/node/mat/closest-boundary-point/get-close-boundary-points.d.ts +17 -17
  156. package/node/mat/closest-boundary-point/get-close-boundary-points.js +80 -80
  157. package/node/mat/closest-boundary-point/get-close-boundary-points.js.map +1 -1
  158. package/node/mat/closest-boundary-point/get-closest-boundary-point.d.ts +18 -18
  159. package/node/mat/closest-boundary-point/get-closest-boundary-point.js +40 -40
  160. package/node/mat/closest-boundary-point/get-closest-boundary-point.js.map +1 -1
  161. package/node/mat/corner.d.ts +37 -37
  162. package/node/mat/corner.js +1 -1
  163. package/node/mat/create-new-cp-tree.d.ts +9 -9
  164. package/node/mat/create-new-cp-tree.js +23 -23
  165. package/node/mat/create-new-cp-tree.js.map +1 -1
  166. package/node/mat/elem-type-two-prong.d.ts +3 -3
  167. package/node/mat/elem-type-two-prong.js +1 -1
  168. package/node/mat/find-mat/add-1-prong.d.ts +12 -12
  169. package/node/mat/find-mat/add-1-prong.js +42 -42
  170. package/node/mat/find-mat/add-1-prong.js.map +1 -1
  171. package/node/mat/find-mat/add-2-prong.d.ts +21 -21
  172. package/node/mat/find-mat/add-2-prong.js +192 -192
  173. package/node/mat/find-mat/add-2-prong.js.map +1 -1
  174. package/node/mat/find-mat/add-3-prong.d.ts +19 -19
  175. package/node/mat/find-mat/add-3-prong.js +54 -54
  176. package/node/mat/find-mat/add-3-prong.js.map +1 -1
  177. package/node/mat/find-mat/add-debug-info.d.ts +9 -9
  178. package/node/mat/find-mat/add-debug-info.js +67 -69
  179. package/node/mat/find-mat/add-debug-info.js.map +1 -1
  180. package/node/mat/find-mat/create-get-interesting-points-on-loop.d.ts +11 -11
  181. package/node/mat/find-mat/create-get-interesting-points-on-loop.js +51 -51
  182. package/node/mat/find-mat/create-get-interesting-points-on-loop.js.map +1 -1
  183. package/node/mat/find-mat/create-initial-cp-graph.d.ts +12 -12
  184. package/node/mat/find-mat/create-initial-cp-graph.js +40 -40
  185. package/node/mat/find-mat/create-initial-cp-graph.js.map +1 -1
  186. package/node/mat/find-mat/find-2-prong/add-debug-info.d.ts +8 -8
  187. package/node/mat/find-mat/find-2-prong/add-debug-info.js +21 -21
  188. package/node/mat/find-mat/find-2-prong/add-debug-info.js.map +1 -1
  189. package/node/mat/find-mat/find-2-prong/cull-bezier-pieces.d.ts +11 -11
  190. package/node/mat/find-mat/find-2-prong/cull-bezier-pieces.js +29 -29
  191. package/node/mat/find-mat/find-2-prong/cull-bezier-pieces.js.map +1 -1
  192. package/node/mat/find-mat/find-2-prong/find-2-prong.d.ts +37 -37
  193. package/node/mat/find-mat/find-2-prong/find-2-prong.js +232 -232
  194. package/node/mat/find-mat/find-2-prong/find-2-prong.js.map +1 -1
  195. package/node/mat/find-mat/find-2-prong/find-equidistant-point-on-line.d.ts +9 -9
  196. package/node/mat/find-mat/find-2-prong/find-equidistant-point-on-line.js +39 -39
  197. package/node/mat/find-mat/find-2-prong/find-equidistant-point-on-line.js.map +1 -1
  198. package/node/mat/find-mat/find-2-prong/get-initial-bezier-pieces.d.ts +11 -11
  199. package/node/mat/find-mat/find-2-prong/get-initial-bezier-pieces.js +37 -37
  200. package/node/mat/find-mat/find-2-prong/get-initial-bezier-pieces.js.map +1 -1
  201. package/node/mat/find-mat/find-2-prong/x-for-debugging.d.ts +9 -9
  202. package/node/mat/find-mat/find-2-prong/x-for-debugging.js +1 -1
  203. package/node/mat/find-mat/find-3-prong/calc-better-x.d.ts +19 -19
  204. package/node/mat/find-mat/find-3-prong/calc-better-x.js +36 -36
  205. package/node/mat/find-mat/find-3-prong/calc-better-x.js.map +1 -1
  206. package/node/mat/find-mat/find-3-prong/calc-initial-3-prong-center.d.ts +13 -13
  207. package/node/mat/find-mat/find-3-prong/calc-initial-3-prong-center.js +25 -25
  208. package/node/mat/find-mat/find-3-prong/calc-initial-3-prong-center.js.map +1 -1
  209. package/node/mat/find-mat/find-3-prong/find-3-prong-for-delta3s.d.ts +22 -22
  210. package/node/mat/find-mat/find-3-prong/find-3-prong-for-delta3s.js +159 -159
  211. package/node/mat/find-mat/find-3-prong/find-3-prong-for-delta3s.js.map +1 -1
  212. package/node/mat/find-mat/find-3-prong/find-3-prong.d.ts +16 -16
  213. package/node/mat/find-mat/find-3-prong/find-3-prong.js +76 -76
  214. package/node/mat/find-mat/find-3-prong/find-3-prong.js.map +1 -1
  215. package/node/mat/find-mat/find-3-prong/get-closest-points.d.ts +9 -9
  216. package/node/mat/find-mat/find-3-prong/get-closest-points.js +16 -16
  217. package/node/mat/find-mat/find-3-prong/get-closest-points.js.map +1 -1
  218. package/node/mat/find-mat/find-and-add-2-prongs-on-all-paths.d.ts +15 -15
  219. package/node/mat/find-mat/find-and-add-2-prongs-on-all-paths.js +20 -20
  220. package/node/mat/find-mat/find-and-add-2-prongs-on-all-paths.js.map +1 -1
  221. package/node/mat/find-mat/find-and-add-2-prongs.d.ts +16 -16
  222. package/node/mat/find-mat/find-and-add-2-prongs.js +73 -74
  223. package/node/mat/find-mat/find-and-add-2-prongs.js.map +1 -1
  224. package/node/mat/find-mat/find-and-add-3-prongs.d.ts +13 -13
  225. package/node/mat/find-mat/find-and-add-3-prongs.js +146 -147
  226. package/node/mat/find-mat/find-and-add-3-prongs.js.map +1 -1
  227. package/node/mat/find-mat/find-and-add-hole-closing-2-prongs.d.ts +14 -14
  228. package/node/mat/find-mat/find-and-add-hole-closing-2-prongs.js +33 -33
  229. package/node/mat/find-mat/find-and-add-hole-closing-2-prongs.js.map +1 -1
  230. package/node/mat/find-mat/get-potential-2-prongs.d.ts +4 -4
  231. package/node/mat/find-mat/get-potential-2-prongs.js +16 -16
  232. package/node/mat/find-mat/get-potential-2-prongs.js.map +1 -1
  233. package/node/mat/find-mat/get-sharp-corners.d.ts +4 -4
  234. package/node/mat/find-mat/get-sharp-corners.js +17 -17
  235. package/node/mat/find-mat/get-sharp-corners.js.map +1 -1
  236. package/node/mat/geometry/get-closest-square-distance-to-rect.d.ts +5 -5
  237. package/node/mat/geometry/get-closest-square-distance-to-rect.js +49 -49
  238. package/node/mat/geometry/get-closest-squared-distance-to-rotated-rect.d.ts +5 -5
  239. package/node/mat/geometry/get-closest-squared-distance-to-rotated-rect.js +15 -15
  240. package/node/mat/geometry/get-closest-squared-distance-to-rotated-rect.js.map +1 -1
  241. package/node/mat/get-boundary-piece-beziers.d.ts +11 -11
  242. package/node/mat/get-boundary-piece-beziers.js +58 -58
  243. package/node/mat/get-boundary-piece-beziers.js.map +1 -1
  244. package/node/mat/get-contact-circles-at-interface.d.ts +8 -8
  245. package/node/mat/get-contact-circles-at-interface.js +20 -20
  246. package/node/mat/get-contact-circles-at-interface.js.map +1 -1
  247. package/node/mat/get-largest-vertex.d.ts +4 -4
  248. package/node/mat/get-largest-vertex.js +9 -9
  249. package/node/mat/get-leaves.d.ts +4 -4
  250. package/node/mat/get-leaves.js +12 -12
  251. package/node/mat/get-leaves.js.map +1 -1
  252. package/node/mat/get-neighboring-cps.d.ts +14 -14
  253. package/node/mat/get-neighboring-cps.js +30 -30
  254. package/node/mat/get-neighboring-cps.js.map +1 -1
  255. package/node/mat/get-two-prong-type.d.ts +5 -5
  256. package/node/mat/get-two-prong-type.js +8 -8
  257. package/node/mat/is-another-cp-closeby.d.ts +20 -20
  258. package/node/mat/is-another-cp-closeby.js +55 -55
  259. package/node/mat/is-another-cp-closeby.js.map +1 -1
  260. package/node/mat/simplify-mat-map-only.d.ts +23 -23
  261. package/node/mat/simplify-mat-map-only.js +80 -80
  262. package/node/mat/simplify-mat-map-only.js.map +1 -1
  263. package/node/mat/to-scale-axis/add-debug-info.d.ts +7 -7
  264. package/node/mat/to-scale-axis/add-debug-info.js +13 -13
  265. package/node/mat/to-scale-axis/add-debug-info.js.map +1 -1
  266. package/node/mat/to-scale-axis/cull-non-cycles.d.ts +9 -9
  267. package/node/mat/to-scale-axis/cull-non-cycles.js +51 -51
  268. package/node/mat/to-scale-axis/cull-non-cycles.js.map +1 -1
  269. package/node/mat/to-scale-axis/cull.d.ts +12 -12
  270. package/node/mat/to-scale-axis/cull.js +132 -132
  271. package/node/mat/to-scale-axis/cull.js.map +1 -1
  272. package/node/mat/trim-mat.d.ts +8 -8
  273. package/node/mat/trim-mat.js +16 -16
  274. package/node/mat/trim-mat.js.map +1 -1
  275. package/node/mat.d.ts +22 -22
  276. package/node/mat.js +1 -1
  277. package/node/point-on-shape.d.ts +73 -73
  278. package/node/point-on-shape.js +167 -167
  279. package/node/point-on-shape.js.map +1 -1
  280. package/node/simplify-mat.d.ts +16 -16
  281. package/node/simplify-mat.js +71 -71
  282. package/node/simplify-mat.js.map +1 -1
  283. package/node/svg/get-loop-bounds.d.ts +12 -12
  284. package/node/svg/get-loop-bounds.js +80 -80
  285. package/node/svg/get-loop-bounds.js.map +1 -1
  286. package/node/svg/get-min-y-pos.d.ts +8 -8
  287. package/node/svg/get-min-y-pos.js +9 -9
  288. package/node/svg/get-shape-bounds.d.ts +9 -9
  289. package/node/svg/get-shape-bounds.js +35 -35
  290. package/node/svg/get-shape-bounds.js.map +1 -1
  291. package/node/sweep-line/sweep-line.d.ts +18 -18
  292. package/node/sweep-line/sweep-line.js +72 -72
  293. package/node/sweep-line/sweep-line.js.map +1 -1
  294. package/node/to-scale-axis.d.ts +16 -16
  295. package/node/to-scale-axis.js +74 -73
  296. package/node/to-scale-axis.js.map +1 -1
  297. package/node/traverse-edges.d.ts +10 -10
  298. package/node/traverse-edges.js +21 -21
  299. package/node/traverse-edges.js.map +1 -1
  300. package/node/traverse-vertices.d.ts +12 -12
  301. package/node/traverse-vertices.js +27 -27
  302. package/node/traverse-vertices.js.map +1 -1
  303. package/package.json +29 -24
  304. package/src/circle.ts +3 -3
  305. package/src/compare-curvatures-at-interface.ts +36 -36
  306. package/src/cp-node/clone.ts +6 -6
  307. package/src/cp-node/remove.ts +4 -4
  308. package/src/cp-node.ts +20 -20
  309. package/src/curve.ts +19 -19
  310. package/src/debug/functions/draw-elem/bounding-hull.ts +2 -2
  311. package/src/debug/functions/draw-elem/branch.ts +4 -4
  312. package/src/debug/functions/draw-elem/culls.ts +4 -4
  313. package/src/debug/functions/draw-elem/draw-circle-percent.ts +2 -2
  314. package/src/debug/functions/draw-elem/draw-elem.ts +1 -1
  315. package/src/debug/functions/draw-elem/dull-corner.ts +3 -3
  316. package/src/debug/functions/draw-elem/leaves.ts +4 -4
  317. package/src/debug/functions/draw-elem/loose-bounding-box.ts +2 -2
  318. package/src/debug/functions/draw-elem/mat.ts +4 -4
  319. package/src/debug/functions/draw-elem/max-vertex.ts +2 -2
  320. package/src/debug/functions/draw-elem/min-y.ts +3 -3
  321. package/src/debug/functions/draw-elem/one-prong-at-dull-corner.ts +4 -4
  322. package/src/debug/functions/draw-elem/one-prong.ts +4 -4
  323. package/src/debug/functions/draw-elem/sharp-corner.ts +2 -2
  324. package/src/debug/functions/draw-elem/three-prong.ts +7 -7
  325. package/src/debug/functions/draw-elem/tight-bounding-box.ts +1 -1
  326. package/src/debug/functions/draw-elem/two-prong.ts +1 -1
  327. package/src/debug/functions/draw-elem/vertex.ts +20 -14
  328. package/src/debug/functions/general.ts +3 -3
  329. package/src/debug/functions/three-prong.ts +37 -37
  330. package/src/debug/functions/two-prong.ts +15 -15
  331. package/src/find-mats.ts +19 -19
  332. package/src/get-boundary-bezier-parts-to-next.ts +8 -8
  333. package/src/get-boundary-beziers-to-next.ts +8 -8
  334. package/src/get-branches.ts +7 -7
  335. package/src/get-curve/get-curve-between.ts +21 -21
  336. package/src/get-curve/get-edge-direction.ts +13 -14
  337. package/src/get-interface-ccw.ts +12 -12
  338. package/src/loop/get-max-coordinate.ts +7 -7
  339. package/src/loop.ts +4 -4
  340. package/src/mat/add-to-cp-graph.ts +8 -8
  341. package/src/mat/closest-boundary-point/closest-points-on-curve.ts +5 -6
  342. package/src/mat/closest-boundary-point/cull-bezier-pieces.ts +1 -1
  343. package/src/mat/closest-boundary-point/cull-by-loose-bounding-box.ts +5 -5
  344. package/src/mat/closest-boundary-point/cull-by-tight-boundary-box.ts +5 -5
  345. package/src/mat/closest-boundary-point/get-best-distance-squared.ts +5 -5
  346. package/src/mat/closest-boundary-point/get-close-boundary-points.ts +15 -15
  347. package/src/mat/closest-boundary-point/get-closest-boundary-point.ts +4 -4
  348. package/src/mat/cmp-cp-on-delta.ts +5 -5
  349. package/src/mat/create-new-cp-tree.ts +3 -3
  350. package/src/mat/find-mat/add-1-prong.ts +5 -5
  351. package/src/mat/find-mat/add-2-prong.ts +42 -42
  352. package/src/mat/find-mat/add-3-prong.ts +1 -1
  353. package/src/mat/find-mat/add-debug-info.ts +18 -20
  354. package/src/mat/find-mat/create-get-interesting-points-on-loop.ts +4 -4
  355. package/src/mat/find-mat/create-initial-cp-graph.ts +11 -11
  356. package/src/mat/find-mat/find-2-prong/add-debug-info.ts +4 -4
  357. package/src/mat/find-mat/find-2-prong/cull-bezier-pieces.ts +5 -5
  358. package/src/mat/find-mat/find-2-prong/find-2-prong.ts +27 -27
  359. package/src/mat/find-mat/find-2-prong/find-equidistant-point-on-line.ts +7 -7
  360. package/src/mat/find-mat/find-2-prong/get-initial-bezier-pieces.ts +4 -4
  361. package/src/mat/find-mat/find-3-prong/calc-better-x.ts +4 -4
  362. package/src/mat/find-mat/find-3-prong/calc-initial-3-prong-center.ts +3 -3
  363. package/src/mat/find-mat/find-3-prong/find-3-prong-for-delta3s.ts +37 -37
  364. package/src/mat/find-mat/find-3-prong/find-3-prong.ts +16 -16
  365. package/src/mat/find-mat/find-3-prong/get-closest-points.ts +1 -1
  366. package/src/mat/find-mat/find-and-add-2-prongs-on-all-paths.ts +2 -2
  367. package/src/mat/find-mat/find-and-add-2-prongs.ts +14 -16
  368. package/src/mat/find-mat/find-and-add-3-prongs.ts +19 -19
  369. package/src/mat/find-mat/find-and-add-hole-closing-2-prongs.ts +6 -6
  370. package/src/mat/find-mat/get-potential-2-prongs.ts +4 -4
  371. package/src/mat/find-mat/get-sharp-corners.ts +4 -4
  372. package/src/mat/find-mat/get-total-abs-curvature.ts +1 -1
  373. package/src/mat/geometry/get-closest-squared-distance-to-rotated-rect.ts +3 -3
  374. package/src/mat/get-boundary-piece-beziers.ts +5 -5
  375. package/src/mat/get-contact-circles-at-interface.ts +1 -1
  376. package/src/mat/get-edges-as-array.ts +2 -2
  377. package/src/mat/get-leaves.ts +2 -2
  378. package/src/mat/get-neighboring-cps.ts +1 -1
  379. package/src/mat/is-another-cp-closeby.ts +9 -9
  380. package/src/mat/simplify-mat-map-only.ts +15 -15
  381. package/src/mat/to-scale-axis/add-debug-info.ts +6 -3
  382. package/src/mat/to-scale-axis/add-to-tree.ts +10 -10
  383. package/src/mat/to-scale-axis/calc-groups.ts +19 -19
  384. package/src/mat/to-scale-axis/create-spacial-tree.ts +4 -4
  385. package/src/mat/to-scale-axis/cull-non-cycles.ts +5 -5
  386. package/src/mat/to-scale-axis/cull.ts +5 -5
  387. package/src/mat/to-scale-axis/get-engulfed-vertices.ts +18 -18
  388. package/src/mat/trim-mat.ts +1 -1
  389. package/src/point-on-shape.ts +16 -16
  390. package/src/simplify-mat.ts +10 -10
  391. package/src/svg/get-curvature-at-interface.ts +6 -8
  392. package/src/svg/get-extreme.ts +1 -1
  393. package/src/svg/get-loop-bounds.ts +13 -13
  394. package/src/svg/get-shape-bounds.ts +4 -4
  395. package/src/sweep-line/are-boxes-intersecting.ts +4 -4
  396. package/src/sweep-line/sweep-line.ts +8 -8
  397. package/src/to-scale-axis.ts +18 -17
  398. package/src/traverse-edges.ts +2 -2
  399. package/src/traverse-vertices.ts +2 -2
  400. package/tsconfig.json +0 -1
  401. package/webpack.config.cjs +12 -63
  402. package/browser/index.min.js.LICENSE.txt +0 -2819
  403. package/browser/index.module.js +0 -7149
  404. package/browser/index.module.min.js +0 -2
  405. package/browser/index.module.min.js.LICENSE.txt +0 -2819
@@ -1,73 +1,73 @@
1
- /** @hidden */
2
- const EVENT_LEFT = 0;
3
- /** @hidden */
4
- const EVENT_RIGHT = 1;
5
- /**
6
- * @hidden
7
- * Generalized sweepline algorithm.
8
- *
9
- * Typically used to turn O(n^2) algorithms into roughly O(n logn) algorithms.
10
- *
11
- * @param items An array of items that are to be compared. Items should
12
- * typically be geometric objects in 2d space with well-defined left and right
13
- * endpoints.
14
- * @param getLeftmostPoint A function that returns the leftmost point of the
15
- * geometric object of interest.
16
- * @param getRightmostPoint A function that returns the rightmost point of the
17
- * geometric object of interest.
18
- * @param predicate A predicate that takes two geometric objects and returns
19
- * true if they are of interest or false otherwise.
20
- */
21
- function sweepLine(items, getLeftmost, getRightmost, predicate) {
22
- // Initialize event queue to contain all endpoints.
23
- let events = [];
24
- for (let item of items) {
25
- events.push({
26
- type: EVENT_LEFT,
27
- item,
28
- x: getLeftmost(item)
29
- });
30
- events.push({
31
- type: EVENT_RIGHT,
32
- item,
33
- x: getRightmost(item)
34
- });
35
- }
36
- events.sort(compare);
37
- let activeItems = new Set();
38
- /** A list of pairs of items that passed the predicate */
39
- let pairedItems = [];
40
- for (let event of events) {
41
- let { item } = event;
42
- if (event.type === EVENT_LEFT) {
43
- for (let activeItem of activeItems.values()) {
44
- if (predicate(item, activeItem)) {
45
- pairedItems.push([item, activeItem]);
46
- }
47
- }
48
- activeItems.add(item);
49
- }
50
- else if (event.type === EVENT_RIGHT) {
51
- activeItems.delete(event.item);
52
- }
53
- }
54
- return pairedItems;
55
- }
56
- /**
57
- * @hidden
58
- * Compare two Events by their x-axis and then by their type. Since it is
59
- * open boxes that are compared we must let the right endpoint type come
60
- * before the left.
61
- * @param a An event
62
- * @param b Another event
63
- */
64
- function compare(a, b) {
65
- let res = a.x - b.x;
66
- if (res !== 0) {
67
- return res;
68
- }
69
- // Alwys put left events before right ones.
70
- return a.type === EVENT_LEFT ? -1 : +1;
71
- }
72
- export { sweepLine };
1
+ /** @hidden */
2
+ const EVENT_LEFT = 0;
3
+ /** @hidden */
4
+ const EVENT_RIGHT = 1;
5
+ /**
6
+ * @hidden
7
+ * Generalized sweepline algorithm.
8
+ *
9
+ * Typically used to turn O(n^2) algorithms into roughly O(n logn) algorithms.
10
+ *
11
+ * @param items An array of items that are to be compared. Items should
12
+ * typically be geometric objects in 2d space with well-defined left and right
13
+ * endpoints.
14
+ * @param getLeftmostPoint A function that returns the leftmost point of the
15
+ * geometric object of interest.
16
+ * @param getRightmostPoint A function that returns the rightmost point of the
17
+ * geometric object of interest.
18
+ * @param predicate A predicate that takes two geometric objects and returns
19
+ * true if they are of interest or false otherwise.
20
+ */
21
+ function sweepLine(items, getLeftmost, getRightmost, predicate) {
22
+ // Initialize event queue to contain all endpoints.
23
+ const events = [];
24
+ for (const item of items) {
25
+ events.push({
26
+ type: EVENT_LEFT,
27
+ item,
28
+ x: getLeftmost(item)
29
+ });
30
+ events.push({
31
+ type: EVENT_RIGHT,
32
+ item,
33
+ x: getRightmost(item)
34
+ });
35
+ }
36
+ events.sort(compare);
37
+ const activeItems = new Set();
38
+ /** A list of pairs of items that passed the predicate */
39
+ const pairedItems = [];
40
+ for (const event of events) {
41
+ const { item } = event;
42
+ if (event.type === EVENT_LEFT) {
43
+ for (const activeItem of activeItems.values()) {
44
+ if (predicate(item, activeItem)) {
45
+ pairedItems.push([item, activeItem]);
46
+ }
47
+ }
48
+ activeItems.add(item);
49
+ }
50
+ else if (event.type === EVENT_RIGHT) {
51
+ activeItems.delete(event.item);
52
+ }
53
+ }
54
+ return pairedItems;
55
+ }
56
+ /**
57
+ * @hidden
58
+ * Compare two Events by their x-axis and then by their type. Since it is
59
+ * open boxes that are compared we must let the right endpoint type come
60
+ * before the left.
61
+ * @param a An event
62
+ * @param b Another event
63
+ */
64
+ function compare(a, b) {
65
+ const res = a.x - b.x;
66
+ if (res !== 0) {
67
+ return res;
68
+ }
69
+ // Alwys put left events before right ones.
70
+ return a.type === EVENT_LEFT ? -1 : +1;
71
+ }
72
+ export { sweepLine };
73
73
  //# sourceMappingURL=sweep-line.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"sweep-line.js","sourceRoot":"","sources":["../../src/sweep-line/sweep-line.ts"],"names":[],"mappings":"AACA,cAAc;AACd,MAAM,UAAU,GAAI,CAAC,CAAC;AACtB,cAAc;AACd,MAAM,WAAW,GAAG,CAAC,CAAC;AAOtB;;;;;;;;;;;;;;;GAeG;AACH,SAAS,SAAS,CACV,KAAU,EACV,WAAgC,EAChC,YAAiC,EACjC,SAA0C;IAE9C,mDAAmD;IACnD,IAAI,MAAM,GAAgB,EAAE,CAAC;IAChC,KAAK,IAAI,IAAI,IAAI,KAAK,EAAE;QACvB,MAAM,CAAC,IAAI,CAAC;YACF,IAAI,EAAE,UAAU;YAChB,IAAI;YACJ,CAAC,EAAE,WAAW,CAAC,IAAI,CAAC;SACvB,CAAC,CAAC;QACT,MAAM,CAAC,IAAI,CAAC;YACF,IAAI,EAAE,WAAW;YACjB,IAAI;YACJ,CAAC,EAAE,YAAY,CAAC,IAAI,CAAC;SACxB,CAAC,CAAC;KACT;IAED,MAAM,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;IAErB,IAAI,WAAW,GAAG,IAAI,GAAG,EAAK,CAAC;IAE5B,yDAAyD;IAC5D,IAAI,WAAW,GAAY,EAAE,CAAC;IAC9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C,OAAO,CAAC,CAAC,IAAI,KAAK,UAAU,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;AAC3C,CAAC;AAGD,OAAO,EAAE,SAAS,EAAE,CAAA"}
@@ -1,16 +1,16 @@
1
- import { Mat } from './mat.js';
2
- /** @hidden */
3
- /**
4
- * Apply and returns an enhanced version of the Scale Axis Transform (SAT) to
5
- * the given MAT. The returned SAT is guaranteed to be a subset of the MAT and
6
- * preserves topology at any scale.
7
- *
8
- * Typically the MAT contains too many branches caused by minute details on the
9
- * boundary of the shape. The SAT is a simplification of the MAT that preserves
10
- * less detail the higher the applied scale factor. The severity at which noise
11
- * are removed depends on the local scale of the shape.
12
- * @param mat The Medial Axis Transform ([[Mat]]) on which to apply the SAT.
13
- * @param s The scale factor >= 1 (e.g. 1.3)
14
- */
15
- declare function toScaleAxis(mat: Mat, s: number, f?: (s: number) => (r: number) => number): Mat;
16
- export { toScaleAxis };
1
+ import { Mat } from './mat.js';
2
+ /** @hidden */
3
+ /**
4
+ * Apply and returns an enhanced version of the Scale Axis Transform (SAT) to
5
+ * the given MAT. The returned SAT is guaranteed to be a subset of the MAT and
6
+ * preserves topology at any scale.
7
+ *
8
+ * Typically the MAT contains too many branches caused by minute details on the
9
+ * boundary of the shape. The SAT is a simplification of the MAT that preserves
10
+ * less detail the higher the applied scale factor. The severity at which noise
11
+ * are removed depends on the local scale of the shape.
12
+ * @param mat The Medial Axis Transform ([[Mat]]) on which to apply the SAT.
13
+ * @param s The scale factor >= 1 (e.g. 1.3)
14
+ */
15
+ declare function toScaleAxis(mat: Mat, s: number, f?: (s: number) => (r: number) => number): Mat;
16
+ export { toScaleAxis };
@@ -1,74 +1,75 @@
1
- import { length } from 'flo-bezier3';
2
- import { traverseEdges } from './traverse-edges.js';
3
- import { traverseVertices } from './traverse-vertices.js';
4
- import { getLargestVertex } from './mat/get-largest-vertex.js';
5
- import { getLeaves } from './mat/get-leaves.js';
6
- import { cull } from './mat/to-scale-axis/cull.js';
7
- import { addDebugInfo } from './mat/to-scale-axis/add-debug-info.js';
8
- import { clone } from './cp-node/clone.js';
9
- import { getCurveToNext } from './get-curve-to-next.js';
10
- function linearScale(s) {
11
- return function (r) {
12
- return s * r;
13
- };
14
- }
15
- /** @hidden */
16
- //let len = length([0,1]);
17
- /**
18
- * Apply and returns an enhanced version of the Scale Axis Transform (SAT) to
19
- * the given MAT. The returned SAT is guaranteed to be a subset of the MAT and
20
- * preserves topology at any scale.
21
- *
22
- * Typically the MAT contains too many branches caused by minute details on the
23
- * boundary of the shape. The SAT is a simplification of the MAT that preserves
24
- * less detail the higher the applied scale factor. The severity at which noise
25
- * are removed depends on the local scale of the shape.
26
- * @param mat The Medial Axis Transform ([[Mat]]) on which to apply the SAT.
27
- * @param s The scale factor >= 1 (e.g. 1.3)
28
- */
29
- function toScaleAxis(mat, s, f = linearScale) {
30
- if (typeof _debug_ !== 'undefined') {
31
- var timingStart = performance.now();
32
- let leaves = getLeaves(mat.cpNode);
33
- _debug_.generated.elems.leaves.push(leaves);
34
- }
35
- /** The largest vertex (as measured by its inscribed disk) */
36
- let cpNodes = [];
37
- traverseVertices(clone(mat.cpNode), cpNode => { cpNodes.push(cpNode); });
38
- let cpNode = getLargestVertex(cpNodes);
39
- let f_ = f(s);
40
- if (typeof _debug_ !== 'undefined') {
41
- _debug_.generated.elems.maxVertex.push(cpNode);
42
- }
43
- /**
44
- * All vertices that are set to be culled initially. This may change later
45
- * in order to preserve topology.
46
- */
47
- let culls = new Set();
48
- let rMap = new Map();
49
- traverseEdges(cpNode, function (cpNode) {
50
- /** The occulating radius stored with this vertex. */
51
- let R = rMap.get(cpNode) || f_(cpNode.cp.circle.radius);
52
- let cpNode_ = cpNode.next;
53
- let l = length([0, 1], getCurveToNext(cpNode));
54
- let r = cpNode_.cp.circle.radius;
55
- let r_ = f_(r);
56
- if (R - l > r_) {
57
- for (let cpNode of cpNode_.getCpNodesOnCircle()) {
58
- rMap.set(cpNode, R - l); // Update osculating radii
59
- }
60
- culls.add(cpNode_.cp.circle);
61
- }
62
- });
63
- cull(culls, cpNode);
64
- if (typeof _debug_ !== 'undefined') {
65
- _debug_.generated.elems.culls.push(Array.from(culls));
66
- }
67
- // TODO - put line below back - goes into infinite loop
68
- //let sat: Mat = { cpNode, cpTrees: createNewCpTree(cpNode) };
69
- let sat = { cpNode, cpTrees: undefined };
70
- addDebugInfo(sat, timingStart);
71
- return sat;
72
- }
73
- export { toScaleAxis };
1
+ import { length } from 'flo-bezier3';
2
+ import { traverseEdges } from './traverse-edges.js';
3
+ import { traverseVertices } from './traverse-vertices.js';
4
+ import { getLargestVertex } from './mat/get-largest-vertex.js';
5
+ import { getLeaves } from './mat/get-leaves.js';
6
+ import { cull } from './mat/to-scale-axis/cull.js';
7
+ import { addDebugInfo } from './mat/to-scale-axis/add-debug-info.js';
8
+ import { clone } from './cp-node/clone.js';
9
+ import { getCurveToNext } from './get-curve-to-next.js';
10
+ function linearScale(s) {
11
+ return function (r) {
12
+ return s * r;
13
+ };
14
+ }
15
+ /** @hidden */
16
+ //let len = length([0,1]);
17
+ /**
18
+ * Apply and returns an enhanced version of the Scale Axis Transform (SAT) to
19
+ * the given MAT. The returned SAT is guaranteed to be a subset of the MAT and
20
+ * preserves topology at any scale.
21
+ *
22
+ * Typically the MAT contains too many branches caused by minute details on the
23
+ * boundary of the shape. The SAT is a simplification of the MAT that preserves
24
+ * less detail the higher the applied scale factor. The severity at which noise
25
+ * are removed depends on the local scale of the shape.
26
+ * @param mat The Medial Axis Transform ([[Mat]]) on which to apply the SAT.
27
+ * @param s The scale factor >= 1 (e.g. 1.3)
28
+ */
29
+ function toScaleAxis(mat, s, f = linearScale) {
30
+ let timingStart = 0;
31
+ if (typeof _debug_ !== 'undefined') {
32
+ timingStart = performance.now();
33
+ const leaves = getLeaves(mat.cpNode);
34
+ _debug_.generated.elems.leaves.push(leaves);
35
+ }
36
+ /** The largest vertex (as measured by its inscribed disk) */
37
+ const cpNodes = [];
38
+ traverseVertices(clone(mat.cpNode), cpNode => { cpNodes.push(cpNode); });
39
+ const cpNode = getLargestVertex(cpNodes);
40
+ const f_ = f(s);
41
+ if (typeof _debug_ !== 'undefined') {
42
+ _debug_.generated.elems.maxVertex.push(cpNode);
43
+ }
44
+ /**
45
+ * All vertices that are set to be culled initially. This may change later
46
+ * in order to preserve topology.
47
+ */
48
+ const culls = new Set();
49
+ const rMap = new Map();
50
+ traverseEdges(cpNode, function (cpNode) {
51
+ /** The occulating radius stored with this vertex. */
52
+ const R = rMap.get(cpNode) || f_(cpNode.cp.circle.radius);
53
+ const cpNode_ = cpNode.next;
54
+ const l = length([0, 1], getCurveToNext(cpNode));
55
+ const r = cpNode_.cp.circle.radius;
56
+ const r_ = f_(r);
57
+ if (R - l > r_) {
58
+ for (const cpNode of cpNode_.getCpNodesOnCircle()) {
59
+ rMap.set(cpNode, R - l); // Update osculating radii
60
+ }
61
+ culls.add(cpNode_.cp.circle);
62
+ }
63
+ });
64
+ cull(culls, cpNode);
65
+ if (typeof _debug_ !== 'undefined') {
66
+ _debug_.generated.elems.culls.push(Array.from(culls));
67
+ }
68
+ // TODO - put line below back - goes into infinite loop
69
+ //const sat: Mat = { cpNode, cpTrees: createNewCpTree(cpNode) };
70
+ const sat = { cpNode, cpTrees: undefined };
71
+ addDebugInfo(sat, timingStart);
72
+ return sat;
73
+ }
74
+ export { toScaleAxis };
74
75
  //# sourceMappingURL=to-scale-axis.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"to-scale-axis.js","sourceRoot":"","sources":["../src/to-scale-axis.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,MAAM,EAAE,MAAM,aAAa,CAAC;AAKrC,OAAO,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAC;AACpD,OAAO,EAAE,gBAAgB,EAAE,MAAM,wBAAwB,CAAC;AAC1D,OAAO,EAAE,gBAAgB,EAAE,MAAM,6BAA6B,CAAC;AAE/D,OAAO,EAAE,SAAS,EAAE,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;IAEpB,IAAI,OAAO,OAAO,KAAK,WAAW,EAAE;QACnC,OAAO,CAAC,SAAS,CAAC,KAAK,CAAC,KAAK,CAAC,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC;KACtD;IAED,uDAAuD;IACvD,gEAAgE;IAChE,MAAM,GAAG,GAAQ,EAAE,MAAM,EAAE,OAAO,EAAE,SAAS,EAAE,CAAC;IAEhD,YAAY,CAAC,GAAG,EAAE,WAAW,CAAC,CAAC;IAE/B,OAAO,GAAG,CAAC;AACZ,CAAC;AAGD,OAAO,EAAE,WAAW,EAAE,CAAA"}
@@ -1,10 +1,10 @@
1
- import { CpNode } from './cp-node.js';
2
- /**
3
- * Traverses all edges (depth first) of the given MAT tree starting at the given
4
- * vertex (represented by a [[CpNode]]).
5
- * @param cpNode Any [[CpNode]] representing the start vertex.
6
- * @param f A callback function for each CpNode representing the vertex at the
7
- * start of an edge.
8
- */
9
- declare function traverseEdges(cpNode: CpNode, f: (cpNode: CpNode) => void): void;
10
- export { traverseEdges };
1
+ import { CpNode } from './cp-node.js';
2
+ /**
3
+ * Traverses all edges (depth first) of the given MAT tree starting at the given
4
+ * vertex (represented by a [[CpNode]]).
5
+ * @param cpNode Any [[CpNode]] representing the start vertex.
6
+ * @param f A callback function for each CpNode representing the vertex at the
7
+ * start of an edge.
8
+ */
9
+ declare function traverseEdges(cpNode: CpNode, f: (cpNode: CpNode) => void): void;
10
+ export { traverseEdges };
@@ -1,22 +1,22 @@
1
- /**
2
- * Traverses all edges (depth first) of the given MAT tree starting at the given
3
- * vertex (represented by a [[CpNode]]).
4
- * @param cpNode Any [[CpNode]] representing the start vertex.
5
- * @param f A callback function for each CpNode representing the vertex at the
6
- * start of an edge.
7
- */
8
- function traverseEdges(cpNode, f) {
9
- // Since the tree is unrooted we must iterate in all directions from the
10
- // given vertex.
11
- let cps = cpNode.getCpNodesOnCircle();
12
- while (cps.length) {
13
- let cp = cps.pop();
14
- f(cp);
15
- if (cp.isTerminating()) {
16
- continue;
17
- }
18
- cps.push(...cp.getChildren());
19
- }
20
- }
21
- export { traverseEdges };
1
+ /**
2
+ * Traverses all edges (depth first) of the given MAT tree starting at the given
3
+ * vertex (represented by a [[CpNode]]).
4
+ * @param cpNode Any [[CpNode]] representing the start vertex.
5
+ * @param f A callback function for each CpNode representing the vertex at the
6
+ * start of an edge.
7
+ */
8
+ function traverseEdges(cpNode, f) {
9
+ // Since the tree is unrooted we must iterate in all directions from the
10
+ // given vertex.
11
+ const cps = cpNode.getCpNodesOnCircle();
12
+ while (cps.length) {
13
+ const cp = cps.pop();
14
+ f(cp);
15
+ if (cp.isTerminating()) {
16
+ continue;
17
+ }
18
+ cps.push(...cp.getChildren());
19
+ }
20
+ }
21
+ export { traverseEdges };
22
22
  //# sourceMappingURL=traverse-edges.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"traverse-edges.js","sourceRoot":"","sources":["../src/traverse-edges.ts"],"names":[],"mappings":"AAGA;;;;;;IAMI;AACJ,SAAS,aAAa,CACpB,MAAc,EACd,CAA2B;IAE5B,wEAAwE;IACxE,gBAAgB;IAChB,IAAI,GAAG,GAAG,MAAM,CAAC,kBAAkB,EAAE,CAAC;IAEtC,OAAO,GAAG,CAAC,MAAM,EAAE;QAClB,IAAI,EAAE,GAAG,GAAG,CAAC,GAAG,EAAE,CAAC;QACnB,CAAC,CAAC,EAAE,CAAC,CAAC;QAEN,IAAI,EAAE,CAAC,aAAa,EAAE,EAAE;YAAE,SAAS;SAAE;QACrC,GAAG,CAAC,IAAI,CAAC,GAAG,EAAE,CAAC,WAAW,EAAE,CAAC,CAAC;KAC9B;AACF,CAAC;AAGD,OAAO,EAAE,aAAa,EAAE,CAAA"}
1
+ {"version":3,"file":"traverse-edges.js","sourceRoot":"","sources":["../src/traverse-edges.ts"],"names":[],"mappings":"AAGA;;;;;;IAMI;AACJ,SAAS,aAAa,CACpB,MAAc,EACd,CAA2B;IAE5B,wEAAwE;IACxE,gBAAgB;IAChB,MAAM,GAAG,GAAG,MAAM,CAAC,kBAAkB,EAAE,CAAC;IAExC,OAAO,GAAG,CAAC,MAAM,EAAE;QAClB,MAAM,EAAE,GAAG,GAAG,CAAC,GAAG,EAAE,CAAC;QACrB,CAAC,CAAC,EAAE,CAAC,CAAC;QAEN,IAAI,EAAE,CAAC,aAAa,EAAE,EAAE;YAAE,SAAS;SAAE;QACrC,GAAG,CAAC,IAAI,CAAC,GAAG,EAAE,CAAC,WAAW,EAAE,CAAC,CAAC;KAC9B;AACF,CAAC;AAGD,OAAO,EAAE,aAAa,EAAE,CAAA"}
@@ -1,12 +1,12 @@
1
- import { CpNode } from './cp-node.js';
2
- /**
3
- * Traverses the MAT tree and calls the given callback function for each vertex
4
- * (represented by a [[CpNode]]) on the MAT.
5
- *
6
- * It is usually preferable to use [[traverseEdges]] as it allows for the
7
- * traversal of all the smooth curves representing the MAT.
8
- * @param cpNode Any [[CpNode]] representing the start vertex.
9
- * @param f A callback function taking a single [[CpNode]] as parameter.
10
- */
11
- declare function traverseVertices(cpNode: CpNode, f: (cpNode: CpNode) => void): void;
12
- export { traverseVertices };
1
+ import { CpNode } from './cp-node.js';
2
+ /**
3
+ * Traverses the MAT tree and calls the given callback function for each vertex
4
+ * (represented by a [[CpNode]]) on the MAT.
5
+ *
6
+ * It is usually preferable to use [[traverseEdges]] as it allows for the
7
+ * traversal of all the smooth curves representing the MAT.
8
+ * @param cpNode Any [[CpNode]] representing the start vertex.
9
+ * @param f A callback function taking a single [[CpNode]] as parameter.
10
+ */
11
+ declare function traverseVertices(cpNode: CpNode, f: (cpNode: CpNode) => void): void;
12
+ export { traverseVertices };
@@ -1,28 +1,28 @@
1
- /**
2
- * Traverses the MAT tree and calls the given callback function for each vertex
3
- * (represented by a [[CpNode]]) on the MAT.
4
- *
5
- * It is usually preferable to use [[traverseEdges]] as it allows for the
6
- * traversal of all the smooth curves representing the MAT.
7
- * @param cpNode Any [[CpNode]] representing the start vertex.
8
- * @param f A callback function taking a single [[CpNode]] as parameter.
9
- */
10
- function traverseVertices(cpNode, f) {
11
- f(cpNode);
12
- // Since the tree is unrooted we must iterate in all directions from the
13
- // given cpNode.
14
- cpNode.getCpNodesOnCircle()
15
- .filter(cpNode => !cpNode.isTerminating())
16
- .map(cpNode => cpNode.next)
17
- .forEach(f_);
18
- function f_(cpNode) {
19
- let cps = [cpNode];
20
- while (cps.length) {
21
- let cp = cps.pop();
22
- f(cp);
23
- cps.push(...cp.vertexChildren);
24
- }
25
- }
26
- }
27
- export { traverseVertices };
1
+ /**
2
+ * Traverses the MAT tree and calls the given callback function for each vertex
3
+ * (represented by a [[CpNode]]) on the MAT.
4
+ *
5
+ * It is usually preferable to use [[traverseEdges]] as it allows for the
6
+ * traversal of all the smooth curves representing the MAT.
7
+ * @param cpNode Any [[CpNode]] representing the start vertex.
8
+ * @param f A callback function taking a single [[CpNode]] as parameter.
9
+ */
10
+ function traverseVertices(cpNode, f) {
11
+ f(cpNode);
12
+ // Since the tree is unrooted we must iterate in all directions from the
13
+ // given cpNode.
14
+ cpNode.getCpNodesOnCircle()
15
+ .filter(cpNode => !cpNode.isTerminating())
16
+ .map(cpNode => cpNode.next)
17
+ .forEach(f_);
18
+ function f_(cpNode) {
19
+ const cps = [cpNode];
20
+ while (cps.length) {
21
+ const cp = cps.pop();
22
+ f(cp);
23
+ cps.push(...cp.vertexChildren);
24
+ }
25
+ }
26
+ }
27
+ export { traverseVertices };
28
28
  //# sourceMappingURL=traverse-vertices.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"traverse-vertices.js","sourceRoot":"","sources":["../src/traverse-vertices.ts"],"names":[],"mappings":"AAGA;;;;;;;;GAQG;AACH,SAAS,gBAAgB,CACvB,MAAc,EACd,CAA2B;IAE5B,CAAC,CAAC,MAAM,CAAC,CAAC;IAEV,wEAAwE;IACxE,iBAAiB;IACjB,MAAM,CAAC,kBAAkB,EAAE;SACzB,MAAM,CAAC,MAAM,CAAC,EAAE,CAAC,CAAC,MAAM,CAAC,aAAa,EAAE,CAAC;SACzC,GAAG,CAAC,MAAM,CAAC,EAAE,CAAC,MAAM,CAAC,IAAI,CAAC;SAC1B,OAAO,CAAC,EAAE,CAAC,CAAC;IAEd,SAAS,EAAE,CAAC,MAAc;QACzB,IAAI,GAAG,GAAG,CAAC,MAAM,CAAC,CAAC;QACnB,OAAO,GAAG,CAAC,MAAM,EAAE;YAClB,IAAI,EAAE,GAAG,GAAG,CAAC,GAAG,EAAE,CAAC;YACnB,CAAC,CAAC,EAAE,CAAC,CAAC;YACN,GAAG,CAAC,IAAI,CAAC,GAAG,EAAE,CAAC,cAAc,CAAC,CAAC;SAC/B;IACF,CAAC;AACF,CAAC;AAGD,OAAO,EAAE,gBAAgB,EAAE,CAAA"}
1
+ {"version":3,"file":"traverse-vertices.js","sourceRoot":"","sources":["../src/traverse-vertices.ts"],"names":[],"mappings":"AAGA;;;;;;;;GAQG;AACH,SAAS,gBAAgB,CACvB,MAAc,EACd,CAA2B;IAE5B,CAAC,CAAC,MAAM,CAAC,CAAC;IAEV,wEAAwE;IACxE,iBAAiB;IACjB,MAAM,CAAC,kBAAkB,EAAE;SACzB,MAAM,CAAC,MAAM,CAAC,EAAE,CAAC,CAAC,MAAM,CAAC,aAAa,EAAE,CAAC;SACzC,GAAG,CAAC,MAAM,CAAC,EAAE,CAAC,MAAM,CAAC,IAAI,CAAC;SAC1B,OAAO,CAAC,EAAE,CAAC,CAAC;IAEd,SAAS,EAAE,CAAC,MAAc;QACzB,MAAM,GAAG,GAAG,CAAC,MAAM,CAAC,CAAC;QACrB,OAAO,GAAG,CAAC,MAAM,EAAE;YAClB,MAAM,EAAE,GAAG,GAAG,CAAC,GAAG,EAAE,CAAC;YACrB,CAAC,CAAC,EAAE,CAAC,CAAC;YACN,GAAG,CAAC,IAAI,CAAC,GAAG,EAAE,CAAC,cAAc,CAAC,CAAC;SAC/B;IACF,CAAC;AACF,CAAC;AAGD,OAAO,EAAE,gBAAgB,EAAE,CAAA"}
package/package.json CHANGED
@@ -1,7 +1,8 @@
1
1
  {
2
2
  "name": "flo-mat",
3
+ "sideEffects": false,
3
4
  "description": "Medial / Scale Axis Transform (MAT/SAT) Library.",
4
- "version": "2.0.1",
5
+ "version": "2.0.3",
5
6
  "author": {
6
7
  "name": "Floris Steenkamp"
7
8
  },
@@ -30,33 +31,37 @@
30
31
  "skeleton"
31
32
  ],
32
33
  "dependencies": {
33
- "big-float-ts": "^3.0.2",
34
- "double-double": "^2.0.6",
35
- "flo-bezier3": "^4.0.1",
36
- "flo-boolean": "^2.1.1",
37
- "flo-draw": "^2.0.0",
38
- "flo-gauss-quadrature": "^2.1.1",
39
- "flo-ll-rb-tree": "^0.3.2",
40
- "flo-memoize": "^1.0.0",
41
- "flo-poly": "^6.0.4",
42
- "flo-vector2d": "^4.0.1"
34
+ "big-float-ts": "^3.0.3",
35
+ "double-double": "^2.0.7",
36
+ "flo-bezier3": "^4.1.4",
37
+ "flo-boolean": "^2.1.6",
38
+ "flo-draw": "^2.0.2",
39
+ "flo-gauss-quadrature": "^2.1.2",
40
+ "flo-ll-rb-tree": "^0.3.3",
41
+ "flo-memoize": "^1.0.2",
42
+ "flo-poly": "^6.0.5",
43
+ "flo-vector2d": "^4.0.2"
43
44
  },
44
45
  "devDependencies": {
45
- "@types/chai": "^4.3.3",
46
- "@types/mocha": "^10.0.0",
47
- "@types/node": "^18.11.8",
48
- "c8": "^7.12.0",
49
- "chai": "^4.3.6",
50
- "mocha": "^10.1.0",
51
- "rimraf": "^3.0.2",
46
+ "@types/chai": "^4.3.4",
47
+ "@types/mocha": "^10.0.1",
48
+ "@types/node": "^18.15.11",
49
+ "@typescript-eslint/eslint-plugin": "^5.58.0",
50
+ "@typescript-eslint/parser": "^5.58.0",
51
+ "c8": "^7.13.0",
52
+ "chai": "^4.3.7",
53
+ "circular-dependency-plugin": "^5.2.2",
54
+ "eslint": "^8.38.0",
55
+ "eslint-plugin-tree-shaking": "^1.10.0",
56
+ "mocha": "^10.2.0",
57
+ "resolve-typescript-plugin": "^2.0.1",
58
+ "rimraf": "^5.0.0",
52
59
  "source-map-support": "^0.5.21",
53
- "ts-loader": "^9.4.1",
60
+ "ts-loader": "^9.4.2",
54
61
  "ts-node": "^10.9.1",
55
- "typescript": "^4.8.4",
56
- "webpack": "^5.74.0",
57
- "webpack-cli": "^4.10.0",
58
- "circular-dependency-plugin": "^5.2.2",
59
- "resolve-typescript-plugin": "^1.2.0"
62
+ "typescript": "^5.0.4",
63
+ "webpack": "^5.78.0",
64
+ "webpack-cli": "^5.0.1"
60
65
  },
61
66
  "scripts": {
62
67
  "build": "npm run build-browser && npm run build-node",
package/src/circle.ts CHANGED
@@ -30,9 +30,9 @@ function engulfsCircle(c1: Circle, c2: Circle) {
30
30
  return false;
31
31
  }
32
32
 
33
- let d = squaredDistanceBetween(c1.center, c2.center);
34
- let dr = c1.radius - c2.radius;
35
- let δ = dr*dr;
33
+ const d = squaredDistanceBetween(c1.center, c2.center);
34
+ const dr = c1.radius - c2.radius;
35
+ const δ = dr*dr;
36
36
 
37
37
  return δ > d;
38
38
  }