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,26 +0,0 @@
|
|
|
1
|
-
import { drawFs } from 'flo-draw';
|
|
2
|
-
import { scaleCircle } from '../../../geometry/circle.js';
|
|
3
|
-
import { getAllOnCircle } from '../../../cp-node/fs/get-all-on-circle.js';
|
|
4
|
-
/** @internal */
|
|
5
|
-
function drawThreeProng(g,
|
|
6
|
-
// threeProng: ThreeProngForDebugging,
|
|
7
|
-
threeProng, classes, delay = 0, scaleFactor = 1) {
|
|
8
|
-
const circle = scaleCircle(threeProng.pointOnShape.circle, 1);
|
|
9
|
-
const { center: c, radius: r } = circle;
|
|
10
|
-
// const poss = threeProng.poss;
|
|
11
|
-
const poss = getAllOnCircle(threeProng)
|
|
12
|
-
.map(cpNode => cpNode.pointOnShape);
|
|
13
|
-
const { dot, circle: drawCircle, crossHair } = drawFs;
|
|
14
|
-
const $circle = drawCircle(g, circle, 'blue thin2 nofill', delay);
|
|
15
|
-
const $cps = [];
|
|
16
|
-
const $ls = [];
|
|
17
|
-
for (let i = 0; i < poss.length; i++) {
|
|
18
|
-
const p = poss[i].p;
|
|
19
|
-
$cps.push(...dot(g, p, 0.01 * (i + 1) * scaleFactor, 'blue', delay));
|
|
20
|
-
$ls.push(...drawFs.line(g, [p, c], 'thin5 red', delay));
|
|
21
|
-
}
|
|
22
|
-
const $cross = crossHair(g, circle.center, 'red thin2 nofill', 0.02 * scaleFactor, delay);
|
|
23
|
-
return [...$cps, ...$ls, ...$circle, ...$cross];
|
|
24
|
-
}
|
|
25
|
-
export { drawThreeProng };
|
|
26
|
-
//# sourceMappingURL=draw-three-prong.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"draw-three-prong.js","sourceRoot":"","sources":["../../../../src/debug/functions/draw-elem/draw-three-prong.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,MAAM,EAAE,MAAM,UAAU,CAAC;AAClC,OAAO,EAAE,WAAW,EAAE,MAAM,6BAA6B,CAAC;AAC1D,OAAO,EAAE,cAAc,EAAE,MAAM,0CAA0C,CAAC;AAG1E,gBAAgB;AAChB,SAAS,cAAc,CACf,CAAc;AACd,sCAAsC;AACtC,UAAkB,EAClB,OAAgB,EAChB,KAAK,GAAG,CAAC,EACT,WAAW,GAAG,CAAC;IAEnB,MAAM,MAAM,GAAG,WAAW,CACtB,UAAU,CAAC,YAAY,CAAC,MAAM,EAC9B,CAAC,CACJ,CAAC;IACF,MAAM,EAAE,MAAM,EAAE,CAAC,EAAE,MAAM,EAAE,CAAC,EAAE,GAAG,MAAM,CAAC;IAExC,gCAAgC;IAChC,MAAM,IAAI,GAAG,cAAc,CAAC,UAAU,CAAC;SAClC,GAAG,CAAC,MAAM,CAAC,EAAE,CAAC,MAAM,CAAC,YAAY,CAAC,CAAA;IAEvC,MAAM,EAAE,GAAG,EAAE,MAAM,EAAE,UAAU,EAAE,SAAS,EAAE,GAAG,MAAM,CAAC;IAEtD,MAAM,OAAO,GAAG,UAAU,CAAC,CAAC,EAAE,MAAM,EAAE,mBAAmB,EAAE,KAAK,CAAC,CAAC;IAElE,MAAM,IAAI,GAAiB,EAAE,CAAC;IAC9B,MAAM,GAAG,GAAiB,EAAE,CAAC;IAC7B,KAAK,IAAI,CAAC,GAAC,CAAC,EAAE,CAAC,GAAC,IAAI,CAAC,MAAM,EAAE,CAAC,EAAE,EAAE,CAAC;QAC/B,MAAM,CAAC,GAAG,IAAI,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;QACpB,IAAI,CAAC,IAAI,CAAC,GAAG,GAAG,CAAC,CAAC,EAAE,CAAC,EAAE,IAAI,GAAC,CAAC,CAAC,GAAC,CAAC,CAAC,GAAC,WAAW,EAAE,MAAM,EAAE,KAAK,CAAC,CAAC,CAAC;QAC/D,GAAG,CAAC,IAAI,CAAC,GAAG,MAAM,CAAC,IAAI,CAAC,CAAC,EAAE,CAAC,CAAC,EAAE,CAAC,CAAC,EAAE,WAAW,EAAE,KAAK,CAAC,CAAC,CAAC;IAC5D,CAAC;IAED,MAAM,MAAM,GAAG,SAAS,CAAC,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,kBAAkB,EAAE,IAAI,GAAC,WAAW,EAAE,KAAK,CAAC,CAAC;IAExF,OAAO,CAAC,GAAG,IAAI,EAAE,GAAG,GAAG,EAAE,GAAG,OAAO,EAAE,GAAG,MAAM,CAAiB,CAAC;AACpE,CAAC;AAGD,OAAO,EAAE,cAAc,EAAE,CAAA"}
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
import { drawFs } from 'flo-draw';
|
|
2
|
-
/** @internal */
|
|
3
|
-
function tightBoundingBox(g, box, classes = 'thin5 pinker nofill', delay = 0, scaleFactor = 1) {
|
|
4
|
-
const $box = drawFs.polygon(g, box, 'thin5 pinker nofill', delay);
|
|
5
|
-
return $box;
|
|
6
|
-
}
|
|
7
|
-
export { tightBoundingBox };
|
|
8
|
-
//# sourceMappingURL=draw-tight-bounding-box.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"draw-tight-bounding-box.js","sourceRoot":"","sources":["../../../../src/debug/functions/draw-elem/draw-tight-bounding-box.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,UAAU,CAAC;AAGlC,gBAAgB;AAChB,SAAS,gBAAgB,CACjB,CAAc,EACd,GAAe,EACf,OAAO,GAAG,qBAAqB,EAC/B,KAAK,GAAG,CAAC,EACT,WAAW,GAAG,CAAC;IAEnB,MAAM,IAAI,GAAG,MAAM,CAAC,OAAO,CAAC,CAAC,EAAE,GAAG,EAAE,qBAAqB,EAAE,KAAK,CAAC,CAAC;IAElE,OAAO,IAAI,CAAC;AAChB,CAAC;AAGD,OAAO,EAAE,gBAAgB,EAAE,CAAA"}
|
|
@@ -1,4 +0,0 @@
|
|
|
1
|
-
import { CpNode } from '../../../cp-node/cp-node.js';
|
|
2
|
-
/** @internal */
|
|
3
|
-
declare function drawTwoProng(drawCrosshair: boolean, drawSpokes: boolean): (g: SVGGElement, twoProng: CpNode, classes?: string, delay?: number, scaleFactor?: number) => SVGElement[];
|
|
4
|
-
export { drawTwoProng };
|
|
@@ -1,49 +0,0 @@
|
|
|
1
|
-
import { drawFs } from 'flo-draw';
|
|
2
|
-
/** @internal */
|
|
3
|
-
function drawTwoProng(drawCrosshair, drawSpokes) {
|
|
4
|
-
return (g, twoProng, classes, delay = 0, scaleFactor = 1) => {
|
|
5
|
-
let color;
|
|
6
|
-
let thin;
|
|
7
|
-
switch (twoProng.isHoleClosing) {
|
|
8
|
-
case false: {
|
|
9
|
-
color = 'red ';
|
|
10
|
-
thin = '2';
|
|
11
|
-
break;
|
|
12
|
-
}
|
|
13
|
-
case true: {
|
|
14
|
-
color = 'cyan ';
|
|
15
|
-
thin = '10';
|
|
16
|
-
break;
|
|
17
|
-
}
|
|
18
|
-
}
|
|
19
|
-
// const cp = twoProng.cp;
|
|
20
|
-
const { pointOnShape: pos } = twoProng;
|
|
21
|
-
const { circle } = pos;
|
|
22
|
-
const { center: c, radius: r } = circle;
|
|
23
|
-
const { isSource, p } = pos;
|
|
24
|
-
const p2 = twoProng.nextOnCircle.pointOnShape.p;
|
|
25
|
-
const pS = isSource ? p : p2;
|
|
26
|
-
const pA = isSource ? p2 : p;
|
|
27
|
-
const { line, dot, circle: drawCircle, crossHair } = drawFs;
|
|
28
|
-
const $center = dot(g, circle.center, 0.02 * scaleFactor, 'yellow', delay);
|
|
29
|
-
const $circle = drawCircle(g, circle, color + 'thin' + thin + ' nofill', delay);
|
|
30
|
-
const $cp1 = dot(g, pS, 0.005 * scaleFactor, color, delay);
|
|
31
|
-
const $cp2 = dot(g, pA, 0.01 * scaleFactor, color, delay);
|
|
32
|
-
// const $l1 = drawSpokes ? line(g, [pS, c], 'thin5 red nofill', delay) : [];
|
|
33
|
-
// const $l2 = drawSpokes ? line(g, [pA, c], 'thin5 red nofill', delay) : [];
|
|
34
|
-
const $cross = drawCrosshair
|
|
35
|
-
? crossHair(g, circle.center, 'red thin2 nofill', 0.002 * scaleFactor, delay)
|
|
36
|
-
: [];
|
|
37
|
-
return [
|
|
38
|
-
...$circle,
|
|
39
|
-
...$cp1,
|
|
40
|
-
...$cp2,
|
|
41
|
-
// ...$l1,
|
|
42
|
-
// ...$l2,
|
|
43
|
-
...$cross,
|
|
44
|
-
...$center
|
|
45
|
-
];
|
|
46
|
-
};
|
|
47
|
-
}
|
|
48
|
-
export { drawTwoProng };
|
|
49
|
-
//# sourceMappingURL=draw-two-prong.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"draw-two-prong.js","sourceRoot":"","sources":["../../../../src/debug/functions/draw-elem/draw-two-prong.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,UAAU,CAAC;AAIlC,gBAAgB;AAChB,SAAS,YAAY,CACb,aAAsB,EACtB,UAAmB;IAEvB,OAAO,CAAC,CAAc,EACd,QAAgB,EAChB,OAAgB,EAChB,KAAK,GAAG,CAAC,EACT,WAAW,GAAG,CAAC,EAAE,EAAE;QAEvB,IAAI,KAAK,CAAC;QACV,IAAI,IAAI,CAAC;QAET,QAAQ,QAAQ,CAAC,aAAa,EAAE,CAAC;YAC7B,KAAK,KAAK,CAAC,CAAC,CAAC;gBACT,KAAK,GAAG,MAAM,CAAC;gBACf,IAAI,GAAG,GAAG,CAAC;gBACX,MAAM;YACV,CAAC;YACD,KAAK,IAAI,CAAC,CAAC,CAAC;gBACR,KAAK,GAAG,OAAO,CAAC;gBAChB,IAAI,GAAG,IAAI,CAAC;gBACZ,MAAM;YACV,CAAC;QACL,CAAC;QAED,0BAA0B;QAC1B,MAAM,EAAE,YAAY,EAAE,GAAG,EAAE,GAAG,QAAQ,CAAC;QACvC,MAAM,EAAE,MAAM,EAAE,GAAG,GAAG,CAAC;QACvB,MAAM,EAAE,MAAM,EAAE,CAAC,EAAE,MAAM,EAAE,CAAC,EAAE,GAAG,MAAM,CAAC;QACxC,MAAM,EAAE,QAAQ,EAAE,CAAC,EAAE,GAAG,GAAG,CAAC;QAC5B,MAAM,EAAE,GAAG,QAAQ,CAAC,YAAY,CAAC,YAAY,CAAC,CAAC,CAAC;QAChD,MAAM,EAAE,GAAG,QAAQ,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC;QAC7B,MAAM,EAAE,GAAG,QAAQ,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,CAAC;QAE7B,MAAM,EAAE,IAAI,EAAE,GAAG,EAAE,MAAM,EAAE,UAAU,EAAE,SAAS,EAAE,GAAG,MAAM,CAAC;QAE5D,MAAM,OAAO,GAAG,GAAG,CAAI,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,IAAI,GAAC,WAAW,EAAE,QAAQ,EAAE,KAAK,CAAC,CAAC;QAC5E,MAAM,OAAO,GAAG,UAAU,CAAC,CAAC,EAAE,MAAM,EAAE,KAAK,GAAG,MAAM,GAAG,IAAI,GAAG,SAAS,EAAE,KAAK,CAAC,CAAC;QAChF,MAAM,IAAI,GAAM,GAAG,CAAI,CAAC,EAAE,EAAE,EAAE,KAAK,GAAC,WAAW,EAAE,KAAK,EAAE,KAAK,CAAC,CAAC;QAC/D,MAAM,IAAI,GAAM,GAAG,CAAI,CAAC,EAAE,EAAE,EAAE,IAAI,GAAC,WAAW,EAAE,KAAK,EAAE,KAAK,CAAC,CAAC;QAE9D,6EAA6E;QAC7E,6EAA6E;QAE7E,MAAM,MAAM,GAAG,aAAa;YACxB,CAAC,CAAC,SAAS,CAAC,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,kBAAkB,EAAE,KAAK,GAAC,WAAW,EAAE,KAAK,CAAC;YAC3E,CAAC,CAAC,EAAE,CAAC;QAET,OAAO;YACH,GAAG,OAAO;YACV,GAAG,IAAI;YACP,GAAG,IAAI;YACP,UAAU;YACV,UAAU;YACV,GAAG,MAAM;YACT,GAAG,OAAO;SACb,CAAC;IACN,CAAC,CAAA;AACL,CAAC;AAGD,OAAO,EAAE,YAAY,EAAE,CAAA"}
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
import { drawFs } from 'flo-draw';
|
|
2
|
-
/** @internal */
|
|
3
|
-
function vertex(g, cpNode, classes, delay = 0, scaleFactor = 1) {
|
|
4
|
-
const circle = cpNode.pointOnShape.circle;
|
|
5
|
-
let $svgs = [];
|
|
6
|
-
// const $circle = drawFs.circle(g, circle, 'red ' + THIN + ' nofill ', delay);
|
|
7
|
-
// const $crossHair = drawFs.crossHair(g, circle.center, 'red ' + THIN + ' nofill ', 3, delay);
|
|
8
|
-
const $dot = drawFs.dot(g, circle.center, 0.01 * scaleFactor, 'darkgreen', delay);
|
|
9
|
-
$svgs = [...$dot];
|
|
10
|
-
return $svgs;
|
|
11
|
-
}
|
|
12
|
-
export { vertex };
|
|
13
|
-
//# sourceMappingURL=draw-vertex.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"draw-vertex.js","sourceRoot":"","sources":["../../../../src/debug/functions/draw-elem/draw-vertex.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,MAAM,EAAE,MAAM,UAAU,CAAC;AAGlC,gBAAgB;AAChB,SAAS,MAAM,CACP,CAAc,EACd,MAAc,EACd,OAAgB,EAChB,KAAK,GAAG,CAAC,EACT,WAAW,GAAG,CAAC;IAEnB,MAAM,MAAM,GAAG,MAAM,CAAC,YAAY,CAAC,MAAM,CAAC;IAE1C,IAAI,KAAK,GAAiB,EAAE,CAAC;IAE7B,+EAA+E;IAC/E,+FAA+F;IAC/F,MAAM,IAAI,GAAG,MAAM,CAAC,GAAG,CAAC,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,IAAI,GAAC,WAAW,EAAE,WAAW,EAAE,KAAK,CAAC,CAAC;IAEhF,KAAK,GAAG,CAAC,GAAG,IAAI,CAAC,CAAC;IAElB,OAAO,KAAK,CAAC;AACjB,CAAC;AAGD,OAAO,EAAE,MAAM,EAAE,CAAA"}
|
|
@@ -1,48 +0,0 @@
|
|
|
1
|
-
import { CpNode } from '../../cp-node/cp-node.js';
|
|
2
|
-
/** @internal */
|
|
3
|
-
export interface IGeneralDebugFunctions {
|
|
4
|
-
nameObj: (obj: any, pre?: string) => void;
|
|
5
|
-
δToString: (cpNodes: CpNode[]) => string[];
|
|
6
|
-
δsToString: (cpNodes: CpNode[][]) => string[][];
|
|
7
|
-
pointToStr: (p: number[], decimalPlaces?: number) => string;
|
|
8
|
-
pointsToStr: (ps: number[][], decimalPlaces?: number) => string[];
|
|
9
|
-
}
|
|
10
|
-
/**
|
|
11
|
-
* @internal
|
|
12
|
-
* Name the given object - for debugging purposes only
|
|
13
|
-
*/
|
|
14
|
-
declare function nameObj(o: any, pre?: string): void;
|
|
15
|
-
/**
|
|
16
|
-
* @internal
|
|
17
|
-
* Transforms a boundary piece (δ) into a human readable string.
|
|
18
|
-
* @param cpNodes A boundary piece given by two CpNodes.
|
|
19
|
-
*/
|
|
20
|
-
declare function δToString(cpNodes: CpNode[]): string[];
|
|
21
|
-
/**
|
|
22
|
-
* @internal
|
|
23
|
-
* Transforms an array of boundary pieces (δs) into a human readable string.
|
|
24
|
-
* @param cpNodes An array of boundary pieces.
|
|
25
|
-
*/
|
|
26
|
-
declare function δsToString(cpNodes: CpNode[][]): string[][];
|
|
27
|
-
/**
|
|
28
|
-
* @internal
|
|
29
|
-
* Convert the given points into a human readable string.
|
|
30
|
-
* @param ps
|
|
31
|
-
*/
|
|
32
|
-
declare function pointsToStr(ps: number[][], decimalPlaces?: number): string[];
|
|
33
|
-
/**
|
|
34
|
-
* @internal
|
|
35
|
-
* Converts the given point into a human readable string.
|
|
36
|
-
* @param p The point
|
|
37
|
-
* @param decimalPlaces number of decimal places
|
|
38
|
-
*/
|
|
39
|
-
declare function pointToStr(p: number[], decimalPlaces?: number): string;
|
|
40
|
-
/** @internal */
|
|
41
|
-
declare const generalDebugFunctions: {
|
|
42
|
-
δToString: typeof δToString;
|
|
43
|
-
δsToString: typeof δsToString;
|
|
44
|
-
pointToStr: typeof pointToStr;
|
|
45
|
-
pointsToStr: typeof pointsToStr;
|
|
46
|
-
nameObj: typeof nameObj;
|
|
47
|
-
};
|
|
48
|
-
export { generalDebugFunctions };
|
|
@@ -1,53 +0,0 @@
|
|
|
1
|
-
import { posToHumanString } from '../../point-on-shape/pos-to-human-string.js';
|
|
2
|
-
/** @internal */
|
|
3
|
-
let i = 0;
|
|
4
|
-
/**
|
|
5
|
-
* @internal
|
|
6
|
-
* Name the given object - for debugging purposes only
|
|
7
|
-
*/
|
|
8
|
-
function nameObj(o, pre = '') {
|
|
9
|
-
o.name = '' + pre + i++;
|
|
10
|
-
}
|
|
11
|
-
/**
|
|
12
|
-
* @internal
|
|
13
|
-
* Transforms a boundary piece (δ) into a human readable string.
|
|
14
|
-
* @param cpNodes A boundary piece given by two CpNodes.
|
|
15
|
-
*/
|
|
16
|
-
function δToString(cpNodes) {
|
|
17
|
-
return cpNodes.map(cpNode => posToHumanString(cpNode.pointOnShape));
|
|
18
|
-
}
|
|
19
|
-
/**
|
|
20
|
-
* @internal
|
|
21
|
-
* Transforms an array of boundary pieces (δs) into a human readable string.
|
|
22
|
-
* @param cpNodes An array of boundary pieces.
|
|
23
|
-
*/
|
|
24
|
-
function δsToString(cpNodes) {
|
|
25
|
-
return cpNodes.map(δToString);
|
|
26
|
-
}
|
|
27
|
-
/**
|
|
28
|
-
* @internal
|
|
29
|
-
* Convert the given points into a human readable string.
|
|
30
|
-
* @param ps
|
|
31
|
-
*/
|
|
32
|
-
function pointsToStr(ps, decimalPlaces = 3) {
|
|
33
|
-
return ps.map(p => pointToStr(p, decimalPlaces));
|
|
34
|
-
}
|
|
35
|
-
/**
|
|
36
|
-
* @internal
|
|
37
|
-
* Converts the given point into a human readable string.
|
|
38
|
-
* @param p The point
|
|
39
|
-
* @param decimalPlaces number of decimal places
|
|
40
|
-
*/
|
|
41
|
-
function pointToStr(p, decimalPlaces = 3) {
|
|
42
|
-
return p[0].toFixed(decimalPlaces) + ', ' + p[1].toFixed(decimalPlaces);
|
|
43
|
-
}
|
|
44
|
-
/** @internal */
|
|
45
|
-
const generalDebugFunctions /*: IGeneralDebugFunctions*/ = {
|
|
46
|
-
δToString,
|
|
47
|
-
δsToString,
|
|
48
|
-
pointToStr,
|
|
49
|
-
pointsToStr,
|
|
50
|
-
nameObj,
|
|
51
|
-
};
|
|
52
|
-
export { generalDebugFunctions };
|
|
53
|
-
//# sourceMappingURL=general.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"general.js","sourceRoot":"","sources":["../../../src/debug/functions/general.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,gBAAgB,EAAE,MAAM,6CAA6C,CAAC;AAa/E,gBAAgB;AAChB,IAAI,CAAC,GAAG,CAAC,CAAC;AACV;;;GAGG;AACH,SAAS,OAAO,CAAC,CAAM,EAAE,GAAG,GAAG,EAAE;IAC7B,CAAC,CAAC,IAAI,GAAG,EAAE,GAAG,GAAG,GAAG,CAAC,EAAE,CAAC;AAC5B,CAAC;AAGD;;;;GAIG;AACH,SAAS,SAAS,CAAC,OAAiB;IAChC,OAAO,OAAO,CAAC,GAAG,CACd,MAAM,CAAC,EAAE,CAAC,gBAAgB,CAAC,MAAM,CAAC,YAAY,CAAC,CAClD,CAAC;AACN,CAAC;AAGD;;;;GAIG;AACH,SAAS,UAAU,CAAC,OAAmB;IACnC,OAAO,OAAO,CAAC,GAAG,CAAC,SAAS,CAAC,CAAC;AAClC,CAAC;AAGD;;;;GAIG;AACH,SAAS,WAAW,CAAC,EAAc,EAAE,aAAa,GAAG,CAAC;IAClD,OAAO,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,CAAC,UAAU,CAAC,CAAC,EAAE,aAAa,CAAC,CAAC,CAAC;AACrD,CAAC;AAGD;;;;;GAKG;AACH,SAAS,UAAU,CAAC,CAAW,EAAE,aAAa,GAAG,CAAC;IAC9C,OAAO,CAAC,CAAC,CAAC,CAAC,CAAC,OAAO,CAAC,aAAa,CAAC,GAAG,IAAI,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC,OAAO,CAAC,aAAa,CAAC,CAAC;AAC5E,CAAC;AAGD,gBAAgB;AAChB,MAAM,qBAAqB,CAAA,4BAA4B,GAAG;IACtD,SAAS;IACT,UAAU;IACV,UAAU;IACV,WAAW;IACX,OAAO;CACV,CAAA;AAGD,OAAO,EAAE,qBAAqB,EAAE,CAAA"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"timed-cc.js","sourceRoot":"","sources":["../../src/find-3-prong/timed-cc.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,cAAc,CAAC;AAI5C,4DAA4D;AAC5D,MAAM,gBAAgB,GAAG,YAAY,CAAC;AAGtC,OAAO,EAAE,gBAAgB,IAAI,YAAY,EAAE,CAAA"}
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Returns a human-readable string of the given `PointOnShape`.
|
|
3
|
-
* For debugging only.
|
|
4
|
-
* @internal
|
|
5
|
-
*/
|
|
6
|
-
function posToHumanString(pos) {
|
|
7
|
-
return '' + pos.p[0] + ', ' + pos.p[1] +
|
|
8
|
-
' | bz: ' + pos.curve.idx +
|
|
9
|
-
' | t: ' + pos.t;
|
|
10
|
-
}
|
|
11
|
-
export { posToHumanString };
|
|
12
|
-
//# sourceMappingURL=pos-to-human-string.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"pos-to-human-string.js","sourceRoot":"","sources":["../../src/point-on-shape/pos-to-human-string.ts"],"names":[],"mappings":"AAGA;;;;GAIG;AACH,SAAS,gBAAgB,CACjB,GAAiB;IAErB,OAAO,EAAE,GAAG,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC,GAAG,IAAI,GAAG,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC;QAClC,SAAS,GAAK,GAAG,CAAC,KAAK,CAAC,GAAG;QAC3B,QAAQ,GAAM,GAAG,CAAC,CAAC,CAAA;AAC3B,CAAC;AAGD,OAAO,EAAE,gBAAgB,EAAE,CAAA"}
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
type TimedFunction<T extends (...args: any[]) => any> = ((this: ThisParameterType<T>, ...args: Parameters<T>) => ReturnType<T>) & {
|
|
2
|
-
getStats: () => {
|
|
3
|
-
count: number;
|
|
4
|
-
totalMs: number;
|
|
5
|
-
avg: number;
|
|
6
|
-
};
|
|
7
|
-
resetStats: () => void;
|
|
8
|
-
};
|
|
9
|
-
/**
|
|
10
|
-
*
|
|
11
|
-
* @param f
|
|
12
|
-
*/
|
|
13
|
-
declare function timeFunctionCalls<T extends (...args: any[]) => any>(f: T): TimedFunction<T>;
|
|
14
|
-
export { timeFunctionCalls };
|
|
@@ -1,32 +0,0 @@
|
|
|
1
|
-
import { sum } from './sum.js';
|
|
2
|
-
/**
|
|
3
|
-
*
|
|
4
|
-
* @param f
|
|
5
|
-
*/
|
|
6
|
-
function timeFunctionCalls(f) {
|
|
7
|
-
const history = [];
|
|
8
|
-
function wrapper(...args) {
|
|
9
|
-
const start = performance.now();
|
|
10
|
-
const result = f.apply(this, args); // Execute original function
|
|
11
|
-
const end = performance.now();
|
|
12
|
-
history.push(end - start); // Track the duration
|
|
13
|
-
return result;
|
|
14
|
-
}
|
|
15
|
-
;
|
|
16
|
-
// Attach a helper method to inspect stats at any time
|
|
17
|
-
wrapper.getStats = () => {
|
|
18
|
-
const total = sum(history);
|
|
19
|
-
return {
|
|
20
|
-
totalMs: total,
|
|
21
|
-
count: history.length,
|
|
22
|
-
avg: history.length === 0 ? 0 : total / history.length,
|
|
23
|
-
// history: history
|
|
24
|
-
};
|
|
25
|
-
};
|
|
26
|
-
wrapper.resetStats = () => {
|
|
27
|
-
history.length = 0;
|
|
28
|
-
};
|
|
29
|
-
return wrapper;
|
|
30
|
-
}
|
|
31
|
-
export { timeFunctionCalls };
|
|
32
|
-
//# sourceMappingURL=time-function-call.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"time-function-call.js","sourceRoot":"","sources":["../../src/utils/time-function-call.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,GAAG,EAAE,MAAM,UAAU,CAAC;AAgB/B;;;GAGG;AACH,SAAS,iBAAiB,CAAoC,CAAI;IAC9D,MAAM,OAAO,GAAa,EAAE,CAAC;IAE7B,SAAS,OAAO,CAA6B,GAAG,IAAmB;QAC/D,MAAM,KAAK,GAAG,WAAW,CAAC,GAAG,EAAE,CAAC;QAChC,MAAM,MAAM,GAAG,CAAC,CAAC,KAAK,CAAC,IAAI,EAAE,IAAI,CAAC,CAAC,CAAC,4BAA4B;QAChE,MAAM,GAAG,GAAG,WAAW,CAAC,GAAG,EAAE,CAAC;QAE9B,OAAO,CAAC,IAAI,CAAC,GAAG,GAAG,KAAK,CAAC,CAAC,CAAC,qBAAqB;QAEhD,OAAO,MAAM,CAAC;IAClB,CAAC;IAAA,CAAC;IAEF,sDAAsD;IACtD,OAAO,CAAC,QAAQ,GAAG,GAAG,EAAE;QACpB,MAAM,KAAK,GAAG,GAAG,CAAC,OAAO,CAAC,CAAC;QAC3B,OAAO;YACH,OAAO,EAAE,KAAK;YACd,KAAK,EAAE,OAAO,CAAC,MAAM;YACrB,GAAG,EAAE,OAAO,CAAC,MAAM,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,KAAK,GAAG,OAAO,CAAC,MAAM;YACtD,mBAAmB;SACtB,CAAC;IACN,CAAC,CAAC;IAEF,OAAO,CAAC,UAAU,GAAG,GAAG,EAAE;QACtB,OAAO,CAAC,MAAM,GAAG,CAAC,CAAC;IACvB,CAAC,CAAA;IAED,OAAO,OAA2B,CAAC;AACvC,CAAC;AAGD,OAAO,EAAE,iBAAiB,EAAE,CAAA"}
|
|
@@ -1,43 +0,0 @@
|
|
|
1
|
-
import { Mat } from '../mat/mat.js';
|
|
2
|
-
import { CpNode } from '../cp-node/cp-node.js';
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
type DebugElemKey = keyof typeof emptyDebugElems;
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
const emptyDebugElems = {
|
|
9
|
-
oneProng: [] as CpNode[],
|
|
10
|
-
// oneProngAtDullCorner: [] as PointOnShape[],
|
|
11
|
-
twoProng: [] as CpNode[],
|
|
12
|
-
threeProng: [] as CpNode[],
|
|
13
|
-
looseBoundingBox: [] as number[][][],
|
|
14
|
-
tightBoundingBox: [] as number[][][],
|
|
15
|
-
boundingHull: [] as number[][][],
|
|
16
|
-
// sharpCorner: [] as Curve[],
|
|
17
|
-
// dullCorner: [] as Curve[],
|
|
18
|
-
vertex: [] as CpNode[],
|
|
19
|
-
mat: [] as Mat[],
|
|
20
|
-
maxVertex: [] as CpNode[],
|
|
21
|
-
leaves: [] as CpNode[][],
|
|
22
|
-
cull: [] as number[][],
|
|
23
|
-
cpNode: [] as CpNode[],
|
|
24
|
-
branch: [] as CpNode[][],
|
|
25
|
-
holeCloser: [] as CpNode[]
|
|
26
|
-
} as const;
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
const debugElemNames =
|
|
30
|
-
Object.keys(emptyDebugElems) as Array<keyof typeof emptyDebugElems>;
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
/** @internal */
|
|
34
|
-
type DebugElems = typeof emptyDebugElems;
|
|
35
|
-
|
|
36
|
-
type DebugElem = { [T in keyof DebugElems]: DebugElems[T][number]; }
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
export {
|
|
40
|
-
DebugElems, DebugElemKey, DebugElem,
|
|
41
|
-
emptyDebugElems, debugElemNames,
|
|
42
|
-
}
|
|
43
|
-
|
|
@@ -1,54 +0,0 @@
|
|
|
1
|
-
import type { CpNode } from '../../cp-node/cp-node.js';
|
|
2
|
-
import { PointOnShape } from '../../point-on-shape/point-on-shape.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: PointOnShape) {
|
|
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δ }
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
import { drawFs } from 'flo-draw';
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
/** @internal */
|
|
5
|
-
function boundingHull(
|
|
6
|
-
g: SVGGElement,
|
|
7
|
-
hull: number[][],
|
|
8
|
-
classes = 'thin5 black nofill',
|
|
9
|
-
delay = 0,
|
|
10
|
-
scaleFactor = 1) {
|
|
11
|
-
|
|
12
|
-
const $polygon = drawFs.polygon(g, hull, classes, delay);
|
|
13
|
-
|
|
14
|
-
return $polygon;
|
|
15
|
-
}
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
export { boundingHull }
|
|
@@ -1,39 +0,0 @@
|
|
|
1
|
-
import { Circle } from '../../../geometry/circle.js';
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
/** @internal */
|
|
5
|
-
function culls(g: SVGGElement, culls: Circle[]) {
|
|
6
|
-
const $elems: SVGElement[] = [];
|
|
7
|
-
|
|
8
|
-
for (const circle of culls) {
|
|
9
|
-
const p = circle.center;
|
|
10
|
-
|
|
11
|
-
$elems.push(drawCircle(g, p, 0.4, 'cyan thin5 nofill'));
|
|
12
|
-
}
|
|
13
|
-
|
|
14
|
-
return $elems;
|
|
15
|
-
}
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
/** @internal */
|
|
19
|
-
function drawCircle(
|
|
20
|
-
g: SVGGElement,
|
|
21
|
-
center: number[],
|
|
22
|
-
radiusPercent: number,
|
|
23
|
-
classes: string) {
|
|
24
|
-
|
|
25
|
-
const XMLNS = 'http://www.w3.org/2000/svg';
|
|
26
|
-
|
|
27
|
-
const $circle = document.createElementNS(XMLNS, 'circle');
|
|
28
|
-
$circle.setAttributeNS(null, "cx", center[0].toString());
|
|
29
|
-
$circle.setAttributeNS(null, "cy", center[1].toString());
|
|
30
|
-
$circle.setAttributeNS(null, "r", radiusPercent.toString() + '%');
|
|
31
|
-
$circle.setAttributeNS(null, "class", classes);
|
|
32
|
-
|
|
33
|
-
g.appendChild($circle);
|
|
34
|
-
|
|
35
|
-
return $circle;
|
|
36
|
-
}
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
export { culls }
|
|
@@ -1,37 +0,0 @@
|
|
|
1
|
-
import type { CpNode } from '../../../cp-node/cp-node.js';
|
|
2
|
-
import { getMatCurveToNext } from '../../../cp-node/fs/get-mat-curve-to-next.js';
|
|
3
|
-
import { isTerminating } from '../../../cp-node/fs/is-terminating.js';
|
|
4
|
-
import { drawBeziersAsSinglePath } from '../draw/draw-beziers-as-single-path.js';
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
/** @internal */
|
|
8
|
-
function drawBranch(
|
|
9
|
-
g: SVGGElement,
|
|
10
|
-
branch: CpNode[],
|
|
11
|
-
classes = 'thin5 purple nofill',
|
|
12
|
-
delay = 0,
|
|
13
|
-
scaleFactor = 1) {
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
const $svgs: SVGElement[] = [];
|
|
17
|
-
let i = 0;
|
|
18
|
-
|
|
19
|
-
const pss: number[][][] = [];
|
|
20
|
-
for (const cpNode of branch) {
|
|
21
|
-
if (isTerminating(cpNode)) { continue; }
|
|
22
|
-
const bezier = getMatCurveToNext(cpNode);
|
|
23
|
-
if (!bezier) { continue; }
|
|
24
|
-
i++;
|
|
25
|
-
// $svgs.push( ...drawFs.bezier(g, bezier, classes, delay));
|
|
26
|
-
pss.push(bezier);
|
|
27
|
-
}
|
|
28
|
-
|
|
29
|
-
// return $svgs;
|
|
30
|
-
|
|
31
|
-
$svgs.push(...drawBeziersAsSinglePath(g, pss, classes, delay));
|
|
32
|
-
|
|
33
|
-
return $svgs;
|
|
34
|
-
}
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
export { drawBranch }
|
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
|
|
2
|
-
/** @internal */
|
|
3
|
-
function drawCirclePercent(
|
|
4
|
-
g: SVGGElement,
|
|
5
|
-
center: number[],
|
|
6
|
-
radiusPercent: number,
|
|
7
|
-
classes: string) {
|
|
8
|
-
|
|
9
|
-
const XMLNS = 'http://www.w3.org/2000/svg';
|
|
10
|
-
|
|
11
|
-
const $circle = document.createElementNS(XMLNS, 'circle');
|
|
12
|
-
$circle.setAttributeNS(null, "cx", center[0].toString());
|
|
13
|
-
$circle.setAttributeNS(null, "cy", center[1].toString());
|
|
14
|
-
$circle.setAttributeNS(null, "r", radiusPercent.toString() + '%');
|
|
15
|
-
$circle.setAttributeNS(null, "class", classes);
|
|
16
|
-
|
|
17
|
-
g.appendChild($circle);
|
|
18
|
-
|
|
19
|
-
return $circle;
|
|
20
|
-
}
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
export { drawCirclePercent }
|
|
@@ -1,46 +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 drawCpNode(
|
|
9
|
-
g: SVGGElement,
|
|
10
|
-
cpNode: CpNode,
|
|
11
|
-
classes = 'blue thin2 nofill',
|
|
12
|
-
delay = 0,
|
|
13
|
-
scaleFactor = 1) {
|
|
14
|
-
|
|
15
|
-
const circle = scaleCircle(
|
|
16
|
-
cpNode.pointOnShape.circle,
|
|
17
|
-
1
|
|
18
|
-
);
|
|
19
|
-
const { center: c, radius: r } = circle;
|
|
20
|
-
|
|
21
|
-
const poss = getAllOnCircle(cpNode)
|
|
22
|
-
.map(cpNode => cpNode.pointOnShape)
|
|
23
|
-
|
|
24
|
-
const { dot, circle: drawCircle, crossHair } = drawFs;
|
|
25
|
-
|
|
26
|
-
const $circle = drawCircle(g, circle, classes, delay);
|
|
27
|
-
|
|
28
|
-
const $cps: SVGElement[] = [];
|
|
29
|
-
const $ls: 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, 'blue', delay));
|
|
33
|
-
$ls.push(...drawFs.line(g, [p, c], 'thin5 red', delay));
|
|
34
|
-
}
|
|
35
|
-
|
|
36
|
-
const $cross = crossHair(g, c, 'orange thin10 nofill', 2*scaleFactor, delay);
|
|
37
|
-
|
|
38
|
-
// if (r === 0) {
|
|
39
|
-
// const $cross = crossHair(g, circle.center, 'red thin2 nofill', 0.02*scaleFactor, delay);
|
|
40
|
-
// }
|
|
41
|
-
|
|
42
|
-
return [...$cps, ...$ls, ...$circle, ...$cross] as SVGElement[];
|
|
43
|
-
}
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
export { drawCpNode }
|
|
@@ -1,21 +0,0 @@
|
|
|
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 }
|