@jscad/modeling 2.11.1 → 3.0.0-alpha.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/CHANGELOG.md +39 -267
- package/README.md +5 -3
- package/dist/jscad-modeling.es.js +7 -0
- package/dist/jscad-modeling.min.js +7 -1205
- package/global.d.ts +15 -0
- package/package.json +22 -19
- package/rollup.config.js +21 -0
- package/src/colors/colorNameToRgb.d.ts +2 -4
- package/src/colors/colorNameToRgb.js +4 -6
- package/src/colors/colorNameToRgb.test.js +2 -2
- package/src/colors/colorize.d.ts +6 -8
- package/src/colors/colorize.js +20 -22
- package/src/colors/colorize.test.js +6 -8
- package/src/colors/cssColors.d.ts +1 -1
- package/src/colors/cssColors.js +2 -4
- package/src/colors/hexToRgb.d.ts +2 -4
- package/src/colors/hexToRgb.js +3 -5
- package/src/colors/hexToRgb.test.js +2 -2
- package/src/colors/hslToRgb.d.ts +5 -7
- package/src/colors/hslToRgb.js +4 -6
- package/src/colors/hslToRgb.test.js +2 -2
- package/src/colors/hsvToRgb.d.ts +5 -7
- package/src/colors/hsvToRgb.js +3 -5
- package/src/colors/hsvToRgb.test.js +2 -2
- package/src/colors/hueToColorComponent.d.ts +1 -3
- package/src/colors/hueToColorComponent.js +2 -4
- package/src/colors/index.d.ts +11 -12
- package/src/colors/index.js +12 -13
- package/src/colors/rgbToHex.d.ts +3 -5
- package/src/colors/rgbToHex.js +2 -4
- package/src/colors/rgbToHex.test.js +2 -2
- package/src/colors/rgbToHsl.d.ts +5 -7
- package/src/colors/rgbToHsl.js +2 -4
- package/src/colors/rgbToHsl.test.js +2 -2
- package/src/colors/rgbToHsv.d.ts +5 -7
- package/src/colors/rgbToHsv.js +2 -4
- package/src/colors/rgbToHsv.test.js +2 -2
- package/src/connectors/create.js +3 -5
- package/src/connectors/create.test.js +3 -3
- package/src/connectors/extends.js +7 -8
- package/src/connectors/fromPointAxisNormal.js +6 -8
- package/src/connectors/fromPointAxisNormal.test.js +3 -3
- package/src/connectors/index.js +7 -9
- package/src/connectors/normalize.js +7 -9
- package/src/connectors/toString.js +1 -3
- package/src/connectors/transform.js +10 -12
- package/src/connectors/transform.test.js +3 -3
- package/src/connectors/transformationBetween.js +25 -27
- package/src/connectors/transformationBetween.test.js +13 -13
- package/src/curves/bezier/arcLengthToT.d.ts +2 -4
- package/src/curves/bezier/arcLengthToT.js +11 -13
- package/src/curves/bezier/arcLengthToT.test.js +38 -38
- package/src/curves/bezier/create.d.ts +2 -4
- package/src/curves/bezier/create.js +3 -5
- package/src/curves/bezier/create.test.js +2 -2
- package/src/curves/bezier/index.d.ts +7 -8
- package/src/curves/bezier/index.js +9 -8
- package/src/curves/bezier/length.d.ts +2 -4
- package/src/curves/bezier/length.js +5 -9
- package/src/curves/bezier/length.test.js +14 -14
- package/src/curves/bezier/lengths.d.ts +2 -4
- package/src/curves/bezier/lengths.js +13 -15
- package/src/curves/bezier/lengths.test.js +15 -15
- package/src/curves/bezier/tangentAt.d.ts +2 -4
- package/src/curves/bezier/tangentAt.js +2 -4
- package/src/curves/bezier/tangentAt.test.js +2 -2
- package/src/curves/bezier/type.d.ts +1 -3
- package/src/curves/bezier/valueAt.d.ts +2 -4
- package/src/curves/bezier/valueAt.js +2 -4
- package/src/curves/bezier/valueAt.test.js +2 -2
- package/src/curves/index.d.ts +1 -3
- package/src/curves/index.js +4 -6
- package/src/geometries/geom2/applyTransforms.js +7 -13
- package/src/geometries/geom2/applyTransforms.test.js +6 -6
- package/src/geometries/geom2/clone.d.ts +2 -4
- package/src/geometries/geom2/clone.js +3 -5
- package/src/geometries/geom2/clone.test.js +5 -5
- package/src/geometries/geom2/create.d.ts +3 -5
- package/src/geometries/geom2/create.js +19 -19
- package/src/geometries/geom2/create.test.js +6 -6
- package/src/geometries/geom2/fromCompactBinary.d.ts +2 -4
- package/src/geometries/geom2/fromCompactBinary.js +19 -11
- package/src/geometries/geom2/fromSides.d.ts +4 -0
- package/src/geometries/geom2/fromSides.js +115 -0
- package/src/geometries/geom2/fromToCompactBinary.test.js +16 -38
- package/src/geometries/geom2/index.d.ts +14 -15
- package/src/geometries/geom2/index.js +17 -24
- package/src/geometries/geom2/isA.d.ts +2 -4
- package/src/geometries/geom2/isA.js +4 -6
- package/src/geometries/geom2/isA.test.js +5 -3
- package/src/geometries/geom2/reverse.d.ts +2 -4
- package/src/geometries/geom2/reverse.js +12 -14
- package/src/geometries/geom2/reverse.test.js +29 -9
- package/src/geometries/geom2/toCompactBinary.d.ts +2 -4
- package/src/geometries/geom2/toCompactBinary.js +18 -15
- package/src/geometries/geom2/toOutlines.d.ts +3 -5
- package/src/geometries/geom2/toOutlines.js +3 -109
- package/src/geometries/geom2/toOutlines.test.js +34 -61
- package/src/geometries/geom2/toPoints.d.ts +3 -5
- package/src/geometries/geom2/toPoints.js +10 -13
- package/src/geometries/geom2/toPoints.test.js +8 -8
- package/src/geometries/geom2/toSides.d.ts +3 -5
- package/src/geometries/geom2/toSides.js +13 -6
- package/src/geometries/geom2/toString.d.ts +2 -4
- package/src/geometries/geom2/toString.js +9 -11
- package/src/geometries/geom2/toString.test.js +17 -0
- package/src/geometries/geom2/transform.d.ts +3 -5
- package/src/geometries/geom2/transform.js +8 -10
- package/src/geometries/geom2/transform.test.js +21 -22
- package/src/geometries/geom2/type.d.ts +5 -7
- package/src/geometries/geom2/validate.d.ts +1 -3
- package/src/geometries/geom2/validate.js +34 -13
- package/src/geometries/geom2/validate.test.js +39 -0
- package/src/geometries/geom3/applyTransforms.js +5 -7
- package/src/geometries/geom3/applyTransforms.test.js +6 -6
- package/src/geometries/geom3/clone.d.ts +2 -4
- package/src/geometries/geom3/clone.js +3 -5
- package/src/geometries/geom3/clone.test.js +5 -5
- package/src/geometries/geom3/create.d.ts +3 -5
- package/src/geometries/geom3/create.js +17 -8
- package/src/geometries/geom3/create.test.js +5 -5
- package/src/geometries/geom3/fromCompactBinary.d.ts +2 -4
- package/src/geometries/geom3/fromCompactBinary.js +6 -8
- package/src/geometries/geom3/fromPoints.d.ts +3 -5
- package/src/geometries/geom3/fromPoints.js +11 -19
- package/src/geometries/geom3/fromPoints.test.js +6 -6
- package/src/geometries/geom3/fromToCompactBinary.test.js +7 -7
- package/src/geometries/geom3/index.d.ts +13 -14
- package/src/geometries/geom3/index.js +21 -29
- package/src/geometries/geom3/invert.d.ts +2 -4
- package/src/geometries/geom3/invert.js +8 -10
- package/src/geometries/geom3/invert.test.js +5 -5
- package/src/geometries/geom3/isA.d.ts +2 -4
- package/src/geometries/geom3/isA.js +2 -4
- package/src/geometries/geom3/isA.test.js +2 -2
- package/src/geometries/geom3/toCompactBinary.d.ts +2 -4
- package/src/geometries/geom3/toCompactBinary.js +10 -12
- package/src/geometries/geom3/toPoints.d.ts +3 -5
- package/src/geometries/geom3/toPoints.js +5 -8
- package/src/geometries/geom3/toPoints.test.js +9 -9
- package/src/geometries/geom3/toPolygons.d.ts +3 -5
- package/src/geometries/geom3/toPolygons.js +4 -6
- package/src/geometries/geom3/toString.d.ts +2 -4
- package/src/geometries/geom3/toString.js +5 -7
- package/src/geometries/geom3/toString.test.js +17 -0
- package/src/geometries/geom3/transform.d.ts +3 -5
- package/src/geometries/geom3/transform.js +6 -8
- package/src/geometries/geom3/transform.test.js +6 -6
- package/src/geometries/geom3/type.d.ts +4 -6
- package/src/geometries/geom3/validate.d.ts +1 -3
- package/src/geometries/geom3/validate.js +5 -6
- package/src/geometries/geom3/validate.test.js +26 -0
- package/src/geometries/index.d.ts +6 -7
- package/src/geometries/index.js +10 -9
- package/src/geometries/path2/appendArc.d.ts +4 -6
- package/src/geometries/path2/appendArc.js +58 -60
- package/src/geometries/path2/appendArc.test.js +8 -7
- package/src/geometries/path2/appendBezier.d.ts +3 -5
- package/src/geometries/path2/appendBezier.js +41 -43
- package/src/geometries/path2/appendBezier.test.js +3 -3
- package/src/geometries/path2/appendPoints.d.ts +3 -5
- package/src/geometries/path2/appendPoints.js +6 -8
- package/src/geometries/path2/appendPoints.test.js +2 -2
- package/src/geometries/path2/applyTransforms.js +3 -5
- package/src/geometries/path2/applyTransforms.test.js +4 -4
- package/src/geometries/path2/clone.d.ts +2 -4
- package/src/geometries/path2/clone.js +3 -5
- package/src/geometries/path2/close.d.ts +2 -4
- package/src/geometries/path2/close.js +6 -8
- package/src/geometries/path2/close.test.js +2 -2
- package/src/geometries/path2/concat.d.ts +2 -4
- package/src/geometries/path2/concat.js +11 -13
- package/src/geometries/path2/concat.test.js +2 -2
- package/src/geometries/path2/create.d.ts +3 -5
- package/src/geometries/path2/create.js +12 -9
- package/src/geometries/path2/create.test.js +2 -2
- package/src/geometries/path2/equals.d.ts +2 -4
- package/src/geometries/path2/equals.js +9 -11
- package/src/geometries/path2/equals.test.js +2 -2
- package/src/geometries/path2/fromCompactBinary.d.ts +2 -4
- package/src/geometries/path2/fromCompactBinary.js +5 -7
- package/src/geometries/path2/fromPoints.d.ts +3 -5
- package/src/geometries/path2/fromPoints.js +9 -11
- package/src/geometries/path2/fromPoints.test.js +3 -3
- package/src/geometries/path2/fromToCompactBinary.test.js +2 -2
- package/src/geometries/path2/index.d.ts +18 -19
- package/src/geometries/path2/index.js +19 -28
- package/src/geometries/path2/isA.d.ts +2 -4
- package/src/geometries/path2/isA.js +2 -4
- package/src/geometries/path2/isA.test.js +2 -2
- package/src/geometries/path2/reverse.d.ts +2 -4
- package/src/geometries/path2/reverse.js +5 -7
- package/src/geometries/path2/reverse.test.js +2 -2
- package/src/geometries/path2/toCompactBinary.d.ts +2 -4
- package/src/geometries/path2/toCompactBinary.js +2 -4
- package/src/geometries/path2/toPoints.d.ts +3 -5
- package/src/geometries/path2/toPoints.js +4 -6
- package/src/geometries/path2/toPoints.test.js +3 -3
- package/src/geometries/path2/toString.d.ts +2 -4
- package/src/geometries/path2/toString.js +5 -7
- package/src/geometries/path2/transform.d.ts +3 -5
- package/src/geometries/path2/transform.js +6 -8
- package/src/geometries/path2/transform.test.js +5 -5
- package/src/geometries/path2/type.d.ts +4 -6
- package/src/geometries/path2/validate.d.ts +1 -3
- package/src/geometries/path2/validate.js +6 -7
- package/src/geometries/poly2/arePointsInside.d.ts +3 -5
- package/src/geometries/poly2/arePointsInside.js +21 -31
- package/src/geometries/poly2/arePointsInside.test.js +2 -2
- package/src/geometries/poly2/clone.d.ts +3 -0
- package/src/geometries/poly2/clone.js +8 -0
- package/src/geometries/poly2/clone.test.js +17 -0
- package/src/geometries/poly2/create.d.ts +3 -5
- package/src/geometries/poly2/create.js +11 -12
- package/src/geometries/poly2/create.test.js +4 -4
- package/src/geometries/poly2/index.d.ts +14 -6
- package/src/geometries/poly2/index.js +16 -11
- package/src/geometries/poly2/isA.d.ts +3 -0
- package/src/geometries/poly2/isA.js +16 -0
- package/src/geometries/poly2/isA.test.js +30 -0
- package/src/geometries/poly2/isConvex.d.ts +3 -0
- package/src/geometries/poly2/isConvex.js +37 -0
- package/src/geometries/poly2/isConvex.test.js +27 -0
- package/src/geometries/poly2/isSimple.d.ts +3 -0
- package/src/geometries/poly2/isSimple.js +38 -0
- package/src/geometries/poly2/isSimple.test.js +31 -0
- package/src/geometries/poly2/measureArea.d.ts +2 -4
- package/src/geometries/poly2/measureArea.js +5 -7
- package/src/geometries/poly2/measureArea.test.js +2 -2
- package/src/geometries/poly2/measureBoundingBox.d.ts +4 -0
- package/src/geometries/poly2/measureBoundingBox.js +18 -0
- package/src/geometries/poly2/measureBoundingBox.test.js +71 -0
- package/src/geometries/poly2/reverse.d.ts +3 -0
- package/src/geometries/poly2/reverse.js +13 -0
- package/src/geometries/poly2/reverse.test.js +27 -0
- package/src/geometries/poly2/toPoints.d.ts +4 -0
- package/src/geometries/poly2/toPoints.js +8 -0
- package/src/geometries/poly2/toPoints.test.js +18 -0
- package/src/geometries/poly2/toString.d.ts +3 -0
- package/src/geometries/poly2/toString.js +9 -0
- package/src/geometries/poly2/toString.test.js +10 -0
- package/src/geometries/poly2/transform.d.ts +4 -0
- package/src/geometries/poly2/transform.js +20 -0
- package/src/geometries/poly2/transform.test.js +62 -0
- package/src/geometries/poly2/type.d.ts +5 -5
- package/src/geometries/poly2/validate.d.ts +2 -0
- package/src/geometries/poly2/validate.js +46 -0
- package/src/geometries/poly2/validate.test.js +31 -0
- package/src/geometries/poly3/clone.d.ts +3 -5
- package/src/geometries/poly3/clone.js +6 -8
- package/src/geometries/poly3/clone.test.js +6 -5
- package/src/geometries/poly3/create.d.ts +3 -5
- package/src/geometries/poly3/create.js +6 -6
- package/src/geometries/poly3/create.test.js +15 -3
- package/src/geometries/poly3/fromVerticesAndPlane.d.ts +5 -0
- package/src/geometries/poly3/{fromPointsAndPlane.js → fromVerticesAndPlane.js} +5 -7
- package/src/geometries/poly3/index.d.ts +16 -18
- package/src/geometries/poly3/index.js +17 -22
- package/src/geometries/poly3/invert.d.ts +2 -4
- package/src/geometries/poly3/invert.js +6 -7
- package/src/geometries/poly3/invert.test.js +5 -5
- package/src/geometries/poly3/isA.d.ts +2 -4
- package/src/geometries/poly3/isA.js +2 -4
- package/src/geometries/poly3/isA.test.js +3 -3
- package/src/geometries/poly3/isConvex.d.ts +2 -4
- package/src/geometries/poly3/isConvex.js +21 -23
- package/src/geometries/poly3/isConvex.test.js +9 -9
- package/src/geometries/poly3/measureArea.d.ts +2 -4
- package/src/geometries/poly3/measureArea.js +4 -6
- package/src/geometries/poly3/measureArea.test.js +12 -11
- package/src/geometries/poly3/measureBoundingBox.d.ts +3 -5
- package/src/geometries/poly3/measureBoundingBox.js +6 -8
- package/src/geometries/poly3/measureBoundingBox.test.js +9 -8
- package/src/geometries/poly3/measureBoundingSphere.d.ts +3 -5
- package/src/geometries/poly3/measureBoundingSphere.js +5 -8
- package/src/geometries/poly3/measureBoundingSphere.test.js +8 -7
- package/src/geometries/poly3/measureSignedVolume.d.ts +2 -4
- package/src/geometries/poly3/measureSignedVolume.js +4 -6
- package/src/geometries/poly3/measureSignedVolume.test.js +8 -8
- package/src/geometries/poly3/plane.d.ts +3 -5
- package/src/geometries/poly3/plane.js +2 -4
- package/src/geometries/poly3/toString.d.ts +2 -4
- package/src/geometries/poly3/toString.js +4 -12
- package/src/geometries/poly3/toString.test.js +10 -0
- package/src/geometries/poly3/toVertices.d.ts +4 -0
- package/src/geometries/poly3/toVertices.js +8 -0
- package/src/geometries/poly3/transform.d.ts +3 -5
- package/src/geometries/poly3/transform.js +7 -9
- package/src/geometries/poly3/transform.test.js +7 -7
- package/src/geometries/poly3/type.d.ts +7 -5
- package/src/geometries/poly3/validate.d.ts +1 -3
- package/src/geometries/poly3/validate.js +14 -15
- package/src/geometries/slice/calculatePlane.d.ts +5 -0
- package/src/geometries/slice/calculatePlane.js +65 -0
- package/src/geometries/slice/calculatePlane.test.js +43 -0
- package/src/geometries/slice/clone.d.ts +3 -0
- package/src/geometries/slice/clone.js +9 -0
- package/src/geometries/slice/clone.test.js +14 -0
- package/src/geometries/slice/create.d.ts +4 -0
- package/src/geometries/slice/create.js +18 -0
- package/src/{operations/extrusions → geometries}/slice/create.test.js +3 -3
- package/src/{operations/extrusions → geometries/slice}/earcut/assignHoles.js +6 -8
- package/src/geometries/slice/earcut/assignHoles.test.js +75 -0
- package/src/{operations/extrusions → geometries/slice}/earcut/eliminateHoles.js +3 -5
- package/src/{operations/extrusions → geometries/slice}/earcut/index.js +7 -8
- package/src/{operations/extrusions → geometries/slice}/earcut/linkedList.js +3 -6
- package/src/{operations/extrusions → geometries/slice}/earcut/linkedListSort.js +1 -4
- package/src/{operations/extrusions → geometries/slice}/earcut/linkedPolygon.js +8 -10
- package/src/{operations/extrusions → geometries/slice}/earcut/polygonHierarchy.js +13 -13
- package/src/{operations/extrusions → geometries/slice}/earcut/triangle.js +2 -5
- package/src/geometries/slice/equals.d.ts +3 -0
- package/src/geometries/slice/equals.js +27 -0
- package/src/geometries/slice/equals.test.js +17 -0
- package/src/geometries/slice/fromGeom2.d.ts +5 -0
- package/src/geometries/slice/fromGeom2.js +17 -0
- package/src/geometries/slice/fromVertices.d.ts +7 -0
- package/src/geometries/slice/fromVertices.js +34 -0
- package/src/geometries/slice/fromVertices.test.js +11 -0
- package/src/geometries/slice/index.d.ts +16 -0
- package/src/geometries/slice/index.js +23 -0
- package/src/geometries/slice/isA.d.ts +3 -0
- package/src/geometries/slice/isA.js +16 -0
- package/src/{operations/extrusions → geometries}/slice/isA.test.js +3 -3
- package/src/geometries/slice/reverse.d.ts +3 -0
- package/src/geometries/slice/reverse.js +14 -0
- package/src/geometries/slice/toEdges.d.ts +3 -0
- package/src/geometries/slice/toEdges.js +20 -0
- package/src/geometries/slice/toPolygons.d.ts +5 -0
- package/src/{operations/extrusions → geometries}/slice/toPolygons.js +9 -10
- package/src/geometries/slice/toString.d.ts +3 -0
- package/src/geometries/slice/toString.js +16 -0
- package/src/geometries/slice/toString.test.js +17 -0
- package/src/geometries/slice/toVertices.d.ts +4 -0
- package/src/geometries/slice/toVertices.js +19 -0
- package/src/geometries/slice/transform.d.ts +5 -0
- package/src/geometries/slice/transform.js +19 -0
- package/src/{operations/extrusions → geometries}/slice/transform.test.js +11 -21
- package/src/geometries/slice/type.d.ts +7 -0
- package/src/geometries/slice/validate.d.ts +1 -0
- package/src/geometries/slice/validate.js +49 -0
- package/src/geometries/slice/validate.test.js +36 -0
- package/src/geometries/types.d.ts +12 -10
- package/src/index.d.ts +2 -4
- package/src/index.js +14 -16
- package/src/index.test-d.ts +3 -3
- package/src/maths/constants.d.ts +1 -1
- package/src/maths/constants.js +10 -20
- package/src/maths/index.d.ts +9 -11
- package/src/maths/index.js +10 -13
- package/src/maths/line2/clone.d.ts +2 -4
- package/src/maths/line2/clone.js +4 -6
- package/src/maths/line2/clone.test.js +4 -3
- package/src/maths/line2/closestPoint.d.ts +3 -5
- package/src/maths/line2/closestPoint.js +7 -9
- package/src/maths/line2/closestPoint.test.js +4 -3
- package/src/maths/line2/copy.d.ts +2 -4
- package/src/maths/line2/copy.js +4 -6
- package/src/maths/line2/copy.test.js +4 -3
- package/src/maths/line2/create.d.ts +2 -4
- package/src/maths/line2/create.js +5 -8
- package/src/maths/line2/create.test.js +3 -3
- package/src/maths/line2/direction.d.ts +3 -5
- package/src/maths/line2/direction.js +4 -6
- package/src/maths/line2/direction.test.js +3 -3
- package/src/maths/line2/distanceToPoint.d.ts +3 -5
- package/src/maths/line2/distanceToPoint.js +5 -7
- package/src/maths/line2/distanceToPoint.test.js +6 -4
- package/src/maths/line2/equals.d.ts +2 -4
- package/src/maths/line2/equals.js +4 -6
- package/src/maths/line2/equals.test.js +3 -2
- package/src/maths/line2/fromPoints.d.ts +3 -5
- package/src/maths/line2/fromPoints.js +6 -8
- package/src/maths/line2/fromPoints.test.js +4 -3
- package/src/maths/line2/fromValues.d.ts +2 -4
- package/src/maths/line2/fromValues.js +6 -8
- package/src/maths/line2/fromValues.test.js +4 -3
- package/src/maths/line2/index.d.ts +16 -17
- package/src/maths/line2/index.js +16 -18
- package/src/maths/line2/intersectPointOfLines.d.ts +3 -5
- package/src/maths/line2/intersectPointOfLines.js +7 -8
- package/src/maths/line2/intersectPointOfLines.test.js +4 -3
- package/src/maths/line2/origin.d.ts +3 -5
- package/src/maths/line2/origin.js +4 -6
- package/src/maths/line2/origin.test.js +4 -3
- package/src/maths/line2/reverse.d.ts +2 -4
- package/src/maths/line2/reverse.js +7 -9
- package/src/maths/line2/reverse.test.js +4 -3
- package/src/maths/line2/toString.d.ts +2 -4
- package/src/maths/line2/toString.js +3 -5
- package/src/maths/line2/transform.d.ts +3 -5
- package/src/maths/line2/transform.js +9 -11
- package/src/maths/line2/transform.test.js +4 -3
- package/src/maths/line2/type.d.ts +1 -3
- package/src/maths/line2/xAtY.d.ts +2 -4
- package/src/maths/line2/xAtY.js +5 -7
- package/src/maths/line2/xAtY.test.js +6 -4
- package/src/maths/line3/clone.d.ts +2 -4
- package/src/maths/line3/clone.js +5 -7
- package/src/maths/line3/clone.test.js +4 -3
- package/src/maths/line3/closestPoint.d.ts +3 -5
- package/src/maths/line3/closestPoint.js +12 -14
- package/src/maths/line3/closestPoint.test.js +4 -3
- package/src/maths/line3/copy.d.ts +2 -4
- package/src/maths/line3/copy.js +5 -7
- package/src/maths/line3/copy.test.js +4 -3
- package/src/maths/line3/create.d.ts +2 -4
- package/src/maths/line3/create.js +4 -7
- package/src/maths/line3/create.test.js +3 -3
- package/src/maths/line3/direction.d.ts +3 -5
- package/src/maths/line3/direction.js +3 -5
- package/src/maths/line3/direction.test.js +4 -3
- package/src/maths/line3/distanceToPoint.d.ts +3 -5
- package/src/maths/line3/distanceToPoint.js +8 -10
- package/src/maths/line3/distanceToPoint.test.js +6 -4
- package/src/maths/line3/equals.d.ts +2 -4
- package/src/maths/line3/equals.js +4 -6
- package/src/maths/line3/equals.test.js +3 -2
- package/src/maths/line3/fromPlanes.d.ts +3 -5
- package/src/maths/line3/fromPlanes.js +14 -17
- package/src/maths/line3/fromPlanes.test.js +4 -4
- package/src/maths/line3/fromPointAndDirection.d.ts +3 -5
- package/src/maths/line3/fromPointAndDirection.js +6 -8
- package/src/maths/line3/fromPointAndDirection.test.js +4 -3
- package/src/maths/line3/fromPoints.d.ts +3 -5
- package/src/maths/line3/fromPoints.js +7 -9
- package/src/maths/line3/fromPoints.test.js +4 -3
- package/src/maths/line3/index.d.ts +16 -17
- package/src/maths/line3/index.js +16 -18
- package/src/maths/line3/intersectPointOfLineAndPlane.d.ts +4 -6
- package/src/maths/line3/intersectPointOfLineAndPlane.js +10 -13
- package/src/maths/line3/intersectPointOfLineAndPlane.test.js +4 -4
- package/src/maths/line3/origin.d.ts +3 -5
- package/src/maths/line3/origin.js +3 -5
- package/src/maths/line3/origin.test.js +4 -3
- package/src/maths/line3/reverse.d.ts +2 -4
- package/src/maths/line3/reverse.js +6 -8
- package/src/maths/line3/reverse.test.js +4 -3
- package/src/maths/line3/toString.d.ts +2 -4
- package/src/maths/line3/toString.js +3 -5
- package/src/maths/line3/transform.d.ts +3 -5
- package/src/maths/line3/transform.js +10 -12
- package/src/maths/line3/transform.test.js +4 -3
- package/src/maths/line3/type.d.ts +2 -4
- package/src/maths/mat4/add.d.ts +2 -4
- package/src/maths/mat4/add.js +5 -7
- package/src/maths/mat4/add.test.js +4 -3
- package/src/maths/mat4/clone.d.ts +2 -4
- package/src/maths/mat4/clone.js +4 -6
- package/src/maths/mat4/clone.test.js +4 -3
- package/src/maths/mat4/copy.d.ts +2 -4
- package/src/maths/mat4/copy.js +4 -6
- package/src/maths/mat4/copy.test.js +4 -3
- package/src/maths/mat4/create.d.ts +2 -4
- package/src/maths/mat4/create.js +2 -5
- package/src/maths/mat4/create.test.js +3 -3
- package/src/maths/mat4/equals.d.ts +2 -4
- package/src/maths/mat4/equals.js +4 -6
- package/src/maths/mat4/equals.test.js +3 -2
- package/src/maths/mat4/fromRotation.d.ts +3 -5
- package/src/maths/mat4/fromRotation.js +8 -10
- package/src/maths/mat4/fromRotation.test.js +4 -3
- package/src/maths/mat4/fromScaling.d.ts +3 -5
- package/src/maths/mat4/fromScaling.js +4 -6
- package/src/maths/mat4/fromScaling.test.js +4 -3
- package/src/maths/mat4/fromTaitBryanRotation.d.ts +2 -4
- package/src/maths/mat4/fromTaitBryanRotation.js +7 -9
- package/src/maths/mat4/fromTaitBryanRotation.test.js +3 -3
- package/src/maths/mat4/fromTranslation.d.ts +3 -5
- package/src/maths/mat4/fromTranslation.js +4 -6
- package/src/maths/mat4/fromTranslation.test.js +4 -3
- package/src/maths/mat4/fromValues.d.ts +2 -4
- package/src/maths/mat4/fromValues.js +19 -21
- package/src/maths/mat4/fromValues.test.js +4 -3
- package/src/maths/mat4/fromVectorRotation.d.ts +3 -5
- package/src/maths/mat4/fromVectorRotation.js +8 -10
- package/src/maths/mat4/fromVectorRotation.test.js +4 -5
- package/src/maths/mat4/fromXRotation.d.ts +2 -4
- package/src/maths/mat4/fromXRotation.js +5 -7
- package/src/maths/mat4/fromXRotation.test.js +4 -3
- package/src/maths/mat4/fromYRotation.d.ts +2 -4
- package/src/maths/mat4/fromYRotation.js +5 -7
- package/src/maths/mat4/fromYRotation.test.js +4 -3
- package/src/maths/mat4/fromZRotation.d.ts +2 -4
- package/src/maths/mat4/fromZRotation.js +5 -7
- package/src/maths/mat4/fromZRotation.test.js +4 -3
- package/src/maths/mat4/identity.d.ts +2 -4
- package/src/maths/mat4/identity.js +3 -5
- package/src/maths/mat4/identity.test.js +4 -3
- package/src/maths/mat4/index.d.ts +30 -27
- package/src/maths/mat4/index.js +29 -31
- package/src/maths/mat4/invert.d.ts +3 -0
- package/src/maths/mat4/invert.js +7 -7
- package/src/maths/mat4/invert.test.js +6 -5
- package/src/maths/mat4/isIdentity.d.ts +3 -0
- package/src/maths/mat4/isIdentity.js +4 -6
- package/src/maths/mat4/isIdentity.test.js +2 -2
- package/src/maths/mat4/isMirroring.d.ts +2 -4
- package/src/maths/mat4/isMirroring.js +4 -6
- package/src/maths/mat4/isMirroring.test.js +3 -3
- package/src/maths/mat4/isOnlyTransformScale.d.ts +3 -0
- package/src/maths/mat4/isOnlyTransformScale.js +7 -5
- package/src/maths/mat4/isOnlyTransformScale.test.js +3 -3
- package/src/maths/mat4/leftMultiplyVec2.d.ts +3 -5
- package/src/maths/mat4/leftMultiplyVec2.js +5 -7
- package/src/maths/mat4/leftMultiplyVec3.d.ts +3 -5
- package/src/maths/mat4/leftMultiplyVec3.js +5 -7
- package/src/maths/mat4/mirror.d.ts +3 -5
- package/src/maths/mat4/mirror.js +5 -7
- package/src/maths/mat4/mirrorByPlane.d.ts +3 -5
- package/src/maths/mat4/mirrorByPlane.js +4 -6
- package/src/maths/mat4/mirrorByPlane.test.js +4 -4
- package/src/maths/mat4/multiply.d.ts +2 -4
- package/src/maths/mat4/multiply.js +5 -7
- package/src/maths/mat4/multiply.test.js +4 -3
- package/src/maths/mat4/rightMultiplyVec2.d.ts +3 -5
- package/src/maths/mat4/rightMultiplyVec2.js +5 -7
- package/src/maths/mat4/rightMultiplyVec3.d.ts +3 -5
- package/src/maths/mat4/rightMultiplyVec3.js +5 -7
- package/src/maths/mat4/rotate.d.ts +3 -5
- package/src/maths/mat4/rotate.js +9 -11
- package/src/maths/mat4/rotate.test.js +6 -5
- package/src/maths/mat4/rotateX.d.ts +2 -4
- package/src/maths/mat4/rotateX.js +6 -8
- package/src/maths/mat4/rotateX.test.js +4 -3
- package/src/maths/mat4/rotateY.d.ts +2 -4
- package/src/maths/mat4/rotateY.js +6 -8
- package/src/maths/mat4/rotateY.test.js +4 -3
- package/src/maths/mat4/rotateZ.d.ts +2 -4
- package/src/maths/mat4/rotateZ.js +6 -8
- package/src/maths/mat4/rotateZ.test.js +4 -3
- package/src/maths/mat4/scale.d.ts +3 -5
- package/src/maths/mat4/scale.js +5 -7
- package/src/maths/mat4/scale.test.js +4 -3
- package/src/maths/mat4/subtract.d.ts +2 -4
- package/src/maths/mat4/subtract.js +5 -7
- package/src/maths/mat4/subtract.test.js +4 -3
- package/src/maths/mat4/toString.d.ts +2 -4
- package/src/maths/mat4/toString.js +3 -5
- package/src/maths/mat4/translate.d.ts +3 -5
- package/src/maths/mat4/translate.js +5 -7
- package/src/maths/mat4/translate.test.js +11 -15
- package/src/maths/mat4/type.d.ts +1 -3
- package/src/maths/plane/clone.d.ts +2 -4
- package/src/maths/plane/clone.test.js +4 -3
- package/src/maths/plane/copy.d.ts +2 -4
- package/src/maths/plane/copy.test.js +4 -3
- package/src/maths/plane/create.d.ts +2 -4
- package/src/maths/plane/create.test.js +3 -3
- package/src/maths/plane/equals.d.ts +2 -4
- package/src/maths/plane/equals.test.js +3 -2
- package/src/maths/plane/flip.d.ts +2 -4
- package/src/maths/plane/flip.js +4 -6
- package/src/maths/plane/flip.test.js +4 -3
- package/src/maths/plane/fromNormalAndPoint.d.ts +3 -5
- package/src/maths/plane/fromNormalAndPoint.js +6 -9
- package/src/maths/plane/fromNormalAndPoint.test.js +4 -3
- package/src/maths/plane/fromPoints.d.ts +3 -5
- package/src/maths/plane/fromPoints.js +4 -6
- package/src/maths/plane/fromPoints.test.js +4 -3
- package/src/maths/plane/fromPointsRandom.d.ts +3 -5
- package/src/maths/plane/fromPointsRandom.js +8 -10
- package/src/maths/plane/fromValues.d.ts +2 -4
- package/src/maths/plane/index.d.ts +14 -15
- package/src/maths/plane/index.js +38 -39
- package/src/maths/plane/projectionOfPoint.d.ts +3 -5
- package/src/maths/plane/projectionOfPoint.js +5 -7
- package/src/maths/plane/projectionOfPoint.test.js +3 -3
- package/src/maths/plane/signedDistanceToPoint.d.ts +3 -5
- package/src/maths/plane/signedDistanceToPoint.js +5 -7
- package/src/maths/plane/signedDistanceToPoint.test.js +3 -2
- package/src/maths/plane/toString.d.ts +2 -4
- package/src/maths/plane/transform.d.ts +3 -5
- package/src/maths/plane/transform.js +11 -13
- package/src/maths/plane/transform.test.js +4 -3
- package/src/maths/plane/type.d.ts +1 -3
- package/src/maths/rotation.test.js +4 -4
- package/src/maths/types.d.ts +15 -8
- package/src/maths/utils/OrthonormalFormula.d.ts +9 -0
- package/src/maths/utils/OrthonormalFormula.js +82 -0
- package/src/maths/utils/OrthonormalFormula.test.js +72 -0
- package/src/maths/utils/aboutEqualNormals.d.ts +2 -4
- package/src/maths/utils/aboutEqualNormals.js +4 -6
- package/src/maths/utils/area.d.ts +2 -4
- package/src/maths/utils/area.js +2 -4
- package/src/maths/utils/interpolateBetween2DPointsForY.d.ts +2 -4
- package/src/maths/utils/interpolateBetween2DPointsForY.js +4 -6
- package/src/maths/utils/intersect.d.ts +2 -4
- package/src/maths/utils/intersect.js +14 -9
- package/src/maths/utils/intersect.test.js +40 -0
- package/src/maths/utils/solve2Linear.d.ts +2 -4
- package/src/maths/utils/solve2Linear.js +1 -3
- package/src/maths/utils/trigonometry.js +7 -9
- package/src/maths/utils/trigonometry.test.js +3 -3
- package/src/maths/vec1/type.d.ts +1 -3
- package/src/maths/vec2/abs.d.ts +2 -4
- package/src/maths/vec2/abs.js +4 -6
- package/src/maths/vec2/abs.test.js +4 -3
- package/src/maths/vec2/add.d.ts +2 -4
- package/src/maths/vec2/add.js +5 -7
- package/src/maths/vec2/add.test.js +4 -3
- package/src/maths/vec2/angle.d.ts +1 -3
- package/src/maths/vec2/angle.js +1 -1
- package/src/maths/vec2/angleDegrees.d.ts +2 -4
- package/src/maths/vec2/angleDegrees.js +4 -6
- package/src/maths/vec2/angleDegrees.test.js +6 -4
- package/src/maths/vec2/angleRadians.d.ts +2 -4
- package/src/maths/vec2/angleRadians.js +3 -5
- package/src/maths/vec2/angleRadians.test.js +6 -4
- package/src/maths/vec2/clone.d.ts +2 -4
- package/src/maths/vec2/clone.js +4 -6
- package/src/maths/vec2/clone.test.js +4 -3
- package/src/maths/vec2/copy.d.ts +2 -4
- package/src/maths/vec2/copy.js +4 -6
- package/src/maths/vec2/copy.test.js +4 -3
- package/src/maths/vec2/create.d.ts +2 -4
- package/src/maths/vec2/create.js +2 -5
- package/src/maths/vec2/create.test.js +3 -3
- package/src/maths/vec2/cross.d.ts +3 -5
- package/src/maths/vec2/cross.js +5 -7
- package/src/maths/vec2/cross.test.js +14 -12
- package/src/maths/vec2/distance.d.ts +2 -4
- package/src/maths/vec2/distance.js +4 -6
- package/src/maths/vec2/distance.test.js +6 -4
- package/src/maths/vec2/divide.d.ts +2 -4
- package/src/maths/vec2/divide.js +5 -7
- package/src/maths/vec2/divide.test.js +4 -3
- package/src/maths/vec2/dot.d.ts +2 -4
- package/src/maths/vec2/dot.js +4 -6
- package/src/maths/vec2/dot.test.js +3 -2
- package/src/maths/vec2/equals.d.ts +2 -4
- package/src/maths/vec2/equals.js +3 -5
- package/src/maths/vec2/equals.test.js +3 -2
- package/src/maths/vec2/fromAngleDegrees.d.ts +2 -4
- package/src/maths/vec2/fromAngleDegrees.js +5 -7
- package/src/maths/vec2/fromAngleDegrees.test.js +4 -3
- package/src/maths/vec2/fromAngleRadians.d.ts +2 -4
- package/src/maths/vec2/fromAngleRadians.js +5 -7
- package/src/maths/vec2/fromAngleRadians.test.js +4 -4
- package/src/maths/vec2/fromScalar.d.ts +2 -4
- package/src/maths/vec2/fromScalar.js +4 -6
- package/src/maths/vec2/fromScalar.test.js +4 -3
- package/src/maths/vec2/fromValues.d.ts +2 -4
- package/src/maths/vec2/fromValues.js +5 -7
- package/src/maths/vec2/index.d.ts +34 -35
- package/src/maths/vec2/index.js +33 -35
- package/src/maths/vec2/length.d.ts +2 -4
- package/src/maths/vec2/length.js +3 -5
- package/src/maths/vec2/length.test.js +6 -4
- package/src/maths/vec2/lerp.d.ts +2 -4
- package/src/maths/vec2/lerp.js +6 -8
- package/src/maths/vec2/lerp.test.js +4 -3
- package/src/maths/vec2/max.d.ts +2 -4
- package/src/maths/vec2/max.js +5 -7
- package/src/maths/vec2/max.test.js +4 -3
- package/src/maths/vec2/min.d.ts +2 -4
- package/src/maths/vec2/min.js +5 -7
- package/src/maths/vec2/min.test.js +4 -3
- package/src/maths/vec2/multiply.d.ts +2 -4
- package/src/maths/vec2/multiply.js +5 -7
- package/src/maths/vec2/multiply.test.js +4 -3
- package/src/maths/vec2/negate.d.ts +2 -4
- package/src/maths/vec2/negate.js +4 -6
- package/src/maths/vec2/negate.test.js +4 -3
- package/src/maths/vec2/normal.d.ts +2 -4
- package/src/maths/vec2/normal.js +7 -9
- package/src/maths/vec2/normal.test.js +4 -3
- package/src/maths/vec2/normalize.d.ts +2 -4
- package/src/maths/vec2/normalize.js +4 -8
- package/src/maths/vec2/normalize.test.js +4 -3
- package/src/maths/vec2/rotate.d.ts +2 -4
- package/src/maths/vec2/rotate.js +6 -8
- package/src/maths/vec2/rotate.test.js +4 -4
- package/src/maths/vec2/scale.d.ts +2 -4
- package/src/maths/vec2/scale.js +5 -7
- package/src/maths/vec2/scale.test.js +4 -3
- package/src/maths/vec2/snap.d.ts +2 -4
- package/src/maths/vec2/snap.js +5 -7
- package/src/maths/vec2/snap.test.js +4 -3
- package/src/maths/vec2/squaredDistance.d.ts +2 -4
- package/src/maths/vec2/squaredDistance.js +4 -6
- package/src/maths/vec2/squaredDistance.test.js +6 -4
- package/src/maths/vec2/squaredLength.d.ts +2 -4
- package/src/maths/vec2/squaredLength.js +3 -5
- package/src/maths/vec2/squaredLength.test.js +6 -4
- package/src/maths/vec2/subtract.d.ts +2 -4
- package/src/maths/vec2/subtract.js +5 -7
- package/src/maths/vec2/subtract.test.js +4 -3
- package/src/maths/vec2/toString.d.ts +2 -4
- package/src/maths/vec2/toString.js +3 -5
- package/src/maths/vec2/transform.d.ts +3 -5
- package/src/maths/vec2/transform.js +5 -7
- package/src/maths/vec2/transform.test.js +4 -3
- package/src/maths/vec2/type.d.ts +1 -3
- package/src/maths/vec3/abs.d.ts +2 -4
- package/src/maths/vec3/abs.js +4 -6
- package/src/maths/vec3/abs.test.js +4 -3
- package/src/maths/vec3/add.d.ts +2 -4
- package/src/maths/vec3/add.js +5 -7
- package/src/maths/vec3/add.test.js +4 -3
- package/src/maths/vec3/angle.d.ts +2 -4
- package/src/maths/vec3/angle.js +5 -7
- package/src/maths/vec3/angle.test.js +6 -4
- package/src/maths/vec3/clone.d.ts +2 -4
- package/src/maths/vec3/clone.js +4 -6
- package/src/maths/vec3/clone.test.js +4 -3
- package/src/maths/vec3/copy.d.ts +2 -4
- package/src/maths/vec3/copy.js +4 -6
- package/src/maths/vec3/copy.test.js +4 -3
- package/src/maths/vec3/create.d.ts +2 -4
- package/src/maths/vec3/create.js +2 -5
- package/src/maths/vec3/create.test.js +3 -3
- package/src/maths/vec3/cross.d.ts +2 -4
- package/src/maths/vec3/cross.js +5 -7
- package/src/maths/vec3/cross.test.js +4 -3
- package/src/maths/vec3/distance.d.ts +2 -4
- package/src/maths/vec3/distance.js +4 -6
- package/src/maths/vec3/distance.test.js +6 -4
- package/src/maths/vec3/divide.d.ts +2 -4
- package/src/maths/vec3/divide.js +5 -7
- package/src/maths/vec3/divide.test.js +4 -3
- package/src/maths/vec3/dot.d.ts +2 -4
- package/src/maths/vec3/dot.js +4 -6
- package/src/maths/vec3/dot.test.js +3 -2
- package/src/maths/vec3/equals.d.ts +2 -4
- package/src/maths/vec3/equals.js +3 -5
- package/src/maths/vec3/equals.test.js +3 -2
- package/src/maths/vec3/fromScalar.d.ts +2 -4
- package/src/maths/vec3/fromScalar.js +4 -6
- package/src/maths/vec3/fromScalar.test.js +4 -3
- package/src/maths/vec3/fromValues.d.ts +2 -4
- package/src/maths/vec3/fromValues.js +6 -8
- package/src/maths/vec3/fromValues.test.js +4 -3
- package/src/maths/vec3/fromVec2.d.ts +3 -5
- package/src/maths/vec3/fromVec2.js +4 -6
- package/src/maths/vec3/fromVec2.test.js +3 -3
- package/src/maths/vec3/index.d.ts +33 -34
- package/src/maths/vec3/index.js +32 -34
- package/src/maths/vec3/length.d.ts +2 -4
- package/src/maths/vec3/length.js +3 -5
- package/src/maths/vec3/length.test.js +6 -4
- package/src/maths/vec3/lerp.d.ts +2 -4
- package/src/maths/vec3/lerp.js +6 -8
- package/src/maths/vec3/lerp.test.js +4 -3
- package/src/maths/vec3/max.d.ts +2 -4
- package/src/maths/vec3/max.js +5 -7
- package/src/maths/vec3/max.test.js +4 -3
- package/src/maths/vec3/min.d.ts +2 -4
- package/src/maths/vec3/min.js +5 -7
- package/src/maths/vec3/min.test.js +4 -3
- package/src/maths/vec3/multiply.d.ts +2 -4
- package/src/maths/vec3/multiply.js +5 -7
- package/src/maths/vec3/multiply.test.js +4 -3
- package/src/maths/vec3/negate.d.ts +2 -4
- package/src/maths/vec3/negate.js +4 -6
- package/src/maths/vec3/negate.test.js +4 -3
- package/src/maths/vec3/normalize.d.ts +2 -4
- package/src/maths/vec3/normalize.js +4 -6
- package/src/maths/vec3/normalize.test.js +4 -3
- package/src/maths/vec3/orthogonal.d.ts +2 -4
- package/src/maths/vec3/orthogonal.js +7 -9
- package/src/maths/vec3/orthogonal.test.js +4 -3
- package/src/maths/vec3/rotateX.d.ts +2 -4
- package/src/maths/vec3/rotateX.js +6 -8
- package/src/maths/vec3/rotateX.test.js +4 -4
- package/src/maths/vec3/rotateY.d.ts +2 -4
- package/src/maths/vec3/rotateY.js +6 -8
- package/src/maths/vec3/rotateY.test.js +4 -4
- package/src/maths/vec3/rotateZ.d.ts +2 -4
- package/src/maths/vec3/rotateZ.js +6 -8
- package/src/maths/vec3/rotateZ.test.js +4 -4
- package/src/maths/vec3/scale.d.ts +2 -4
- package/src/maths/vec3/scale.js +5 -7
- package/src/maths/vec3/scale.test.js +4 -3
- package/src/maths/vec3/snap.d.ts +2 -4
- package/src/maths/vec3/snap.js +5 -7
- package/src/maths/vec3/snap.test.js +4 -3
- package/src/maths/vec3/squaredDistance.d.ts +2 -4
- package/src/maths/vec3/squaredDistance.js +4 -6
- package/src/maths/vec3/squaredDistance.test.js +6 -4
- package/src/maths/vec3/squaredLength.d.ts +2 -4
- package/src/maths/vec3/squaredLength.js +3 -5
- package/src/maths/vec3/squaredLength.test.js +6 -4
- package/src/maths/vec3/subtract.d.ts +2 -4
- package/src/maths/vec3/subtract.js +5 -7
- package/src/maths/vec3/subtract.test.js +4 -3
- package/src/maths/vec3/toString.d.ts +2 -4
- package/src/maths/vec3/toString.js +3 -5
- package/src/maths/vec3/transform.d.ts +3 -5
- package/src/maths/vec3/transform.js +5 -7
- package/src/maths/vec3/transform.test.js +12 -15
- package/src/maths/vec3/type.d.ts +1 -3
- package/src/maths/vec4/clone.d.ts +2 -4
- package/src/maths/vec4/clone.js +4 -6
- package/src/maths/vec4/clone.test.js +4 -3
- package/src/maths/vec4/copy.d.ts +2 -4
- package/src/maths/vec4/copy.js +4 -6
- package/src/maths/vec4/copy.test.js +4 -3
- package/src/maths/vec4/create.d.ts +2 -4
- package/src/maths/vec4/create.js +2 -5
- package/src/maths/vec4/create.test.js +3 -3
- package/src/maths/vec4/dot.d.ts +2 -4
- package/src/maths/vec4/dot.js +4 -6
- package/src/maths/vec4/dot.test.js +2 -2
- package/src/maths/vec4/equals.d.ts +2 -4
- package/src/maths/vec4/equals.js +3 -5
- package/src/maths/vec4/equals.test.js +3 -2
- package/src/maths/vec4/fromScalar.d.ts +2 -4
- package/src/maths/vec4/fromScalar.js +3 -5
- package/src/maths/vec4/fromScalar.test.js +4 -3
- package/src/maths/vec4/fromValues.d.ts +2 -4
- package/src/maths/vec4/fromValues.js +7 -9
- package/src/maths/vec4/fromValues.test.js +4 -3
- package/src/maths/vec4/index.d.ts +10 -11
- package/src/maths/vec4/index.js +9 -11
- package/src/maths/vec4/toString.d.ts +2 -4
- package/src/maths/vec4/toString.js +3 -5
- package/src/maths/vec4/transform.d.ts +3 -5
- package/src/maths/vec4/transform.js +6 -7
- package/src/maths/vec4/transform.test.js +4 -3
- package/src/maths/vec4/type.d.ts +1 -3
- package/src/measurements/calculateEpsilonFromBounds.js +2 -4
- package/src/measurements/calculateEpsilonFromBounds.test.js +4 -3
- package/src/measurements/index.d.ts +13 -14
- package/src/measurements/index.js +13 -15
- package/src/measurements/measureAggregateArea.d.ts +3 -5
- package/src/measurements/measureAggregateArea.js +4 -6
- package/src/measurements/measureAggregateArea.test.js +4 -3
- package/src/measurements/measureAggregateBoundingBox.d.ts +4 -6
- package/src/measurements/measureAggregateBoundingBox.js +6 -8
- package/src/measurements/measureAggregateBoundingBox.test.js +4 -4
- package/src/measurements/measureAggregateEpsilon.d.ts +3 -5
- package/src/measurements/measureAggregateEpsilon.js +10 -8
- package/src/measurements/measureAggregateEpsilon.test.js +6 -4
- package/src/measurements/measureAggregateVolume.d.ts +3 -5
- package/src/measurements/measureAggregateVolume.js +4 -6
- package/src/measurements/measureAggregateVolume.test.js +4 -3
- package/src/measurements/measureArea.d.ts +5 -7
- package/src/measurements/measureArea.js +37 -19
- package/src/measurements/measureArea.test.js +14 -4
- package/src/measurements/measureBoundingBox.d.ts +6 -8
- package/src/measurements/measureBoundingBox.js +81 -81
- package/src/measurements/measureBoundingBox.test.js +26 -5
- package/src/measurements/measureBoundingSphere.d.ts +4 -7
- package/src/measurements/measureBoundingSphere.js +83 -64
- package/src/measurements/measureBoundingSphere.test.js +7 -4
- package/src/measurements/measureCenter.d.ts +4 -6
- package/src/measurements/measureCenter.js +4 -6
- package/src/measurements/measureCenter.test.js +7 -4
- package/src/measurements/measureCenterOfMass.d.ts +4 -6
- package/src/measurements/measureCenterOfMass.js +6 -8
- package/src/measurements/measureCenterOfMass.test.js +7 -4
- package/src/measurements/measureDimensions.d.ts +4 -6
- package/src/measurements/measureDimensions.js +3 -5
- package/src/measurements/measureDimensions.test.js +7 -4
- package/src/measurements/measureEpsilon.d.ts +5 -7
- package/src/measurements/measureEpsilon.js +14 -29
- package/src/measurements/measureEpsilon.test.js +7 -4
- package/src/measurements/measureVolume.d.ts +5 -7
- package/src/measurements/measureVolume.js +7 -30
- package/src/measurements/measureVolume.test.js +7 -4
- package/src/measurements/types.d.ts +2 -1
- package/src/operations/booleans/index.d.ts +3 -5
- package/src/operations/booleans/index.js +5 -7
- package/src/operations/booleans/intersect.d.ts +5 -6
- package/src/operations/booleans/intersect.js +12 -14
- package/src/operations/booleans/intersect.test.js +25 -0
- package/src/operations/booleans/intersectGeom2.js +10 -16
- package/src/operations/booleans/intersectGeom2.test.js +23 -17
- package/src/operations/booleans/intersectGeom3.js +9 -11
- package/src/operations/booleans/intersectGeom3.test.js +13 -17
- package/src/operations/booleans/intersectGeom3Sub.js +10 -11
- package/src/operations/booleans/martinez/compareEvents.js +45 -0
- package/src/operations/booleans/martinez/compareSegments.js +51 -0
- package/src/operations/booleans/martinez/computeFields.js +109 -0
- package/src/operations/booleans/martinez/connectEdges.js +189 -0
- package/src/operations/booleans/martinez/contour.js +12 -0
- package/src/operations/booleans/martinez/divideSegment.js +32 -0
- package/src/operations/booleans/martinez/edgeType.js +4 -0
- package/src/operations/booleans/martinez/fillQueue.js +80 -0
- package/src/operations/booleans/martinez/index.js +154 -0
- package/src/operations/booleans/martinez/operation.js +4 -0
- package/src/operations/booleans/martinez/possibleIntersection.js +113 -0
- package/src/operations/booleans/martinez/segmentIntersection.js +132 -0
- package/src/operations/booleans/martinez/signedArea.js +16 -0
- package/src/operations/booleans/martinez/splaytree.js +599 -0
- package/src/operations/booleans/martinez/subdivideSegments.js +82 -0
- package/src/operations/booleans/martinez/sweepEvent.js +132 -0
- package/src/operations/booleans/martinez/tinyqueue.js +76 -0
- package/src/operations/booleans/mayOverlap.js +6 -7
- package/src/operations/booleans/mayOverlap.test.js +6 -6
- package/src/operations/booleans/scission.js +5 -9
- package/src/operations/booleans/scission.test.js +4 -4
- package/src/operations/booleans/scissionGeom3.js +15 -16
- package/src/operations/booleans/subtract.d.ts +5 -6
- package/src/operations/booleans/subtract.js +12 -14
- package/src/operations/booleans/subtract.test.js +25 -0
- package/src/operations/booleans/subtractGeom2.js +10 -16
- package/src/operations/booleans/subtractGeom2.test.js +22 -17
- package/src/operations/booleans/subtractGeom3.js +9 -11
- package/src/operations/booleans/subtractGeom3.test.js +12 -6
- package/src/operations/booleans/subtractGeom3Sub.js +10 -11
- package/src/operations/booleans/trees/Node.js +45 -48
- package/src/operations/booleans/trees/PolygonTreeNode.js +36 -38
- package/src/operations/booleans/trees/Tree.js +9 -12
- package/src/operations/booleans/trees/index.js +1 -3
- package/src/operations/booleans/trees/splitLineSegmentByPlane.js +2 -4
- package/src/operations/booleans/trees/splitPolygonByPlane.js +55 -57
- package/src/operations/booleans/union.d.ts +5 -6
- package/src/operations/booleans/union.js +12 -14
- package/src/operations/booleans/union.test.js +25 -0
- package/src/operations/booleans/unionGeom2.js +10 -16
- package/src/operations/booleans/unionGeom2.test.js +129 -84
- package/src/operations/booleans/unionGeom3.js +9 -11
- package/src/operations/booleans/unionGeom3.test.js +17 -9
- package/src/operations/booleans/unionGeom3Sub.js +10 -12
- package/src/operations/extrusions/extrudeFromSlices.d.ts +3 -6
- package/src/operations/extrusions/extrudeFromSlices.js +19 -31
- package/src/operations/extrusions/extrudeFromSlices.test.js +47 -48
- package/src/operations/extrusions/extrudeHelical.d.ts +2 -4
- package/src/operations/extrusions/extrudeHelical.js +21 -29
- package/src/operations/extrusions/extrudeHelical.test.js +40 -42
- package/src/operations/extrusions/extrudeLinear.d.ts +4 -6
- package/src/operations/extrusions/extrudeLinear.js +10 -12
- package/src/operations/extrusions/extrudeLinear.test.js +84 -67
- package/src/operations/extrusions/extrudeLinearGeom2.js +18 -23
- package/src/operations/extrusions/extrudeLinearPath2.js +11 -12
- package/src/operations/extrusions/extrudeRotate.d.ts +2 -4
- package/src/operations/extrusions/extrudeRotate.js +27 -32
- package/src/operations/extrusions/extrudeRotate.test.js +58 -34
- package/src/operations/extrusions/extrudeWalls.js +11 -14
- package/src/operations/extrusions/extrudeWalls.test.js +24 -48
- package/src/operations/extrusions/index.d.ts +5 -8
- package/src/operations/extrusions/index.js +6 -10
- package/src/operations/extrusions/project.d.ts +6 -8
- package/src/operations/extrusions/project.js +36 -29
- package/src/operations/extrusions/project.test.js +116 -83
- package/src/operations/hulls/hull.d.ts +5 -7
- package/src/operations/hulls/hull.js +10 -12
- package/src/operations/hulls/hull.test.js +56 -58
- package/src/operations/hulls/hullChain.d.ts +5 -7
- package/src/operations/hulls/hullChain.js +10 -10
- package/src/operations/hulls/hullChain.test.js +17 -8
- package/src/operations/hulls/hullGeom2.js +7 -9
- package/src/operations/hulls/hullGeom3.js +8 -10
- package/src/operations/hulls/hullPath2.js +6 -8
- package/src/operations/hulls/hullPath2.test.js +3 -3
- package/src/operations/hulls/hullPoints2.js +5 -6
- package/src/operations/hulls/hullPoints2.test.js +2 -2
- package/src/operations/hulls/index.d.ts +2 -4
- package/src/operations/hulls/index.js +3 -5
- package/src/operations/hulls/quickhull/Face.js +7 -21
- package/src/operations/hulls/quickhull/HalfEdge.js +2 -5
- package/src/operations/hulls/quickhull/QuickHull.js +14 -16
- package/src/operations/hulls/quickhull/Vertex.js +1 -3
- package/src/operations/hulls/quickhull/VertexList.js +1 -4
- package/src/operations/hulls/quickhull/index.js +2 -4
- package/src/operations/hulls/quickhull/point-line-distance.js +2 -6
- package/src/operations/hulls/toUniquePoints.js +4 -6
- package/src/operations/modifiers/generalize.d.ts +2 -2
- package/src/operations/modifiers/generalize.js +14 -16
- package/src/operations/modifiers/generalize.test.js +6 -6
- package/src/operations/modifiers/index.d.ts +3 -3
- package/src/operations/modifiers/index.js +4 -6
- package/src/operations/modifiers/insertTjunctions.js +164 -165
- package/src/operations/modifiers/insertTjunctions.test.js +5 -5
- package/src/operations/modifiers/mergePolygons.js +35 -36
- package/src/operations/modifiers/reTesselateCoplanarPolygons.js +235 -236
- package/src/operations/modifiers/reTesselateCoplanarPolygons.test.js +4 -4
- package/src/operations/modifiers/retessellate.d.ts +2 -2
- package/src/operations/modifiers/retessellate.js +69 -30
- package/src/operations/modifiers/retessellate.test.js +4 -4
- package/src/operations/modifiers/snap.d.ts +2 -2
- package/src/operations/modifiers/snap.js +30 -19
- package/src/operations/modifiers/snap.test.js +32 -10
- package/src/operations/modifiers/snapPolygons.js +14 -16
- package/src/operations/modifiers/snapPolygons.test.js +3 -3
- package/src/operations/modifiers/triangulatePolygons.js +5 -6
- package/src/operations/offsets/extrudePolygon.js +32 -0
- package/src/operations/offsets/index.d.ts +2 -0
- package/src/operations/offsets/index.js +9 -0
- package/src/operations/offsets/offset.d.ts +12 -0
- package/src/operations/offsets/offset.js +36 -0
- package/src/operations/offsets/offsetFromPoints.d.ts +10 -0
- package/src/operations/{expansions → offsets}/offsetFromPoints.js +29 -28
- package/src/operations/offsets/offsetFromPoints.test.js +317 -0
- package/src/operations/offsets/offsetGeom2.js +55 -0
- package/src/operations/offsets/offsetGeom2.test.js +268 -0
- package/src/operations/offsets/offsetGeom3.js +33 -0
- package/src/operations/{expansions/expandGeom3.test.js → offsets/offsetGeom3.test.js} +63 -5
- package/src/operations/{expansions/expandPath2.js → offsets/offsetPath2.js} +27 -33
- package/src/operations/offsets/offsetPath2.test.js +103 -0
- package/src/operations/{expansions/expandShell.js → offsets/offsetShell.js} +54 -56
- package/src/operations/transforms/align.d.ts +5 -7
- package/src/operations/transforms/align.js +9 -9
- package/src/operations/transforms/align.test.js +7 -6
- package/src/operations/transforms/center.d.ts +3 -3
- package/src/operations/transforms/center.js +11 -18
- package/src/operations/transforms/center.test.js +16 -6
- package/src/operations/transforms/index.d.ts +7 -9
- package/src/operations/transforms/index.js +8 -29
- package/src/operations/transforms/mirror.d.ts +3 -3
- package/src/operations/transforms/mirror.js +11 -18
- package/src/operations/transforms/mirror.test.js +18 -6
- package/src/operations/transforms/rotate.d.ts +6 -6
- package/src/operations/transforms/rotate.js +13 -20
- package/src/operations/transforms/rotate.test.js +18 -7
- package/src/operations/transforms/scale.d.ts +6 -6
- package/src/operations/transforms/scale.js +12 -19
- package/src/operations/transforms/scale.test.js +21 -6
- package/src/operations/transforms/transform.d.ts +3 -3
- package/src/operations/transforms/transform.js +7 -9
- package/src/operations/transforms/transform.test.js +7 -7
- package/src/operations/transforms/translate.d.ts +3 -5
- package/src/operations/transforms/translate.js +13 -20
- package/src/operations/transforms/translate.test.js +18 -6
- package/src/primitives/arc.d.ts +3 -5
- package/src/primitives/arc.js +26 -28
- package/src/primitives/arc.test.js +6 -5
- package/src/primitives/circle.d.ts +3 -5
- package/src/primitives/circle.js +11 -13
- package/src/primitives/circle.test.js +13 -5
- package/src/primitives/commonChecks.js +3 -9
- package/src/primitives/cube.d.ts +3 -5
- package/src/primitives/cube.js +7 -10
- package/src/primitives/cube.test.js +11 -4
- package/src/primitives/cuboid.d.ts +3 -5
- package/src/primitives/cuboid.js +12 -11
- package/src/primitives/cuboid.test.js +11 -4
- package/src/primitives/cylinder.d.ts +3 -5
- package/src/primitives/cylinder.js +15 -14
- package/src/primitives/cylinder.test.js +18 -4
- package/src/primitives/cylinderElliptic.d.ts +3 -5
- package/src/primitives/cylinderElliptic.js +33 -35
- package/src/primitives/cylinderElliptic.test.js +6 -5
- package/src/primitives/ellipse.d.ts +3 -5
- package/src/primitives/ellipse.js +23 -22
- package/src/primitives/ellipse.test.js +13 -5
- package/src/primitives/ellipsoid.d.ts +3 -5
- package/src/primitives/ellipsoid.js +52 -52
- package/src/primitives/ellipsoid.test.js +11 -4
- package/src/primitives/geodesicSphere.d.ts +2 -4
- package/src/primitives/geodesicSphere.js +18 -18
- package/src/primitives/geodesicSphere.test.js +11 -4
- package/src/primitives/index.d.ts +21 -23
- package/src/primitives/index.js +22 -24
- package/src/primitives/line.d.ts +3 -5
- package/src/primitives/line.js +3 -5
- package/src/primitives/line.test.js +4 -4
- package/src/primitives/polygon.d.ts +3 -5
- package/src/primitives/polygon.js +17 -20
- package/src/primitives/polygon.test.js +7 -7
- package/src/primitives/polyhedron.d.ts +4 -6
- package/src/primitives/polyhedron.js +15 -17
- package/src/primitives/polyhedron.test.js +4 -4
- package/src/primitives/rectangle.d.ts +3 -5
- package/src/primitives/rectangle.js +14 -13
- package/src/primitives/rectangle.test.js +11 -4
- package/src/primitives/roundedCuboid.d.ts +3 -5
- package/src/primitives/roundedCuboid.js +65 -59
- package/src/primitives/roundedCuboid.test.js +18 -4
- package/src/primitives/roundedCylinder.d.ts +3 -5
- package/src/primitives/roundedCylinder.js +83 -79
- package/src/primitives/roundedCylinder.test.js +25 -4
- package/src/primitives/roundedRectangle.d.ts +3 -5
- package/src/primitives/roundedRectangle.js +24 -17
- package/src/primitives/roundedRectangle.test.js +18 -4
- package/src/primitives/sphere.d.ts +3 -5
- package/src/primitives/sphere.js +9 -12
- package/src/primitives/sphere.test.js +11 -4
- package/src/primitives/square.d.ts +3 -5
- package/src/primitives/square.js +7 -10
- package/src/primitives/square.test.js +11 -4
- package/src/primitives/star.d.ts +3 -5
- package/src/primitives/star.js +16 -18
- package/src/primitives/star.test.js +4 -4
- package/src/primitives/torus.d.ts +2 -4
- package/src/primitives/torus.js +16 -18
- package/src/primitives/torus.test.js +8 -6
- package/src/primitives/triangle.d.ts +2 -4
- package/src/primitives/triangle.js +9 -11
- package/src/primitives/triangle.test.js +8 -6
- package/src/text/fonts/single-line/hershey/simplex.js +1 -1
- package/src/text/index.d.ts +2 -4
- package/src/text/index.js +3 -5
- package/src/text/vectorChar.d.ts +2 -8
- package/src/text/vectorChar.js +51 -39
- package/src/text/vectorChar.test.js +63 -0
- package/src/text/vectorText.d.ts +2 -8
- package/src/text/vectorText.js +100 -72
- package/src/text/vectorText.test.js +267 -0
- package/src/utils/areAllShapesTheSameType.d.ts +2 -4
- package/src/utils/areAllShapesTheSameType.js +4 -6
- package/src/utils/areAllShapesTheSameType.test.js +3 -3
- package/src/utils/degToRad.d.ts +1 -3
- package/src/utils/degToRad.js +3 -5
- package/src/utils/degToRad.test.js +3 -3
- package/src/utils/flatten.d.ts +2 -4
- package/src/utils/flatten.js +1 -3
- package/src/utils/fnNumberSort.d.ts +1 -3
- package/src/utils/fnNumberSort.js +1 -3
- package/src/utils/index.d.ts +4 -9
- package/src/utils/index.js +5 -10
- package/src/utils/insertSorted.d.ts +1 -3
- package/src/utils/insertSorted.js +11 -13
- package/src/utils/padArrayToLength.d.ts +1 -3
- package/src/utils/padArrayToLength.js +2 -4
- package/src/utils/padArrayToLength.test.js +2 -2
- package/src/utils/radToDeg.d.ts +1 -3
- package/src/utils/radToDeg.js +3 -5
- package/src/utils/radToDeg.test.js +3 -3
- package/src/utils/radiusToSegments.d.ts +1 -3
- package/src/utils/radiusToSegments.js +6 -8
- package/src/utils/radiusToSegments.test.js +3 -3
- package/src/utils/recursiveArray.d.ts +1 -3
- package/test/helpers/asserts.js +9 -16
- package/test/helpers/comparePoints.js +2 -4
- package/test/helpers/comparePolygonLists.js +2 -4
- package/test/helpers/comparePolygons.js +4 -6
- package/test/helpers/comparePolygonsAsPoints.js +4 -6
- package/test/helpers/compareVectors.js +5 -6
- package/test/helpers/index.js +6 -8
- package/test/helpers/nearlyEqual.js +1 -3
- package/tsconfig.json +17 -0
- package/src/geometries/geom2/fromPoints.d.ts +0 -6
- package/src/geometries/geom2/fromPoints.js +0 -35
- package/src/geometries/geom2/fromPoints.test.js +0 -22
- package/src/geometries/poly2/flip.d.ts +0 -5
- package/src/geometries/poly2/flip.js +0 -15
- package/src/geometries/poly3/fromPoints.d.ts +0 -6
- package/src/geometries/poly3/fromPoints.js +0 -25
- package/src/geometries/poly3/fromPoints.test.js +0 -15
- package/src/geometries/poly3/fromPointsAndPlane.d.ts +0 -7
- package/src/geometries/poly3/toPoints.d.ts +0 -6
- package/src/geometries/poly3/toPoints.js +0 -10
- package/src/maths/OrthoNormalBasis.js +0 -207
- package/src/maths/utils/index.d.ts +0 -8
- package/src/maths/utils/index.js +0 -15
- package/src/operations/booleans/fromFakePolygons.js +0 -52
- package/src/operations/booleans/to3DWalls.js +0 -36
- package/src/operations/expansions/expand.d.ts +0 -18
- package/src/operations/expansions/expand.js +0 -42
- package/src/operations/expansions/expand.test.js +0 -188
- package/src/operations/expansions/expandGeom2.js +0 -43
- package/src/operations/expansions/expandGeom3.js +0 -36
- package/src/operations/expansions/extrudePolygon.js +0 -34
- package/src/operations/expansions/index.d.ts +0 -4
- package/src/operations/expansions/index.js +0 -11
- package/src/operations/expansions/offset.d.ts +0 -15
- package/src/operations/expansions/offset.js +0 -36
- package/src/operations/expansions/offset.test.js +0 -503
- package/src/operations/expansions/offsetGeom2.js +0 -47
- package/src/operations/expansions/offsetPath2.js +0 -32
- package/src/operations/extrusions/earcut/assignHoles.test.js +0 -74
- package/src/operations/extrusions/extrudeRectangular.d.ts +0 -17
- package/src/operations/extrusions/extrudeRectangular.js +0 -45
- package/src/operations/extrusions/extrudeRectangular.test.js +0 -72
- package/src/operations/extrusions/extrudeRectangularGeom2.js +0 -46
- package/src/operations/extrusions/extrudeRectangularPath2.js +0 -33
- package/src/operations/extrusions/slice/calculatePlane.d.ts +0 -7
- package/src/operations/extrusions/slice/calculatePlane.js +0 -41
- package/src/operations/extrusions/slice/calculatePlane.test.js +0 -35
- package/src/operations/extrusions/slice/clone.d.ts +0 -6
- package/src/operations/extrusions/slice/clone.js +0 -28
- package/src/operations/extrusions/slice/clone.test.js +0 -34
- package/src/operations/extrusions/slice/create.d.ts +0 -5
- package/src/operations/extrusions/slice/create.js +0 -20
- package/src/operations/extrusions/slice/equals.d.ts +0 -5
- package/src/operations/extrusions/slice/equals.js +0 -27
- package/src/operations/extrusions/slice/equals.test.js +0 -17
- package/src/operations/extrusions/slice/fromPoints.d.ts +0 -9
- package/src/operations/extrusions/slice/fromPoints.js +0 -35
- package/src/operations/extrusions/slice/fromPoints.test.js +0 -15
- package/src/operations/extrusions/slice/fromSides.d.ts +0 -7
- package/src/operations/extrusions/slice/fromSides.js +0 -27
- package/src/operations/extrusions/slice/fromSides.test.js +0 -15
- package/src/operations/extrusions/slice/index.d.ts +0 -16
- package/src/operations/extrusions/slice/index.js +0 -19
- package/src/operations/extrusions/slice/isA.d.ts +0 -5
- package/src/operations/extrusions/slice/isA.js +0 -18
- package/src/operations/extrusions/slice/repair.js +0 -62
- package/src/operations/extrusions/slice/reverse.d.ts +0 -6
- package/src/operations/extrusions/slice/reverse.js +0 -26
- package/src/operations/extrusions/slice/toEdges.d.ts +0 -5
- package/src/operations/extrusions/slice/toEdges.js +0 -13
- package/src/operations/extrusions/slice/toPolygons.d.ts +0 -7
- package/src/operations/extrusions/slice/toString.d.ts +0 -5
- package/src/operations/extrusions/slice/toString.js +0 -15
- package/src/operations/extrusions/slice/transform.d.ts +0 -7
- package/src/operations/extrusions/slice/transform.js +0 -21
- package/src/operations/extrusions/slice/type.d.ts +0 -7
- package/src/operations/hulls/quickhull/get-plane-normal.js +0 -20
- package/src/text/text.test.js +0 -187
- package/src/text/vectorParams.js +0 -26
|
@@ -1,14 +1,16 @@
|
|
|
1
|
-
|
|
1
|
+
import test from 'ava'
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
import { comparePolygonsAsPoints } from '../../../test/helpers/index.js'
|
|
4
4
|
|
|
5
|
-
|
|
5
|
+
import { geom3 } from '../../geometries/index.js'
|
|
6
6
|
|
|
7
|
-
|
|
7
|
+
import { measureVolume } from '../../measurements/index.js'
|
|
8
8
|
|
|
9
|
-
|
|
9
|
+
import { sphere, cuboid } from '../../primitives/index.js'
|
|
10
10
|
|
|
11
|
-
|
|
11
|
+
import { subtract } from './index.js'
|
|
12
|
+
|
|
13
|
+
import { center } from '../transforms/index.js'
|
|
12
14
|
|
|
13
15
|
test('subtract: subtract of one or more geom3 objects produces expected geometry', (t) => {
|
|
14
16
|
const geometry1 = sphere({ radius: 2, segments: 8 })
|
|
@@ -67,6 +69,7 @@ test('subtract: subtract of one or more geom3 objects produces expected geometry
|
|
|
67
69
|
[[8.65956056235493e-17, 8.659560562354935e-17, 2], [1.4142135623730951, 3.4638242249419736e-16, 1.414213562373095], [0.9999999999999998, 1.0000000000000002, 1.414213562373095]]
|
|
68
70
|
]
|
|
69
71
|
t.notThrows.skip(() => geom3.validate(result1))
|
|
72
|
+
t.is(measureVolume(result1), 25.751611331979678)
|
|
70
73
|
t.is(obs.length, 32)
|
|
71
74
|
t.true(comparePolygonsAsPoints(obs, exp))
|
|
72
75
|
|
|
@@ -76,6 +79,7 @@ test('subtract: subtract of one or more geom3 objects produces expected geometry
|
|
|
76
79
|
const result2 = subtract(geometry1, geometry2)
|
|
77
80
|
obs = geom3.toPoints(result2)
|
|
78
81
|
t.notThrows.skip(() => geom3.validate(result2))
|
|
82
|
+
t.is(measureVolume(result2), 25.751611331979678)
|
|
79
83
|
t.is(obs.length, 32)
|
|
80
84
|
|
|
81
85
|
// subtract of two partially overlapping objects
|
|
@@ -98,6 +102,7 @@ test('subtract: subtract of one or more geom3 objects produces expected geometry
|
|
|
98
102
|
[[12, 9, 8], [12, 8, 8], [9, 8, 8], [9, 9, 8]]
|
|
99
103
|
]
|
|
100
104
|
t.notThrows.skip(() => geom3.validate(result3))
|
|
105
|
+
t.is(measureVolume(result3), 63)
|
|
101
106
|
t.is(obs.length, 12)
|
|
102
107
|
t.true(comparePolygonsAsPoints(obs, exp))
|
|
103
108
|
|
|
@@ -105,5 +110,6 @@ test('subtract: subtract of one or more geom3 objects produces expected geometry
|
|
|
105
110
|
const result4 = subtract(geometry1, geometry3)
|
|
106
111
|
obs = geom3.toPoints(result4)
|
|
107
112
|
t.notThrows(() => geom3.validate(result4))
|
|
113
|
+
t.is(measureVolume(result4), 0)
|
|
108
114
|
t.is(obs.length, 0)
|
|
109
115
|
})
|
|
@@ -1,16 +1,17 @@
|
|
|
1
|
-
|
|
1
|
+
import * as geom3 from '../../geometries/geom3/index.js'
|
|
2
2
|
|
|
3
|
-
|
|
4
|
-
|
|
3
|
+
import { Tree } from './trees/index.js'
|
|
4
|
+
|
|
5
|
+
import { mayOverlap } from './mayOverlap.js'
|
|
5
6
|
|
|
6
7
|
/*
|
|
7
8
|
* Return a new 3D geometry representing the space in the first geometry but not
|
|
8
9
|
* in the second geometry. None of the given geometries are modified.
|
|
9
|
-
* @param {
|
|
10
|
-
* @param {
|
|
11
|
-
* @returns {
|
|
10
|
+
* @param {Geom3} geometry1 - a geometry
|
|
11
|
+
* @param {Geom3} geometry2 - a geometry
|
|
12
|
+
* @returns {Geom3} new 3D geometry
|
|
12
13
|
*/
|
|
13
|
-
const subtractGeom3Sub = (geometry1, geometry2) => {
|
|
14
|
+
export const subtractGeom3Sub = (geometry1, geometry2) => {
|
|
14
15
|
if (!mayOverlap(geometry1, geometry2)) {
|
|
15
16
|
return geom3.clone(geometry1)
|
|
16
17
|
}
|
|
@@ -24,8 +25,6 @@ const subtractGeom3Sub = (geometry1, geometry2) => {
|
|
|
24
25
|
a.addPolygons(b.allPolygons())
|
|
25
26
|
a.invert()
|
|
26
27
|
|
|
27
|
-
const
|
|
28
|
-
return geom3.create(
|
|
28
|
+
const newPolygons = a.allPolygons()
|
|
29
|
+
return geom3.create(newPolygons)
|
|
29
30
|
}
|
|
30
|
-
|
|
31
|
-
module.exports = subtractGeom3Sub
|
|
@@ -1,5 +1,6 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
1
|
+
import * as plane from '../../../maths/plane/index.js'
|
|
2
|
+
|
|
3
|
+
import * as poly3 from '../../../geometries/poly3/index.js'
|
|
3
4
|
|
|
4
5
|
// # class Node
|
|
5
6
|
// Holds a node in a BSP tree.
|
|
@@ -7,7 +8,7 @@ const poly3 = require('../../../geometries/poly3')
|
|
|
7
8
|
// Polygons are not stored directly in the tree, but in PolygonTreeNodes, stored in this.polygontreenodes.
|
|
8
9
|
// Those PolygonTreeNodes are children of the owning Tree.polygonTree.
|
|
9
10
|
// This is not a leafy BSP tree since there is no distinction between internal and leaf nodes.
|
|
10
|
-
class Node {
|
|
11
|
+
export class Node {
|
|
11
12
|
constructor (parent) {
|
|
12
13
|
this.plane = null
|
|
13
14
|
this.front = null
|
|
@@ -33,43 +34,41 @@ class Node {
|
|
|
33
34
|
|
|
34
35
|
// clip polygontreenodes to our plane
|
|
35
36
|
// calls remove() for all clipped PolygonTreeNodes
|
|
36
|
-
clipPolygons (
|
|
37
|
-
let current = { node: this,
|
|
37
|
+
clipPolygons (polygonTreeNodes, alsoRemoveCoplanarFront) {
|
|
38
|
+
let current = { node: this, polygonTreeNodes }
|
|
38
39
|
let node
|
|
39
40
|
const stack = []
|
|
40
41
|
|
|
41
42
|
do {
|
|
42
43
|
node = current.node
|
|
43
|
-
|
|
44
|
+
polygonTreeNodes = current.polygonTreeNodes
|
|
44
45
|
|
|
45
46
|
if (node.plane) {
|
|
46
47
|
const plane = node.plane
|
|
47
48
|
|
|
48
|
-
const
|
|
49
|
-
const
|
|
50
|
-
const
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
const treenode = polygontreenodes[i]
|
|
54
|
-
if (!treenode.isRemoved()) {
|
|
49
|
+
const backNodes = []
|
|
50
|
+
const frontNodes = []
|
|
51
|
+
const coplanarFrontNodes = alsoRemoveCoplanarFront ? backNodes : frontNodes
|
|
52
|
+
polygonTreeNodes.forEach((treeNode) => {
|
|
53
|
+
if (!treeNode.isRemoved()) {
|
|
55
54
|
// split this polygon tree node using the plane
|
|
56
55
|
// NOTE: children are added to the tree if there are spanning polygons
|
|
57
|
-
|
|
56
|
+
treeNode.splitByPlane(plane, coplanarFrontNodes, backNodes, frontNodes, backNodes)
|
|
58
57
|
}
|
|
59
|
-
}
|
|
58
|
+
})
|
|
60
59
|
|
|
61
|
-
if (node.front && (
|
|
60
|
+
if (node.front && (frontNodes.length > 0)) {
|
|
62
61
|
// add front node for further splitting
|
|
63
|
-
stack.push({ node: node.front,
|
|
62
|
+
stack.push({ node: node.front, polygonTreeNodes: frontNodes })
|
|
64
63
|
}
|
|
65
|
-
const
|
|
66
|
-
if (node.back && (
|
|
64
|
+
const numBackNodes = backNodes.length
|
|
65
|
+
if (node.back && (numBackNodes > 0)) {
|
|
67
66
|
// add back node for further splitting
|
|
68
|
-
stack.push({ node: node.back,
|
|
67
|
+
stack.push({ node: node.back, polygonTreeNodes: backNodes })
|
|
69
68
|
} else {
|
|
70
69
|
// remove all back nodes from processing
|
|
71
|
-
for (let i = 0; i <
|
|
72
|
-
|
|
70
|
+
for (let i = 0; i < numBackNodes; i++) {
|
|
71
|
+
backNodes[i].remove()
|
|
73
72
|
}
|
|
74
73
|
}
|
|
75
74
|
}
|
|
@@ -79,12 +78,12 @@ class Node {
|
|
|
79
78
|
|
|
80
79
|
// Remove all polygons in this BSP tree that are inside the other BSP tree
|
|
81
80
|
// `tree`.
|
|
82
|
-
clipTo (tree,
|
|
81
|
+
clipTo (tree, alsoRemoveCoplanarFront) {
|
|
83
82
|
let node = this
|
|
84
83
|
const stack = []
|
|
85
84
|
do {
|
|
86
85
|
if (node.polygontreenodes.length > 0) {
|
|
87
|
-
tree.rootnode.clipPolygons(node.polygontreenodes,
|
|
86
|
+
tree.rootnode.clipPolygons(node.polygontreenodes, alsoRemoveCoplanarFront)
|
|
88
87
|
}
|
|
89
88
|
if (node.front) stack.push(node.front)
|
|
90
89
|
if (node.back) stack.push(node.back)
|
|
@@ -92,53 +91,51 @@ class Node {
|
|
|
92
91
|
} while (node !== undefined)
|
|
93
92
|
}
|
|
94
93
|
|
|
95
|
-
addPolygonTreeNodes (
|
|
96
|
-
let current = { node: this,
|
|
94
|
+
addPolygonTreeNodes (newPolygonTreeNodes) {
|
|
95
|
+
let current = { node: this, polygonTreeNodes: newPolygonTreeNodes }
|
|
97
96
|
const stack = []
|
|
98
97
|
do {
|
|
99
98
|
const node = current.node
|
|
100
|
-
const
|
|
99
|
+
const polygonTreeNodes = current.polygonTreeNodes
|
|
100
|
+
const len = polygonTreeNodes.length
|
|
101
101
|
|
|
102
|
-
if (
|
|
102
|
+
if (len === 0) {
|
|
103
103
|
current = stack.pop()
|
|
104
104
|
continue
|
|
105
105
|
}
|
|
106
106
|
if (!node.plane) {
|
|
107
107
|
let index = 0 // default
|
|
108
|
-
index = Math.floor(
|
|
109
|
-
// index =
|
|
110
|
-
// index = Math.floor(Math.random()*
|
|
111
|
-
const
|
|
112
|
-
node.plane = poly3.plane(
|
|
108
|
+
index = Math.floor(len / 2)
|
|
109
|
+
// index = len >> 1
|
|
110
|
+
// index = Math.floor(Math.random() * len)
|
|
111
|
+
const bestPoly = polygonTreeNodes[index].getPolygon()
|
|
112
|
+
node.plane = poly3.plane(bestPoly)
|
|
113
113
|
}
|
|
114
|
-
const
|
|
115
|
-
const
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
polygontreenodes[i].splitByPlane(node.plane, node.polygontreenodes, backnodes, frontnodes, backnodes)
|
|
114
|
+
const frontNodes = []
|
|
115
|
+
const backNodes = []
|
|
116
|
+
for (let i = 0; i < len; ++i) {
|
|
117
|
+
polygonTreeNodes[i].splitByPlane(node.plane, node.polygontreenodes, backNodes, frontNodes, backNodes)
|
|
119
118
|
}
|
|
120
119
|
|
|
121
|
-
if (
|
|
120
|
+
if (frontNodes.length > 0) {
|
|
122
121
|
if (!node.front) node.front = new Node(node)
|
|
123
122
|
|
|
124
123
|
// unable to split by any of the current nodes
|
|
125
|
-
const stopCondition =
|
|
126
|
-
if (stopCondition) node.front.polygontreenodes =
|
|
127
|
-
else stack.push({ node: node.front,
|
|
124
|
+
const stopCondition = len === frontNodes.length && backNodes.length === 0
|
|
125
|
+
if (stopCondition) node.front.polygontreenodes = frontNodes
|
|
126
|
+
else stack.push({ node: node.front, polygonTreeNodes: frontNodes })
|
|
128
127
|
}
|
|
129
|
-
if (
|
|
128
|
+
if (backNodes.length > 0) {
|
|
130
129
|
if (!node.back) node.back = new Node(node)
|
|
131
130
|
|
|
132
131
|
// unable to split by any of the current nodes
|
|
133
|
-
const stopCondition =
|
|
132
|
+
const stopCondition = len === backNodes.length && frontNodes.length === 0
|
|
134
133
|
|
|
135
|
-
if (stopCondition) node.back.polygontreenodes =
|
|
136
|
-
else stack.push({ node: node.back,
|
|
134
|
+
if (stopCondition) node.back.polygontreenodes = backNodes
|
|
135
|
+
else stack.push({ node: node.back, polygonTreeNodes: backNodes })
|
|
137
136
|
}
|
|
138
137
|
|
|
139
138
|
current = stack.pop()
|
|
140
139
|
} while (current !== undefined)
|
|
141
140
|
}
|
|
142
141
|
}
|
|
143
|
-
|
|
144
|
-
module.exports = Node
|
|
@@ -1,37 +1,37 @@
|
|
|
1
|
-
|
|
1
|
+
import { EPS } from '../../../maths/constants.js'
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
import * as vec3 from '../../../maths/vec3/index.js'
|
|
4
4
|
|
|
5
|
-
|
|
5
|
+
import * as poly3 from '../../../geometries/poly3/index.js'
|
|
6
6
|
|
|
7
|
-
|
|
7
|
+
import { splitPolygonByPlane } from './splitPolygonByPlane.js'
|
|
8
8
|
|
|
9
9
|
// # class PolygonTreeNode
|
|
10
10
|
// This class manages hierarchical splits of polygons.
|
|
11
11
|
// At the top is a root node which does not hold a polygon, only child PolygonTreeNodes.
|
|
12
12
|
// Below that are zero or more 'top' nodes; each holds a polygon.
|
|
13
13
|
// The polygons can be in different planes.
|
|
14
|
-
// splitByPlane() splits a node by a plane. If the plane intersects the polygon,
|
|
15
|
-
// are created holding the
|
|
14
|
+
// splitByPlane() splits a node by a plane. If the plane intersects the polygon,
|
|
15
|
+
// two new child nodes are created holding the split polygon.
|
|
16
16
|
// getPolygons() retrieves the polygons from the tree. If for PolygonTreeNode the polygon is split but
|
|
17
17
|
// the two split parts (child nodes) are still intact, then the unsplit polygon is returned.
|
|
18
18
|
// This ensures that we can safely split a polygon into many fragments. If the fragments are untouched,
|
|
19
19
|
// getPolygons() will return the original unsplit polygon instead of the fragments.
|
|
20
20
|
// remove() removes a polygon from the tree. Once a polygon is removed, the parent polygons are invalidated
|
|
21
21
|
// since they are no longer intact.
|
|
22
|
-
class PolygonTreeNode {
|
|
22
|
+
export class PolygonTreeNode {
|
|
23
23
|
// constructor creates the root node
|
|
24
24
|
constructor (parent, polygon) {
|
|
25
25
|
this.parent = parent
|
|
26
26
|
this.children = []
|
|
27
27
|
this.polygon = polygon
|
|
28
|
-
this.removed = false
|
|
28
|
+
this.removed = false // state of branch or leaf
|
|
29
29
|
}
|
|
30
30
|
|
|
31
31
|
// fill the tree with polygons. Should be called on the root node only; child nodes must
|
|
32
32
|
// always be a derivate (split) of the parent node.
|
|
33
33
|
addPolygons (polygons) {
|
|
34
|
-
// new polygons can only be added to root node; children can only be
|
|
34
|
+
// new polygons can only be added to root node; children can only be split polygons
|
|
35
35
|
if (!this.isRootNode()) {
|
|
36
36
|
throw new Error('Assertion failed')
|
|
37
37
|
}
|
|
@@ -98,11 +98,11 @@ class PolygonTreeNode {
|
|
|
98
98
|
}
|
|
99
99
|
}
|
|
100
100
|
|
|
101
|
-
// split the node by a plane; add the resulting nodes to the
|
|
101
|
+
// split the node by a plane; add the resulting nodes to the frontNodes and backNodes array
|
|
102
102
|
// If the plane doesn't intersect the polygon, the 'this' object is added to one of the arrays
|
|
103
103
|
// If the plane does intersect the polygon, two new child nodes are created for the front and back fragments,
|
|
104
104
|
// and added to both arrays.
|
|
105
|
-
splitByPlane (plane,
|
|
105
|
+
splitByPlane (plane, coplanarFrontNodes, coplanarBackNodes, frontNodes, backNodes) {
|
|
106
106
|
if (this.children.length) {
|
|
107
107
|
const queue = [this.children]
|
|
108
108
|
let i
|
|
@@ -118,59 +118,59 @@ class PolygonTreeNode {
|
|
|
118
118
|
queue.push(node.children)
|
|
119
119
|
} else {
|
|
120
120
|
// no children. Split the polygon:
|
|
121
|
-
node._splitByPlane(plane,
|
|
121
|
+
node._splitByPlane(plane, coplanarFrontNodes, coplanarBackNodes, frontNodes, backNodes)
|
|
122
122
|
}
|
|
123
123
|
}
|
|
124
124
|
}
|
|
125
125
|
} else {
|
|
126
|
-
this._splitByPlane(plane,
|
|
126
|
+
this._splitByPlane(plane, coplanarFrontNodes, coplanarBackNodes, frontNodes, backNodes)
|
|
127
127
|
}
|
|
128
128
|
}
|
|
129
129
|
|
|
130
130
|
// only to be called for nodes with no children
|
|
131
|
-
_splitByPlane (splane,
|
|
131
|
+
_splitByPlane (splane, coplanarFrontNodes, coplanarBackNodes, frontNodes, backNodes) {
|
|
132
132
|
const polygon = this.polygon
|
|
133
133
|
if (polygon) {
|
|
134
134
|
const bound = poly3.measureBoundingSphere(polygon)
|
|
135
|
-
const
|
|
136
|
-
const
|
|
137
|
-
const d = vec3.dot(splane,
|
|
138
|
-
if (d >
|
|
139
|
-
|
|
140
|
-
} else if (d < -
|
|
141
|
-
|
|
135
|
+
const sphereRadius = bound[3] + EPS // ensure radius is LARGER then polygon
|
|
136
|
+
const sphereCenter = bound
|
|
137
|
+
const d = vec3.dot(splane, sphereCenter) - splane[3]
|
|
138
|
+
if (d > sphereRadius) {
|
|
139
|
+
frontNodes.push(this)
|
|
140
|
+
} else if (d < -sphereRadius) {
|
|
141
|
+
backNodes.push(this)
|
|
142
142
|
} else {
|
|
143
|
-
const
|
|
144
|
-
switch (
|
|
143
|
+
const splitResult = splitPolygonByPlane(splane, polygon)
|
|
144
|
+
switch (splitResult.type) {
|
|
145
145
|
case 0:
|
|
146
146
|
// coplanar front:
|
|
147
|
-
|
|
147
|
+
coplanarFrontNodes.push(this)
|
|
148
148
|
break
|
|
149
149
|
|
|
150
150
|
case 1:
|
|
151
151
|
// coplanar back:
|
|
152
|
-
|
|
152
|
+
coplanarBackNodes.push(this)
|
|
153
153
|
break
|
|
154
154
|
|
|
155
155
|
case 2:
|
|
156
156
|
// front:
|
|
157
|
-
|
|
157
|
+
frontNodes.push(this)
|
|
158
158
|
break
|
|
159
159
|
|
|
160
160
|
case 3:
|
|
161
161
|
// back:
|
|
162
|
-
|
|
162
|
+
backNodes.push(this)
|
|
163
163
|
break
|
|
164
164
|
|
|
165
165
|
case 4:
|
|
166
166
|
// spanning:
|
|
167
|
-
if (
|
|
168
|
-
const
|
|
169
|
-
|
|
167
|
+
if (splitResult.front) {
|
|
168
|
+
const frontNode = this.addChild(splitResult.front)
|
|
169
|
+
frontNodes.push(frontNode)
|
|
170
170
|
}
|
|
171
|
-
if (
|
|
172
|
-
const
|
|
173
|
-
|
|
171
|
+
if (splitResult.back) {
|
|
172
|
+
const backNode = this.addChild(splitResult.back)
|
|
173
|
+
backNodes.push(backNode)
|
|
174
174
|
}
|
|
175
175
|
break
|
|
176
176
|
}
|
|
@@ -184,9 +184,9 @@ class PolygonTreeNode {
|
|
|
184
184
|
// a child should be created for every fragment of the split polygon
|
|
185
185
|
// returns the newly created child
|
|
186
186
|
addChild (polygon) {
|
|
187
|
-
const
|
|
188
|
-
this.children.push(
|
|
189
|
-
return
|
|
187
|
+
const newChild = new PolygonTreeNode(this, polygon)
|
|
188
|
+
this.children.push(newChild)
|
|
189
|
+
return newChild
|
|
190
190
|
}
|
|
191
191
|
|
|
192
192
|
invertSub () {
|
|
@@ -257,5 +257,3 @@ class PolygonTreeNode {
|
|
|
257
257
|
return result
|
|
258
258
|
}
|
|
259
259
|
}
|
|
260
|
-
|
|
261
|
-
module.exports = PolygonTreeNode
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
1
|
+
import { Node } from './Node.js'
|
|
2
|
+
import { PolygonTreeNode } from './PolygonTreeNode.js'
|
|
3
3
|
|
|
4
4
|
// # class Tree
|
|
5
5
|
// This is the root of a BSP tree.
|
|
6
6
|
// This separate class for the root of the tree in order to hold the PolygonTreeNode root.
|
|
7
7
|
// The actual tree is kept in this.rootnode
|
|
8
|
-
class Tree {
|
|
8
|
+
export class Tree {
|
|
9
9
|
constructor (polygons) {
|
|
10
10
|
this.polygonTree = new PolygonTreeNode()
|
|
11
11
|
this.rootnode = new Node(null)
|
|
@@ -19,8 +19,8 @@ class Tree {
|
|
|
19
19
|
|
|
20
20
|
// Remove all polygons in this BSP tree that are inside the other BSP tree
|
|
21
21
|
// `tree`.
|
|
22
|
-
clipTo (tree,
|
|
23
|
-
this.rootnode.clipTo(tree,
|
|
22
|
+
clipTo (tree, alsoRemoveCoplanarFront = false) {
|
|
23
|
+
this.rootnode.clipTo(tree, alsoRemoveCoplanarFront)
|
|
24
24
|
}
|
|
25
25
|
|
|
26
26
|
allPolygons () {
|
|
@@ -30,11 +30,11 @@ class Tree {
|
|
|
30
30
|
}
|
|
31
31
|
|
|
32
32
|
addPolygons (polygons) {
|
|
33
|
-
const
|
|
33
|
+
const polygonTreeNodes = new Array(polygons.length)
|
|
34
34
|
for (let i = 0; i < polygons.length; i++) {
|
|
35
|
-
|
|
35
|
+
polygonTreeNodes[i] = this.polygonTree.addChild(polygons[i])
|
|
36
36
|
}
|
|
37
|
-
this.rootnode.addPolygonTreeNodes(
|
|
37
|
+
this.rootnode.addPolygonTreeNodes(polygonTreeNodes)
|
|
38
38
|
}
|
|
39
39
|
|
|
40
40
|
clear () {
|
|
@@ -42,9 +42,6 @@ class Tree {
|
|
|
42
42
|
}
|
|
43
43
|
|
|
44
44
|
toString () {
|
|
45
|
-
|
|
46
|
-
return result
|
|
45
|
+
return 'Tree: ' + this.polygonTree.toString('')
|
|
47
46
|
}
|
|
48
47
|
}
|
|
49
|
-
|
|
50
|
-
module.exports = Tree
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
|
|
1
|
+
import * as vec3 from '../../../maths/vec3/index.js'
|
|
2
2
|
|
|
3
|
-
const splitLineSegmentByPlane = (plane, p1, p2) => {
|
|
3
|
+
export const splitLineSegmentByPlane = (plane, p1, p2) => {
|
|
4
4
|
const direction = vec3.subtract(vec3.create(), p2, p1)
|
|
5
5
|
let lambda = (plane[3] - vec3.dot(plane, p1)) / vec3.dot(plane, direction)
|
|
6
6
|
if (Number.isNaN(lambda)) lambda = 0
|
|
@@ -11,5 +11,3 @@ const splitLineSegmentByPlane = (plane, p1, p2) => {
|
|
|
11
11
|
vec3.add(direction, p1, direction)
|
|
12
12
|
return direction
|
|
13
13
|
}
|
|
14
|
-
|
|
15
|
-
module.exports = splitLineSegmentByPlane
|