flo-mat 3.0.0 → 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 +70 -59
- 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 +40 -95
- package/node/sat/cull.js.map +1 -1
- package/node/sat/get-leaves.js +6 -4
- 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.d.ts +1 -2
- package/node/sat/to-scale-axis.js +14 -52
- 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 +87 -71
- 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 +48 -99
- package/src/sat/get-leaves.ts +9 -4
- package/src/sat/get-sat-culls.ts +46 -0
- package/src/sat/to-scale-axis.ts +14 -70
- 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 -33670
- 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/src/sat/t-tree.ts +0 -8
- package/src/sat/traverse-spacial-tree.ts +0 -34
- /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
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
import { CpNode } from '../../cp-node/cp-node.js';
|
|
2
|
+
import { ContactPoint, compareCps } from '../../contact-point/contact-point.js';
|
|
3
|
+
|
|
4
|
+
|
|
5
|
+
/**
|
|
6
|
+
* @internal
|
|
7
|
+
*
|
|
8
|
+
* Note: For debugging only
|
|
9
|
+
*
|
|
10
|
+
* Checks the position of the ContactPoint (cp) on the boundary piece.
|
|
11
|
+
* Returns < 0 if the cp is not on δ, > 0 if it is on the boundary piece
|
|
12
|
+
* excluding the endpoints and 0 if it is on the endpoints. Also returns > 0 if
|
|
13
|
+
* δ === undefined.
|
|
14
|
+
*
|
|
15
|
+
* @param δ The boundary piece
|
|
16
|
+
* @param cp The contact point
|
|
17
|
+
*/
|
|
18
|
+
function cmpCpOnδ(
|
|
19
|
+
δ: CpNode[],
|
|
20
|
+
cp: ContactPoint) {
|
|
21
|
+
|
|
22
|
+
if (δ[0] === undefined) {
|
|
23
|
+
return 1;
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
const cpBef = δ[0].cp;
|
|
27
|
+
const cpAft = δ[1].cp;
|
|
28
|
+
|
|
29
|
+
const cmp = compareCps(cpBef, cpAft);
|
|
30
|
+
const cmpPrev = compareCps(cpBef, cp);
|
|
31
|
+
const cmpNext = compareCps(cp, cpAft);
|
|
32
|
+
|
|
33
|
+
if (cmp < 0) {
|
|
34
|
+
if (cmpPrev > 0 || cmpNext > 0) {
|
|
35
|
+
// console.log(`2-PRONG (antipode) Order is wrong - cmpPrev and cmpNext should be > 0; cmp: ${cmp}, cmpPrev: ${cmpPrev}, cmpNext ${cmpNext}`);
|
|
36
|
+
return -1;
|
|
37
|
+
}
|
|
38
|
+
} else if (cmp > 0) {
|
|
39
|
+
if (cmpPrev > 0 && cmpNext > 0) {
|
|
40
|
+
// console.log(`2-PRONG (antipode) Order is wrong: ${cmpPrev}, ${cmpNext}`);
|
|
41
|
+
return -1;
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
if (cmpPrev === 0 || cmpNext === 0) {
|
|
46
|
+
// console.log('2-PRONG orders are equal.');
|
|
47
|
+
return 0;
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
return 1;
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
|
|
54
|
+
export { cmpCpOnδ }
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import { BezierPiece, fromTo } from "flo-bezier3"
|
|
2
|
+
import { drawFs } from "flo-draw"
|
|
3
|
+
|
|
4
|
+
|
|
5
|
+
const clss = [
|
|
6
|
+
'red thin10 nofill',
|
|
7
|
+
'green thin10 nofill'
|
|
8
|
+
]
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
function drawBezierPieces(
|
|
12
|
+
g: SVGGElement,
|
|
13
|
+
bezierPieces: BezierPiece[],
|
|
14
|
+
classes_ = 'red thin10 nofill, green thin10 nofill, deeppink thin10 nofill',
|
|
15
|
+
delay = 0,
|
|
16
|
+
scaleFactor = 1) {
|
|
17
|
+
|
|
18
|
+
const $svgs: SVGElement[] = [];
|
|
19
|
+
|
|
20
|
+
const classes = classes_.split(',');
|
|
21
|
+
for (let i=0; i<bezierPieces.length; i++) {
|
|
22
|
+
const piece = bezierPieces[i];
|
|
23
|
+
const { ps, ts } = piece;
|
|
24
|
+
if (ts[0] === ts[1]) {
|
|
25
|
+
$svgs.push(...drawFs.crossHair(g, ps[0], classes[i%classes.length], scaleFactor, delay));
|
|
26
|
+
}
|
|
27
|
+
const bezier = fromTo(ps, ts[0], ts[1]);
|
|
28
|
+
$svgs.push(...drawFs.bezier(g, bezier, classes[i%classes.length], delay));
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
return $svgs;
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
|
|
35
|
+
export { drawBezierPieces }
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import { XMLNS } from "./xmlns.js";
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
function drawBeziersAsSinglePath(
|
|
5
|
+
g: SVGGElement,
|
|
6
|
+
beziers: number[][][],
|
|
7
|
+
class_ = 'thin10 red nofill',
|
|
8
|
+
delay = 0) {
|
|
9
|
+
|
|
10
|
+
if (beziers.length === 0) { return []; }
|
|
11
|
+
|
|
12
|
+
const x0 = beziers[0][0][0];
|
|
13
|
+
const y0 = beziers[0][0][1];
|
|
14
|
+
let d = `M${x0} ${y0} `;
|
|
15
|
+
|
|
16
|
+
for (let i=0; i<beziers.length; i++) {
|
|
17
|
+
const ps = beziers[i];
|
|
18
|
+
|
|
19
|
+
if (ps.length <= 1) { continue; }
|
|
20
|
+
|
|
21
|
+
const [,p1,p2,p3] = ps;
|
|
22
|
+
d +=
|
|
23
|
+
ps.length === 2
|
|
24
|
+
? `L ${p1[0]} ${p1[1]} `
|
|
25
|
+
: ps.length === 3
|
|
26
|
+
? `Q ${p1[0]} ${p1[1]} ${p2[0]} ${p2[1]} `
|
|
27
|
+
: `C ${p1[0]} ${p1[1]} ${p2[0]} ${p2[1]} ${p3[0]} ${p3[1]} `
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
// d += ' z';
|
|
31
|
+
const $path = document.createElementNS(XMLNS, 'path');
|
|
32
|
+
$path.setAttributeNS(null, "d", d);
|
|
33
|
+
$path.setAttributeNS(null, "class", class_);
|
|
34
|
+
g.appendChild($path);
|
|
35
|
+
|
|
36
|
+
return [$path];
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
|
|
40
|
+
export { drawBeziersAsSinglePath }
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import { XMLNS } from "./xmlns.js";
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
* Draws a circle
|
|
6
|
+
* @param g An SVG group element wherein to draw the circle.
|
|
7
|
+
* @param circle
|
|
8
|
+
* @param classes
|
|
9
|
+
* @param delay
|
|
10
|
+
*/
|
|
11
|
+
function drawDisk(
|
|
12
|
+
g: SVGGElement,
|
|
13
|
+
circle: { radius: number, center: number[] },
|
|
14
|
+
color = 'black',
|
|
15
|
+
delay?: number) {
|
|
16
|
+
|
|
17
|
+
const c = circle.center;
|
|
18
|
+
const r = circle.radius;
|
|
19
|
+
|
|
20
|
+
const $disk = document.createElementNS(XMLNS, 'circle');
|
|
21
|
+
$disk.setAttributeNS(null, "cx", c[0].toString());
|
|
22
|
+
$disk.setAttributeNS(null, "cy", c[1].toString());
|
|
23
|
+
$disk.setAttributeNS(null, "r", r.toString());
|
|
24
|
+
$disk.setAttributeNS(null, "fill", color);
|
|
25
|
+
|
|
26
|
+
g.appendChild($disk);
|
|
27
|
+
|
|
28
|
+
if (delay) { setTimeout(() => $disk.remove(), delay); }
|
|
29
|
+
|
|
30
|
+
return [$disk];
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
|
|
34
|
+
export { drawDisk }
|
|
@@ -13,7 +13,6 @@ function drawBranch(g: SVGGElement, branch: CpNode[], delay?: number) {
|
|
|
13
13
|
|
|
14
14
|
for (const cpNode of branch) {
|
|
15
15
|
if (isTerminating(cpNode)) { continue; }
|
|
16
|
-
//let bezier = cpNode.matCurveToNextVertex;
|
|
17
16
|
const bezier = getCurveToNext(cpNode);
|
|
18
17
|
if (!bezier) { continue; }
|
|
19
18
|
i++;
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import { drawFs } from 'flo-draw';
|
|
2
|
+
import { CpNode } from '../../../cp-node/cp-node.js';
|
|
3
|
+
import { CpNodeFs } from '../../../cp-node/cp-node-fs.js';
|
|
4
|
+
import { getMatCurveToNext } from '../../../cp-node/fs/get-mat-curve-to-next.js';
|
|
5
|
+
import { isTerminating } from '../../../cp-node/fs/is-terminating.js';
|
|
6
|
+
import { drawBeziersAsSinglePath } from '../draw/draw-beziers-as-single-path.js';
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
/** @internal */
|
|
10
|
+
function drawBranch(
|
|
11
|
+
g: SVGGElement,
|
|
12
|
+
branch: CpNode[],
|
|
13
|
+
classes = 'thin5 purple nofill',
|
|
14
|
+
delay = 0,
|
|
15
|
+
scaleFactor = 1) {
|
|
16
|
+
|
|
17
|
+
|
|
18
|
+
const $svgs: SVGElement[] = [];
|
|
19
|
+
let i = 0;
|
|
20
|
+
|
|
21
|
+
const pss: number[][][] = [];
|
|
22
|
+
for (const cpNode of branch) {
|
|
23
|
+
if (isTerminating(cpNode)) { continue; }
|
|
24
|
+
const bezier = getMatCurveToNext(cpNode);
|
|
25
|
+
if (!bezier) { continue; }
|
|
26
|
+
i++;
|
|
27
|
+
// $svgs.push( ...drawFs.bezier(g, bezier, classes, delay));
|
|
28
|
+
pss.push(bezier);
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
// return $svgs;
|
|
32
|
+
|
|
33
|
+
$svgs.push(...drawBeziersAsSinglePath(g, pss, classes, delay));
|
|
34
|
+
|
|
35
|
+
return $svgs;
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
|
|
39
|
+
export { drawBranch }
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
|
|
2
|
+
import { drawFs } from 'flo-draw';
|
|
3
|
+
import { scaleCircle } from '../../../geometry/circle.js';
|
|
4
|
+
import { CpNode } from '../../../cp-node/cp-node.js';
|
|
5
|
+
import { CpNodeFs } from '../../../cp-node/cp-node-fs.js';
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
/** @internal */
|
|
9
|
+
function drawCpNode(
|
|
10
|
+
g: SVGGElement,
|
|
11
|
+
cpNode: CpNode,
|
|
12
|
+
classes = 'blue thin2 nofill',
|
|
13
|
+
delay = 0,
|
|
14
|
+
scaleFactor = 1) {
|
|
15
|
+
|
|
16
|
+
const circle = scaleCircle(
|
|
17
|
+
cpNode.cp.circle,
|
|
18
|
+
1
|
|
19
|
+
);
|
|
20
|
+
const { center: c, radius: r } = circle;
|
|
21
|
+
|
|
22
|
+
const poss = CpNodeFs.getAllOnCircle(cpNode)
|
|
23
|
+
.map(cpNode => cpNode.cp.pointOnShape)
|
|
24
|
+
|
|
25
|
+
const { dot, circle: drawCircle, crossHair } = drawFs;
|
|
26
|
+
|
|
27
|
+
const $circle = drawCircle(g, circle, classes, delay);
|
|
28
|
+
|
|
29
|
+
const $cps: SVGElement[] = [];
|
|
30
|
+
const $ls: SVGElement[] = [];
|
|
31
|
+
for (let i=0; i<poss.length; i++) {
|
|
32
|
+
const p = poss[i].p;
|
|
33
|
+
$cps.push(...dot(g, p, 0.01*(i+1)*scaleFactor, 'blue', delay));
|
|
34
|
+
$ls.push(...drawFs.line(g, [p, c], 'thin5 red', delay));
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
const $cross = crossHair(g, c, 'orange thin10 nofill', 2*scaleFactor, delay);
|
|
38
|
+
|
|
39
|
+
// if (r === 0) {
|
|
40
|
+
// const $cross = crossHair(g, circle.center, 'red thin2 nofill', 0.02*scaleFactor, delay);
|
|
41
|
+
// }
|
|
42
|
+
|
|
43
|
+
return [...$cps, ...$ls, ...$circle, ...$cross] as SVGElement[];
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
|
|
47
|
+
export { drawCpNode }
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { drawFs } from "flo-draw";
|
|
2
|
+
|
|
3
|
+
/** @internal */
|
|
4
|
+
function drawCull(
|
|
5
|
+
g: SVGGElement,
|
|
6
|
+
cull: number[],
|
|
7
|
+
classes = 'thin10 cyan nofill',
|
|
8
|
+
delay = 0,
|
|
9
|
+
scaleFactor = 1) {
|
|
10
|
+
|
|
11
|
+
const $elems: SVGElement[] = [];
|
|
12
|
+
|
|
13
|
+
$elems.push(...drawFs.crossHair(
|
|
14
|
+
g, cull, classes, 0.1*scaleFactor, delay)
|
|
15
|
+
)
|
|
16
|
+
|
|
17
|
+
return $elems;
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
|
|
21
|
+
export { drawCull }
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { drawFs } from 'flo-draw';
|
|
2
|
+
import { Curve } from '../../../curve/curve.js';
|
|
3
|
+
|
|
4
|
+
|
|
5
|
+
/** @internal */
|
|
6
|
+
function dullCorner(
|
|
7
|
+
g: SVGGElement,
|
|
8
|
+
curve: Curve,
|
|
9
|
+
classes = 'orange',
|
|
10
|
+
delay = 0,
|
|
11
|
+
scaleFactor = 1) {
|
|
12
|
+
|
|
13
|
+
const ps = curve.ps;
|
|
14
|
+
const p = curve.ps[ps.length-1];
|
|
15
|
+
const $pos = drawFs.dot(g, p, 0.1*0.5*scaleFactor, classes, delay);
|
|
16
|
+
|
|
17
|
+
return $pos;
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
|
|
21
|
+
export { dullCorner }
|
|
@@ -1,65 +1,68 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { drawOneProng
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import { vertex
|
|
6
|
-
import { minY
|
|
7
|
-
import { boundingHull
|
|
8
|
-
import { looseBoundingBox } from './loose-bounding-box.js';
|
|
9
|
-
import { tightBoundingBox } from './tight-bounding-box.js';
|
|
10
|
-
import { sharpCorner
|
|
11
|
-
import { dullCorner
|
|
12
|
-
import { drawMat
|
|
13
|
-
import { loop
|
|
14
|
-
import { loops
|
|
15
|
-
import { maxVertex
|
|
16
|
-
import {
|
|
17
|
-
import {
|
|
18
|
-
import {
|
|
1
|
+
import { DebugElem, DebugElemKey } from '../../debug-elem-types.js';
|
|
2
|
+
import { drawOneProng } from './draw-one-prong.js';
|
|
3
|
+
import { drawTwoProng } from './draw-two-prong.js';
|
|
4
|
+
import { drawThreeProng } from './draw-three-prong.js';
|
|
5
|
+
import { vertex } from './draw-vertex.js';
|
|
6
|
+
import { minY } from './draw-min-y.js';
|
|
7
|
+
import { boundingHull } from './bounding-hull.js';
|
|
8
|
+
import { looseBoundingBox } from './draw-loose-bounding-box.js';
|
|
9
|
+
import { tightBoundingBox } from './draw-tight-bounding-box.js';
|
|
10
|
+
import { sharpCorner } from './draw-sharp-corner.js';
|
|
11
|
+
import { dullCorner } from './draw-dull-corner.js';
|
|
12
|
+
import { drawMat } from './draw-mat.js';
|
|
13
|
+
import { loop } from './draw-loop.js';
|
|
14
|
+
import { loops } from './draw-loops.js';
|
|
15
|
+
import { maxVertex } from './draw-max-vertex.js';
|
|
16
|
+
import { drawLeaves } from './draw-leaves.js';
|
|
17
|
+
import { drawCull } from './draw-cull.js';
|
|
18
|
+
import { drawBranch } from './draw-branch.js';
|
|
19
|
+
import { oneProngAtDullCorner } from './draw-one-prong-at-dull-corner.js';
|
|
20
|
+
import { drawCpNode } from './draw-cp-node.js';
|
|
21
|
+
import { drawSpeed } from './draw-speed.js';
|
|
19
22
|
|
|
20
23
|
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
scaleFactor?: number) => SVGElement[] };
|
|
24
|
+
type DrawElemFunction<T extends DebugElemKey> = (
|
|
25
|
+
g: SVGGElement,
|
|
26
|
+
elem: DebugElem[T],
|
|
27
|
+
classes?: string,
|
|
28
|
+
delay?: number,
|
|
29
|
+
scaleFactor?: number,
|
|
30
|
+
options?: any) => SVGElement[];
|
|
29
31
|
|
|
30
32
|
|
|
31
33
|
/** @internal */
|
|
32
|
-
|
|
33
|
-
return [] as SVGElement[];
|
|
34
|
-
}
|
|
34
|
+
type DrawElemFunctions = { [T in DebugElemKey]: DrawElemFunction<T> }
|
|
35
35
|
|
|
36
36
|
|
|
37
37
|
/** @internal */
|
|
38
|
-
const
|
|
38
|
+
const drawElemFs: DrawElemFunctions = {
|
|
39
39
|
oneProng: drawOneProng,
|
|
40
|
-
oneProngAtDullCorner,
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
twoProng_deleted: twoProng,
|
|
45
|
-
twoProng_holeClosing: twoProng,
|
|
46
|
-
threeProng,
|
|
47
|
-
//minY,
|
|
40
|
+
// oneProngAtDullCorner,
|
|
41
|
+
// csf,
|
|
42
|
+
twoProng: drawTwoProng(false, true),
|
|
43
|
+
threeProng: drawThreeProng,
|
|
48
44
|
boundingHull,
|
|
49
45
|
looseBoundingBox,
|
|
50
46
|
tightBoundingBox,
|
|
51
|
-
sharpCorner,
|
|
52
|
-
dullCorner,
|
|
47
|
+
// sharpCorner,
|
|
48
|
+
// dullCorner,
|
|
53
49
|
vertex,
|
|
54
|
-
mat: drawMat
|
|
55
|
-
sat: drawMat('sat'),
|
|
56
|
-
//loop,
|
|
57
|
-
//loops,
|
|
50
|
+
mat: drawMat,
|
|
51
|
+
// sat: drawMat('sat'),
|
|
58
52
|
maxVertex,
|
|
59
|
-
leaves,
|
|
60
|
-
|
|
61
|
-
cpNode:
|
|
53
|
+
leaves: drawLeaves,
|
|
54
|
+
cull: drawCull,
|
|
55
|
+
cpNode: drawCpNode,
|
|
56
|
+
branch: drawBranch,
|
|
57
|
+
holeCloser: drawTwoProng(false, false),
|
|
58
|
+
speed: drawSpeed
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
|
|
62
|
+
const drawElemFsDetailed: DrawElemFunctions = {
|
|
63
|
+
...drawElemFs,
|
|
64
|
+
twoProng: drawTwoProng(true, true),
|
|
62
65
|
}
|
|
63
66
|
|
|
64
67
|
|
|
65
|
-
export {
|
|
68
|
+
export { drawElemFs, drawElemFsDetailed, DrawElemFunctions }
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
import { drawFs } from 'flo-draw';
|
|
2
|
+
import { CpNodeFs } from '../../../cp-node/cp-node-fs.js';
|
|
3
|
+
import { CpNode } from '../../../cp-node/cp-node.js';
|
|
4
|
+
import { drawCirclePercent } from './draw-circle-percent.js';
|
|
5
|
+
|
|
6
|
+
|
|
7
|
+
/** @internal */
|
|
8
|
+
function drawLeaves(
|
|
9
|
+
g: SVGGElement,
|
|
10
|
+
leaves: CpNode[],
|
|
11
|
+
classes = 'thin10 deeppink nofill',
|
|
12
|
+
delay = 0,
|
|
13
|
+
scaleFactor = 1) {
|
|
14
|
+
|
|
15
|
+
const $elems: SVGElement[] = [];
|
|
16
|
+
const { line, dot, circle: drawCircle } = drawFs;
|
|
17
|
+
|
|
18
|
+
for (const cpNode of leaves) {
|
|
19
|
+
const cp = cpNode.cp;
|
|
20
|
+
const { circle } = cp;
|
|
21
|
+
const { center: c, radius: r } = circle;
|
|
22
|
+
|
|
23
|
+
const $center = [drawCirclePercent(g, c, 0.5, 'pinker thin5 nofill')];
|
|
24
|
+
|
|
25
|
+
const poss = CpNodeFs.getAllOnCircle(cpNode)
|
|
26
|
+
.map(cpNode => cpNode.cp.pointOnShape);
|
|
27
|
+
|
|
28
|
+
const $ls: SVGElement[] = [];
|
|
29
|
+
const $cps: SVGElement[] = [];
|
|
30
|
+
for (let i=0; i<poss.length; i++) {
|
|
31
|
+
const p = poss[i].p;
|
|
32
|
+
$cps.push(...dot(g, p, 0.01*(i+1)*scaleFactor, 'pinker', delay));
|
|
33
|
+
$ls.push(...line(g, [p, c], 'thin5 red', delay));
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
const $circle = drawCircle(g, circle, classes, delay);
|
|
37
|
+
// const $cp = dot(g, p, 0.005*scaleFactor, 'pinker', delay);
|
|
38
|
+
|
|
39
|
+
$elems.push(...[
|
|
40
|
+
...$circle,
|
|
41
|
+
...$cps,
|
|
42
|
+
...$ls,
|
|
43
|
+
...$center
|
|
44
|
+
]);
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
return $elems;
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
|
|
51
|
+
export { drawLeaves }
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
//import { Loop } from "../../../loop.js";
|
|
2
|
+
import { Loop } from 'flo-boolean';
|
|
3
|
+
|
|
4
|
+
|
|
5
|
+
/** @internal */
|
|
6
|
+
function loop(g: SVGGElement, loop: Loop): SVGElement[] {
|
|
7
|
+
/*
|
|
8
|
+
for (let curve of loop.curves) {
|
|
9
|
+
drawFs.bezier(g, curve.ps, undefined, 1000);
|
|
10
|
+
}
|
|
11
|
+
*/
|
|
12
|
+
return [];
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
export { loop }
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { drawFs } from "flo-draw";
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
/** @internal */
|
|
5
|
+
function looseBoundingBox(
|
|
6
|
+
g: SVGGElement,
|
|
7
|
+
box: number[][],
|
|
8
|
+
classes = 'thin5 brown nofill',
|
|
9
|
+
delay = 0,
|
|
10
|
+
scaleFactor = 1) {
|
|
11
|
+
|
|
12
|
+
const [[x0, y0],[x1, y1]] = box;
|
|
13
|
+
box = [[x0, y0],[x1, y0],[x1,y1],[x0,y1]];
|
|
14
|
+
|
|
15
|
+
const $box = drawFs.polygon(g, box, classes, delay);
|
|
16
|
+
|
|
17
|
+
return $box;
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
|
|
21
|
+
export { looseBoundingBox }
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
import { drawFs } from 'flo-draw';
|
|
2
|
+
import { Mat } from '../../../mat/mat.js';
|
|
3
|
+
import { $traverseEdges, traverseEdges, traverseEdges$$ } from '../../../cp-node/fs/traverse-edges.js';
|
|
4
|
+
import { getMatCurveToNext } from '../../../cp-node/fs/get-mat-curve-to-next.js';
|
|
5
|
+
import { CpNodeFs } from '../../../cp-node/cp-node-fs.js';
|
|
6
|
+
import { drawCpNode } from './draw-cp-node.js';
|
|
7
|
+
import { sleep } from '../../../utils/sleep.js';
|
|
8
|
+
|
|
9
|
+
const { isTerminating } = CpNodeFs;
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
const altClasses = [
|
|
13
|
+
'thin10 blue nofill',
|
|
14
|
+
'thin10 red nofill'
|
|
15
|
+
];
|
|
16
|
+
|
|
17
|
+
/** @internal */
|
|
18
|
+
/*async */function drawMat(
|
|
19
|
+
g: SVGGElement,
|
|
20
|
+
mat: Mat,
|
|
21
|
+
classes_?: string,
|
|
22
|
+
delay = 0,
|
|
23
|
+
scaleFactor = 1): /*Promise<*/SVGElement[]/*>*/ {
|
|
24
|
+
|
|
25
|
+
let cpNode = mat.cpNode;
|
|
26
|
+
if (!cpNode) { return []; }
|
|
27
|
+
|
|
28
|
+
while (!isTerminating(cpNode)) { cpNode = cpNode.next; }
|
|
29
|
+
|
|
30
|
+
const $svgs: SVGElement[] = [];
|
|
31
|
+
|
|
32
|
+
let i = 0;
|
|
33
|
+
traverseEdges(cpNode, async cpNode => {
|
|
34
|
+
// await sleep(50);
|
|
35
|
+
if (isTerminating(cpNode)) { return; }
|
|
36
|
+
|
|
37
|
+
const bezier = getMatCurveToNext(cpNode);
|
|
38
|
+
if (!bezier) { return; }
|
|
39
|
+
|
|
40
|
+
$svgs.push( ...drawFs.bezier(g, bezier, altClasses[i%2], delay));
|
|
41
|
+
i++;
|
|
42
|
+
});
|
|
43
|
+
|
|
44
|
+
return $svgs;
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
|
|
48
|
+
function drawCurve() {
|
|
49
|
+
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
|
|
53
|
+
export { drawMat }
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { drawFs } from 'flo-draw';
|
|
2
|
+
import { CpNode } from '../../../cp-node/cp-node.js';
|
|
3
|
+
|
|
4
|
+
|
|
5
|
+
/** @internal */
|
|
6
|
+
function maxVertex(g: SVGGElement, cpNode: CpNode) {
|
|
7
|
+
const circle = cpNode.cp.circle;
|
|
8
|
+
|
|
9
|
+
const $elems = drawFs.circle(g, circle, 'brown thin10 nofill');
|
|
10
|
+
|
|
11
|
+
return $elems;
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
export { maxVertex }
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { toCubic, evalDeCasteljau } from 'flo-bezier3';
|
|
2
|
+
import { drawFs } from 'flo-draw';
|
|
3
|
+
import { PointOnShape } from '../../../point-on-shape/point-on-shape.js';
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
/** @internal */
|
|
7
|
+
function minY(g: SVGGElement, pos: PointOnShape) {
|
|
8
|
+
const p = evalDeCasteljau(pos.curve.ps, pos.t);
|
|
9
|
+
|
|
10
|
+
const $elems = drawFs.crossHair(
|
|
11
|
+
g, p, 'red thin10 nofill'
|
|
12
|
+
);
|
|
13
|
+
|
|
14
|
+
return $elems;
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
|
|
18
|
+
export { minY }
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
|
|
2
|
+
import { drawFs } from 'flo-draw';
|
|
3
|
+
import { PointOnShape } from '../../../point-on-shape/point-on-shape.js';
|
|
4
|
+
import { getOsculatingCircle } from '../../../point-on-shape/get-osculating-circle.js';
|
|
5
|
+
|
|
6
|
+
|
|
7
|
+
/** @hidden */
|
|
8
|
+
function oneProngAtDullCorner(
|
|
9
|
+
g: SVGGElement,
|
|
10
|
+
pos: PointOnShape,
|
|
11
|
+
classes?: string,
|
|
12
|
+
delay = 1000,
|
|
13
|
+
scaleFactor = 1) {
|
|
14
|
+
|
|
15
|
+
//let oCircle = PointOnShape.getOsculatingCircle(Number.POSITIVE_INFINITY, pos);
|
|
16
|
+
const oCircle = getOsculatingCircle(Number.POSITIVE_INFINITY, pos);
|
|
17
|
+
|
|
18
|
+
const $center = drawFs.dot(g, pos.p, 0.1, 'orange');
|
|
19
|
+
const $circle = drawFs.dot(g, oCircle.center, 0.25, 'orange');
|
|
20
|
+
const $pos = drawFs.circle(g, oCircle, 'orange thin10 nofill');
|
|
21
|
+
|
|
22
|
+
return [...$center, ...$circle, ...$pos];
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
|
|
26
|
+
export { oneProngAtDullCorner }
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { drawFs } from 'flo-draw';
|
|
2
|
+
import { CpNode } from '../../../cp-node/cp-node.js';
|
|
3
|
+
|
|
4
|
+
|
|
5
|
+
/** @hidden */
|
|
6
|
+
function drawOneProng(
|
|
7
|
+
g: SVGGElement,
|
|
8
|
+
cpNodes: CpNode[],
|
|
9
|
+
classes?: string,
|
|
10
|
+
delay = 0,
|
|
11
|
+
scaleFactor = 1) {
|
|
12
|
+
|
|
13
|
+
const cp = cpNodes[0].cp;
|
|
14
|
+
const { circle, pointOnShape: pos } = cp;
|
|
15
|
+
const $center = drawFs.dot(g, pos.p, 0.02*scaleFactor, 'deeppink', delay);
|
|
16
|
+
const $circle = drawFs.dot(g, circle.center, 0.05*scaleFactor, 'deeppink', delay);
|
|
17
|
+
const $pos = drawFs.circle(g, circle, 'deeppink thin5 nofill', delay);
|
|
18
|
+
|
|
19
|
+
return [...$center, ...$circle, ...$pos];
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
|
|
23
|
+
export { drawOneProng }
|