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,21 +1,21 @@
1
- import { LlRbTree } from 'flo-ll-rb-tree';
2
- import { Loop } from '../../loop.js';
3
- import { CpNode } from '../../cp-node.js';
4
- import { Circle } from '../../circle.js';
5
- import { IPointOnShape } from '../../point-on-shape.js';
6
- /**
7
- * @hidden
8
- * Adds a 2-prong contact circle to the shape.
9
- * @param cpGraphs
10
- * @param circle Circle containing the 2 contact points
11
- * @param posSource The source point on shape
12
- * @param posAntipode The found antipodal point on shape
13
- * @param holeClosing True if this is a hole-closing 2-prong, false otherwise
14
- * @param extreme The maximum coordinate value used to calculate floating point
15
- * tolerances.
16
- */
17
- declare function add2Prong(cpGraphs: Map<Loop, LlRbTree<CpNode>>, circle: Circle, posSource: IPointOnShape, posAntipodes: {
18
- pos: IPointOnShape;
19
- d: number;
20
- }[], holeClosing: boolean, extreme: number): CpNode;
21
- export { add2Prong };
1
+ import { LlRbTree } from 'flo-ll-rb-tree';
2
+ import { Loop } from '../../loop.js';
3
+ import { CpNode } from '../../cp-node.js';
4
+ import { Circle } from '../../circle.js';
5
+ import { IPointOnShape } from '../../point-on-shape.js';
6
+ /**
7
+ * @hidden
8
+ * Adds a 2-prong contact circle to the shape.
9
+ * @param cpGraphs
10
+ * @param circle Circle containing the 2 contact points
11
+ * @param posSource The source point on shape
12
+ * @param posAntipode The found antipodal point on shape
13
+ * @param holeClosing True if this is a hole-closing 2-prong, false otherwise
14
+ * @param extreme The maximum coordinate value used to calculate floating point
15
+ * tolerances.
16
+ */
17
+ declare function add2Prong(cpGraphs: Map<Loop, LlRbTree<CpNode>>, circle: Circle, posSource: IPointOnShape, posAntipodes: {
18
+ pos: IPointOnShape;
19
+ d: number;
20
+ }[], holeClosing: boolean, extreme: number): CpNode;
21
+ export { add2Prong };
@@ -1,193 +1,193 @@
1
- import { exponent } from 'big-float-ts';
2
- import { CpNode } from '../../cp-node.js';
3
- import { PointOnShape, calcPosOrder } from '../../point-on-shape.js';
4
- import { isAnotherCpCloseby } from '../is-another-cp-closeby.js';
5
- import { getNeighbouringPoints } from '../get-neighboring-cps.js';
6
- /**
7
- * @hidden
8
- * Adds a 2-prong contact circle to the shape.
9
- * @param cpGraphs
10
- * @param circle Circle containing the 2 contact points
11
- * @param posSource The source point on shape
12
- * @param posAntipode The found antipodal point on shape
13
- * @param holeClosing True if this is a hole-closing 2-prong, false otherwise
14
- * @param extreme The maximum coordinate value used to calculate floating point
15
- * tolerances.
16
- */
17
- function add2Prong(cpGraphs, circle, posSource, posAntipodes, holeClosing, extreme) {
18
- //let orderSource = PointOnShape.calcOrder(circle, posSource);
19
- let orderSource = calcPosOrder(circle, posSource);
20
- let orderAntipodes = posAntipodes.map(posAntipode => {
21
- //console.log(circle.center)
22
- //return PointOnShape.calcOrder(circle, posAntipode.pos);
23
- return calcPosOrder(circle, posAntipode.pos);
24
- });
25
- let t_s = posSource.t;
26
- let curve;
27
- if (t_s === 0) {
28
- t_s = 1;
29
- curve = posSource.curve.prev;
30
- posSource = new PointOnShape(curve, t_s);
31
- }
32
- // Make sure there isn't already a ContactPoint close by - it can cause
33
- // floating point stability issues.
34
- // TODO - possibly combine n-prongs in this case
35
- let isCloseByAntipodes = false;
36
- for (let i = 0; i < posAntipodes.length; i++) {
37
- let posAntipode = posAntipodes[i];
38
- let orderAntipode = orderAntipodes[i];
39
- if (isAnotherCpCloseby(cpGraphs, posAntipode.pos, circle, orderAntipode, 0, extreme, 'red')) {
40
- isCloseByAntipodes = true;
41
- break;
42
- }
43
- }
44
- if (isAnotherCpCloseby(cpGraphs, posSource, circle, orderSource, 0, extreme, 'red') ||
45
- isCloseByAntipodes) {
46
- if (typeof _debug_ !== 'undefined') {
47
- if (holeClosing) {
48
- _debug_.generated.elems['twoProng_holeClosing'].pop();
49
- }
50
- else {
51
- _debug_.generated.elems['twoProng_regular'].pop();
52
- }
53
- }
54
- return;
55
- }
56
- // Antipode
57
- let newCpAntipodes = [];
58
- let cpAntipodes = [];
59
- let cpTreeAntipodes = [];
60
- let deltaAntipodes = [];
61
- let loopAntipodes = [];
62
- for (let i = 0; i < posAntipodes.length; i++) {
63
- let posAntipode = posAntipodes[i];
64
- let orderAntipode = orderAntipodes[i];
65
- let cpAntipode = { pointOnShape: posAntipode.pos, circle, order: orderAntipode, order2: 0 };
66
- cpAntipodes.push(cpAntipode);
67
- let loopAntipode = posAntipode.pos.curve.loop;
68
- loopAntipodes.push(loopAntipode);
69
- let cpTreeAntipode = cpGraphs.get(loopAntipode);
70
- cpTreeAntipodes.push(cpTreeAntipode);
71
- let deltaAntipode = getNeighbouringPoints(cpTreeAntipode, posAntipode.pos, orderAntipode, 0);
72
- deltaAntipodes.push(deltaAntipode);
73
- newCpAntipodes.push(CpNode.insert(holeClosing, false, cpTreeAntipode, cpAntipode, deltaAntipode[0]));
74
- }
75
- // Source
76
- let cpSource = { pointOnShape: posSource, circle, order: orderSource, order2: 0 };
77
- let loopSource = posSource.curve.loop;
78
- let cpTreeSource = cpGraphs.get(loopSource);
79
- let deltaSource = getNeighbouringPoints(cpTreeSource, posSource, orderSource, 0);
80
- let newCpSource = CpNode.insert(holeClosing, false, cpTreeSource, cpSource, deltaSource[0]);
81
- // Connect graph
82
- if (newCpAntipodes.length === 1) {
83
- newCpSource.prevOnCircle = newCpAntipodes[0];
84
- newCpSource.nextOnCircle = newCpAntipodes[0];
85
- newCpAntipodes[0].prevOnCircle = newCpSource;
86
- newCpAntipodes[0].nextOnCircle = newCpSource;
87
- }
88
- else {
89
- let cpNodes = newCpAntipodes.slice();
90
- cpNodes.push(newCpSource);
91
- // Order points according to their angle with the x-axis
92
- cpNodes.sort(byAngle(circle));
93
- for (let i = 0; i < cpNodes.length; i++) {
94
- let iNext = (i + 1 === cpNodes.length) ? 0 : i + 1;
95
- let iPrev = (i === 0) ? cpNodes.length - 1 : i - 1;
96
- let cpNodeCurr = cpNodes[i];
97
- let cpNodeNext = cpNodes[iNext];
98
- let cpNodePrev = cpNodes[iPrev];
99
- cpNodeCurr.nextOnCircle = cpNodeNext;
100
- cpNodeCurr.prevOnCircle = cpNodePrev;
101
- }
102
- }
103
- if (holeClosing) {
104
- // TODO - important - take care of case where there are more than 1 antipode
105
- // Duplicate ContactPoints
106
- let cpB2 = { pointOnShape: posAntipodes[0].pos, circle, order: cpAntipodes[0].order, order2: +1 };
107
- let newCpB2Node = CpNode.insert(true, false, cpTreeAntipodes[0], cpB2, newCpAntipodes[0]);
108
- let cpB1 = { pointOnShape: posSource, circle, order: cpSource.order, order2: -1 };
109
- let newCpB1Node = CpNode.insert(true, false, cpTreeSource, cpB1, newCpSource.prev);
110
- // Connect graph
111
- newCpB1Node.prevOnCircle = newCpB2Node;
112
- newCpB1Node.nextOnCircle = newCpB2Node;
113
- newCpB2Node.prevOnCircle = newCpB1Node;
114
- newCpB2Node.nextOnCircle = newCpB1Node;
115
- newCpAntipodes[0].next = newCpSource;
116
- newCpSource.prev = newCpAntipodes[0];
117
- newCpB1Node.next = newCpB2Node;
118
- newCpB2Node.prev = newCpB1Node;
119
- }
120
- if (typeof _debug_ !== 'undefined') {
121
- let elems;
122
- if (holeClosing) {
123
- elems = _debug_.generated.elems['twoProng_holeClosing'];
124
- }
125
- else {
126
- elems = _debug_.generated.elems['twoProng_regular'];
127
- }
128
- let elem = elems[elems.length - 1];
129
- if (!newCpSource) {
130
- console.log('asas');
131
- }
132
- elem.cpNode = newCpSource;
133
- }
134
- return newCpSource;
135
- }
136
- /** @hidden */
137
- function scale(n, exp) {
138
- return n * (2 ** -(exp + 1));
139
- }
140
- /** @hidden */
141
- function getSize(x, y) {
142
- // Get size of a
143
- if (x > 0) {
144
- if (x > 0.5) {
145
- return y; // ~ -0.7 -> 0.7, i.e. -(sqrt(2)/2) -> +(sqrt(2)/2)
146
- }
147
- else {
148
- if (y < 0) {
149
- return x - 2; // ~ -2.0 -> -1.3
150
- }
151
- else {
152
- return -x + 2; // ~ 1.3 -> 2.0
153
- }
154
- }
155
- }
156
- else {
157
- if (x < -0.5) {
158
- return -y + 4; // ~ 3.3 -> 4.7
159
- }
160
- else {
161
- if (y < 0) {
162
- return x + 6; // ~ 5.3 -> 6.0
163
- }
164
- else {
165
- return -x + 2; // ~ 2 -> 2.7
166
- }
167
- }
168
- }
169
- }
170
- /** @hidden */
171
- function byAngle(circle) {
172
- let c = circle.center;
173
- let r = circle.radius;
174
- let exp = exponent(r);
175
- return function (_a, _b) {
176
- let a = _a.cp.pointOnShape.p;
177
- let b = _b.cp.pointOnShape.p;
178
- // Move onto origin
179
- a = [a[0] - c[0], a[1] - c[1]];
180
- b = [b[0] - c[0], b[1] - c[1]];
181
- // Scale
182
- let ax = scale(a[0], exp);
183
- let ay = scale(a[1], exp);
184
- let bx = scale(b[0], exp);
185
- let by = scale(b[1], exp);
186
- // Get 'size'
187
- let sa = getSize(ax, ay);
188
- let sb = getSize(bx, by);
189
- return sb - sa;
190
- };
191
- }
192
- export { add2Prong };
1
+ import { exponent } from 'big-float-ts';
2
+ import { CpNode } from '../../cp-node.js';
3
+ import { PointOnShape, calcPosOrder } from '../../point-on-shape.js';
4
+ import { isAnotherCpCloseby } from '../is-another-cp-closeby.js';
5
+ import { getNeighbouringPoints } from '../get-neighboring-cps.js';
6
+ /**
7
+ * @hidden
8
+ * Adds a 2-prong contact circle to the shape.
9
+ * @param cpGraphs
10
+ * @param circle Circle containing the 2 contact points
11
+ * @param posSource The source point on shape
12
+ * @param posAntipode The found antipodal point on shape
13
+ * @param holeClosing True if this is a hole-closing 2-prong, false otherwise
14
+ * @param extreme The maximum coordinate value used to calculate floating point
15
+ * tolerances.
16
+ */
17
+ function add2Prong(cpGraphs, circle, posSource, posAntipodes, holeClosing, extreme) {
18
+ //let orderSource = PointOnShape.calcOrder(circle, posSource);
19
+ const orderSource = calcPosOrder(circle, posSource);
20
+ const orderAntipodes = posAntipodes.map(posAntipode => {
21
+ //console.log(circle.center)
22
+ //return PointOnShape.calcOrder(circle, posAntipode.pos);
23
+ return calcPosOrder(circle, posAntipode.pos);
24
+ });
25
+ let t_s = posSource.t;
26
+ let curve;
27
+ if (t_s === 0) {
28
+ t_s = 1;
29
+ curve = posSource.curve.prev;
30
+ posSource = new PointOnShape(curve, t_s);
31
+ }
32
+ // Make sure there isn't already a ContactPoint close by - it can cause
33
+ // floating point stability issues.
34
+ // TODO - possibly combine n-prongs in this case
35
+ let isCloseByAntipodes = false;
36
+ for (let i = 0; i < posAntipodes.length; i++) {
37
+ const posAntipode = posAntipodes[i];
38
+ const orderAntipode = orderAntipodes[i];
39
+ if (isAnotherCpCloseby(cpGraphs, posAntipode.pos, circle, orderAntipode, 0, extreme, 'red')) {
40
+ isCloseByAntipodes = true;
41
+ break;
42
+ }
43
+ }
44
+ if (isAnotherCpCloseby(cpGraphs, posSource, circle, orderSource, 0, extreme, 'red') ||
45
+ isCloseByAntipodes) {
46
+ if (typeof _debug_ !== 'undefined') {
47
+ if (holeClosing) {
48
+ _debug_.generated.elems['twoProng_holeClosing'].pop();
49
+ }
50
+ else {
51
+ _debug_.generated.elems['twoProng_regular'].pop();
52
+ }
53
+ }
54
+ return;
55
+ }
56
+ // Antipode
57
+ const newCpAntipodes = [];
58
+ const cpAntipodes = [];
59
+ const cpTreeAntipodes = [];
60
+ const deltaAntipodes = [];
61
+ const loopAntipodes = [];
62
+ for (let i = 0; i < posAntipodes.length; i++) {
63
+ const posAntipode = posAntipodes[i];
64
+ const orderAntipode = orderAntipodes[i];
65
+ const cpAntipode = { pointOnShape: posAntipode.pos, circle, order: orderAntipode, order2: 0 };
66
+ cpAntipodes.push(cpAntipode);
67
+ const loopAntipode = posAntipode.pos.curve.loop;
68
+ loopAntipodes.push(loopAntipode);
69
+ const cpTreeAntipode = cpGraphs.get(loopAntipode);
70
+ cpTreeAntipodes.push(cpTreeAntipode);
71
+ const deltaAntipode = getNeighbouringPoints(cpTreeAntipode, posAntipode.pos, orderAntipode, 0);
72
+ deltaAntipodes.push(deltaAntipode);
73
+ newCpAntipodes.push(CpNode.insert(holeClosing, false, cpTreeAntipode, cpAntipode, deltaAntipode[0]));
74
+ }
75
+ // Source
76
+ const cpSource = { pointOnShape: posSource, circle, order: orderSource, order2: 0 };
77
+ const loopSource = posSource.curve.loop;
78
+ const cpTreeSource = cpGraphs.get(loopSource);
79
+ const deltaSource = getNeighbouringPoints(cpTreeSource, posSource, orderSource, 0);
80
+ const newCpSource = CpNode.insert(holeClosing, false, cpTreeSource, cpSource, deltaSource[0]);
81
+ // Connect graph
82
+ if (newCpAntipodes.length === 1) {
83
+ newCpSource.prevOnCircle = newCpAntipodes[0];
84
+ newCpSource.nextOnCircle = newCpAntipodes[0];
85
+ newCpAntipodes[0].prevOnCircle = newCpSource;
86
+ newCpAntipodes[0].nextOnCircle = newCpSource;
87
+ }
88
+ else {
89
+ const cpNodes = newCpAntipodes.slice();
90
+ cpNodes.push(newCpSource);
91
+ // Order points according to their angle with the x-axis
92
+ cpNodes.sort(byAngle(circle));
93
+ for (let i = 0; i < cpNodes.length; i++) {
94
+ const iNext = (i + 1 === cpNodes.length) ? 0 : i + 1;
95
+ const iPrev = (i === 0) ? cpNodes.length - 1 : i - 1;
96
+ const cpNodeCurr = cpNodes[i];
97
+ const cpNodeNext = cpNodes[iNext];
98
+ const cpNodePrev = cpNodes[iPrev];
99
+ cpNodeCurr.nextOnCircle = cpNodeNext;
100
+ cpNodeCurr.prevOnCircle = cpNodePrev;
101
+ }
102
+ }
103
+ if (holeClosing) {
104
+ // TODO - important - take care of case where there are more than 1 antipode
105
+ // Duplicate ContactPoints
106
+ const cpB2 = { pointOnShape: posAntipodes[0].pos, circle, order: cpAntipodes[0].order, order2: +1 };
107
+ const newCpB2Node = CpNode.insert(true, false, cpTreeAntipodes[0], cpB2, newCpAntipodes[0]);
108
+ const cpB1 = { pointOnShape: posSource, circle, order: cpSource.order, order2: -1 };
109
+ const newCpB1Node = CpNode.insert(true, false, cpTreeSource, cpB1, newCpSource.prev);
110
+ // Connect graph
111
+ newCpB1Node.prevOnCircle = newCpB2Node;
112
+ newCpB1Node.nextOnCircle = newCpB2Node;
113
+ newCpB2Node.prevOnCircle = newCpB1Node;
114
+ newCpB2Node.nextOnCircle = newCpB1Node;
115
+ newCpAntipodes[0].next = newCpSource;
116
+ newCpSource.prev = newCpAntipodes[0];
117
+ newCpB1Node.next = newCpB2Node;
118
+ newCpB2Node.prev = newCpB1Node;
119
+ }
120
+ if (typeof _debug_ !== 'undefined') {
121
+ let elems;
122
+ if (holeClosing) {
123
+ elems = _debug_.generated.elems['twoProng_holeClosing'];
124
+ }
125
+ else {
126
+ elems = _debug_.generated.elems['twoProng_regular'];
127
+ }
128
+ const elem = elems[elems.length - 1];
129
+ if (!newCpSource) {
130
+ console.log('asas');
131
+ }
132
+ elem.cpNode = newCpSource;
133
+ }
134
+ return newCpSource;
135
+ }
136
+ /** @hidden */
137
+ function scale(n, exp) {
138
+ return n * (2 ** -(exp + 1));
139
+ }
140
+ /** @hidden */
141
+ function getSize(x, y) {
142
+ // Get size of a
143
+ if (x > 0) {
144
+ if (x > 0.5) {
145
+ return y; // ~ -0.7 -> 0.7, i.e. -(sqrt(2)/2) -> +(sqrt(2)/2)
146
+ }
147
+ else {
148
+ if (y < 0) {
149
+ return x - 2; // ~ -2.0 -> -1.3
150
+ }
151
+ else {
152
+ return -x + 2; // ~ 1.3 -> 2.0
153
+ }
154
+ }
155
+ }
156
+ else {
157
+ if (x < -0.5) {
158
+ return -y + 4; // ~ 3.3 -> 4.7
159
+ }
160
+ else {
161
+ if (y < 0) {
162
+ return x + 6; // ~ 5.3 -> 6.0
163
+ }
164
+ else {
165
+ return -x + 2; // ~ 2 -> 2.7
166
+ }
167
+ }
168
+ }
169
+ }
170
+ /** @hidden */
171
+ function byAngle(circle) {
172
+ const c = circle.center;
173
+ const r = circle.radius;
174
+ const exp = exponent(r);
175
+ return function (_a, _b) {
176
+ let a = _a.cp.pointOnShape.p;
177
+ let b = _b.cp.pointOnShape.p;
178
+ // Move onto origin
179
+ a = [a[0] - c[0], a[1] - c[1]];
180
+ b = [b[0] - c[0], b[1] - c[1]];
181
+ // Scale
182
+ const ax = scale(a[0], exp);
183
+ const ay = scale(a[1], exp);
184
+ const bx = scale(b[0], exp);
185
+ const by = scale(b[1], exp);
186
+ // Get 'size'
187
+ const sa = getSize(ax, ay);
188
+ const sb = getSize(bx, by);
189
+ return sb - sa;
190
+ };
191
+ }
192
+ export { add2Prong };
193
193
  //# sourceMappingURL=add-2-prong.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"add-2-prong.js","sourceRoot":"","sources":["../../../src/mat/find-mat/add-2-prong.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,QAAQ,EAAE,MAAM,cAAc,CAAC;AAGxC,OAAO,EAAE,MAAM,EAAQ,MAAM,kBAAkB,CAAC;AAGhD,OAAO,EAAE,YAAY,EAAE,YAAY,EAAiB,MAAM,yBAAyB,CAAC;AACpF,OAAO,EAAE,kBAAkB,EAAE,MAAM,6BAA6B,CAAC;AACjE,OAAO,EAAE,qBAAqB,EAAE,MAAM,2BAA2B,CAAC;AAIlE;;;;;;;;;;GAUG;AACH,SAAS,SAAS,CAChB,QAA0C,EACpC,MAAsB,EACtB,SAA6B,EACnC,YAAmD,EACnD,WAAuB,EACvB,OAAsB;IAEvB,gEAAgE;IAChE,IAAI,WAAW,GAAK,YAAY,CAAC,MAAM,EAAE,SAAS,CAAC,CAAC;IACpD,IAAI,cAAc,GAAG,YAAY,C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A"}
@@ -1,19 +1,19 @@
1
- import { LlRbTree } from 'flo-ll-rb-tree';
2
- import { CpNode } from '../../cp-node.js';
3
- import { Loop } from '../../loop.js';
4
- import { Circle } from '../../circle.js';
5
- import { IPointOnShape } from '../../point-on-shape.js';
6
- /**
7
- * @hidden
8
- * Adds a 3-prong MAT circle according to the 3 given (previously calculated)
9
- * points on the shape.
10
- * @param cpTrees
11
- * @param orders
12
- * @param threeProng
13
- */
14
- declare function add3Prong(cpTrees: Map<Loop, LlRbTree<CpNode>>, orders: number[], threeProng: {
15
- circle: Circle;
16
- ps: IPointOnShape[];
17
- δ3s: CpNode[][];
18
- }): Circle;
19
- export { add3Prong };
1
+ import { LlRbTree } from 'flo-ll-rb-tree';
2
+ import { CpNode } from '../../cp-node.js';
3
+ import { Loop } from '../../loop.js';
4
+ import { Circle } from '../../circle.js';
5
+ import { IPointOnShape } from '../../point-on-shape.js';
6
+ /**
7
+ * @hidden
8
+ * Adds a 3-prong MAT circle according to the 3 given (previously calculated)
9
+ * points on the shape.
10
+ * @param cpTrees
11
+ * @param orders
12
+ * @param threeProng
13
+ */
14
+ declare function add3Prong(cpTrees: Map<Loop, LlRbTree<CpNode>>, orders: number[], threeProng: {
15
+ circle: Circle;
16
+ ps: IPointOnShape[];
17
+ δ3s: CpNode[][];
18
+ }): Circle;
19
+ export { add3Prong };
@@ -1,55 +1,55 @@
1
- import { addToCpGraph } from '../add-to-cp-graph.js';
2
- import { isAnotherCpCloseby } from '../is-another-cp-closeby.js';
3
- /**
4
- * @hidden
5
- * Adds a 3-prong MAT circle according to the 3 given (previously calculated)
6
- * points on the shape.
7
- * @param cpTrees
8
- * @param orders
9
- * @param threeProng
10
- */
11
- function add3Prong(cpTrees, orders, threeProng) {
12
- let { circle, ps: poss, δ3s } = threeProng;
13
- // Keep for possible future debugging.
14
- /*
15
- if (typeof _debug_ !== 'undefined') {
16
- for (let i=0; i<3; i++) {
17
- let cpBef = threeProng.δ3s[i][0].cp;
18
- let cpAft = threeProng.δ3s[i][1].cp;
19
- //let cmpBef = PointOnShape.compareInclOrder(cpBef.pointOnShape, ps[i], cpBef.order, orders[i]);
20
- //let cmpAft = PointOnShape.compareInclOrder(cpAft.pointOnShape, ps[i], cpAft.order, orders[i]);
21
-
22
- let cmpBef = PointOnShape.compare(cpBef.pointOnShape, ps[i]);
23
- let cmpAft = PointOnShape.compare(cpAft.pointOnShape, ps[i]);
24
-
25
- // len is used by debug functions to reference a particular
26
- // three-prong.
27
- let len = _debug_.generated.elems.threeProng.length-1;
28
- if (cmpBef > 0) {
29
- console.log('----------------------------------------');
30
- console.log(`3-prong order is wrong (bef) : i: ${i} - cmp: ${cmpBef} - n: ${len}`);
31
- console.log(threeProng);
32
- console.log(cpBef);
33
- console.log(cpAft);
34
- console.log(ps[i]);
35
- }
36
- if (cmpAft < 0) {
37
- console.log('----------------------------------------');
38
- console.log(`3-prong order is wrong (aft) : i: ${i} - cmp: ${cmpAft} - n: ${len}`);
39
- console.log(threeProng);
40
- console.log(cpBef);
41
- console.log(cpAft);
42
- console.log(ps[i]);
43
- }
44
- }
45
- }
46
- */
47
- // TODO - replace 1000 below with correct value
48
- isAnotherCpCloseby(cpTrees, poss[0], circle, orders[0], 0, 1000, 'blue');
49
- isAnotherCpCloseby(cpTrees, poss[1], circle, orders[1], 0, 1000, 'blue');
50
- isAnotherCpCloseby(cpTrees, poss[2], circle, orders[2], 0, 1000, 'blue');
51
- addToCpGraph(circle, orders, cpTrees, poss, δ3s);
52
- return circle;
53
- }
54
- export { add3Prong };
1
+ import { addToCpGraph } from '../add-to-cp-graph.js';
2
+ import { isAnotherCpCloseby } from '../is-another-cp-closeby.js';
3
+ /**
4
+ * @hidden
5
+ * Adds a 3-prong MAT circle according to the 3 given (previously calculated)
6
+ * points on the shape.
7
+ * @param cpTrees
8
+ * @param orders
9
+ * @param threeProng
10
+ */
11
+ function add3Prong(cpTrees, orders, threeProng) {
12
+ const { circle, ps: poss, δ3s } = threeProng;
13
+ // Keep for possible future debugging.
14
+ /*
15
+ if (typeof _debug_ !== 'undefined') {
16
+ for (let i=0; i<3; i++) {
17
+ let cpBef = threeProng.δ3s[i][0].cp;
18
+ let cpAft = threeProng.δ3s[i][1].cp;
19
+ //let cmpBef = PointOnShape.compareInclOrder(cpBef.pointOnShape, ps[i], cpBef.order, orders[i]);
20
+ //let cmpAft = PointOnShape.compareInclOrder(cpAft.pointOnShape, ps[i], cpAft.order, orders[i]);
21
+
22
+ let cmpBef = PointOnShape.compare(cpBef.pointOnShape, ps[i]);
23
+ let cmpAft = PointOnShape.compare(cpAft.pointOnShape, ps[i]);
24
+
25
+ // len is used by debug functions to reference a particular
26
+ // three-prong.
27
+ let len = _debug_.generated.elems.threeProng.length-1;
28
+ if (cmpBef > 0) {
29
+ console.log('----------------------------------------');
30
+ console.log(`3-prong order is wrong (bef) : i: ${i} - cmp: ${cmpBef} - n: ${len}`);
31
+ console.log(threeProng);
32
+ console.log(cpBef);
33
+ console.log(cpAft);
34
+ console.log(ps[i]);
35
+ }
36
+ if (cmpAft < 0) {
37
+ console.log('----------------------------------------');
38
+ console.log(`3-prong order is wrong (aft) : i: ${i} - cmp: ${cmpAft} - n: ${len}`);
39
+ console.log(threeProng);
40
+ console.log(cpBef);
41
+ console.log(cpAft);
42
+ console.log(ps[i]);
43
+ }
44
+ }
45
+ }
46
+ */
47
+ // TODO - replace 1000 below with correct value
48
+ isAnotherCpCloseby(cpTrees, poss[0], circle, orders[0], 0, 1000, 'blue');
49
+ isAnotherCpCloseby(cpTrees, poss[1], circle, orders[1], 0, 1000, 'blue');
50
+ isAnotherCpCloseby(cpTrees, poss[2], circle, orders[2], 0, 1000, 'blue');
51
+ addToCpGraph(circle, orders, cpTrees, poss, δ3s);
52
+ return circle;
53
+ }
54
+ export { add3Prong };
55
55
  //# sourceMappingURL=add-3-prong.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"add-3-prong.js","sourceRoot":"","sources":["../../../src/mat/find-mat/add-3-prong.ts"],"names":[],"mappings":"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M,EAAE,EAAE,EAAE,IAAI,EAAE,GAAG,EAAE,GAAG,UAAU,CAAC;IAE7C,uCAAuC;IACvC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;MAgCE;IAEF,+CAA+C;IAC/C,kBAAkB,CAAC,OAAO,EAAE,IAAI,CAAC,CAAC,CAAC,EAAE,MAAM,EAAE,MAAM,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,IAAI,EAAE,MAAM,CAAC,CAAC;IACzE,kBAAkB,CAAC,OAAO,EAAE,IAAI,CAAC,CAAC,CAAC,EAAE,MAAM,EAAE,MAAM,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,IAAI,EAAE,MAAM,CAAC,CAAC;IACzE,kBAAkB,CAAC,OAAO,EAAE,IAAI,CAAC,CAAC,CAAC,EAAE,MAAM,EAAE,MAAM,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,IAAI,EAAE,MAAM,CAAC,CAAC;IAEzE,YAAY,CAAC,MAAM,EAAE,MAAM,EAAE,OAAO,EAAE,IAAI,EAAE,GAAG,CAAC,CAAC;IAEjD,OAAO,MAAM,CAAC;AACf,CAAC;AAGD,OAAO,EAAE,SAAS,EAAE,CAAA"}
@@ -1,9 +1,9 @@
1
- import { Loop } from '../../loop.js';
2
- import { Mat } from '../../mat.js';
3
- /** @hidden */
4
- declare function addDebugInfo1(loops: Loop[]): void;
5
- /** @hidden */
6
- declare function addDebugInfo2(): void;
7
- declare function addDebugInfo3(): void;
8
- declare function addDebugInfo4(mat: Mat): void;
9
- export { addDebugInfo1, addDebugInfo2, addDebugInfo3, addDebugInfo4 };
1
+ import { Loop } from '../../loop.js';
2
+ import { Mat } from '../../mat.js';
3
+ /** @hidden */
4
+ declare function addDebugInfo1(loops: Loop[]): void;
5
+ /** @hidden */
6
+ declare function addDebugInfo2(): void;
7
+ declare function addDebugInfo3(): void;
8
+ declare function addDebugInfo4(mat: Mat): void;
9
+ export { addDebugInfo1, addDebugInfo2, addDebugInfo3, addDebugInfo4 };