flo-mat 3.0.1 → 3.0.2
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.
- package/.mocharc.cjs +1 -1
- package/README.md +7 -7
- package/browser/index.min.js +1 -1
- package/newdocs/README.md +41 -0
- package/newdocs/babel.config.js +3 -0
- package/newdocs/blog/2019-05-28-first-blog-post.md +12 -0
- package/newdocs/blog/2019-05-29-long-blog-post.md +44 -0
- package/newdocs/blog/2021-08-01-mdx-blog-post.mdx +20 -0
- package/newdocs/blog/2021-08-26-welcome/docusaurus-plushie-banner.jpeg +0 -0
- package/newdocs/blog/2021-08-26-welcome/index.md +25 -0
- package/newdocs/blog/authors.yml +17 -0
- package/newdocs/docs/Introduction.md +78 -0
- package/newdocs/docs/aaa.md +23 -0
- package/newdocs/docusaurus.config.js +139 -0
- package/newdocs/package-lock.json +12697 -0
- package/newdocs/package.json +46 -0
- package/newdocs/sidebars.js +33 -0
- package/newdocs/src/components/HomepageFeatures/index.tsx +46 -0
- package/newdocs/src/components/HomepageFeatures/styles.module.css +11 -0
- package/newdocs/src/css/custom.css +30 -0
- package/newdocs/src/pages/index.module.css +23 -0
- package/newdocs/src/pages/index.tsx +43 -0
- package/newdocs/src/pages/markdown-page.md +7 -0
- package/newdocs/static/.nojekyll +0 -0
- package/newdocs/static/img/docusaurus-social-card.jpg +0 -0
- package/newdocs/static/img/docusaurus.png +0 -0
- package/newdocs/static/img/favicon.ico +0 -0
- package/newdocs/static/img/favicon1.ico +0 -0
- package/newdocs/static/img/favicon_io/android-chrome-192x192.png +0 -0
- package/newdocs/static/img/favicon_io/android-chrome-512x512.png +0 -0
- package/newdocs/static/img/favicon_io/apple-touch-icon.png +0 -0
- package/newdocs/static/img/favicon_io/favicon-16x16.png +0 -0
- package/newdocs/static/img/favicon_io/favicon-32x32.png +0 -0
- package/newdocs/static/img/favicon_io/favicon.ico +0 -0
- package/newdocs/static/img/favicon_io/site.webmanifest +1 -0
- package/newdocs/static/img/favicon_io.zip +0 -0
- package/newdocs/static/img/logo.png +0 -0
- package/newdocs/static/img/logo.svg +1 -0
- package/newdocs/static/img/undraw_books_re_8gea.svg +1 -0
- package/newdocs/static/img/undraw_docusaurus_mountain.svg +171 -0
- package/newdocs/static/img/undraw_docusaurus_react.svg +170 -0
- package/newdocs/static/img/undraw_docusaurus_tree.svg +40 -0
- package/newdocs/tsconfig.json +7 -0
- package/node/add-n-prong.ts/join-spokes.d.ts +4 -0
- package/node/add-n-prong.ts/join-spokes.js +24 -0
- package/node/add-n-prong.ts/join-spokes.js.map +1 -0
- package/node/bezier/fit-quads-to-cubic.d.ts +19 -0
- package/node/bezier/fit-quads-to-cubic.js +83 -0
- package/node/bezier/fit-quads-to-cubic.js.map +1 -0
- package/node/bezier/total-curvature.d.ts +2 -0
- package/node/bezier/total-curvature.js +5 -0
- package/node/bezier/total-curvature.js.map +1 -0
- package/node/bezier/total-length.d.ts +2 -0
- package/node/bezier/total-length.js +5 -0
- package/node/bezier/total-length.js.map +1 -0
- package/node/closest-boundary-point/cull-bezier-pieces.d.ts +2 -2
- package/node/closest-boundary-point/cull-bezier-pieces.js.map +1 -1
- package/node/closest-boundary-point/cull-by-loose-bounding-box.d.ts +2 -2
- package/node/closest-boundary-point/cull-by-loose-bounding-box.js +2 -2
- package/node/closest-boundary-point/cull-by-loose-bounding-box.js.map +1 -1
- package/node/closest-boundary-point/cull-by-tight-boundary-box.d.ts +2 -2
- package/node/closest-boundary-point/cull-by-tight-boundary-box.js.map +1 -1
- package/node/closest-boundary-point/dd-deflate-with-running-error.js.map +1 -1
- package/node/closest-boundary-point/foot-and-endpoint-info.d.ts +1 -1
- package/node/closest-boundary-point/get-best-distance-squared.d.ts +2 -2
- package/node/closest-boundary-point/get-best-distance-squared.js.map +1 -1
- package/node/closest-boundary-point/get-close-boundary-points-certified.d.ts +6 -3
- package/node/closest-boundary-point/get-close-boundary-points-certified.js +6 -3
- package/node/closest-boundary-point/get-close-boundary-points-certified.js.map +1 -1
- package/node/closest-boundary-point/get-potential-closest-points-on-curve-certified.d.ts +5 -1
- package/node/closest-boundary-point/get-potential-closest-points-on-curve-certified.js +22 -5
- package/node/closest-boundary-point/get-potential-closest-points-on-curve-certified.js.map +1 -1
- package/node/closest-boundary-point/root-interval-to-distance-squared-interval.d.ts +1 -1
- package/node/closest-boundary-point/root-interval-to-distance-squared-interval.js +13 -8
- package/node/closest-boundary-point/root-interval-to-distance-squared-interval.js.map +1 -1
- package/node/contact-point/contact-point.js.map +1 -1
- package/node/corner/compare-curvatures-at-interface.js +37 -54
- package/node/corner/compare-curvatures-at-interface.js.map +1 -1
- package/node/corner/corner.d.ts +0 -1
- package/node/corner/get-corner.d.ts +1 -1
- package/node/corner/get-corner.js +9 -21
- package/node/corner/get-corner.js.map +1 -1
- package/node/corner/get-interface-ccw.d.ts +6 -7
- package/node/corner/get-interface-ccw.js +63 -46
- package/node/corner/get-interface-ccw.js.map +1 -1
- package/node/cp-node/cp-node-fs.d.ts +225 -0
- package/node/cp-node/cp-node-fs.js +228 -0
- package/node/cp-node/cp-node-fs.js.map +1 -0
- package/node/cp-node/cp-node.d.ts +22 -128
- package/node/cp-node/cp-node.js +1 -248
- package/node/cp-node/cp-node.js.map +1 -1
- package/node/cp-node/{clone.d.ts → fs/clone.d.ts} +1 -1
- package/node/cp-node/{clone.js → fs/clone.js} +14 -5
- package/node/cp-node/fs/clone.js.map +1 -0
- package/node/cp-node/fs/cp-nodes-to-boundary-beziers.d.ts +3 -0
- package/node/cp-node/fs/cp-nodes-to-boundary-beziers.js +6 -0
- package/node/cp-node/fs/cp-nodes-to-boundary-beziers.js.map +1 -0
- package/node/cp-node/{enhance-cp-node.d.ts → fs/enhance-cp-node.d.ts} +14 -4
- package/node/cp-node/{enhance-cp-node.js → fs/enhance-cp-node.js} +8 -1
- package/node/cp-node/fs/enhance-cp-node.js.map +1 -0
- package/node/cp-node/fs/find-first.d.ts +3 -0
- package/node/cp-node/fs/find-first.js +16 -0
- package/node/cp-node/fs/find-first.js.map +1 -0
- package/node/cp-node/fs/get-all-between.d.ts +17 -0
- package/node/cp-node/fs/get-all-between.js +31 -0
- package/node/cp-node/fs/get-all-between.js.map +1 -0
- package/node/cp-node/fs/get-all-on-circle.d.ts +3 -0
- package/node/cp-node/fs/get-all-on-circle.js +14 -0
- package/node/cp-node/fs/get-all-on-circle.js.map +1 -0
- package/node/cp-node/fs/get-all-on-loop.d.ts +3 -0
- package/node/cp-node/fs/get-all-on-loop.js +12 -0
- package/node/cp-node/fs/get-all-on-loop.js.map +1 -0
- package/node/cp-node/fs/get-all-vertices.d.ts +3 -0
- package/node/cp-node/fs/get-all-vertices.js +10 -0
- package/node/cp-node/fs/get-all-vertices.js.map +1 -0
- package/node/cp-node/fs/get-angle-between-mat-curves.d.ts +9 -0
- package/node/cp-node/fs/get-angle-between-mat-curves.js +18 -0
- package/node/cp-node/fs/get-angle-between-mat-curves.js.map +1 -0
- package/node/cp-node/{get-boundary-bezier-parts-to-next.d.ts → fs/get-boundary-bezier-parts-to-next.d.ts} +1 -6
- package/node/cp-node/{get-boundary-bezier-parts-to-next.js → fs/get-boundary-bezier-parts-to-next.js} +0 -5
- package/node/cp-node/fs/get-boundary-bezier-parts-to-next.js.map +1 -0
- package/node/cp-node/fs/get-boundary-beziers-between.d.ts +17 -0
- package/node/cp-node/fs/get-boundary-beziers-between.js +22 -0
- package/node/cp-node/fs/get-boundary-beziers-between.js.map +1 -0
- package/node/cp-node/fs/get-boundary-beziers-to-next.d.ts +3 -0
- package/node/cp-node/{get-boundary-beziers-to-next.js → fs/get-boundary-beziers-to-next.js} +2 -7
- package/node/cp-node/fs/get-boundary-beziers-to-next.js.map +1 -0
- package/node/cp-node/fs/get-branch-beziers.d.ts +8 -0
- package/node/cp-node/fs/get-branch-beziers.js +12 -0
- package/node/cp-node/fs/get-branch-beziers.js.map +1 -0
- package/node/cp-node/fs/get-branch.d.ts +10 -0
- package/node/cp-node/fs/get-branch.js +33 -0
- package/node/cp-node/fs/get-branch.js.map +1 -0
- package/node/cp-node/fs/get-children.d.ts +3 -0
- package/node/cp-node/fs/get-children.js +12 -0
- package/node/cp-node/fs/get-children.js.map +1 -0
- package/node/cp-node/{get-cp-node-ordering.d.ts → fs/get-cp-node-ordering.d.ts} +5 -1
- package/node/cp-node/{get-cp-node-ordering.js → fs/get-cp-node-ordering.js} +4 -0
- package/node/cp-node/fs/get-cp-node-ordering.js.map +1 -0
- package/node/cp-node/fs/get-distance-to-next.d.ts +4 -0
- package/node/cp-node/fs/get-distance-to-next.js +11 -0
- package/node/cp-node/fs/get-distance-to-next.js.map +1 -0
- package/node/cp-node/fs/get-edge-direction.d.ts +3 -0
- package/node/{get-curve → cp-node/fs}/get-edge-direction.js +1 -7
- package/node/cp-node/fs/get-edge-direction.js.map +1 -0
- package/node/cp-node/fs/get-first-exit.d.ts +3 -0
- package/node/cp-node/fs/get-first-exit.js +15 -0
- package/node/cp-node/fs/get-first-exit.js.map +1 -0
- package/node/cp-node/fs/get-hole-closers.d.ts +3 -0
- package/node/cp-node/fs/get-hole-closers.js +7 -0
- package/node/cp-node/fs/get-hole-closers.js.map +1 -0
- package/node/cp-node/fs/get-implied-boundary-bezier-between.d.ts +3 -0
- package/node/cp-node/fs/get-implied-boundary-bezier-between.js +58 -0
- package/node/cp-node/fs/get-implied-boundary-bezier-between.js.map +1 -0
- package/node/cp-node/fs/get-mat-curve-between.d.ts +3 -0
- package/node/{get-curve/get-curve-between.js → cp-node/fs/get-mat-curve-between.js} +3 -9
- package/node/cp-node/fs/get-mat-curve-between.js.map +1 -0
- package/node/cp-node/fs/get-mat-curve-to-next.d.ts +4 -0
- package/node/cp-node/fs/get-mat-curve-to-next.js +8 -0
- package/node/cp-node/fs/get-mat-curve-to-next.js.map +1 -0
- package/node/cp-node/fs/get-mat-curves-between.d.ts +3 -0
- package/node/cp-node/fs/get-mat-curves-between.js +13 -0
- package/node/cp-node/fs/get-mat-curves-between.js.map +1 -0
- package/node/cp-node/fs/get-non-terminating-on-circle.d.ts +3 -0
- package/node/cp-node/fs/get-non-terminating-on-circle.js +15 -0
- package/node/cp-node/fs/get-non-terminating-on-circle.js.map +1 -0
- package/node/cp-node/fs/get-prong-count.d.ts +3 -0
- package/node/cp-node/fs/get-prong-count.js +12 -0
- package/node/cp-node/fs/get-prong-count.js.map +1 -0
- package/node/cp-node/fs/get-real-prong-count.d.ts +3 -0
- package/node/cp-node/fs/get-real-prong-count.js +9 -0
- package/node/cp-node/fs/get-real-prong-count.js.map +1 -0
- package/node/cp-node/fs/get-salience.d.ts +7 -0
- package/node/cp-node/fs/get-salience.js +20 -0
- package/node/cp-node/fs/get-salience.js.map +1 -0
- package/node/cp-node/fs/get-smoothed-speed.d.ts +3 -0
- package/node/cp-node/fs/get-smoothed-speed.js +75 -0
- package/node/cp-node/fs/get-smoothed-speed.js.map +1 -0
- package/node/cp-node/fs/get-speed.d.ts +4 -0
- package/node/cp-node/fs/get-speed.js +40 -0
- package/node/cp-node/fs/get-speed.js.map +1 -0
- package/node/cp-node/fs/get-vertex-forward-children.d.ts +3 -0
- package/node/cp-node/fs/get-vertex-forward-children.js +15 -0
- package/node/cp-node/fs/get-vertex-forward-children.js.map +1 -0
- package/node/cp-node/fs/insert-cp-node.d.ts +5 -0
- package/node/cp-node/fs/insert-cp-node.js +21 -0
- package/node/cp-node/fs/insert-cp-node.js.map +1 -0
- package/node/cp-node/fs/is-fully-terminating.d.ts +3 -0
- package/node/cp-node/fs/is-fully-terminating.js +8 -0
- package/node/cp-node/fs/is-fully-terminating.js.map +1 -0
- package/node/cp-node/fs/is-on-same-circle.d.ts +3 -0
- package/node/cp-node/fs/is-on-same-circle.js +8 -0
- package/node/cp-node/fs/is-on-same-circle.js.map +1 -0
- package/node/cp-node/fs/is-one-prong.d.ts +3 -0
- package/node/cp-node/fs/is-one-prong.js +13 -0
- package/node/cp-node/fs/is-one-prong.js.map +1 -0
- package/node/cp-node/fs/is-order-correct.d.ts +5 -0
- package/node/cp-node/fs/is-order-correct.js +26 -0
- package/node/cp-node/fs/is-order-correct.js.map +1 -0
- package/node/cp-node/fs/is-sharp.d.ts +3 -0
- package/node/cp-node/fs/is-sharp.js +5 -0
- package/node/cp-node/fs/is-sharp.js.map +1 -0
- package/node/cp-node/fs/is-special.d.ts +3 -0
- package/node/cp-node/fs/is-special.js +9 -0
- package/node/cp-node/fs/is-special.js.map +1 -0
- package/node/cp-node/fs/is-terminating.d.ts +3 -0
- package/node/cp-node/fs/is-terminating.js +5 -0
- package/node/cp-node/fs/is-terminating.js.map +1 -0
- package/node/cp-node/fs/is-trivial.d.ts +6 -0
- package/node/cp-node/fs/is-trivial.js +10 -0
- package/node/cp-node/fs/is-trivial.js.map +1 -0
- package/node/cp-node/fs/is-two-prong.d.ts +3 -0
- package/node/cp-node/fs/is-two-prong.js +6 -0
- package/node/cp-node/fs/is-two-prong.js.map +1 -0
- package/node/cp-node/fs/is-vertex-special.d.ts +2 -0
- package/node/cp-node/fs/is-vertex-special.js +5 -0
- package/node/cp-node/fs/is-vertex-special.js.map +1 -0
- package/node/cp-node/fs/is-vertex.d.ts +3 -0
- package/node/cp-node/fs/is-vertex.js +6 -0
- package/node/cp-node/fs/is-vertex.js.map +1 -0
- package/node/cp-node/fs/remove-cp-node.d.ts +5 -0
- package/node/cp-node/fs/remove-cp-node.js +10 -0
- package/node/cp-node/fs/remove-cp-node.js.map +1 -0
- package/node/cp-node/fs/traverse-cp.d.ts +3 -0
- package/node/cp-node/{traverse-cp.js → fs/traverse-cp.js} +2 -10
- package/node/cp-node/fs/traverse-cp.js.map +1 -0
- package/node/cp-node/fs/traverse-edges.d.ts +5 -0
- package/node/cp-node/fs/traverse-edges.js +47 -0
- package/node/cp-node/fs/traverse-edges.js.map +1 -0
- package/node/cp-node/fs/traverse-vertices.d.ts +3 -0
- package/node/cp-node/fs/traverse-vertices.js +21 -0
- package/node/cp-node/fs/traverse-vertices.js.map +1 -0
- package/node/curve/curve.d.ts +1 -8
- package/node/curve/curve.js +1 -13
- package/node/curve/curve.js.map +1 -1
- package/node/debug/debug-elem-types.d.ts +24 -29
- package/node/debug/debug-elem-types.js +22 -1
- package/node/debug/debug-elem-types.js.map +1 -1
- package/node/debug/debug.d.ts +4 -8
- package/node/debug/debug.js +16 -17
- package/node/debug/debug.js.map +1 -1
- package/node/debug/functions/draw/draw-beziers-as-single-path.d.ts +2 -0
- package/node/debug/functions/draw/draw-beziers-as-single-path.js +30 -0
- package/node/debug/functions/draw/draw-beziers-as-single-path.js.map +1 -0
- package/node/debug/functions/draw/xmlns.d.ts +2 -0
- package/node/debug/functions/draw/xmlns.js +3 -0
- package/node/debug/functions/draw/xmlns.js.map +1 -0
- package/node/debug/functions/draw-elem/draw-branch.d.ts +4 -0
- package/node/debug/functions/draw-elem/draw-branch.js +26 -0
- package/node/debug/functions/draw-elem/draw-branch.js.map +1 -0
- package/node/debug/functions/draw-elem/draw-cp-node.d.ts +4 -0
- package/node/debug/functions/draw-elem/draw-cp-node.js +26 -0
- package/node/debug/functions/draw-elem/draw-cp-node.js.map +1 -0
- package/node/debug/functions/draw-elem/draw-cull.d.ts +3 -0
- package/node/debug/functions/draw-elem/draw-cull.js +9 -0
- package/node/debug/functions/draw-elem/draw-cull.js.map +1 -0
- package/node/debug/functions/draw-elem/{dull-corner.js → draw-dull-corner.js} +1 -1
- package/node/debug/functions/draw-elem/draw-dull-corner.js.map +1 -0
- package/node/debug/functions/draw-elem/draw-elem.d.ts +7 -5
- package/node/debug/functions/draw-elem/draw-elem.js +33 -36
- package/node/debug/functions/draw-elem/draw-elem.js.map +1 -1
- package/node/debug/functions/draw-elem/draw-leaves.d.ts +4 -0
- package/node/debug/functions/draw-elem/draw-leaves.js +34 -0
- package/node/debug/functions/draw-elem/draw-leaves.js.map +1 -0
- package/node/debug/functions/draw-elem/{loop.js → draw-loop.js} +1 -1
- package/node/debug/functions/draw-elem/draw-loop.js.map +1 -0
- package/node/debug/functions/draw-elem/{loops.js → draw-loops.js} +1 -1
- package/node/debug/functions/draw-elem/draw-loops.js.map +1 -0
- package/node/debug/functions/draw-elem/{loose-bounding-box.js → draw-loose-bounding-box.js} +1 -1
- package/node/debug/functions/draw-elem/draw-loose-bounding-box.js.map +1 -0
- package/node/debug/functions/draw-elem/draw-mat.d.ts +4 -0
- package/node/debug/functions/draw-elem/draw-mat.js +38 -0
- package/node/debug/functions/draw-elem/draw-mat.js.map +1 -0
- package/node/debug/functions/draw-elem/{max-vertex.js → draw-max-vertex.js} +1 -1
- package/node/debug/functions/draw-elem/draw-max-vertex.js.map +1 -0
- package/node/debug/functions/draw-elem/{min-y.js → draw-min-y.js} +1 -1
- package/node/debug/functions/draw-elem/draw-min-y.js.map +1 -0
- package/node/debug/functions/draw-elem/{one-prong-at-dull-corner.js → draw-one-prong-at-dull-corner.js} +1 -1
- package/node/debug/functions/draw-elem/draw-one-prong-at-dull-corner.js.map +1 -0
- package/node/debug/functions/draw-elem/{one-prong.js → draw-one-prong.js} +1 -1
- package/node/debug/functions/draw-elem/draw-one-prong.js.map +1 -0
- package/node/debug/functions/draw-elem/{sharp-corner.js → draw-sharp-corner.js} +1 -1
- package/node/debug/functions/draw-elem/draw-sharp-corner.js.map +1 -0
- package/node/debug/functions/draw-elem/draw-speed.d.ts +4 -0
- package/node/debug/functions/draw-elem/draw-speed.js +21 -0
- package/node/debug/functions/draw-elem/draw-speed.js.map +1 -0
- package/node/debug/functions/draw-elem/draw-three-prong.d.ts +4 -0
- package/node/debug/functions/draw-elem/draw-three-prong.js +26 -0
- package/node/debug/functions/draw-elem/draw-three-prong.js.map +1 -0
- package/node/debug/functions/draw-elem/{tight-bounding-box.js → draw-tight-bounding-box.js} +1 -1
- package/node/debug/functions/draw-elem/draw-tight-bounding-box.js.map +1 -0
- package/node/debug/functions/draw-elem/draw-two-prong.d.ts +4 -0
- package/node/debug/functions/draw-elem/draw-two-prong.js +48 -0
- package/node/debug/functions/draw-elem/draw-two-prong.js.map +1 -0
- package/node/debug/functions/draw-elem/{vertex.d.ts → draw-vertex.d.ts} +1 -2
- package/node/debug/functions/draw-elem/draw-vertex.js +15 -0
- package/node/debug/functions/draw-elem/draw-vertex.js.map +1 -0
- package/node/find-2-prong/add-1-prong.d.ts +3 -5
- package/node/find-2-prong/add-1-prong.js +15 -16
- package/node/find-2-prong/add-1-prong.js.map +1 -1
- package/node/find-2-prong/add-2-prong.d.ts +6 -6
- package/node/find-2-prong/add-2-prong.js +45 -124
- package/node/find-2-prong/add-2-prong.js.map +1 -1
- package/node/find-2-prong/calc-seperation-tolerance.d.ts +2 -0
- package/node/find-2-prong/calc-seperation-tolerance.js +86 -0
- package/node/find-2-prong/calc-seperation-tolerance.js.map +1 -0
- package/node/find-2-prong/cull-bezier-pieces.d.ts +2 -2
- package/node/find-2-prong/cull-bezier-pieces.js +2 -2
- package/node/find-2-prong/cull-bezier-pieces.js.map +1 -1
- package/node/find-2-prong/find-2-prong.d.ts +4 -6
- package/node/find-2-prong/find-2-prong.js +69 -54
- package/node/find-2-prong/find-2-prong.js.map +1 -1
- package/node/find-2-prong/find-and-add-2-prong.d.ts +11 -0
- package/node/find-2-prong/find-and-add-2-prong.js +19 -0
- package/node/find-2-prong/find-and-add-2-prong.js.map +1 -0
- package/node/find-2-prong/find-and-add-2-prongs-on-all-loops.d.ts +14 -0
- package/node/find-2-prong/find-and-add-2-prongs-on-all-loops.js +21 -0
- package/node/find-2-prong/find-and-add-2-prongs-on-all-loops.js.map +1 -0
- package/node/find-2-prong/find-and-add-2-prongs.d.ts +5 -9
- package/node/find-2-prong/find-and-add-2-prongs.js +17 -21
- package/node/find-2-prong/find-and-add-2-prongs.js.map +1 -1
- package/node/find-2-prong/find-and-add-hole-closing-2-prongs.d.ts +3 -4
- package/node/find-2-prong/find-and-add-hole-closing-2-prongs.js +8 -8
- package/node/find-2-prong/find-and-add-hole-closing-2-prongs.js.map +1 -1
- package/node/find-2-prong/find-equidistant-point-on-line-dd.js.map +1 -1
- package/node/find-2-prong/get-initial-bezier-pieces.d.ts +2 -8
- package/node/find-2-prong/get-initial-bezier-pieces.js +13 -21
- package/node/find-2-prong/get-initial-bezier-pieces.js.map +1 -1
- package/node/find-2-prong/reduce-radius.d.ts +2 -2
- package/node/find-2-prong/reduce-radius.js +10 -19
- package/node/find-2-prong/reduce-radius.js.map +1 -1
- package/node/find-3-prong.ts/calc-better-x.d.ts +3 -3
- package/node/find-3-prong.ts/calc-better-x.js +4 -4
- package/node/find-3-prong.ts/calc-better-x.js.map +1 -1
- package/node/find-3-prong.ts/calc-initial-3-prong-center.d.ts +2 -2
- package/node/find-3-prong.ts/calc-initial-3-prong-center.js +6 -3
- package/node/find-3-prong.ts/calc-initial-3-prong-center.js.map +1 -1
- package/node/find-3-prong.ts/find-3-prong-for-delta3s.d.ts +4 -4
- package/node/find-3-prong.ts/find-3-prong-for-delta3s.js +24 -33
- package/node/find-3-prong.ts/find-3-prong-for-delta3s.js.map +1 -1
- package/node/find-3-prong.ts/find-3-prong.d.ts +1 -1
- package/node/find-3-prong.ts/find-3-prong.js +2 -61
- package/node/find-3-prong.ts/find-3-prong.js.map +1 -1
- package/node/find-3-prong.ts/find-and-add-3-prong.d.ts +15 -0
- package/node/find-3-prong.ts/find-and-add-3-prong.js +43 -0
- package/node/find-3-prong.ts/find-and-add-3-prong.js.map +1 -0
- package/node/find-3-prong.ts/find-and-add-3-prongs-on-loop.d.ts +11 -0
- package/node/find-3-prong.ts/find-and-add-3-prongs-on-loop.js +63 -0
- package/node/find-3-prong.ts/find-and-add-3-prongs-on-loop.js.map +1 -0
- package/node/find-3-prong.ts/find-and-add-3-prongs.d.ts +22 -3
- package/node/find-3-prong.ts/find-and-add-3-prongs.js +28 -55
- package/node/find-3-prong.ts/find-and-add-3-prongs.js.map +1 -1
- package/node/find-3-prong.ts/get-closest-points.d.ts +2 -2
- package/node/find-3-prong.ts/get-closest-points.js +2 -1
- package/node/find-3-prong.ts/get-closest-points.js.map +1 -1
- package/node/find-mat/clip-options.d.ts +3 -0
- package/node/find-mat/clip-options.js +32 -0
- package/node/find-mat/clip-options.js.map +1 -0
- package/node/find-mat/{create-initial-cp-graph.d.ts → create-initial-cp-tree.d.ts} +5 -2
- package/node/find-mat/{create-initial-cp-graph.js → create-initial-cp-tree.js} +11 -10
- package/node/find-mat/create-initial-cp-tree.js.map +1 -0
- package/node/find-mat/find-mat.d.ts +7 -2
- package/node/find-mat/find-mat.js +34 -22
- package/node/find-mat/find-mat.js.map +1 -1
- package/node/find-mat/find-mats.d.ts +4 -2
- package/node/find-mat/find-mats.js +27 -10
- package/node/find-mat/find-mats.js.map +1 -1
- package/node/find-mat/{get-dull-corners.js → get-dull-corners-on-loop.js} +3 -3
- package/node/find-mat/get-dull-corners-on-loop.js.map +1 -0
- package/node/find-mat/get-for-1-prongs-on-loop.js +15 -5
- package/node/find-mat/get-for-1-prongs-on-loop.js.map +1 -1
- package/node/find-mat/get-for-2-prongs-on-loop.js +14 -10
- package/node/find-mat/get-for-2-prongs-on-loop.js.map +1 -1
- package/node/find-mat/get-meta.d.ts +11 -0
- package/node/find-mat/get-meta.js +82 -0
- package/node/find-mat/get-meta.js.map +1 -0
- package/node/find-mat/get-sharp-corners.js +3 -2
- package/node/find-mat/get-sharp-corners.js.map +1 -1
- package/node/find-mat/mat-options.d.ts +88 -0
- package/node/find-mat/mat-options.js +36 -0
- package/node/find-mat/mat-options.js.map +1 -0
- package/node/floyd-warshall/floyd-warshall.d.ts +7 -0
- package/node/floyd-warshall/floyd-warshall.js +67 -0
- package/node/floyd-warshall/floyd-warshall.js.map +1 -0
- package/node/floyd-warshall/get-graph.d.ts +3 -0
- package/node/floyd-warshall/get-graph.js +54 -0
- package/node/floyd-warshall/get-graph.js.map +1 -0
- package/node/floyd-warshall/get-hole-closer-pairs.d.ts +3 -0
- package/node/floyd-warshall/get-hole-closer-pairs.js +19 -0
- package/node/floyd-warshall/get-hole-closer-pairs.js.map +1 -0
- package/node/geometry/circle.js.map +1 -1
- package/node/geometry/get-bounding-box-.d.ts +2 -2
- package/node/geometry/get-bounding-box-.js +2 -2
- package/node/geometry/get-bounding-box-.js.map +1 -1
- package/node/geometry/get-closest-square-distance-to-rect.js.map +1 -1
- package/node/geometry/get-closest-squared-distance-to-rotated-rect.js.map +1 -1
- package/node/index.d.ts +50 -40
- package/node/index.js +34 -37
- package/node/index.js.map +1 -1
- package/node/loop/get-max-coordinate.js.map +1 -1
- package/node/mat/{add-to-cp-graph.d.ts → add-to-cp-tree.d.ts} +6 -4
- package/node/mat/add-to-cp-tree.js +34 -0
- package/node/mat/add-to-cp-tree.js.map +1 -0
- package/node/mat/connect-hole-closers.d.ts +3 -0
- package/node/mat/connect-hole-closers.js +5 -0
- package/node/mat/connect-hole-closers.js.map +1 -0
- package/node/mat/create-new-cp-tree.d.ts +1 -1
- package/node/mat/create-new-cp-tree.js +2 -1
- package/node/mat/create-new-cp-tree.js.map +1 -1
- package/node/mat/{bezier-piece.d.ts → curve-piece.d.ts} +2 -2
- package/node/mat/curve-piece.js +2 -0
- package/node/mat/curve-piece.js.map +1 -0
- package/node/mat/get-boundary-piece-beziers.d.ts +3 -2
- package/node/mat/get-boundary-piece-beziers.js +2 -3
- package/node/mat/get-boundary-piece-beziers.js.map +1 -1
- package/node/mat/get-branches.d.ts +1 -10
- package/node/mat/get-branches.js +23 -60
- package/node/mat/get-branches.js.map +1 -1
- package/node/mat/get-closeby-cp-if-exist.d.ts +17 -0
- package/node/mat/{is-another-cp-closeby.js → get-closeby-cp-if-exist.js} +17 -13
- package/node/mat/get-closeby-cp-if-exist.js.map +1 -0
- package/node/mat/get-cp-node-to-left-or-same.d.ts +18 -0
- package/node/mat/get-cp-node-to-left-or-same.js +29 -0
- package/node/mat/get-cp-node-to-left-or-same.js.map +1 -0
- package/node/mat/get-largest-vertex.d.ts +1 -1
- package/node/mat/get-largest-vertex.js +3 -1
- package/node/mat/get-largest-vertex.js.map +1 -1
- package/node/mat/mat-meta.d.ts +24 -0
- package/node/mat/mat-meta.js +2 -0
- package/node/mat/mat-meta.js.map +1 -0
- package/node/mat/mat.d.ts +6 -6
- package/node/mat/simplify-mat.d.ts +2 -2
- package/node/mat/simplify-mat.js +31 -20
- package/node/mat/simplify-mat.js.map +1 -1
- package/node/mat/trim-mat.js +8 -2
- package/node/mat/trim-mat.js.map +1 -1
- package/node/memoize-primitive.d.ts +11 -0
- package/node/memoize-primitive.js +25 -0
- package/node/memoize-primitive.js.map +1 -0
- package/node/point-on-shape/calc-pos-order.js +1 -2
- package/node/point-on-shape/calc-pos-order.js.map +1 -1
- package/node/point-on-shape/compare-poss.js.map +1 -1
- package/node/point-on-shape/create-pos.d.ts +1 -1
- package/node/point-on-shape/create-pos.js +2 -3
- package/node/point-on-shape/create-pos.js.map +1 -1
- package/node/point-on-shape/get-osculating-circle.d.ts +3 -1
- package/node/point-on-shape/get-osculating-circle.js +6 -2
- package/node/point-on-shape/get-osculating-circle.js.map +1 -1
- package/node/point-on-shape/get-pos-corner.js +4 -2
- package/node/point-on-shape/get-pos-corner.js.map +1 -1
- package/node/point-on-shape/is-pos-quite-sharp-corner.js.map +1 -1
- package/node/point-on-shape/is-pos-sharp-corner.js.map +1 -1
- package/node/point-on-shape/point-on-shape.d.ts +1 -1
- package/node/sat/add-debug-info.d.ts +1 -2
- package/node/sat/add-debug-info.js +1 -2
- package/node/sat/add-debug-info.js.map +1 -1
- package/node/sat/cull-non-cycles.js +2 -2
- package/node/sat/cull-non-cycles.js.map +1 -1
- package/node/sat/cull.d.ts +2 -2
- package/node/sat/cull.js +44 -29
- package/node/sat/cull.js.map +1 -1
- package/node/sat/get-leaves.js +4 -2
- package/node/sat/get-leaves.js.map +1 -1
- package/node/sat/get-sat-culls.d.ts +4 -0
- package/node/sat/get-sat-culls.js +33 -0
- package/node/sat/get-sat-culls.js.map +1 -0
- package/node/sat/to-scale-axis.js +13 -44
- package/node/sat/to-scale-axis.js.map +1 -1
- package/node/svg/get-loop-bounds.js.map +1 -1
- package/node/svg/get-min-y-pos.d.ts +1 -1
- package/node/svg/get-shape-bounds.js.map +1 -1
- package/node/sweep-line/sweep-line.js.map +1 -1
- package/node/utils/dual-set.d.ts +27 -0
- package/node/utils/dual-set.js +55 -0
- package/node/utils/dual-set.js.map +1 -0
- package/node/utils/sleep.d.ts +2 -0
- package/node/utils/sleep.js +5 -0
- package/node/utils/sleep.js.map +1 -0
- package/node/utils/sum.d.ts +2 -0
- package/node/utils/sum.js +9 -0
- package/node/utils/sum.js.map +1 -0
- package/node/utils/tri-map.d.ts +27 -0
- package/node/utils/tri-map.js +49 -0
- package/node/utils/tri-map.js.map +1 -0
- package/node/vertex/remove-vertex.d.ts +5 -0
- package/node/vertex/remove-vertex.js +12 -0
- package/node/vertex/remove-vertex.js.map +1 -0
- package/package.json +21 -25
- package/src/add-n-prong.ts/join-spokes.ts +39 -0
- package/src/bezier/fit-quads-to-cubic.ts +103 -0
- package/src/bezier/total-curvature.ts +8 -0
- package/src/bezier/total-length.ts +8 -0
- package/src/closest-boundary-point/closest-points-on-curve-precise.ts +62 -62
- package/src/closest-boundary-point/cull-bezier-pieces.ts +2 -2
- package/src/closest-boundary-point/cull-by-loose-bounding-box.ts +4 -4
- package/src/closest-boundary-point/cull-by-tight-boundary-box.ts +2 -2
- package/src/closest-boundary-point/foot-and-endpoint-info.ts +2 -2
- package/src/closest-boundary-point/get-best-distance-squared.ts +2 -2
- package/src/closest-boundary-point/get-close-boundary-points-certified.ts +8 -3
- package/src/closest-boundary-point/get-closest-boundary-point-certified.ts +56 -56
- package/src/closest-boundary-point/get-potential-closest-points-on-curve-certified.ts +24 -6
- package/src/closest-boundary-point/root-interval-to-distance-squared-interval.ts +12 -6
- package/src/corner/compare-curvatures-at-interface.ts +49 -69
- package/src/corner/corner.ts +1 -1
- package/src/corner/get-corner.ts +9 -23
- package/src/corner/get-interface-ccw.ts +96 -60
- package/src/cp-node/cp-node-fs.ts +234 -0
- package/src/cp-node/cp-node.ts +27 -348
- package/src/cp-node/fs/add-distance-from.ts +50 -0
- package/src/cp-node/{clone.ts → fs/clone.ts} +27 -17
- package/src/cp-node/fs/cp-nodes-to-boundary-beziers.ts +10 -0
- package/src/cp-node/fs/create-cp-node.ts +21 -0
- package/src/cp-node/{enhance-cp-node.ts → fs/enhance-cp-node.ts} +10 -4
- package/src/cp-node/fs/find-first.ts +25 -0
- package/src/cp-node/fs/get-all-between.ts +44 -0
- package/src/cp-node/fs/get-all-on-circle.ts +23 -0
- package/src/cp-node/fs/get-all-on-loop.ts +18 -0
- package/src/cp-node/fs/get-all-vertices.ts +17 -0
- package/src/cp-node/fs/get-angle-between-mat-curves.ts +33 -0
- package/src/cp-node/fs/get-avg-speed.ts +31 -0
- package/src/cp-node/{get-boundary-bezier-parts-to-next.ts → fs/get-boundary-bezier-parts-to-next.ts} +2 -9
- package/src/cp-node/fs/get-boundary-beziers-between.ts +31 -0
- package/src/cp-node/{get-boundary-beziers-to-next.ts → fs/get-boundary-beziers-to-next.ts} +5 -10
- package/src/cp-node/fs/get-boundary-distance-to-next.ts +16 -0
- package/src/cp-node/fs/get-branch-beziers.ts +18 -0
- package/src/cp-node/fs/get-branch.ts +43 -0
- package/src/cp-node/fs/get-children.ts +18 -0
- package/src/cp-node/{get-cp-node-ordering.ts → fs/get-cp-node-ordering.ts} +5 -1
- package/src/cp-node/fs/get-distance-between.ts +16 -0
- package/src/cp-node/fs/get-distance-to-next.ts +19 -0
- package/src/cp-node/fs/get-edge-direction.ts +64 -0
- package/src/cp-node/fs/get-first-exit.ts +22 -0
- package/src/cp-node/fs/get-hole-closers.ts +13 -0
- package/src/cp-node/fs/get-implied-boundary-bezier-between.ts +78 -0
- package/src/cp-node/fs/get-mat-curve-between.ts +74 -0
- package/src/cp-node/fs/get-mat-curve-to-next.ts +13 -0
- package/src/cp-node/fs/get-mat-curves-between.ts +22 -0
- package/src/cp-node/fs/get-non-terminating-on-circle.ts +24 -0
- package/src/cp-node/fs/get-prong-count.ts +18 -0
- package/src/cp-node/fs/get-real-prong-count.ts +14 -0
- package/src/cp-node/fs/get-salience.ts +28 -0
- package/src/cp-node/fs/get-smoothed-speed.ts +97 -0
- package/src/cp-node/fs/get-smoothed.ts +62 -0
- package/src/cp-node/fs/get-speed.ts +61 -0
- package/src/cp-node/fs/get-terminating-on-circle.ts +24 -0
- package/src/cp-node/fs/get-vertex-forward-children.ts +22 -0
- package/src/cp-node/fs/insert-cp-node.ts +40 -0
- package/src/cp-node/fs/is-fully-terminating.ts +13 -0
- package/src/cp-node/fs/is-on-same-circle.ts +16 -0
- package/src/cp-node/fs/is-one-prong.ts +21 -0
- package/src/cp-node/fs/is-order-correct.ts +36 -0
- package/src/cp-node/fs/is-sharp.ts +9 -0
- package/src/cp-node/fs/is-single-3-prong.ts +15 -0
- package/src/cp-node/fs/is-special.ts +16 -0
- package/src/cp-node/fs/is-terminating.ts +9 -0
- package/src/cp-node/fs/is-trivial.ts +16 -0
- package/src/cp-node/fs/is-two-prong.ts +10 -0
- package/src/cp-node/fs/is-vertex-special.ts +8 -0
- package/src/cp-node/fs/is-vertex.ts +12 -0
- package/src/cp-node/fs/iterate-all-on-loop.ts +15 -0
- package/src/cp-node/fs/remove-cp-node.ts +20 -0
- package/src/cp-node/fs/traverse-all-forward.ts +24 -0
- package/src/cp-node/{traverse-cp.ts → fs/traverse-cp.ts} +3 -11
- package/src/cp-node/fs/traverse-edges.ts +71 -0
- package/src/cp-node/fs/traverse-vertices.ts +32 -0
- package/src/curve/curve.ts +1 -16
- package/src/dbscan/dbscan.ts +91 -0
- package/src/debug/debug-elem-types.ts +37 -29
- package/src/debug/debug.ts +20 -25
- package/src/debug/functions/check-ordering.ts +97 -0
- package/src/debug/functions/cmp-cp-on-delta.ts +54 -0
- package/src/debug/functions/draw/draw-bezier-pieces.ts +35 -0
- package/src/debug/functions/draw/draw-beziers-as-single-path.ts +40 -0
- package/src/debug/functions/draw/draw-disk.ts +34 -0
- package/src/debug/functions/draw/xmlns.ts +5 -0
- package/src/debug/functions/draw-elem/branch.ts +0 -1
- package/src/debug/functions/draw-elem/draw-branch.ts +39 -0
- package/src/debug/functions/draw-elem/draw-cp-node.ts +47 -0
- package/src/debug/functions/draw-elem/draw-cull.ts +21 -0
- package/src/debug/functions/draw-elem/draw-dull-corner.ts +21 -0
- package/src/debug/functions/draw-elem/draw-elem.ts +51 -48
- package/src/debug/functions/draw-elem/draw-leaves.ts +51 -0
- package/src/debug/functions/draw-elem/draw-loop.ts +16 -0
- package/src/debug/functions/draw-elem/draw-loops.ts +10 -0
- package/src/debug/functions/draw-elem/draw-loose-bounding-box.ts +21 -0
- package/src/debug/functions/draw-elem/draw-mat.ts +53 -0
- package/src/debug/functions/draw-elem/draw-max-vertex.ts +15 -0
- package/src/debug/functions/draw-elem/draw-min-y.ts +18 -0
- package/src/debug/functions/draw-elem/draw-one-prong-at-dull-corner.ts +26 -0
- package/src/debug/functions/draw-elem/draw-one-prong.ts +23 -0
- package/src/debug/functions/draw-elem/draw-sharp-corner.ts +20 -0
- package/src/debug/functions/draw-elem/draw-speed.ts +35 -0
- package/src/debug/functions/draw-elem/draw-three-prong.ts +44 -0
- package/src/debug/functions/draw-elem/draw-tight-bounding-box.ts +18 -0
- package/src/debug/functions/draw-elem/draw-two-prong.ts +67 -0
- package/src/debug/functions/draw-elem/draw-vertex.ts +30 -0
- package/src/debug/two-prong-for-debugging.ts +2 -2
- package/src/dijkstra/dijkstra.ts +418 -0
- package/src/find-2-prong/add-1-prong.ts +15 -22
- package/src/find-2-prong/add-2-prong.ts +68 -173
- package/src/find-2-prong/add-debug-info.ts +21 -25
- package/src/find-2-prong/calc-seperation-tolerance.ts +121 -0
- package/src/find-2-prong/cull-bezier-pieces.ts +4 -4
- package/src/find-2-prong/find-2-prong.ts +86 -65
- package/src/find-2-prong/find-and-add-2-prong.ts +30 -0
- package/src/find-2-prong/find-and-add-2-prongs-on-all-loops.ts +37 -0
- package/src/find-2-prong/find-and-add-2-prongs.ts +20 -33
- package/src/find-2-prong/find-and-add-hole-closing-2-prongs.ts +13 -14
- package/src/find-2-prong/get-initial-bezier-pieces.ts +23 -31
- package/src/find-2-prong/reduce-radius.ts +13 -24
- package/src/find-3-prong.ts/array-set.ts +47 -0
- package/src/find-3-prong.ts/calc-better-x.ts +7 -7
- package/src/find-3-prong.ts/calc-initial-3-prong-center.ts +8 -3
- package/src/find-3-prong.ts/find-3-prong-for-delta3s.ts +28 -42
- package/src/find-3-prong.ts/find-3-prong.ts +7 -107
- package/src/find-3-prong.ts/find-and-add-3-prong.ts +61 -0
- package/src/find-3-prong.ts/find-and-add-3-prongs-on-loop.ts +89 -0
- package/src/find-3-prong.ts/find-and-add-3-prongs.ts +31 -81
- package/src/find-3-prong.ts/get-closest-points.ts +3 -3
- package/src/find-mat/add-2-prongs-by-error.ts +122 -0
- package/src/find-mat/clip-options.ts +38 -0
- package/src/find-mat/cp-node-for-insertion.ts +13 -0
- package/src/find-mat/create-initial-cp-tree.ts +59 -0
- package/src/find-mat/find-mat.ts +50 -38
- package/src/find-mat/find-mats.ts +39 -22
- package/src/find-mat/get-dull-corners-on-loop.ts +34 -0
- package/src/find-mat/get-for-1-prongs-on-loop.ts +25 -6
- package/src/find-mat/get-for-2-prongs-on-loop.ts +16 -8
- package/src/find-mat/get-half-angles.ts +95 -0
- package/src/find-mat/get-meta.ts +115 -0
- package/src/find-mat/get-sharp-corners.ts +3 -2
- package/src/find-mat/get-total-by.ts +5 -5
- package/src/find-mat/mat-options.ts +140 -0
- package/src/floyd-warshall/floyd-warshall.ts +89 -0
- package/src/floyd-warshall/get-graph.ts +73 -0
- package/src/floyd-warshall/get-hole-closer-pairs.ts +27 -0
- package/src/geometry/get-bounding-box-.ts +3 -2
- package/src/heap/heap.ts +96 -0
- package/src/index.ts +52 -133
- package/src/mat/add-to-cp-tree.ts +56 -0
- package/src/mat/clone-mat.ts +14 -0
- package/src/mat/clone-meta.ts +17 -0
- package/src/mat/connect-hole-closers.ts +9 -0
- package/src/mat/create-new-cp-tree.ts +4 -1
- package/src/mat/{bezier-piece.ts → curve-piece.ts} +2 -2
- package/src/mat/get-boundary-piece-beziers.ts +10 -11
- package/src/mat/get-branches.ts +25 -75
- package/src/mat/get-closeby-cp-if-exist.ts +75 -0
- package/src/mat/get-cp-node-to-left-or-same.ts +43 -0
- package/src/mat/get-edges-as-array.ts +12 -12
- package/src/mat/get-largest-3-prong.ts +21 -0
- package/src/mat/get-largest-vertex.ts +4 -1
- package/src/mat/mat-meta.ts +31 -0
- package/src/mat/mat.ts +7 -7
- package/src/mat/simplify-mat.ts +39 -23
- package/src/mat/trim-mat.ts +8 -2
- package/src/memoize-primitive.ts +31 -0
- package/src/point-on-shape/calc-pos-order.ts +1 -2
- package/src/point-on-shape/create-pos.ts +2 -3
- package/src/point-on-shape/get-osculating-circle.ts +4 -1
- package/src/point-on-shape/get-pos-corner.ts +10 -6
- package/src/point-on-shape/is-pos-dull-corner.ts +6 -4
- package/src/point-on-shape/point-on-shape.ts +1 -1
- package/src/sat/add-debug-info.ts +0 -4
- package/src/sat/cull-by-salience.ts +115 -0
- package/src/sat/cull-non-cycles.ts +4 -2
- package/src/sat/cull.ts +53 -33
- package/src/sat/get-leaves.ts +7 -2
- package/src/sat/get-sat-culls.ts +46 -0
- package/src/sat/to-scale-axis.ts +13 -57
- package/src/svg/get-extreme.ts +1 -1
- package/src/utils/bezier-piece-to-bezier.ts +13 -0
- package/src/utils/deg-to-rad.ts +7 -0
- package/src/utils/dual-map.ts +55 -0
- package/src/utils/dual-set.ts +82 -0
- package/src/utils/rad-to-deg.ts +7 -0
- package/src/utils/rotate.ts +17 -0
- package/src/utils/sleep.ts +7 -0
- package/src/utils/sum.ts +12 -0
- package/src/utils/tri-map.ts +76 -0
- package/src/vertex/remove-vertex.ts +22 -0
- package/webpack.config.cjs +38 -36
- package/browser/index.js +0 -33589
- package/node/closest-boundary-point/get-closest-boundary-point-certified.d.ts +0 -15
- package/node/closest-boundary-point/get-closest-boundary-point-certified.js +0 -42
- package/node/closest-boundary-point/get-closest-boundary-point-certified.js.map +0 -1
- package/node/cp-node/clone.js.map +0 -1
- package/node/cp-node/create-cp-node.d.ts +0 -4
- package/node/cp-node/create-cp-node.js +0 -8
- package/node/cp-node/create-cp-node.js.map +0 -1
- package/node/cp-node/enhance-cp-node.js.map +0 -1
- package/node/cp-node/get-boundary-bezier-parts-to-next.js.map +0 -1
- package/node/cp-node/get-boundary-beziers-to-next.d.ts +0 -8
- package/node/cp-node/get-boundary-beziers-to-next.js.map +0 -1
- package/node/cp-node/get-cp-node-ordering.js.map +0 -1
- package/node/cp-node/get-curve-to-next.d.ts +0 -9
- package/node/cp-node/get-curve-to-next.js +0 -12
- package/node/cp-node/get-curve-to-next.js.map +0 -1
- package/node/cp-node/remove.d.ts +0 -9
- package/node/cp-node/remove.js +0 -20
- package/node/cp-node/remove.js.map +0 -1
- package/node/cp-node/traverse-cp.d.ts +0 -12
- package/node/cp-node/traverse-cp.js.map +0 -1
- package/node/cp-node/traverse-edges.d.ts +0 -10
- package/node/cp-node/traverse-edges.js +0 -23
- package/node/cp-node/traverse-edges.js.map +0 -1
- package/node/cp-node/traverse-vertices.d.ts +0 -12
- package/node/cp-node/traverse-vertices.js +0 -29
- package/node/cp-node/traverse-vertices.js.map +0 -1
- package/node/debug/functions/draw-elem/branch.d.ts +0 -4
- package/node/debug/functions/draw-elem/branch.js +0 -24
- package/node/debug/functions/draw-elem/branch.js.map +0 -1
- package/node/debug/functions/draw-elem/culls.d.ts +0 -4
- package/node/debug/functions/draw-elem/culls.js +0 -22
- package/node/debug/functions/draw-elem/culls.js.map +0 -1
- package/node/debug/functions/draw-elem/dull-corner.js.map +0 -1
- package/node/debug/functions/draw-elem/leaves.d.ts +0 -4
- package/node/debug/functions/draw-elem/leaves.js +0 -13
- package/node/debug/functions/draw-elem/leaves.js.map +0 -1
- package/node/debug/functions/draw-elem/loop.js.map +0 -1
- package/node/debug/functions/draw-elem/loops.js.map +0 -1
- package/node/debug/functions/draw-elem/loose-bounding-box.js.map +0 -1
- package/node/debug/functions/draw-elem/mat.d.ts +0 -4
- package/node/debug/functions/draw-elem/mat.js +0 -33
- package/node/debug/functions/draw-elem/mat.js.map +0 -1
- package/node/debug/functions/draw-elem/max-vertex.js.map +0 -1
- package/node/debug/functions/draw-elem/min-y.js.map +0 -1
- package/node/debug/functions/draw-elem/one-prong-at-dull-corner.js.map +0 -1
- package/node/debug/functions/draw-elem/one-prong.js.map +0 -1
- package/node/debug/functions/draw-elem/sharp-corner.js.map +0 -1
- package/node/debug/functions/draw-elem/three-prong.d.ts +0 -4
- package/node/debug/functions/draw-elem/three-prong.js +0 -15
- package/node/debug/functions/draw-elem/three-prong.js.map +0 -1
- package/node/debug/functions/draw-elem/tight-bounding-box.js.map +0 -1
- package/node/debug/functions/draw-elem/two-prong.d.ts +0 -4
- package/node/debug/functions/draw-elem/two-prong.js +0 -36
- package/node/debug/functions/draw-elem/two-prong.js.map +0 -1
- package/node/debug/functions/draw-elem/vertex.js +0 -30
- package/node/debug/functions/draw-elem/vertex.js.map +0 -1
- package/node/debug/functions/three-prong.d.ts +0 -11
- package/node/debug/functions/three-prong.js +0 -182
- package/node/debug/functions/three-prong.js.map +0 -1
- package/node/debug/functions/two-prong.d.ts +0 -24
- package/node/debug/functions/two-prong.js +0 -116
- package/node/debug/functions/two-prong.js.map +0 -1
- package/node/debug/three-prong-for-debugging.d.ts +0 -31
- package/node/debug/three-prong-for-debugging.js +0 -21
- package/node/debug/three-prong-for-debugging.js.map +0 -1
- package/node/debug/two-prong-for-debugging.d.ts +0 -26
- package/node/debug/two-prong-for-debugging.js +0 -2
- package/node/debug/two-prong-for-debugging.js.map +0 -1
- package/node/find-2-prong/add-debug-info.d.ts +0 -8
- package/node/find-2-prong/add-debug-info.js +0 -23
- package/node/find-2-prong/add-debug-info.js.map +0 -1
- package/node/find-2-prong/find-and-add-2-prongs-on-all-paths.d.ts +0 -15
- package/node/find-2-prong/find-and-add-2-prongs-on-all-paths.js +0 -22
- package/node/find-2-prong/find-and-add-2-prongs-on-all-paths.js.map +0 -1
- package/node/find-2-prong/x-for-debugging.d.ts +0 -9
- package/node/find-2-prong/x-for-debugging.js +0 -2
- package/node/find-2-prong/x-for-debugging.js.map +0 -1
- package/node/find-3-prong.ts/add-3-prong.d.ts +0 -24
- package/node/find-3-prong.ts/add-3-prong.js +0 -82
- package/node/find-3-prong.ts/add-3-prong.js.map +0 -1
- package/node/find-3-prong.ts/find-and-add-all-3-prongs.d.ts +0 -13
- package/node/find-3-prong.ts/find-and-add-all-3-prongs.js +0 -66
- package/node/find-3-prong.ts/find-and-add-all-3-prongs.js.map +0 -1
- package/node/find-mat/add-debug-info.d.ts +0 -9
- package/node/find-mat/add-debug-info.js +0 -68
- package/node/find-mat/add-debug-info.js.map +0 -1
- package/node/find-mat/create-initial-cp-graph.js.map +0 -1
- package/node/find-mat/fix-ordering.d.ts +0 -8
- package/node/find-mat/fix-ordering.js +0 -59
- package/node/find-mat/fix-ordering.js.map +0 -1
- package/node/find-mat/get-dull-corners.js.map +0 -1
- package/node/find-mat/get-size-params.d.ts +0 -7
- package/node/find-mat/get-size-params.js +0 -33
- package/node/find-mat/get-size-params.js.map +0 -1
- package/node/get-curve/get-curve-between.d.ts +0 -9
- package/node/get-curve/get-curve-between.js.map +0 -1
- package/node/get-curve/get-edge-direction.d.ts +0 -9
- package/node/get-curve/get-edge-direction.js.map +0 -1
- package/node/mat/add-to-cp-graph.js +0 -33
- package/node/mat/add-to-cp-graph.js.map +0 -1
- package/node/mat/bezier-piece.js +0 -2
- package/node/mat/bezier-piece.js.map +0 -1
- package/node/mat/elem-type-two-prong.d.ts +0 -3
- package/node/mat/elem-type-two-prong.js +0 -2
- package/node/mat/elem-type-two-prong.js.map +0 -1
- package/node/mat/get-neighboring-cps.d.ts +0 -16
- package/node/mat/get-neighboring-cps.js +0 -33
- package/node/mat/get-neighboring-cps.js.map +0 -1
- package/node/mat/get-two-prong-type.d.ts +0 -5
- package/node/mat/get-two-prong-type.js +0 -9
- package/node/mat/get-two-prong-type.js.map +0 -1
- package/node/mat/is-another-cp-closeby.d.ts +0 -21
- package/node/mat/is-another-cp-closeby.js.map +0 -1
- package/node/mat/simplify-mat-map-only.d.ts +0 -23
- package/node/mat/simplify-mat-map-only.js +0 -82
- package/node/mat/simplify-mat-map-only.js.map +0 -1
- package/node/point-on-shape/is-pos-dull-corner.d.ts +0 -6
- package/node/point-on-shape/is-pos-dull-corner.js +0 -14
- package/node/point-on-shape/is-pos-dull-corner.js.map +0 -1
- package/src/cp-node/create-cp-node.ts +0 -21
- package/src/cp-node/get-curve-to-next.ts +0 -16
- package/src/cp-node/remove.ts +0 -27
- package/src/cp-node/traverse-edges.ts +0 -29
- package/src/cp-node/traverse-vertices.ts +0 -37
- /package/{test → __tests__}/lib-load.spec.ts +0 -0
- /package/node/debug/functions/draw-elem/{dull-corner.d.ts → draw-dull-corner.d.ts} +0 -0
- /package/node/debug/functions/draw-elem/{loop.d.ts → draw-loop.d.ts} +0 -0
- /package/node/debug/functions/draw-elem/{loops.d.ts → draw-loops.d.ts} +0 -0
- /package/node/debug/functions/draw-elem/{loose-bounding-box.d.ts → draw-loose-bounding-box.d.ts} +0 -0
- /package/node/debug/functions/draw-elem/{max-vertex.d.ts → draw-max-vertex.d.ts} +0 -0
- /package/node/debug/functions/draw-elem/{min-y.d.ts → draw-min-y.d.ts} +0 -0
- /package/node/debug/functions/draw-elem/{one-prong-at-dull-corner.d.ts → draw-one-prong-at-dull-corner.d.ts} +0 -0
- /package/node/debug/functions/draw-elem/{one-prong.d.ts → draw-one-prong.d.ts} +0 -0
- /package/node/debug/functions/draw-elem/{sharp-corner.d.ts → draw-sharp-corner.d.ts} +0 -0
- /package/node/debug/functions/draw-elem/{tight-bounding-box.d.ts → draw-tight-bounding-box.d.ts} +0 -0
- /package/node/find-mat/{get-dull-corners.d.ts → get-dull-corners-on-loop.d.ts} +0 -0
|
@@ -1,6 +1,4 @@
|
|
|
1
|
-
import { LlRbTree } from 'flo-ll-rb-tree';
|
|
2
1
|
import { ContactPoint } from '../contact-point/contact-point.js';
|
|
3
|
-
import { removeCpNode } from './remove.js';
|
|
4
2
|
/**
|
|
5
3
|
* The primary interface of the library.
|
|
6
4
|
*
|
|
@@ -24,7 +22,7 @@ import { removeCpNode } from './remove.js';
|
|
|
24
22
|
* the CpNode to the next maximal disk contact point. This is equivalent to
|
|
25
23
|
* following other branches on the MAT.
|
|
26
24
|
*
|
|
27
|
-
* Call [[
|
|
25
|
+
* Call [[getMatCurveBetween]](cpNodeFrom, cpNodeTo) or getMatCurveToNext(cpNode)
|
|
28
26
|
* (replacing the older CpNode.[[matCurveToNextVertex]]) to get a bezier curve
|
|
29
27
|
* from the maximal disk of this [[CpNode]] to the next [[CpNode]]'s
|
|
30
28
|
* maximal disk and thus directly representing a piece of the medial axis.
|
|
@@ -37,12 +35,12 @@ import { removeCpNode } from './remove.js';
|
|
|
37
35
|
* be the edges [[next]] and [[nextOnCircle]], etc. [[getChildren]] allows one to
|
|
38
36
|
* easily traverse the MAT tree - see e.g. the implementation of [[traverseEdges]].
|
|
39
37
|
*
|
|
40
|
-
* The getter, [[
|
|
38
|
+
* The getter, [[getVertexForwardChildren]], is similar to [[getChildren]] but returns the
|
|
41
39
|
* child nodes of the tree when [[CpNode]] is seen as a MAT vertex point (as
|
|
42
40
|
* opposed to edge). In this way the dual graph of the tree can easily be
|
|
43
41
|
* traversed - see e.g. [[traverseVertices]]. Generally, however, traversing the
|
|
44
42
|
* edges is preferred as it returns the entire Medial Axis (by utilizing
|
|
45
|
-
* [[
|
|
43
|
+
* [[getMatCurveToNext]] on each returned edge).
|
|
46
44
|
*
|
|
47
45
|
* It may be worth mentioning that by traversing from the CpNode by following
|
|
48
46
|
* [[next]] repeatedly until one is back at the same CpNode allows one
|
|
@@ -70,127 +68,23 @@ interface CpNode {
|
|
|
70
68
|
* the inscribed circle defined by the maximal disk).
|
|
71
69
|
*/
|
|
72
70
|
nextOnCircle: CpNode;
|
|
71
|
+
/**
|
|
72
|
+
* For hole closers only - the next `CpNode` ignoring the hole closer
|
|
73
|
+
*/
|
|
74
|
+
holeCloserNext?: CpNode | undefined;
|
|
75
|
+
/**
|
|
76
|
+
* For hole closers only - the prev `CpNode` ignoring the hole closer
|
|
77
|
+
*/
|
|
78
|
+
holeCloserPrev?: CpNode | undefined;
|
|
79
|
+
/** Only used in export */
|
|
80
|
+
id?: number;
|
|
81
|
+
/** Only used in export */
|
|
82
|
+
children?: number[];
|
|
83
|
+
/** Only used in export */
|
|
84
|
+
isRoot?: boolean;
|
|
85
|
+
/** Only used in export */
|
|
86
|
+
parentId?: number;
|
|
87
|
+
/** Only used in export */
|
|
88
|
+
childId?: number;
|
|
73
89
|
}
|
|
74
|
-
|
|
75
|
-
* Returns the bezier curve from the maximal disk of this [[CpNode]] to the
|
|
76
|
-
* next [[CpNode]]'s maximal disk and thus directly represents a piece of the
|
|
77
|
-
* medial axis.
|
|
78
|
-
* @deprecated Use [[getCurveToNext]] instead
|
|
79
|
-
* @param cpNode
|
|
80
|
-
*/
|
|
81
|
-
declare function matCurveToNextVertex(cpNode: CpNode): number[][];
|
|
82
|
-
/**
|
|
83
|
-
* Primarily for internal use.
|
|
84
|
-
*
|
|
85
|
-
* Compares the order of two [[CpNode]]s. The order is cyclic and depends
|
|
86
|
-
* on a [[CpNode]]'s relative position along the shape boundary.
|
|
87
|
-
*/
|
|
88
|
-
declare const cpNodeComparator: (a: CpNode, b: CpNode) => number;
|
|
89
|
-
/**
|
|
90
|
-
* Returns the children of this [[CpNode]] when seen as a MAT edge. Only
|
|
91
|
-
* children in a 'forward' direction are returned. These include all edges
|
|
92
|
-
* except the 'backward' edge given by [[prevOnCircle]], even terminating
|
|
93
|
-
* edges.
|
|
94
|
-
*/
|
|
95
|
-
declare function getChildren(cpNode: CpNode): CpNode[];
|
|
96
|
-
/**
|
|
97
|
-
* Similar to [[getChildren]] but returns the child nodes of the tree when
|
|
98
|
-
* [[CpNode]] is seen as a MAT vertex point (as opposed to edge). In this
|
|
99
|
-
* way the dual graph of the tree can easily be traversed - see e.g.
|
|
100
|
-
* [[traverseVertices]]. Generally, however, traversing the edges is
|
|
101
|
-
* preferred as it returns the entire Medial Axis (by utilizing
|
|
102
|
-
* [[getCurveToNext]] on each returned edge).
|
|
103
|
-
*/
|
|
104
|
-
declare function vertexChildren(cpNode: CpNode): CpNode[];
|
|
105
|
-
/**
|
|
106
|
-
* Returns all [[CpNode]]s on the MAT that this [[CpNode]] is part of
|
|
107
|
-
* starting from the current one and going anti-clockwise around the shape.
|
|
108
|
-
*/
|
|
109
|
-
declare function getAllOnLoop(cpNode: CpNode): CpNode[];
|
|
110
|
-
/**
|
|
111
|
-
* Primarily for internal use.
|
|
112
|
-
*
|
|
113
|
-
* Insert a [[CpNode]] into the MAT tree graph after the specified point
|
|
114
|
-
* and returns the freshly inserted [[CpNode]].
|
|
115
|
-
* @param isHoleClosing True if this is a hole closing contact point.
|
|
116
|
-
* @param isIntersection True if this is a contact point at a shape boundary
|
|
117
|
-
* intersection point.
|
|
118
|
-
* @param cpTree The tree graph holding the [[CpNodes]] of the MAT.
|
|
119
|
-
* @param cp [[ContactPoint]] defining the [[CpNode]].
|
|
120
|
-
* @param prev_ Inserts the new [[CpNode]] right after this item if the
|
|
121
|
-
* loop is not empty, else insert the new [[CpNode]] as the only item in the
|
|
122
|
-
* loop.
|
|
123
|
-
*/
|
|
124
|
-
declare function insertCpNode(isHoleClosing: boolean, isIntersection: boolean, cpTree: LlRbTree<CpNode>, cp: ContactPoint, prev_: CpNode): CpNode;
|
|
125
|
-
/**
|
|
126
|
-
* Return this (except if exclThis is truthy) and the the other CpNodes
|
|
127
|
-
* around the maximal disk vertex circle in an anti-clockwise order.
|
|
128
|
-
* @param exclThis If true the returned array does not include this
|
|
129
|
-
* [[CpNode]].
|
|
130
|
-
*/
|
|
131
|
-
declare function getCpNodesOnCircle(cpNode: CpNode, exclThis?: boolean): CpNode[];
|
|
132
|
-
/**
|
|
133
|
-
* Returns true if the 2 given [[CpNode]]s are on the same maximal disk
|
|
134
|
-
* circle.
|
|
135
|
-
* @param cpNode1 A [[CpNode]].
|
|
136
|
-
* @param cpNode2 Another [[CpNode]]
|
|
137
|
-
*/
|
|
138
|
-
declare function isOnSameCircle(cpNode1: CpNode, cpNode2: CpNode): boolean;
|
|
139
|
-
/**
|
|
140
|
-
* Returns true if this [[CpNode]] is terminating, i.e. implies a leaf MAT
|
|
141
|
-
* vertex.
|
|
142
|
-
*
|
|
143
|
-
* This is always the case for sharp corners and maximal disks with
|
|
144
|
-
* a single contact point. Note, however, that even in these cases there are
|
|
145
|
-
* two contact points stored (sitting 'on top' of each other) for the
|
|
146
|
-
* maximal disk. It can be seen as a limiting case of a two-prong where the
|
|
147
|
-
* distance between two of the contact points tend to zero. One point
|
|
148
|
-
* (represented by a [[CpNode]] of course) will be terminating with the
|
|
149
|
-
* other point being its [[next]], whereas the other point will *not* be
|
|
150
|
-
* terminating and 'points' back into the shape.
|
|
151
|
-
*/
|
|
152
|
-
declare function isTerminating(cpNode: CpNode): boolean;
|
|
153
|
-
/**
|
|
154
|
-
* Like isTerminating() but only returns true if all cpNodes on the circle
|
|
155
|
-
* (except this.prevOnCircle) is terminating.
|
|
156
|
-
*/
|
|
157
|
-
declare function isFullyTerminating(cpNode: CpNode): boolean;
|
|
158
|
-
/**
|
|
159
|
-
* Returns the first [[CpNode]] (from this one by successively applying
|
|
160
|
-
* .nextOnCircle) that exits the circle.
|
|
161
|
-
*/
|
|
162
|
-
declare function getFirstExit(cpNode: CpNode): CpNode | undefined;
|
|
163
|
-
/**
|
|
164
|
-
* Returns true if this [[CpNode]] represents a sharp corner, i.e. the
|
|
165
|
-
* limiting case of a two-prong having zero radius.
|
|
166
|
-
*
|
|
167
|
-
* Note that two [[CpNode]]s are stored for each sharp corner, one being
|
|
168
|
-
* terminating and one not. See [[isTerminating]] for more details.
|
|
169
|
-
*/
|
|
170
|
-
declare function isSharp(cpNode: CpNode): boolean;
|
|
171
|
-
/**
|
|
172
|
-
* Returns the number of contact points on the maximal disk circle implied
|
|
173
|
-
* by this [[CpNode]].
|
|
174
|
-
*
|
|
175
|
-
* Note, however, that even one-prongs and sharp corners will return 2 (see
|
|
176
|
-
* [[isTerminating]] for more details); if this is not desired use
|
|
177
|
-
* [[getRealProngCount]] instead which will return 1 in these cases.
|
|
178
|
-
*/
|
|
179
|
-
declare function getProngCount(cpNode: CpNode): number;
|
|
180
|
-
/**
|
|
181
|
-
* Returns the number of contact points (up to planar coordinates) on the
|
|
182
|
-
* maximal disk circle implied by this [[CpNode]].
|
|
183
|
-
*
|
|
184
|
-
* See also [[getProngCount]].
|
|
185
|
-
*/
|
|
186
|
-
declare function getRealProngCount(cpNode: CpNode): number;
|
|
187
|
-
/**
|
|
188
|
-
* Returns true if this [[CpNode]]'s maximal disk has only one contact point
|
|
189
|
-
* on the shape boundary (up to planar coordinates). These includes sharp
|
|
190
|
-
* corners.
|
|
191
|
-
*
|
|
192
|
-
* Note, however, that two [[CpNode]]s are stored for each such point to
|
|
193
|
-
* preserve symmetry - see [[isTerminating]] for more details.
|
|
194
|
-
*/
|
|
195
|
-
declare function isOneProng(cpNode: CpNode): boolean;
|
|
196
|
-
export { CpNode, matCurveToNextVertex, getChildren, vertexChildren, getAllOnLoop, insertCpNode, getCpNodesOnCircle, isOnSameCircle, isTerminating, isFullyTerminating, getFirstExit, isSharp, isOneProng, getProngCount, getRealProngCount, cpNodeComparator, removeCpNode };
|
|
90
|
+
export { CpNode };
|
package/node/cp-node/cp-node.js
CHANGED
|
@@ -1,249 +1,2 @@
|
|
|
1
|
-
|
|
2
|
-
import { removeCpNode } from './remove.js';
|
|
3
|
-
import { getCurveToNext } from './get-curve-to-next.js';
|
|
4
|
-
import { createCpNode } from './create-cp-node.js';
|
|
5
|
-
/**
|
|
6
|
-
* Returns the bezier curve from the maximal disk of this [[CpNode]] to the
|
|
7
|
-
* next [[CpNode]]'s maximal disk and thus directly represents a piece of the
|
|
8
|
-
* medial axis.
|
|
9
|
-
* @deprecated Use [[getCurveToNext]] instead
|
|
10
|
-
* @param cpNode
|
|
11
|
-
*/
|
|
12
|
-
function matCurveToNextVertex(cpNode) {
|
|
13
|
-
return getCurveToNext(cpNode);
|
|
14
|
-
}
|
|
15
|
-
/**
|
|
16
|
-
* Primarily for internal use.
|
|
17
|
-
*
|
|
18
|
-
* Compares the order of two [[CpNode]]s. The order is cyclic and depends
|
|
19
|
-
* on a [[CpNode]]'s relative position along the shape boundary.
|
|
20
|
-
*/
|
|
21
|
-
const cpNodeComparator = (a, b) => compareCps(a.cp, b.cp);
|
|
22
|
-
/**
|
|
23
|
-
* Returns the children of this [[CpNode]] when seen as a MAT edge. Only
|
|
24
|
-
* children in a 'forward' direction are returned. These include all edges
|
|
25
|
-
* except the 'backward' edge given by [[prevOnCircle]], even terminating
|
|
26
|
-
* edges.
|
|
27
|
-
*/
|
|
28
|
-
function getChildren(cpNode) {
|
|
29
|
-
const children = [];
|
|
30
|
-
const cp = cpNode.next;
|
|
31
|
-
let cp_ = cp;
|
|
32
|
-
do {
|
|
33
|
-
children.push(cp_);
|
|
34
|
-
cp_ = cp_.nextOnCircle;
|
|
35
|
-
} while (cp_.nextOnCircle !== cp);
|
|
36
|
-
return children;
|
|
37
|
-
}
|
|
38
|
-
/**
|
|
39
|
-
* Similar to [[getChildren]] but returns the child nodes of the tree when
|
|
40
|
-
* [[CpNode]] is seen as a MAT vertex point (as opposed to edge). In this
|
|
41
|
-
* way the dual graph of the tree can easily be traversed - see e.g.
|
|
42
|
-
* [[traverseVertices]]. Generally, however, traversing the edges is
|
|
43
|
-
* preferred as it returns the entire Medial Axis (by utilizing
|
|
44
|
-
* [[getCurveToNext]] on each returned edge).
|
|
45
|
-
*/
|
|
46
|
-
function vertexChildren(cpNode) {
|
|
47
|
-
if (isTerminating(cpNode)) {
|
|
48
|
-
return [];
|
|
49
|
-
}
|
|
50
|
-
const children = [];
|
|
51
|
-
let cp_ = cpNode;
|
|
52
|
-
while (cp_ !== cpNode.prevOnCircle) {
|
|
53
|
-
if (!isTerminating(cp_)) {
|
|
54
|
-
children.push(cp_.next);
|
|
55
|
-
}
|
|
56
|
-
cp_ = cp_.nextOnCircle;
|
|
57
|
-
}
|
|
58
|
-
return children;
|
|
59
|
-
}
|
|
60
|
-
/**
|
|
61
|
-
* Returns all [[CpNode]]s on the MAT that this [[CpNode]] is part of
|
|
62
|
-
* starting from the current one and going anti-clockwise around the shape.
|
|
63
|
-
*/
|
|
64
|
-
function getAllOnLoop(cpNode) {
|
|
65
|
-
const cpStart = cpNode;
|
|
66
|
-
const cpNodes = [cpStart];
|
|
67
|
-
let cpNode_ = cpNode.next;
|
|
68
|
-
while (cpNode_ !== cpStart) {
|
|
69
|
-
cpNodes.push(cpNode_);
|
|
70
|
-
cpNode_ = cpNode_.next;
|
|
71
|
-
}
|
|
72
|
-
return cpNodes;
|
|
73
|
-
}
|
|
74
|
-
/**
|
|
75
|
-
* Primarily for internal use.
|
|
76
|
-
*
|
|
77
|
-
* Insert a [[CpNode]] into the MAT tree graph after the specified point
|
|
78
|
-
* and returns the freshly inserted [[CpNode]].
|
|
79
|
-
* @param isHoleClosing True if this is a hole closing contact point.
|
|
80
|
-
* @param isIntersection True if this is a contact point at a shape boundary
|
|
81
|
-
* intersection point.
|
|
82
|
-
* @param cpTree The tree graph holding the [[CpNodes]] of the MAT.
|
|
83
|
-
* @param cp [[ContactPoint]] defining the [[CpNode]].
|
|
84
|
-
* @param prev_ Inserts the new [[CpNode]] right after this item if the
|
|
85
|
-
* loop is not empty, else insert the new [[CpNode]] as the only item in the
|
|
86
|
-
* loop.
|
|
87
|
-
*/
|
|
88
|
-
function insertCpNode(isHoleClosing, isIntersection, cpTree, cp, prev_) {
|
|
89
|
-
// const cpNode = new CpNode(cp, isHoleClosing, isIntersection);
|
|
90
|
-
const cpNode = createCpNode(cp, isHoleClosing, isIntersection);
|
|
91
|
-
if (typeof _debug_ !== 'undefined') {
|
|
92
|
-
_debug_.generated.elems.cpNode.push({
|
|
93
|
-
generated: _debug_.generated,
|
|
94
|
-
cpNode
|
|
95
|
-
});
|
|
96
|
-
}
|
|
97
|
-
let prev;
|
|
98
|
-
let next;
|
|
99
|
-
if (!prev_) {
|
|
100
|
-
prev = cpNode;
|
|
101
|
-
next = cpNode;
|
|
102
|
-
}
|
|
103
|
-
else {
|
|
104
|
-
prev = prev_;
|
|
105
|
-
next = prev.next;
|
|
106
|
-
}
|
|
107
|
-
next.prev = cpNode;
|
|
108
|
-
prev.next = cpNode;
|
|
109
|
-
cpNode.prev = prev;
|
|
110
|
-
cpNode.next = next;
|
|
111
|
-
cpTree.insert(cpNode);
|
|
112
|
-
return cpNode;
|
|
113
|
-
}
|
|
114
|
-
/**
|
|
115
|
-
* Return this (except if exclThis is truthy) and the the other CpNodes
|
|
116
|
-
* around the maximal disk vertex circle in an anti-clockwise order.
|
|
117
|
-
* @param exclThis If true the returned array does not include this
|
|
118
|
-
* [[CpNode]].
|
|
119
|
-
*/
|
|
120
|
-
function getCpNodesOnCircle(cpNode, exclThis = false) {
|
|
121
|
-
// const startCp = this as CpNode;
|
|
122
|
-
const startCpNode = cpNode;
|
|
123
|
-
let cpNode_ = startCpNode;
|
|
124
|
-
const cpNodes = [];
|
|
125
|
-
do {
|
|
126
|
-
if (exclThis) {
|
|
127
|
-
exclThis = false;
|
|
128
|
-
}
|
|
129
|
-
else {
|
|
130
|
-
cpNodes.push(cpNode_);
|
|
131
|
-
}
|
|
132
|
-
cpNode_ = cpNode_.nextOnCircle;
|
|
133
|
-
} while (cpNode_ !== startCpNode);
|
|
134
|
-
return cpNodes;
|
|
135
|
-
}
|
|
136
|
-
/**
|
|
137
|
-
* Returns true if the 2 given [[CpNode]]s are on the same maximal disk
|
|
138
|
-
* circle.
|
|
139
|
-
* @param cpNode1 A [[CpNode]].
|
|
140
|
-
* @param cpNode2 Another [[CpNode]]
|
|
141
|
-
*/
|
|
142
|
-
function isOnSameCircle(cpNode1, cpNode2) {
|
|
143
|
-
const cpNodes = getCpNodesOnCircle(cpNode1, true);
|
|
144
|
-
return cpNodes.indexOf(cpNode2) >= 0;
|
|
145
|
-
}
|
|
146
|
-
/**
|
|
147
|
-
* Returns true if this [[CpNode]] is terminating, i.e. implies a leaf MAT
|
|
148
|
-
* vertex.
|
|
149
|
-
*
|
|
150
|
-
* This is always the case for sharp corners and maximal disks with
|
|
151
|
-
* a single contact point. Note, however, that even in these cases there are
|
|
152
|
-
* two contact points stored (sitting 'on top' of each other) for the
|
|
153
|
-
* maximal disk. It can be seen as a limiting case of a two-prong where the
|
|
154
|
-
* distance between two of the contact points tend to zero. One point
|
|
155
|
-
* (represented by a [[CpNode]] of course) will be terminating with the
|
|
156
|
-
* other point being its [[next]], whereas the other point will *not* be
|
|
157
|
-
* terminating and 'points' back into the shape.
|
|
158
|
-
*/
|
|
159
|
-
function isTerminating(cpNode) {
|
|
160
|
-
// return this === this.next.prevOnCircle;
|
|
161
|
-
return cpNode === cpNode.next.prevOnCircle;
|
|
162
|
-
}
|
|
163
|
-
/**
|
|
164
|
-
* Like isTerminating() but only returns true if all cpNodes on the circle
|
|
165
|
-
* (except this.prevOnCircle) is terminating.
|
|
166
|
-
*/
|
|
167
|
-
function isFullyTerminating(cpNode) {
|
|
168
|
-
const otherOnCircle = getCpNodesOnCircle(cpNode.prevOnCircle, true);
|
|
169
|
-
const isFullyTerminating = otherOnCircle.every(cpn => isTerminating(cpn));
|
|
170
|
-
return isFullyTerminating;
|
|
171
|
-
}
|
|
172
|
-
/**
|
|
173
|
-
* Returns the first [[CpNode]] (from this one by successively applying
|
|
174
|
-
* .nextOnCircle) that exits the circle.
|
|
175
|
-
*/
|
|
176
|
-
function getFirstExit(cpNode) {
|
|
177
|
-
// const startNode = this as CpNode;
|
|
178
|
-
const startNode = cpNode;
|
|
179
|
-
let cpNode_ = startNode;
|
|
180
|
-
while (cpNode_.next === cpNode_.prevOnCircle) {
|
|
181
|
-
cpNode_ = cpNode_.next;
|
|
182
|
-
if (cpNode_ === startNode) {
|
|
183
|
-
// The very special case the MAT is a single point.
|
|
184
|
-
return undefined;
|
|
185
|
-
}
|
|
186
|
-
}
|
|
187
|
-
return cpNode_;
|
|
188
|
-
}
|
|
189
|
-
/**
|
|
190
|
-
* Returns true if this [[CpNode]] represents a sharp corner, i.e. the
|
|
191
|
-
* limiting case of a two-prong having zero radius.
|
|
192
|
-
*
|
|
193
|
-
* Note that two [[CpNode]]s are stored for each sharp corner, one being
|
|
194
|
-
* terminating and one not. See [[isTerminating]] for more details.
|
|
195
|
-
*/
|
|
196
|
-
function isSharp(cpNode) {
|
|
197
|
-
return cpNode.cp.circle.radius === 0;
|
|
198
|
-
}
|
|
199
|
-
/**
|
|
200
|
-
* Returns the number of contact points on the maximal disk circle implied
|
|
201
|
-
* by this [[CpNode]].
|
|
202
|
-
*
|
|
203
|
-
* Note, however, that even one-prongs and sharp corners will return 2 (see
|
|
204
|
-
* [[isTerminating]] for more details); if this is not desired use
|
|
205
|
-
* [[getRealProngCount]] instead which will return 1 in these cases.
|
|
206
|
-
*/
|
|
207
|
-
function getProngCount(cpNode) {
|
|
208
|
-
// const startCp = this as CpNode;
|
|
209
|
-
const startCpNode = cpNode;
|
|
210
|
-
let cpNode_ = startCpNode;
|
|
211
|
-
let i = 0;
|
|
212
|
-
do {
|
|
213
|
-
i++;
|
|
214
|
-
cpNode_ = cpNode_.nextOnCircle;
|
|
215
|
-
} while (cpNode_ !== startCpNode);
|
|
216
|
-
return i;
|
|
217
|
-
}
|
|
218
|
-
/**
|
|
219
|
-
* Returns the number of contact points (up to planar coordinates) on the
|
|
220
|
-
* maximal disk circle implied by this [[CpNode]].
|
|
221
|
-
*
|
|
222
|
-
* See also [[getProngCount]].
|
|
223
|
-
*/
|
|
224
|
-
function getRealProngCount(cpNode) {
|
|
225
|
-
if (isOneProng(cpNode)) {
|
|
226
|
-
return 1;
|
|
227
|
-
}
|
|
228
|
-
return getProngCount(cpNode);
|
|
229
|
-
}
|
|
230
|
-
/**
|
|
231
|
-
* Returns true if this [[CpNode]]'s maximal disk has only one contact point
|
|
232
|
-
* on the shape boundary (up to planar coordinates). These includes sharp
|
|
233
|
-
* corners.
|
|
234
|
-
*
|
|
235
|
-
* Note, however, that two [[CpNode]]s are stored for each such point to
|
|
236
|
-
* preserve symmetry - see [[isTerminating]] for more details.
|
|
237
|
-
*/
|
|
238
|
-
function isOneProng(cpNode) {
|
|
239
|
-
const cp1 = cpNode;
|
|
240
|
-
if (cp1.cp.circle.radius === 0) {
|
|
241
|
-
return true;
|
|
242
|
-
}
|
|
243
|
-
const cp2 = cp1.nextOnCircle;
|
|
244
|
-
const p1 = cp1.cp.pointOnShape.p;
|
|
245
|
-
const p2 = cp2.cp.pointOnShape.p;
|
|
246
|
-
return (p1[0] === p2[0] && p1[1] === p2[1]);
|
|
247
|
-
}
|
|
248
|
-
export { matCurveToNextVertex, getChildren, vertexChildren, getAllOnLoop, insertCpNode, getCpNodesOnCircle, isOnSameCircle, isTerminating, isFullyTerminating, getFirstExit, isSharp, isOneProng, getProngCount, getRealProngCount, cpNodeComparator, removeCpNode };
|
|
1
|
+
export {};
|
|
249
2
|
//# sourceMappingURL=cp-node.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"cp-node.js","sourceRoot":"","sources":["../../src/cp-node/cp-node.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"cp-node.js","sourceRoot":"","sources":["../../src/cp-node/cp-node.ts"],"names":[],"mappings":""}
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import { createCpNode } from "./create-cp-node.js";
|
|
2
1
|
/** @internal */
|
|
3
2
|
const EDGES = ['prev', 'next', 'prevOnCircle', 'nextOnCircle'];
|
|
4
3
|
/**
|
|
@@ -10,8 +9,7 @@ function clone(cpNode) {
|
|
|
10
9
|
// Don't change this function to be recursive, the call stack may
|
|
11
10
|
// overflow if there are too many CpNodes.
|
|
12
11
|
const nodeMap = new Map();
|
|
13
|
-
|
|
14
|
-
const newCpNode = createCpNode(cpNode.cp, cpNode.isHoleClosing, cpNode.isIntersection);
|
|
12
|
+
const newCpNode = cloneWithoutLinks(cpNode);
|
|
15
13
|
nodeMap.set(cpNode, newCpNode);
|
|
16
14
|
const cpStack = [{ cpNode, newCpNode }];
|
|
17
15
|
while (cpStack.length) {
|
|
@@ -20,8 +18,7 @@ function clone(cpNode) {
|
|
|
20
18
|
const node = cpNode[edge];
|
|
21
19
|
let newNode = nodeMap.get(node);
|
|
22
20
|
if (!newNode) {
|
|
23
|
-
|
|
24
|
-
newNode = createCpNode(node.cp, node.isHoleClosing, node.isIntersection);
|
|
21
|
+
newNode = cloneWithoutLinks(node);
|
|
25
22
|
nodeMap.set(node, newNode);
|
|
26
23
|
cpStack.push({ cpNode: node, newCpNode: newNode });
|
|
27
24
|
}
|
|
@@ -30,5 +27,17 @@ function clone(cpNode) {
|
|
|
30
27
|
}
|
|
31
28
|
return newCpNode;
|
|
32
29
|
}
|
|
30
|
+
function cloneWithoutLinks(cpNode) {
|
|
31
|
+
const newNode = {
|
|
32
|
+
...cpNode,
|
|
33
|
+
...{
|
|
34
|
+
prev: undefined,
|
|
35
|
+
next: undefined,
|
|
36
|
+
prevOnCircle: undefined,
|
|
37
|
+
nextOnCircle: undefined
|
|
38
|
+
}
|
|
39
|
+
};
|
|
40
|
+
return newNode;
|
|
41
|
+
}
|
|
33
42
|
export { clone };
|
|
34
43
|
//# sourceMappingURL=clone.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"clone.js","sourceRoot":"","sources":["../../../src/cp-node/fs/clone.ts"],"names":[],"mappings":"AAUA,gBAAgB;AAChB,MAAM,KAAK,GAAW,CAAC,MAAM,EAAE,MAAM,EAAE,cAAc,EAAE,cAAc,CAAC,CAAC;AAOvE;;;;GAIG;AACH,SAAS,KAAK,CAAC,MAAc;IACzB,kEAAkE;IAClE,0CAA0C;IAE1C,MAAM,OAAO,GAAoC,IAAI,GAAG,EAAE,CAAC;IAE3D,MAAM,SAAS,GAAuB,iBAAiB,CAAC,MAAM,CAAC,CAAC;IAEhE,OAAO,CAAC,GAAG,CAAC,MAAM,EAAE,SAAS,CAAC,CAAC;IAC/B,MAAM,OAAO,GAAG,CAAC,EAAE,MAAM,EAAE,SAAS,EAAE,CAAC,CAAC;IAExC,OAAO,OAAO,CAAC,MAAM,EAAE,CAAC;QACpB,MAAM,EAAE,MAAM,EAAE,SAAS,EAAE,GAAG,OAAO,CAAC,GAAG,EAAG,CAAC;QAE7C,KAAK,MAAM,IAAI,IAAI,KAAK,EAAE,CAAC;YACvB,MAAM,IAAI,GAAG,MAAM,CAAC,IAAI,CAAC,CAAC;YAC1B,IAAI,OAAO,GAAG,OAAO,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC;YAChC,IAAI,CAAC,OAAO,EAAE,CAAC;gBACX,OAAO,GAAG,iBAAiB,CAAC,IAAI,CAAC,CAAC;gBAElC,OAAO,CAAC,GAAG,CAAC,IAAI,EAAE,OAAO,CAAC,CAAC;gBAC3B,OAAO,CAAC,IAAI,CAAC,EAAC,MAAM,EAAE,IAAI,EAAE,SAAS,EAAE,OAAO,EAAE,CAAC,CAAC;YACtD,CAAC;YACA,SAAoB,CAAC,IAAI,CAAC,GAAG,OAAiB,CAAC;QACpD,CAAC;IACL,CAAC;IAED,OAAO,SAAmB,CAAC;AAC/B,CAAC;AAGD,SAAS,iBAAiB,CAAC,MAAc;IACrC,MAAM,OAAO,GAAG;QACZ,GAAG,MAAM;QACT,GAAG;YACC,IAAI,EAAE,SAAS;YACf,IAAI,EAAE,SAAS;YACf,YAAY,EAAE,SAAS;YACvB,YAAY,EAAE,SAAS;SAC1B;KACJ,CAAC;IAEF,OAAO,OAAO,CAAC;AACnB,CAAC;AAGD,OAAO,EAAE,KAAK,EAAE,CAAA"}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { getBoundaryBeziersToNext } from "./get-boundary-beziers-to-next.js";
|
|
2
|
+
function cpNodesToBoundaryBeziers(cpNodes) {
|
|
3
|
+
return cpNodes.flatMap(getBoundaryBeziersToNext);
|
|
4
|
+
}
|
|
5
|
+
export { cpNodesToBoundaryBeziers };
|
|
6
|
+
//# sourceMappingURL=cp-nodes-to-boundary-beziers.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"cp-nodes-to-boundary-beziers.js","sourceRoot":"","sources":["../../../src/cp-node/fs/cp-nodes-to-boundary-beziers.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,wBAAwB,EAAE,MAAM,mCAAmC,CAAC;AAG7E,SAAS,wBAAwB,CAAC,OAAiB;IAC/C,OAAO,OAAO,CAAC,OAAO,CAAC,wBAAwB,CAAC,CAAA;AACpD,CAAC;AAGD,OAAO,EAAE,wBAAwB,EAAE,CAAA"}
|
|
@@ -1,5 +1,8 @@
|
|
|
1
|
-
import { CpNode } from "
|
|
1
|
+
import { CpNode } from "../cp-node.js";
|
|
2
2
|
declare function enhanceCpNode(cpNode: CpNode): {
|
|
3
|
+
pos: import("../../index.js").PointOnShape;
|
|
4
|
+
p: number[];
|
|
5
|
+
t: number;
|
|
3
6
|
isTerminating: boolean;
|
|
4
7
|
isFullyTerminating: boolean;
|
|
5
8
|
isSharp: boolean;
|
|
@@ -11,14 +14,21 @@ declare function enhanceCpNode(cpNode: CpNode): {
|
|
|
11
14
|
order: number;
|
|
12
15
|
order2: number;
|
|
13
16
|
};
|
|
14
|
-
curve: import("
|
|
15
|
-
loop: import("flo-boolean
|
|
16
|
-
cp: import("
|
|
17
|
+
curve: import("../../index.js").Curve;
|
|
18
|
+
loop: import("flo-boolean").Loop;
|
|
19
|
+
cp: import("../../index.js").ContactPoint;
|
|
17
20
|
isHoleClosing: boolean;
|
|
18
21
|
isIntersection: boolean;
|
|
19
22
|
prev: CpNode;
|
|
20
23
|
next: CpNode;
|
|
21
24
|
prevOnCircle: CpNode;
|
|
22
25
|
nextOnCircle: CpNode;
|
|
26
|
+
holeCloserNext?: CpNode | undefined;
|
|
27
|
+
holeCloserPrev?: CpNode | undefined;
|
|
28
|
+
id?: number;
|
|
29
|
+
children?: number[];
|
|
30
|
+
isRoot?: boolean;
|
|
31
|
+
parentId?: number;
|
|
32
|
+
childId?: number;
|
|
23
33
|
};
|
|
24
34
|
export { enhanceCpNode };
|
|
@@ -1,11 +1,18 @@
|
|
|
1
|
-
import { getProngCount, getRealProngCount, isFullyTerminating, isSharp, isTerminating } from "./cp-node.js";
|
|
2
1
|
import { getCpNodeOrdering } from './get-cp-node-ordering.js';
|
|
2
|
+
import { getProngCount } from './get-prong-count.js';
|
|
3
|
+
import { getRealProngCount } from "./get-real-prong-count.js";
|
|
4
|
+
import { isFullyTerminating } from "./is-fully-terminating.js";
|
|
5
|
+
import { isSharp } from "./is-sharp.js";
|
|
6
|
+
import { isTerminating } from "./is-terminating.js";
|
|
3
7
|
function enhanceCpNode(cpNode) {
|
|
4
8
|
const cp = cpNode.cp;
|
|
5
9
|
const pos = cp.pointOnShape;
|
|
6
10
|
const curve = pos.curve;
|
|
7
11
|
return {
|
|
8
12
|
...cpNode,
|
|
13
|
+
pos: cpNode.cp.pointOnShape,
|
|
14
|
+
p: cpNode.cp.pointOnShape.p,
|
|
15
|
+
t: cpNode.cp.pointOnShape.t,
|
|
9
16
|
isTerminating: isTerminating(cpNode),
|
|
10
17
|
isFullyTerminating: isFullyTerminating(cpNode),
|
|
11
18
|
isSharp: isSharp(cpNode),
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"enhance-cp-node.js","sourceRoot":"","sources":["../../../src/cp-node/fs/enhance-cp-node.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,iBAAiB,EAAE,MAAM,2BAA2B,CAAC;AAE9D,OAAO,EAAE,aAAa,EAAE,MAAM,sBAAsB,CAAC;AACrD,OAAO,EAAE,iBAAiB,EAAE,MAAM,2BAA2B,CAAC;AAC9D,OAAO,EAAE,kBAAkB,EAAE,MAAM,2BAA2B,CAAC;AAC/D,OAAO,EAAE,OAAO,EAAE,MAAM,eAAe,CAAC;AACxC,OAAO,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAC;AAGpD,SAAS,aAAa,CAAC,MAAc;IACjC,MAAM,EAAE,GAAG,MAAM,CAAC,EAAE,CAAC;IACrB,MAAM,GAAG,GAAG,EAAE,CAAC,YAAY,CAAC;IAC5B,MAAM,KAAK,GAAG,GAAG,CAAC,KAAK,CAAC;IAExB,OAAO;QACH,GAAG,MAAM;QACT,GAAG,EAAE,MAAM,CAAC,EAAE,CAAC,YAAY;QAC3B,CAAC,EAAE,MAAM,CAAC,EAAE,CAAC,YAAY,CAAC,CAAC;QAC3B,CAAC,EAAE,MAAM,CAAC,EAAE,CAAC,YAAY,CAAC,CAAC;QAC3B,aAAa,EAAE,aAAa,CAAC,MAAM,CAAC;QACpC,kBAAkB,EAAE,kBAAkB,CAAC,MAAM,CAAC;QAC9C,OAAO,EAAE,OAAO,CAAC,MAAM,CAAC;QACxB,UAAU,EAAE,aAAa,CAAC,MAAM,CAAC;QACjC,iBAAiB,EAAE,iBAAiB,CAAC,MAAM,CAAC;QAC5C,QAAQ,EAAE,iBAAiB,CAAC,MAAM,CAAC;QACnC,KAAK;QACL,IAAI,EAAE,KAAK,CAAC,IAAI;KACnB,CAAA;AACL,CAAC;AAGD,OAAO,EAAE,aAAa,EAAE,CAAA"}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
function findFirst(f, cpNode) {
|
|
2
|
+
const cpStart = cpNode;
|
|
3
|
+
if (f(cpStart)) {
|
|
4
|
+
return cpStart;
|
|
5
|
+
}
|
|
6
|
+
let cpNode_ = cpNode.next;
|
|
7
|
+
while (cpNode_ !== cpStart) {
|
|
8
|
+
if (f(cpNode_)) {
|
|
9
|
+
return cpNode_;
|
|
10
|
+
}
|
|
11
|
+
cpNode_ = cpNode_.next;
|
|
12
|
+
}
|
|
13
|
+
return undefined;
|
|
14
|
+
}
|
|
15
|
+
export { findFirst };
|
|
16
|
+
//# sourceMappingURL=find-first.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"find-first.js","sourceRoot":"","sources":["../../../src/cp-node/fs/find-first.ts"],"names":[],"mappings":"AAIA,SAAS,SAAS,CACV,CAAyC,EACzC,MAAc;IAElB,MAAM,OAAO,GAAG,MAAM,CAAC;IAEvB,IAAI,CAAC,CAAC,OAAO,CAAC,EAAE,CAAC;QAAC,OAAO,OAAO,CAAC;IAAC,CAAC;IAEtC,IAAI,OAAO,GAAG,MAAM,CAAC,IAAI,CAAC;IAC1B,OAAO,OAAO,KAAK,OAAO,EAAE,CAAC;QAC5B,IAAI,CAAC,CAAC,OAAO,CAAC,EAAE,CAAC;YACP,OAAO,OAAO,CAAC;QACnB,CAAC;QACP,OAAO,GAAG,OAAO,CAAC,IAAI,CAAC;IACxB,CAAC;IAED,OAAO,SAAS,CAAC;AAClB,CAAC;AAGD,OAAO,EAAE,SAAS,EAAE,CAAA"}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { CpNode } from "../cp-node.js";
|
|
2
|
+
/**
|
|
3
|
+
* Returns all `CpNode`s between the two given ones (exclisive the last one).
|
|
4
|
+
*
|
|
5
|
+
* * If the second `CpNode` is never encountered all on the loop will be
|
|
6
|
+
* returned.
|
|
7
|
+
*
|
|
8
|
+
* @param cpNodeS
|
|
9
|
+
* @param cpNodeE
|
|
10
|
+
* @param inclAllIfEqual if `true` and first and last `CpNode`s are equal then
|
|
11
|
+
* include all `CpNode`s around the loop, otherwise include none.
|
|
12
|
+
*/
|
|
13
|
+
declare function getAllBetween(cpNodeS: CpNode, cpNodeE: CpNode, inclAllIfEqual?: boolean): {
|
|
14
|
+
cpNodes: CpNode[];
|
|
15
|
+
hasHoleCloser: boolean;
|
|
16
|
+
};
|
|
17
|
+
export { getAllBetween };
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Returns all `CpNode`s between the two given ones (exclisive the last one).
|
|
3
|
+
*
|
|
4
|
+
* * If the second `CpNode` is never encountered all on the loop will be
|
|
5
|
+
* returned.
|
|
6
|
+
*
|
|
7
|
+
* @param cpNodeS
|
|
8
|
+
* @param cpNodeE
|
|
9
|
+
* @param inclAllIfEqual if `true` and first and last `CpNode`s are equal then
|
|
10
|
+
* include all `CpNode`s around the loop, otherwise include none.
|
|
11
|
+
*/
|
|
12
|
+
function getAllBetween(cpNodeS, cpNodeE, inclAllIfEqual = true) {
|
|
13
|
+
if (!inclAllIfEqual && cpNodeS === cpNodeE) {
|
|
14
|
+
return { cpNodes: [], hasHoleCloser: false };
|
|
15
|
+
}
|
|
16
|
+
const cpStart = cpNodeS;
|
|
17
|
+
const cpNodes = [cpStart];
|
|
18
|
+
let cpNode_ = cpNodeS.next;
|
|
19
|
+
let hasHoleCloser = cpStart.isHoleClosing;
|
|
20
|
+
while (cpNode_ !== cpNodeE &&
|
|
21
|
+
cpNode_ !== cpStart) {
|
|
22
|
+
if (cpNode_.isHoleClosing) {
|
|
23
|
+
hasHoleCloser = true;
|
|
24
|
+
}
|
|
25
|
+
cpNodes.push(cpNode_);
|
|
26
|
+
cpNode_ = cpNode_.next;
|
|
27
|
+
}
|
|
28
|
+
return { cpNodes, hasHoleCloser };
|
|
29
|
+
}
|
|
30
|
+
export { getAllBetween };
|
|
31
|
+
//# sourceMappingURL=get-all-between.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"get-all-between.js","sourceRoot":"","sources":["../../../src/cp-node/fs/get-all-between.ts"],"names":[],"mappings":"AAGA;;;;;;;;;;GAUG;AACH,SAAS,aAAa,CACpB,OAAe,EACf,OAAe,EACf,cAAc,GAAG,IAAI;IAEtB,IAAI,CAAC,cAAc,IAAI,OAAO,KAAK,OAAO,EAAE,CAAC;QAC5C,OAAO,EAAE,OAAO,EAAE,EAAE,EAAE,aAAa,EAAE,KAAK,EAAE,CAAA;IAC7C,CAAC;IAED,MAAM,OAAO,GAAG,OAAO,CAAC;IACxB,MAAM,OAAO,GAAa,CAAC,OAAO,CAAC,CAAC;IAEpC,IAAI,OAAO,GAAG,OAAO,CAAC,IAAI,CAAC;IAC3B,IAAI,aAAa,GAAG,OAAO,CAAC,aAAa,CAAC;IAE1C,OAAO,OAAO,KAAK,OAAO;QACtB,OAAO,KAAK,OAAO,EAAE,CAAC;QAEzB,IAAI,OAAO,CAAC,aAAa,EAAE,CAAC;YAC3B,aAAa,GAAG,IAAI,CAAC;QACtB,CAAC;QACD,OAAO,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;QACtB,OAAO,GAAG,OAAO,CAAC,IAAI,CAAC;IACxB,CAAC;IAED,OAAO,EAAE,OAAO,EAAE,aAAa,EAAE,CAAC;AACnC,CAAC;AAGD,OAAO,EAAE,aAAa,EAAE,CAAA"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
function getAllOnCircle(cpNode, exclThis = false) {
|
|
2
|
+
const startCpNode = cpNode;
|
|
3
|
+
let cpNode_ = startCpNode;
|
|
4
|
+
const cpNodes = [];
|
|
5
|
+
do {
|
|
6
|
+
if (!(exclThis && cpNode_ === startCpNode)) {
|
|
7
|
+
cpNodes.push(cpNode_);
|
|
8
|
+
}
|
|
9
|
+
cpNode_ = cpNode_.nextOnCircle;
|
|
10
|
+
} while (cpNode_ !== startCpNode);
|
|
11
|
+
return cpNodes;
|
|
12
|
+
}
|
|
13
|
+
export { getAllOnCircle };
|
|
14
|
+
//# sourceMappingURL=get-all-on-circle.js.map
|