flo-mat 4.0.2 → 4.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/__tests__/find-2-prong/get-medial/dd-get-medial-point-coeffs-same-curve.spec.ts +106 -0
- package/__tests__/find-2-prong/get-medial/dd-get-medial-point-coeffs.spec.ts +73 -0
- package/__tests__/find-2-prong/get-medial/get-closest-points.spec.ts +5 -2
- package/__tests__/helpers/close-to.ts +5 -5
- package/__tests__/specific-cases/load-svg/load-svg.ts +30 -0
- package/__tests__/specific-cases/specific-cases.spec.ts +170 -0
- package/__tests__/specific-cases/test-svgs/achispado.svg +5052 -0
- package/browser/index.js +5129 -8785
- package/browser/index.min.js +1 -1
- package/{jest.config.cjs → jest.config.ts} +8 -3
- package/node/closest-boundary-point/get-close-boundary-points-certified.js +3 -2
- package/node/closest-boundary-point/get-close-boundary-points-certified.js.map +1 -1
- package/node/corner/get-corner.js +1 -1
- package/node/corner/get-corner.js.map +1 -1
- package/node/cp-node/fs/get-all-on-loop-by-loop.d.ts +11 -0
- package/node/cp-node/fs/get-all-on-loop-by-loop.js +42 -0
- package/node/cp-node/fs/get-all-on-loop-by-loop.js.map +1 -0
- package/node/cp-node/fs/get-boundary-beziers-to-next.d.ts +1 -0
- package/node/cp-node/fs/get-boundary-beziers-to-next.js +1 -59
- package/node/cp-node/fs/get-boundary-beziers-to-next.js.map +1 -1
- package/node/cp-node/fs/get-edge-direction.d.ts +3 -1
- package/node/cp-node/fs/get-edge-direction.js +5 -3
- package/node/cp-node/fs/get-edge-direction.js.map +1 -1
- package/node/cp-node/fs/get-mat-curve-between.js +6 -6
- package/node/cp-node/fs/get-mat-curve-between.js.map +1 -1
- package/node/cp-node/fs/is-fully-terminating.js +12 -0
- package/node/cp-node/fs/is-fully-terminating.js.map +1 -1
- package/node/cp-node/fs/is-on-same-loop.d.ts +3 -0
- package/node/cp-node/fs/is-on-same-loop.js +6 -0
- package/node/cp-node/fs/is-on-same-loop.js.map +1 -0
- package/node/debug/debug.d.ts +8 -22
- package/node/debug/debug.js +12 -50
- package/node/debug/debug.js.map +1 -1
- package/node/find-2-prong/add-1-prong.js +1 -4
- package/node/find-2-prong/add-1-prong.js.map +1 -1
- package/node/find-2-prong/find-2-prong.js +24 -10
- package/node/find-2-prong/find-2-prong.js.map +1 -1
- package/node/find-2-prong/get-medial/get-antipodal-points.d.ts +1 -1
- package/node/find-2-prong/get-medial/get-antipodal-points.js +2 -2
- package/node/find-2-prong/get-medial/get-antipodal-points.js.map +1 -1
- package/node/find-2-prong/get-medial/get-closest-points.d.ts +7 -1
- package/node/find-2-prong/get-medial/get-closest-points.js +60 -14
- package/node/find-2-prong/get-medial/get-closest-points.js.map +1 -1
- package/node/find-2-prong/reduce-radius.d.ts +3 -1
- package/node/find-2-prong/reduce-radius.js +8 -6
- package/node/find-2-prong/reduce-radius.js.map +1 -1
- package/node/find-3-prong/calc-better-x.js +1 -3
- package/node/find-3-prong/calc-better-x.js.map +1 -1
- package/node/find-3-prong/calc-initial-3-prong-center.js +1 -2
- package/node/find-3-prong/calc-initial-3-prong-center.js.map +1 -1
- package/node/find-3-prong/find-3-prong-for-delta3s.js +1 -4
- package/node/find-3-prong/find-3-prong-for-delta3s.js.map +1 -1
- package/node/find-3-prong/find-3-prong.js.map +1 -1
- package/node/find-3-prong/find-and-add-3-prong.js +0 -14
- package/node/find-3-prong/find-and-add-3-prong.js.map +1 -1
- package/node/find-mat/find-mat.js +2 -2
- package/node/find-mat/find-mat.js.map +1 -1
- package/node/find-mat/find-mats.js.map +1 -1
- package/node/find-mat/get-dull-corners-on-loop.js +3 -2
- package/node/find-mat/get-dull-corners-on-loop.js.map +1 -1
- package/node/find-mat/get-for-1-prongs-on-loop.js +6 -3
- 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 +5 -1
- package/node/find-mat/get-for-2-prongs-on-loop.js.map +1 -1
- package/node/find-mat/get-meta.d.ts +4 -6
- package/node/find-mat/get-meta.js +12 -26
- package/node/find-mat/get-meta.js.map +1 -1
- package/node/find-mat/get-sharp-corners.js +4 -2
- package/node/find-mat/get-sharp-corners.js.map +1 -1
- package/node/get-medial-points/double-double/dd-get-medial-point-coeffs-bez0.d.ts +21 -0
- package/node/get-medial-points/double-double/dd-get-medial-point-coeffs-bez0.js +46 -0
- package/node/get-medial-points/double-double/dd-get-medial-point-coeffs-bez0.js.map +1 -0
- package/node/get-medial-points/double-double/dd-get-medial-point-coeffs-bez1.d.ts +28 -0
- package/node/get-medial-points/double-double/dd-get-medial-point-coeffs-bez1.js +97 -0
- package/node/get-medial-points/double-double/dd-get-medial-point-coeffs-bez1.js.map +1 -0
- package/node/get-medial-points/double-double/dd-get-medial-point-coeffs-bez2-same-curve.d.ts +28 -0
- package/node/get-medial-points/double-double/dd-get-medial-point-coeffs-bez2-same-curve.js +109 -0
- package/node/get-medial-points/double-double/dd-get-medial-point-coeffs-bez2-same-curve.js.map +1 -0
- package/node/get-medial-points/double-double/dd-get-medial-point-coeffs-bez2.d.ts +29 -0
- package/node/get-medial-points/double-double/dd-get-medial-point-coeffs-bez2.js +123 -0
- package/node/get-medial-points/double-double/dd-get-medial-point-coeffs-bez2.js.map +1 -0
- package/node/get-medial-points/double-double/dd-get-medial-point-coeffs-bez3-same-curve.d.ts +30 -0
- package/node/get-medial-points/double-double/dd-get-medial-point-coeffs-bez3-same-curve.js +177 -0
- package/node/get-medial-points/double-double/dd-get-medial-point-coeffs-bez3-same-curve.js.map +1 -0
- package/node/get-medial-points/double-double/dd-get-medial-point-coeffs-bez3.d.ts +29 -0
- package/node/get-medial-points/double-double/dd-get-medial-point-coeffs-bez3.js +156 -0
- package/node/get-medial-points/double-double/dd-get-medial-point-coeffs-bez3.js.map +1 -0
- package/node/get-medial-points/double-double/dd-get-medial-point-coeffs.d.ts +28 -0
- package/node/get-medial-points/double-double/dd-get-medial-point-coeffs.js +40 -0
- package/node/get-medial-points/double-double/dd-get-medial-point-coeffs.js.map +1 -0
- package/node/index.d.ts +6 -10
- package/node/index.js +5 -6
- package/node/index.js.map +1 -1
- package/node/point-on-shape/point-on-shape.d.ts +2 -0
- package/node/point-on-shape/to-p.d.ts +1 -1
- package/node/point-on-shape/to-p.js +1 -1
- package/node/point-on-shape/to-p.js.map +1 -1
- package/node/reconstruct-from-mat/get-cp-nodess-for-sat.d.ts +4 -0
- package/node/reconstruct-from-mat/get-cp-nodess-for-sat.js +15 -0
- package/node/reconstruct-from-mat/get-cp-nodess-for-sat.js.map +1 -0
- package/node/reconstruct-from-mat/reconstruct-from-mat.d.ts +10 -0
- package/node/reconstruct-from-mat/reconstruct-from-mat.js +160 -0
- package/node/reconstruct-from-mat/reconstruct-from-mat.js.map +1 -0
- package/node/reconstruct-from-mat/remove-sat-induced-trivial-3prongs.d.ts +12 -0
- package/node/reconstruct-from-mat/remove-sat-induced-trivial-3prongs.js +46 -0
- package/node/reconstruct-from-mat/remove-sat-induced-trivial-3prongs.js.map +1 -0
- package/node/sat/add-debug-info.js +1 -2
- package/node/sat/add-debug-info.js.map +1 -1
- package/node/svg/get-loop-bounds.js +6 -2
- package/node/svg/get-loop-bounds.js.map +1 -1
- package/node/utils/map-deep.d.ts +15 -0
- package/node/utils/map-deep.js +34 -0
- package/node/utils/map-deep.js.map +1 -0
- package/package.json +14 -8
- package/src/closest-boundary-point/get-close-boundary-points-certified.ts +3 -2
- package/src/corner/get-corner.ts +1 -1
- package/src/cp-node/fs/get-all-on-loop-by-loop.ts +56 -0
- package/src/cp-node/fs/get-all-on-loop.ts +1 -1
- package/src/cp-node/fs/get-boundary-beziers-to-next.ts +1 -72
- package/src/cp-node/fs/get-edge-direction.ts +8 -4
- package/src/cp-node/fs/get-mat-curve-between.ts +6 -6
- package/src/cp-node/fs/is-fully-terminating.ts +16 -0
- package/src/cp-node/fs/is-on-same-loop.ts +15 -0
- package/src/debug/debug.ts +27 -87
- package/src/find-2-prong/add-1-prong.ts +1 -5
- package/src/find-2-prong/find-2-prong.ts +37 -14
- package/src/find-2-prong/get-medial/get-antipodal-points.ts +3 -2
- package/src/find-2-prong/get-medial/get-closest-points-d.ts +213 -0
- package/src/find-2-prong/get-medial/get-closest-points.ts +74 -13
- package/src/find-2-prong/reduce-radius.ts +8 -5
- package/src/find-3-prong/calc-better-x.ts +1 -3
- package/src/find-3-prong/calc-initial-3-prong-center.ts +1 -2
- package/src/find-3-prong/find-3-prong-for-delta3s.ts +1 -4
- package/src/find-3-prong/find-3-prong.ts +0 -1
- package/src/find-3-prong/find-and-add-3-prong.ts +1 -15
- package/src/find-mat/find-mat.ts +3 -2
- package/src/find-mat/find-mats.ts +0 -1
- package/src/find-mat/get-dull-corners-on-loop.ts +4 -3
- package/src/find-mat/get-for-1-prongs-on-loop.ts +8 -3
- package/src/find-mat/get-for-2-prongs-on-loop.ts +6 -1
- package/src/find-mat/get-meta.ts +14 -38
- package/src/find-mat/get-sharp-corners.ts +5 -1
- package/src/get-medial-curve/__pycache__/get-cubic-self-medial-curve.cpython-313.pyc +0 -0
- package/src/get-medial-curve/get-cubic-self-medial-curve.py +419 -0
- package/src/get-medial-points/double-double/dd-get-medial-point-coeffs-bez0-with-running-err.ts +76 -0
- package/src/get-medial-points/double-double/dd-get-medial-point-coeffs-bez0.ts +61 -0
- package/src/get-medial-points/double-double/dd-get-medial-point-coeffs-bez1.ts +116 -0
- package/src/get-medial-points/double-double/dd-get-medial-point-coeffs-bez2-same-curve.ts +129 -0
- package/src/get-medial-points/double-double/dd-get-medial-point-coeffs-bez2.ts +142 -0
- package/src/get-medial-points/double-double/dd-get-medial-point-coeffs-bez3-same-curve.ts +199 -0
- package/src/get-medial-points/double-double/dd-get-medial-point-coeffs-bez3.ts +177 -0
- package/src/get-medial-points/double-double/dd-get-medial-point-coeffs.ts +48 -0
- package/src/get-medial-points/double-double/error-bound-calc.txt +72 -0
- package/src/index.ts +7 -11
- package/src/point-on-shape/point-on-shape.ts +3 -0
- package/src/point-on-shape/to-p.ts +2 -2
- package/src/reconstruct-from-mat/get-cp-nodess-for-sat.ts +24 -0
- package/src/reconstruct-from-mat/reconstruct-from-mat.ts +226 -0
- package/src/reconstruct-from-mat/remove-sat-induced-trivial-3prongs.ts +62 -0
- package/src/sat/add-debug-info.ts +1 -2
- package/src/svg/get-loop-bounds.ts +11 -3
- package/src/utils/clip.ts +13 -0
- package/src/utils/map-deep.ts +75 -0
- package/src/utils/map-map.ts +33 -0
- package/wallaby.mjs +4 -4
- package/node/debug/debug-elem-types.d.ts +0 -26
- package/node/debug/debug-elem-types.js +0 -22
- package/node/debug/debug-elem-types.js.map +0 -1
- package/node/debug/functions/draw/draw-beziers-as-single-path.d.ts +0 -2
- package/node/debug/functions/draw/draw-beziers-as-single-path.js +0 -30
- package/node/debug/functions/draw/draw-beziers-as-single-path.js.map +0 -1
- package/node/debug/functions/draw/xmlns.d.ts +0 -2
- package/node/debug/functions/draw/xmlns.js +0 -3
- package/node/debug/functions/draw/xmlns.js.map +0 -1
- package/node/debug/functions/draw-elem/bounding-hull.d.ts +0 -3
- package/node/debug/functions/draw-elem/bounding-hull.js +0 -8
- package/node/debug/functions/draw-elem/bounding-hull.js.map +0 -1
- package/node/debug/functions/draw-elem/draw-branch.d.ts +0 -4
- package/node/debug/functions/draw-elem/draw-branch.js +0 -26
- package/node/debug/functions/draw-elem/draw-branch.js.map +0 -1
- package/node/debug/functions/draw-elem/draw-circle-percent.d.ts +0 -3
- package/node/debug/functions/draw-elem/draw-circle-percent.js +0 -13
- package/node/debug/functions/draw-elem/draw-circle-percent.js.map +0 -1
- package/node/debug/functions/draw-elem/draw-cp-node.d.ts +0 -4
- package/node/debug/functions/draw-elem/draw-cp-node.js +0 -26
- package/node/debug/functions/draw-elem/draw-cp-node.js.map +0 -1
- package/node/debug/functions/draw-elem/draw-cull.d.ts +0 -3
- package/node/debug/functions/draw-elem/draw-cull.js +0 -9
- package/node/debug/functions/draw-elem/draw-cull.js.map +0 -1
- package/node/debug/functions/draw-elem/draw-dull-corner.d.ts +0 -4
- package/node/debug/functions/draw-elem/draw-dull-corner.js +0 -10
- package/node/debug/functions/draw-elem/draw-dull-corner.js.map +0 -1
- package/node/debug/functions/draw-elem/draw-elem.d.ts +0 -10
- package/node/debug/functions/draw-elem/draw-elem.js +0 -39
- package/node/debug/functions/draw-elem/draw-elem.js.map +0 -1
- package/node/debug/functions/draw-elem/draw-leaves.d.ts +0 -4
- package/node/debug/functions/draw-elem/draw-leaves.js +0 -34
- package/node/debug/functions/draw-elem/draw-leaves.js.map +0 -1
- package/node/debug/functions/draw-elem/draw-loop.d.ts +0 -4
- package/node/debug/functions/draw-elem/draw-loop.js +0 -11
- package/node/debug/functions/draw-elem/draw-loop.js.map +0 -1
- package/node/debug/functions/draw-elem/draw-loops.d.ts +0 -4
- package/node/debug/functions/draw-elem/draw-loops.js +0 -6
- package/node/debug/functions/draw-elem/draw-loops.js.map +0 -1
- package/node/debug/functions/draw-elem/draw-loose-bounding-box.d.ts +0 -3
- package/node/debug/functions/draw-elem/draw-loose-bounding-box.js +0 -10
- package/node/debug/functions/draw-elem/draw-loose-bounding-box.js.map +0 -1
- package/node/debug/functions/draw-elem/draw-mat.d.ts +0 -4
- package/node/debug/functions/draw-elem/draw-mat.js +0 -34
- package/node/debug/functions/draw-elem/draw-mat.js.map +0 -1
- package/node/debug/functions/draw-elem/draw-max-vertex.d.ts +0 -4
- package/node/debug/functions/draw-elem/draw-max-vertex.js +0 -9
- package/node/debug/functions/draw-elem/draw-max-vertex.js.map +0 -1
- package/node/debug/functions/draw-elem/draw-min-y.d.ts +0 -4
- package/node/debug/functions/draw-elem/draw-min-y.js +0 -10
- package/node/debug/functions/draw-elem/draw-min-y.js.map +0 -1
- package/node/debug/functions/draw-elem/draw-one-prong-at-dull-corner.d.ts +0 -4
- package/node/debug/functions/draw-elem/draw-one-prong-at-dull-corner.js +0 -22
- package/node/debug/functions/draw-elem/draw-one-prong-at-dull-corner.js.map +0 -1
- package/node/debug/functions/draw-elem/draw-one-prong.d.ts +0 -4
- package/node/debug/functions/draw-elem/draw-one-prong.js +0 -13
- package/node/debug/functions/draw-elem/draw-one-prong.js.map +0 -1
- package/node/debug/functions/draw-elem/draw-sharp-corner.d.ts +0 -4
- package/node/debug/functions/draw-elem/draw-sharp-corner.js +0 -10
- package/node/debug/functions/draw-elem/draw-sharp-corner.js.map +0 -1
- package/node/debug/functions/draw-elem/draw-three-prong.d.ts +0 -4
- package/node/debug/functions/draw-elem/draw-three-prong.js +0 -26
- package/node/debug/functions/draw-elem/draw-three-prong.js.map +0 -1
- package/node/debug/functions/draw-elem/draw-tight-bounding-box.d.ts +0 -3
- package/node/debug/functions/draw-elem/draw-tight-bounding-box.js +0 -8
- package/node/debug/functions/draw-elem/draw-tight-bounding-box.js.map +0 -1
- package/node/debug/functions/draw-elem/draw-two-prong.d.ts +0 -4
- package/node/debug/functions/draw-elem/draw-two-prong.js +0 -49
- package/node/debug/functions/draw-elem/draw-two-prong.js.map +0 -1
- package/node/debug/functions/draw-elem/draw-vertex.d.ts +0 -4
- package/node/debug/functions/draw-elem/draw-vertex.js +0 -13
- package/node/debug/functions/draw-elem/draw-vertex.js.map +0 -1
- package/node/debug/functions/general.d.ts +0 -48
- package/node/debug/functions/general.js +0 -53
- package/node/debug/functions/general.js.map +0 -1
- package/node/find-3-prong/timed-cc.d.ts +0 -3
- package/node/find-3-prong/timed-cc.js +0 -5
- package/node/find-3-prong/timed-cc.js.map +0 -1
- package/node/point-on-shape/pos-to-human-string.d.ts +0 -8
- package/node/point-on-shape/pos-to-human-string.js +0 -12
- package/node/point-on-shape/pos-to-human-string.js.map +0 -1
- package/node/utils/time-function-call.d.ts +0 -14
- package/node/utils/time-function-call.js +0 -32
- package/node/utils/time-function-call.js.map +0 -1
- package/src/debug/debug-elem-types.ts +0 -43
- package/src/debug/elem-type-two-prong.ts +0 -8
- package/src/debug/functions/cmp-cp-on-delta.ts +0 -54
- package/src/debug/functions/draw-elem/bounding-hull.ts +0 -18
- package/src/debug/functions/draw-elem/culls.ts +0 -39
- package/src/debug/functions/draw-elem/draw-branch.ts +0 -37
- package/src/debug/functions/draw-elem/draw-circle-percent.ts +0 -23
- package/src/debug/functions/draw-elem/draw-cp-node.ts +0 -46
- package/src/debug/functions/draw-elem/draw-cull.ts +0 -21
- package/src/debug/functions/draw-elem/draw-dull-corner.ts +0 -21
- package/src/debug/functions/draw-elem/draw-elem.ts +0 -64
- package/src/debug/functions/draw-elem/draw-leaves.ts +0 -51
- package/src/debug/functions/draw-elem/draw-loop.ts +0 -16
- package/src/debug/functions/draw-elem/draw-loops.ts +0 -10
- package/src/debug/functions/draw-elem/draw-loose-bounding-box.ts +0 -21
- package/src/debug/functions/draw-elem/draw-mat.ts +0 -43
- package/src/debug/functions/draw-elem/draw-max-vertex.ts +0 -15
- package/src/debug/functions/draw-elem/draw-min-y.ts +0 -18
- package/src/debug/functions/draw-elem/draw-one-prong-at-dull-corner.ts +0 -40
- package/src/debug/functions/draw-elem/draw-one-prong.ts +0 -25
- package/src/debug/functions/draw-elem/draw-sharp-corner.ts +0 -21
- package/src/debug/functions/draw-elem/draw-three-prong.ts +0 -44
- package/src/debug/functions/draw-elem/draw-tight-bounding-box.ts +0 -18
- package/src/debug/functions/draw-elem/draw-two-prong.ts +0 -68
- package/src/debug/functions/draw-elem/draw-vertex.ts +0 -27
- package/src/debug/functions/draw-elem/dull-corner.ts +0 -21
- package/src/debug/functions/draw-elem/leaves.ts +0 -20
- package/src/debug/functions/draw-elem/loop.ts +0 -16
- package/src/debug/functions/draw-elem/loops.ts +0 -10
- package/src/debug/functions/draw-elem/loose-bounding-box.ts +0 -21
- package/src/debug/functions/draw-elem/mat.ts +0 -47
- package/src/debug/functions/draw-elem/max-vertex.ts +0 -15
- package/src/debug/functions/draw-elem/min-y.ts +0 -18
- package/src/debug/functions/draw-elem/one-prong-at-dull-corner.ts +0 -26
- package/src/debug/functions/draw-elem/one-prong.ts +0 -23
- package/src/debug/functions/draw-elem/sharp-corner.ts +0 -20
- package/src/debug/functions/draw-elem/three-prong.ts +0 -30
- package/src/debug/functions/draw-elem/tight-bounding-box.ts +0 -18
- package/src/debug/functions/draw-elem/two-prong.ts +0 -50
- package/src/debug/functions/draw-elem/vertex.ts +0 -51
- package/src/debug/functions/general.ts +0 -79
- package/src/debug/functions/three-prong.ts +0 -249
- package/src/debug/functions/two-prong.ts +0 -203
- package/src/find-2-prong/add-debug-info.ts +0 -45
- package/src/find-3-prong/timed-cc.ts +0 -9
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
import type { Curve } from 'flo-boolean';
|
|
2
|
-
import { drawFs } from 'flo-draw';
|
|
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 = 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,64 +0,0 @@
|
|
|
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
|
-
|
|
22
|
-
|
|
23
|
-
type DrawElemFunction<T extends DebugElemKey> = (
|
|
24
|
-
g: SVGGElement,
|
|
25
|
-
elem: DebugElem[T],
|
|
26
|
-
classes?: string,
|
|
27
|
-
delay?: number,
|
|
28
|
-
scaleFactor?: number,
|
|
29
|
-
options?: any) => SVGElement[];
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
/** @internal */
|
|
33
|
-
type DrawElemFunctions = { [T in DebugElemKey]: DrawElemFunction<T> }
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
/** @internal */
|
|
37
|
-
const drawElemFs: DrawElemFunctions = {
|
|
38
|
-
oneProng: drawOneProng,
|
|
39
|
-
twoProng: drawTwoProng(false, true),
|
|
40
|
-
threeProng: drawThreeProng,
|
|
41
|
-
boundingHull,
|
|
42
|
-
looseBoundingBox,
|
|
43
|
-
tightBoundingBox,
|
|
44
|
-
// sharpCorner,
|
|
45
|
-
// dullCorner,
|
|
46
|
-
vertex,
|
|
47
|
-
mat: drawMat,
|
|
48
|
-
// sat: drawMat('sat'),
|
|
49
|
-
maxVertex,
|
|
50
|
-
leaves: drawLeaves,
|
|
51
|
-
cull: drawCull,
|
|
52
|
-
cpNode: drawCpNode,
|
|
53
|
-
branch: drawBranch,
|
|
54
|
-
holeCloser: drawTwoProng(false, false)
|
|
55
|
-
}
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
const drawElemFsDetailed: DrawElemFunctions = {
|
|
59
|
-
...drawElemFs,
|
|
60
|
-
twoProng: drawTwoProng(true, true),
|
|
61
|
-
}
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
export { drawElemFs, drawElemFsDetailed, DrawElemFunctions }
|
|
@@ -1,51 +0,0 @@
|
|
|
1
|
-
import type { CpNode } from '../../../cp-node/cp-node.js';
|
|
2
|
-
import { drawFs } from 'flo-draw';
|
|
3
|
-
import { drawCirclePercent } from './draw-circle-percent.js';
|
|
4
|
-
import { getAllOnCircle } from '../../../cp-node/fs/get-all-on-circle.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.pointOnShape;
|
|
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 = getAllOnCircle(cpNode)
|
|
26
|
-
.map(cpNode => cpNode.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 }
|
|
@@ -1,16 +0,0 @@
|
|
|
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 }
|
|
@@ -1,21 +0,0 @@
|
|
|
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 }
|
|
@@ -1,43 +0,0 @@
|
|
|
1
|
-
import type { Mat } from '../../../mat/mat.js';
|
|
2
|
-
import { drawFs } from 'flo-draw';
|
|
3
|
-
import { traverseEdges } from '../../../cp-node/fs/traverse-edges.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
|
-
|
|
7
|
-
|
|
8
|
-
const altClasses = [
|
|
9
|
-
'thin10 blue nofill',
|
|
10
|
-
'thin10 red nofill'
|
|
11
|
-
];
|
|
12
|
-
|
|
13
|
-
/** @internal */
|
|
14
|
-
function drawMat(
|
|
15
|
-
g: SVGGElement,
|
|
16
|
-
mat: Mat,
|
|
17
|
-
classes_?: string,
|
|
18
|
-
delay = 0,
|
|
19
|
-
scaleFactor = 1): SVGElement[] {
|
|
20
|
-
|
|
21
|
-
let cpNode = mat.cpNode;
|
|
22
|
-
if (!cpNode) { return []; }
|
|
23
|
-
|
|
24
|
-
while (!isTerminating(cpNode)) { cpNode = cpNode.next; }
|
|
25
|
-
|
|
26
|
-
const $svgs: SVGElement[] = [];
|
|
27
|
-
|
|
28
|
-
let i = 0;
|
|
29
|
-
traverseEdges(cpNode, cpNode => {
|
|
30
|
-
if (isTerminating(cpNode)) { return; }
|
|
31
|
-
|
|
32
|
-
const bezier = getMatCurveToNext(cpNode);
|
|
33
|
-
if (!bezier) { return; }
|
|
34
|
-
|
|
35
|
-
$svgs.push( ...drawFs.bezier(g, bezier, altClasses[i%2], delay));
|
|
36
|
-
i++;
|
|
37
|
-
});
|
|
38
|
-
|
|
39
|
-
return $svgs;
|
|
40
|
-
}
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
export { drawMat }
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
import type { CpNode } from '../../../cp-node/cp-node.js';
|
|
2
|
-
import { drawFs } from 'flo-draw';
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
/** @internal */
|
|
6
|
-
function maxVertex(g: SVGGElement, cpNode: CpNode) {
|
|
7
|
-
const circle = cpNode.pointOnShape.circle;
|
|
8
|
-
|
|
9
|
-
const $elems = drawFs.circle(g, circle, 'brown thin10 nofill');
|
|
10
|
-
|
|
11
|
-
return $elems;
|
|
12
|
-
}
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
export { maxVertex }
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
import type { PointOnShape } from '../../../point-on-shape/point-on-shape.js';
|
|
2
|
-
import { evalDeCasteljau } from 'flo-bezier3';
|
|
3
|
-
import { drawFs } from 'flo-draw';
|
|
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 }
|
|
@@ -1,40 +0,0 @@
|
|
|
1
|
-
import type { Circle } from '../../../geometry/circle.js';
|
|
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
|
-
import { ddCurvature, ddNormal, ddTangent } from 'flo-bezier3';
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
/** @hidden */
|
|
9
|
-
function oneProngAtDullCorner(
|
|
10
|
-
g: SVGGElement,
|
|
11
|
-
pos: PointOnShape,
|
|
12
|
-
classes?: string,
|
|
13
|
-
delay = 1000,
|
|
14
|
-
scaleFactor = 1) {
|
|
15
|
-
|
|
16
|
-
//let oCircle = PointOnShape.getOsculatingCircle(Infinity, pos);
|
|
17
|
-
const { curve, p, t } = pos;
|
|
18
|
-
const { ps } = curve;
|
|
19
|
-
|
|
20
|
-
const norm = ddNormal(ps, t).map(c => c[1]);
|
|
21
|
-
// const [center,r] = getOsculatingCircle(Infinity, pos, norm);
|
|
22
|
-
|
|
23
|
-
const k = -(ddCurvature(ps, t)[1]);
|
|
24
|
-
|
|
25
|
-
const [tx, ty] = norm;
|
|
26
|
-
const l = Math.sqrt(tx*tx + ty*ty);
|
|
27
|
-
const scale = k*l;
|
|
28
|
-
const center = [p[0] - tx/scale, p[1] - ty/scale];
|
|
29
|
-
|
|
30
|
-
const oCircle: Circle = { center, radius: 1/k };
|
|
31
|
-
|
|
32
|
-
const $center = drawFs.dot(g, pos.p, 0.1, 'orange');
|
|
33
|
-
const $circle = drawFs.dot(g, oCircle.center, 0.25, 'orange');
|
|
34
|
-
const $pos = drawFs.circle(g, oCircle, 'orange thin10 nofill');
|
|
35
|
-
|
|
36
|
-
return [...$center, ...$circle, ...$pos];
|
|
37
|
-
}
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
export { oneProngAtDullCorner }
|
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
import type { CpNode } from '../../../cp-node/cp-node.js';
|
|
2
|
-
import { drawFs } from 'flo-draw';
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
/** @hidden */
|
|
6
|
-
function drawOneProng(
|
|
7
|
-
g: SVGGElement,
|
|
8
|
-
cpNode: CpNode,
|
|
9
|
-
classes?: string,
|
|
10
|
-
delay = 0,
|
|
11
|
-
scaleFactor = 1) {
|
|
12
|
-
|
|
13
|
-
// const cp = cpNode.cp;
|
|
14
|
-
const { pointOnShape: pos } = cpNode;
|
|
15
|
-
const { circle } = pos;
|
|
16
|
-
|
|
17
|
-
const $posP = drawFs.dot(g, pos.p, 0.02*scaleFactor, 'deeppink', delay);
|
|
18
|
-
const $circleCenter = drawFs.dot(g, circle.center, 0.01*scaleFactor, 'deeppink', delay);
|
|
19
|
-
const $circle = drawFs.circle(g, circle, 'deeppink thin5 nofill', delay);
|
|
20
|
-
|
|
21
|
-
return [...$posP, ...$circleCenter, ...$circle];
|
|
22
|
-
}
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
export { drawOneProng }
|
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
import type { Curve } from 'flo-boolean';
|
|
2
|
-
import { drawFs } from 'flo-draw';
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
/** @internal */
|
|
6
|
-
function sharpCorner(
|
|
7
|
-
g: SVGGElement,
|
|
8
|
-
curve: Curve,
|
|
9
|
-
classes = 'green',
|
|
10
|
-
delay = 0,
|
|
11
|
-
scaleFactor = 1) {
|
|
12
|
-
|
|
13
|
-
const { ps } = curve;
|
|
14
|
-
const p = ps[ps.length-1];
|
|
15
|
-
const $pos = drawFs.dot(g, p, 0.6*scaleFactor, 'green', delay);
|
|
16
|
-
|
|
17
|
-
return $pos;
|
|
18
|
-
}
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
export { sharpCorner }
|
|
@@ -1,44 +0,0 @@
|
|
|
1
|
-
import type { CpNode } from '../../../cp-node/cp-node.js';
|
|
2
|
-
import { drawFs } from 'flo-draw';
|
|
3
|
-
import { scaleCircle } from '../../../geometry/circle.js';
|
|
4
|
-
import { getAllOnCircle } from '../../../cp-node/fs/get-all-on-circle.js';
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
/** @internal */
|
|
8
|
-
function drawThreeProng(
|
|
9
|
-
g: SVGGElement,
|
|
10
|
-
// threeProng: ThreeProngForDebugging,
|
|
11
|
-
threeProng: CpNode,
|
|
12
|
-
classes?: string,
|
|
13
|
-
delay = 0,
|
|
14
|
-
scaleFactor = 1) {
|
|
15
|
-
|
|
16
|
-
const circle = scaleCircle(
|
|
17
|
-
threeProng.pointOnShape.circle,
|
|
18
|
-
1
|
|
19
|
-
);
|
|
20
|
-
const { center: c, radius: r } = circle;
|
|
21
|
-
|
|
22
|
-
// const poss = threeProng.poss;
|
|
23
|
-
const poss = getAllOnCircle(threeProng)
|
|
24
|
-
.map(cpNode => cpNode.pointOnShape)
|
|
25
|
-
|
|
26
|
-
const { dot, circle: drawCircle, crossHair } = drawFs;
|
|
27
|
-
|
|
28
|
-
const $circle = drawCircle(g, circle, 'blue thin2 nofill', delay);
|
|
29
|
-
|
|
30
|
-
const $cps: SVGElement[] = [];
|
|
31
|
-
const $ls: SVGElement[] = [];
|
|
32
|
-
for (let i=0; i<poss.length; i++) {
|
|
33
|
-
const p = poss[i].p;
|
|
34
|
-
$cps.push(...dot(g, p, 0.01*(i+1)*scaleFactor, 'blue', delay));
|
|
35
|
-
$ls.push(...drawFs.line(g, [p, c], 'thin5 red', delay));
|
|
36
|
-
}
|
|
37
|
-
|
|
38
|
-
const $cross = crossHair(g, circle.center, 'red thin2 nofill', 0.02*scaleFactor, delay);
|
|
39
|
-
|
|
40
|
-
return [...$cps, ...$ls, ...$circle, ...$cross] as SVGElement[];
|
|
41
|
-
}
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
export { drawThreeProng }
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
import { drawFs } from 'flo-draw';
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
/** @internal */
|
|
5
|
-
function tightBoundingBox(
|
|
6
|
-
g: SVGGElement,
|
|
7
|
-
box: number[][],
|
|
8
|
-
classes = 'thin5 pinker nofill',
|
|
9
|
-
delay = 0,
|
|
10
|
-
scaleFactor = 1) {
|
|
11
|
-
|
|
12
|
-
const $box = drawFs.polygon(g, box, 'thin5 pinker nofill', delay);
|
|
13
|
-
|
|
14
|
-
return $box;
|
|
15
|
-
}
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
export { tightBoundingBox }
|
|
@@ -1,68 +0,0 @@
|
|
|
1
|
-
import { drawFs } from 'flo-draw';
|
|
2
|
-
import { CpNode } from '../../../cp-node/cp-node.js';
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
/** @internal */
|
|
6
|
-
function drawTwoProng(
|
|
7
|
-
drawCrosshair: boolean,
|
|
8
|
-
drawSpokes: boolean) {
|
|
9
|
-
|
|
10
|
-
return (g: SVGGElement,
|
|
11
|
-
twoProng: CpNode,
|
|
12
|
-
classes?: string,
|
|
13
|
-
delay = 0,
|
|
14
|
-
scaleFactor = 1) => {
|
|
15
|
-
|
|
16
|
-
let color;
|
|
17
|
-
let thin;
|
|
18
|
-
|
|
19
|
-
switch (twoProng.isHoleClosing) {
|
|
20
|
-
case false: {
|
|
21
|
-
color = 'red ';
|
|
22
|
-
thin = '2';
|
|
23
|
-
break;
|
|
24
|
-
}
|
|
25
|
-
case true: {
|
|
26
|
-
color = 'cyan ';
|
|
27
|
-
thin = '10';
|
|
28
|
-
break;
|
|
29
|
-
}
|
|
30
|
-
}
|
|
31
|
-
|
|
32
|
-
// const cp = twoProng.cp;
|
|
33
|
-
const { pointOnShape: pos } = twoProng;
|
|
34
|
-
const { circle } = pos;
|
|
35
|
-
const { center: c, radius: r } = circle;
|
|
36
|
-
const { isSource, p } = pos;
|
|
37
|
-
const p2 = twoProng.nextOnCircle.pointOnShape.p;
|
|
38
|
-
const pS = isSource ? p : p2;
|
|
39
|
-
const pA = isSource ? p2 : p;
|
|
40
|
-
|
|
41
|
-
const { line, dot, circle: drawCircle, crossHair } = drawFs;
|
|
42
|
-
|
|
43
|
-
const $center = dot (g, circle.center, 0.02*scaleFactor, 'yellow', delay);
|
|
44
|
-
const $circle = drawCircle(g, circle, color + 'thin' + thin + ' nofill', delay);
|
|
45
|
-
const $cp1 = dot (g, pS, 0.005*scaleFactor, color, delay);
|
|
46
|
-
const $cp2 = dot (g, pA, 0.01*scaleFactor, color, delay);
|
|
47
|
-
|
|
48
|
-
// const $l1 = drawSpokes ? line(g, [pS, c], 'thin5 red nofill', delay) : [];
|
|
49
|
-
// const $l2 = drawSpokes ? line(g, [pA, c], 'thin5 red nofill', delay) : [];
|
|
50
|
-
|
|
51
|
-
const $cross = drawCrosshair
|
|
52
|
-
? crossHair(g, circle.center, 'red thin2 nofill', 0.002*scaleFactor, delay)
|
|
53
|
-
: [];
|
|
54
|
-
|
|
55
|
-
return [
|
|
56
|
-
...$circle,
|
|
57
|
-
...$cp1,
|
|
58
|
-
...$cp2,
|
|
59
|
-
// ...$l1,
|
|
60
|
-
// ...$l2,
|
|
61
|
-
...$cross,
|
|
62
|
-
...$center
|
|
63
|
-
];
|
|
64
|
-
}
|
|
65
|
-
}
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
export { drawTwoProng }
|
|
@@ -1,27 +0,0 @@
|
|
|
1
|
-
import type { CpNode } from '../../../cp-node/cp-node.js';
|
|
2
|
-
import { drawFs } from 'flo-draw';
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
/** @internal */
|
|
6
|
-
function vertex(
|
|
7
|
-
g: SVGGElement,
|
|
8
|
-
cpNode: CpNode,
|
|
9
|
-
classes?: string,
|
|
10
|
-
delay = 0,
|
|
11
|
-
scaleFactor = 1) {
|
|
12
|
-
|
|
13
|
-
const circle = cpNode.pointOnShape.circle;
|
|
14
|
-
|
|
15
|
-
let $svgs: SVGElement[] = [];
|
|
16
|
-
|
|
17
|
-
// const $circle = drawFs.circle(g, circle, 'red ' + THIN + ' nofill ', delay);
|
|
18
|
-
// const $crossHair = drawFs.crossHair(g, circle.center, 'red ' + THIN + ' nofill ', 3, delay);
|
|
19
|
-
const $dot = drawFs.dot(g, circle.center, 0.01*scaleFactor, 'darkgreen', delay);
|
|
20
|
-
|
|
21
|
-
$svgs = [...$dot];
|
|
22
|
-
|
|
23
|
-
return $svgs;
|
|
24
|
-
}
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
export { vertex }
|
|
@@ -1,21 +0,0 @@
|
|
|
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,20 +0,0 @@
|
|
|
1
|
-
import { CpNode } from '../../../cp-node/cp-node.js';
|
|
2
|
-
import { drawCirclePercent } from './draw-circle-percent.js';
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
/** @internal */
|
|
6
|
-
function leaves(g: SVGGElement, leaves: CpNode[]) {
|
|
7
|
-
const $elems: SVGElement[] = [];
|
|
8
|
-
|
|
9
|
-
for (const cpNode of leaves) {
|
|
10
|
-
const cp = cpNode.cp;
|
|
11
|
-
const p = cp.circle.center;
|
|
12
|
-
|
|
13
|
-
$elems.push(drawCirclePercent(g, p, 0.5, 'pinker thin5 nofill'));
|
|
14
|
-
}
|
|
15
|
-
|
|
16
|
-
return $elems;
|
|
17
|
-
}
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
export { leaves }
|
|
@@ -1,16 +0,0 @@
|
|
|
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 }
|
|
@@ -1,21 +0,0 @@
|
|
|
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 }
|
|
@@ -1,47 +0,0 @@
|
|
|
1
|
-
import { drawFs } from 'flo-draw';
|
|
2
|
-
import { Mat } from '../../../mat/mat.js';
|
|
3
|
-
import { traverseEdges } from '../../../cp-node/traverse-edges.js';
|
|
4
|
-
import { getCurveToNext } from '../../../cp-node/get-curve-to-next.js';
|
|
5
|
-
import { isTerminating } from '../../../cp-node/cp-node.js';
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
/** @internal */
|
|
9
|
-
function drawMat(type: 'mat' | 'sat') {
|
|
10
|
-
|
|
11
|
-
const classes: string = type === 'mat'
|
|
12
|
-
? 'thin5 purple nofill'
|
|
13
|
-
: 'thin10 red nofill';
|
|
14
|
-
|
|
15
|
-
return (
|
|
16
|
-
g: SVGGElement,
|
|
17
|
-
mat: Mat,
|
|
18
|
-
classes_?: string,
|
|
19
|
-
delay = 0,
|
|
20
|
-
scaleFactor = 1): SVGElement[] => {
|
|
21
|
-
|
|
22
|
-
const cpNode = mat.cpNode;
|
|
23
|
-
|
|
24
|
-
// if (!cpNode) { return undefined; }
|
|
25
|
-
if (!cpNode) { return []; }
|
|
26
|
-
|
|
27
|
-
const $svgs: SVGElement[] = [];
|
|
28
|
-
let i = 0;
|
|
29
|
-
|
|
30
|
-
traverseEdges(cpNode, cpNode => {
|
|
31
|
-
if (isTerminating(cpNode)) { return; }
|
|
32
|
-
|
|
33
|
-
const bezier = getCurveToNext(cpNode);
|
|
34
|
-
|
|
35
|
-
if (!bezier) { return; }
|
|
36
|
-
|
|
37
|
-
i++;
|
|
38
|
-
|
|
39
|
-
$svgs.push( ...drawFs.bezier(g, bezier, classes, delay));
|
|
40
|
-
});
|
|
41
|
-
|
|
42
|
-
return $svgs;
|
|
43
|
-
}
|
|
44
|
-
}
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
export { drawMat }
|
|
@@ -1,15 +0,0 @@
|
|
|
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 }
|