brepjs 8.0.2 → 8.0.3
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/dist/2d.cjs +2 -2
- package/dist/2d.js +3 -3
- package/dist/{Blueprint-B9fhnpFp.js → Blueprint-DnAO3gr5.js} +8 -9
- package/dist/{Blueprint-VGbo3izk.cjs → Blueprint-FxmMji4s.cjs} +9 -10
- package/dist/{boolean2D-_WiqPxWZ.js → boolean2D-BnZKKBWU.js} +10 -10
- package/dist/{boolean2D-B1XrGVgx.cjs → boolean2D-BrjHZfWn.cjs} +10 -10
- package/dist/{booleanFns-CkccZ7UL.js → booleanFns-Ct3wDnhc.js} +3 -3
- package/dist/{booleanFns-BxW-N3rP.cjs → booleanFns-ND7sZvhu.cjs} +3 -3
- package/dist/brepjs.cjs +63 -64
- package/dist/brepjs.js +111 -113
- package/dist/{cast-C4Ff_1Qe.js → cast-BEg1mN7n.js} +2 -2
- package/dist/{cast-DIiyxDLo.cjs → cast-CqDc8oFW.cjs} +2 -2
- package/dist/core.cjs +3 -3
- package/dist/core.js +3 -3
- package/dist/{cornerFinder-DzGzfiqb.js → cornerFinder-89obDwGi.js} +1 -1
- package/dist/{cornerFinder-BndBNtJE.cjs → cornerFinder-BKsCkrXd.cjs} +1 -1
- package/dist/{curveBuilders-BUoFO1UG.cjs → curveBuilders-BjtdNw1B.cjs} +2 -2
- package/dist/{curveBuilders-CBlIWlbU.js → curveBuilders-U26XDfxg.js} +2 -2
- package/dist/curveFns-BoG_iA07.cjs +375 -0
- package/dist/curveFns-Cg99XKe2.js +376 -0
- package/dist/{drawFns-D2eDcf4k.cjs → drawFns-C-MCkYj6.cjs} +15 -16
- package/dist/{drawFns-Btmlh_Oz.js → drawFns-DJV-nOox.js} +12 -13
- package/dist/{faceFns-DDzCECn3.js → faceFns-CyokaCDr.js} +3 -3
- package/dist/{faceFns-NDRFeekj.cjs → faceFns-DcSCjDG0.cjs} +3 -3
- package/dist/{helpers-Ck8GJ58k.cjs → helpers--iZxPeJg.cjs} +9 -9
- package/dist/{helpers-jku2V1DY.js → helpers-CRx_ks-u.js} +6 -6
- package/dist/io.cjs +4 -4
- package/dist/io.js +4 -4
- package/dist/kernel/curveOps.d.ts.map +1 -1
- package/dist/kernel/meshOps.d.ts.map +1 -1
- package/dist/kernel/modifierOps.d.ts.map +1 -1
- package/dist/{loft-DJXwxV_L.cjs → loft-8asn63t4.cjs} +4 -4
- package/dist/{loft-Bk9EM0gZ.js → loft-jIkZRqHm.js} +4 -4
- package/dist/{measurement-DlXaTzKc.js → measurement-DWv8kK6J.js} +3 -3
- package/dist/{measurement-LcGh4wV0.cjs → measurement-lRLwaoqD.cjs} +3 -3
- package/dist/measurement.cjs +1 -1
- package/dist/measurement.js +1 -1
- package/dist/{meshFns-c8lDKfYy.cjs → meshFns-DWuLC3fk.cjs} +29 -9
- package/dist/{meshFns-Djzdn-CS.js → meshFns-DgAIL1B-.js} +29 -9
- package/dist/{occtBoundary-6kQSl3cF.cjs → occtBoundary-DHtzU4tz.cjs} +72 -61
- package/dist/{occtBoundary-CqXvDhZY.js → occtBoundary-DYsksDtE.js} +72 -61
- package/dist/operations/patternFns.d.ts.map +1 -1
- package/dist/{operations-CrQlFDHc.js → operations-B8FHVC22.js} +32 -10
- package/dist/{operations-Do-WZGXc.cjs → operations-CCFPvtd-.cjs} +32 -10
- package/dist/operations.cjs +2 -2
- package/dist/operations.js +2 -2
- package/dist/query.cjs +5 -5
- package/dist/query.js +6 -6
- package/dist/{shapeTypes-BJ3Hmskg.cjs → shapeTypes-b_lhwQB7.cjs} +1 -1
- package/dist/{shapeTypes-C9sUsmEW.js → shapeTypes-i7VwMRwc.js} +1 -1
- package/dist/sketching.cjs +2 -2
- package/dist/sketching.js +2 -2
- package/dist/topology/meshFns.d.ts.map +1 -1
- package/dist/{topology-CtfUZwLR.js → topology-Bh-aPIxA.js} +7 -8
- package/dist/{topology-DXq8dLsi.cjs → topology-ByOn_z3E.cjs} +12 -13
- package/dist/topology.cjs +33 -34
- package/dist/topology.js +50 -51
- package/dist/{vectors-BVgXsYWl.js → vectors-DWLjb9-P.js} +1 -1
- package/dist/{vectors-DK2hEKcI.cjs → vectors-aQBZK0Sb.cjs} +1 -1
- package/dist/vectors.cjs +2 -2
- package/dist/vectors.js +2 -2
- package/package.json +1 -1
- package/dist/curveFns-BrJDkaWi.cjs +0 -177
- package/dist/curveFns-BshHA9Ys.js +0 -178
- package/dist/shapeFns-DQtpzndX.js +0 -203
- package/dist/shapeFns-cN4qGpbO.cjs +0 -202
package/dist/2d.cjs
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
3
|
-
const Blueprint = require("./Blueprint-
|
|
4
|
-
const boolean2D = require("./boolean2D-
|
|
3
|
+
const Blueprint = require("./Blueprint-FxmMji4s.cjs");
|
|
4
|
+
const boolean2D = require("./boolean2D-BrjHZfWn.cjs");
|
|
5
5
|
function reverseCurve(curve) {
|
|
6
6
|
const cloned = curve.clone();
|
|
7
7
|
cloned.reverse();
|
package/dist/2d.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { B as Blueprint } from "./Blueprint-
|
|
2
|
-
import { e, C, f } from "./Blueprint-
|
|
3
|
-
import { b, C as C2, c, d, f as f2, e as e2, i, g, o, p, r } from "./boolean2D-
|
|
1
|
+
import { B as Blueprint } from "./Blueprint-DnAO3gr5.js";
|
|
2
|
+
import { e, C, f } from "./Blueprint-DnAO3gr5.js";
|
|
3
|
+
import { b, C as C2, c, d, f as f2, e as e2, i, g, o, p, r } from "./boolean2D-BnZKKBWU.js";
|
|
4
4
|
function reverseCurve(curve) {
|
|
5
5
|
const cloned = curve.clone();
|
|
6
6
|
cloned.reverse();
|
|
@@ -1,14 +1,13 @@
|
|
|
1
|
-
import { r as resolvePlane } from "./vectors-
|
|
2
|
-
import { g as getKernel, a as toVec3, m as makeOcAx2 } from "./occtBoundary-
|
|
3
|
-
import { t as localGC, u as createFace, e as isFace, y as registerForCleanup, z as unregisterFromCleanup, p as gcWithScope, o as createEdge, n as createWire } from "./shapeTypes-
|
|
4
|
-
import { u as uvBounds, a as faceGeomType, f as faceCenter, h as uvCoordinates } from "./faceFns-
|
|
5
|
-
import {
|
|
1
|
+
import { r as resolvePlane } from "./vectors-DWLjb9-P.js";
|
|
2
|
+
import { g as getKernel, a as toVec3, m as makeOcAx2 } from "./occtBoundary-DYsksDtE.js";
|
|
3
|
+
import { t as localGC, u as createFace, e as isFace, y as registerForCleanup, z as unregisterFromCleanup, p as gcWithScope, o as createEdge, n as createWire } from "./shapeTypes-i7VwMRwc.js";
|
|
4
|
+
import { u as uvBounds, a as faceGeomType, f as faceCenter, h as uvCoordinates } from "./faceFns-CyokaCDr.js";
|
|
5
|
+
import { a as getEdges, A as findCurveType, D as getOrientation } from "./curveFns-Cg99XKe2.js";
|
|
6
6
|
import { e as err, o as occtError, l as ok, a as andThen, x as validationError, u as unwrap, b as computationError } from "./errors-wGhcJMpB.js";
|
|
7
|
-
import { d as distance2d, s as samePoint, k as scalarMultiply2d, i as add2d, n as normalize2d, h as subtract2d, g as getSingleFace } from "./helpers-
|
|
8
|
-
import { c as cast } from "./cast-
|
|
7
|
+
import { d as distance2d, s as samePoint, k as scalarMultiply2d, i as add2d, n as normalize2d, h as subtract2d, g as getSingleFace } from "./helpers-CRx_ks-u.js";
|
|
8
|
+
import { c as cast } from "./cast-BEg1mN7n.js";
|
|
9
9
|
import { R as RAD2DEG, D as DEG2RAD } from "./vecOps-ZDdZWbwT.js";
|
|
10
|
-
import { a as
|
|
11
|
-
import { m as makeLine, a as assembleWire$1 } from "./curveBuilders-CBlIWlbU.js";
|
|
10
|
+
import { m as makeLine, a as assembleWire$1 } from "./curveBuilders-U26XDfxg.js";
|
|
12
11
|
import { bug } from "./result.js";
|
|
13
12
|
function makePlane(plane, origin) {
|
|
14
13
|
if (plane && typeof plane !== "string") {
|
|
@@ -1,15 +1,14 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
const vectors = require("./vectors-
|
|
3
|
-
const occtBoundary = require("./occtBoundary-
|
|
4
|
-
const shapeTypes = require("./shapeTypes-
|
|
5
|
-
const faceFns = require("./faceFns-
|
|
6
|
-
const curveFns = require("./curveFns-
|
|
2
|
+
const vectors = require("./vectors-aQBZK0Sb.cjs");
|
|
3
|
+
const occtBoundary = require("./occtBoundary-DHtzU4tz.cjs");
|
|
4
|
+
const shapeTypes = require("./shapeTypes-b_lhwQB7.cjs");
|
|
5
|
+
const faceFns = require("./faceFns-DcSCjDG0.cjs");
|
|
6
|
+
const curveFns = require("./curveFns-BoG_iA07.cjs");
|
|
7
7
|
const errors = require("./errors-DK1VAdP4.cjs");
|
|
8
|
-
const helpers = require("./helpers
|
|
9
|
-
const cast = require("./cast-
|
|
8
|
+
const helpers = require("./helpers--iZxPeJg.cjs");
|
|
9
|
+
const cast = require("./cast-CqDc8oFW.cjs");
|
|
10
10
|
const vecOps = require("./vecOps-CjRL1jau.cjs");
|
|
11
|
-
const
|
|
12
|
-
const curveBuilders = require("./curveBuilders-BUoFO1UG.cjs");
|
|
11
|
+
const curveBuilders = require("./curveBuilders-BjtdNw1B.cjs");
|
|
13
12
|
const result = require("./result.cjs");
|
|
14
13
|
function makePlane(plane, origin) {
|
|
15
14
|
if (plane && typeof plane !== "string") {
|
|
@@ -84,7 +83,7 @@ function makeNonPlanarFace(wire) {
|
|
|
84
83
|
const faceBuilder = r(
|
|
85
84
|
new oc.BRepOffsetAPI_MakeFilling(3, 15, 2, false, 1e-5, 1e-4, 0.01, 0.1, 8, 9)
|
|
86
85
|
);
|
|
87
|
-
|
|
86
|
+
curveFns.getEdges(wire).forEach((edge) => {
|
|
88
87
|
faceBuilder.Add_1(
|
|
89
88
|
edge.wrapped,
|
|
90
89
|
oc.GeomAbs_Shape.GeomAbs_C0,
|
|
@@ -1,16 +1,16 @@
|
|
|
1
|
-
import { a as createPlane } from "./vectors-
|
|
1
|
+
import { a as createPlane } from "./vectors-DWLjb9-P.js";
|
|
2
2
|
import { l as ok, e as err, b as computationError, u as unwrap, g as isOk } from "./errors-wGhcJMpB.js";
|
|
3
|
-
import { d as downcast } from "./cast-
|
|
4
|
-
import { g as getKernel, a as toVec3 } from "./occtBoundary-
|
|
3
|
+
import { d as downcast } from "./cast-BEg1mN7n.js";
|
|
4
|
+
import { g as getKernel, a as toVec3 } from "./occtBoundary-DYsksDtE.js";
|
|
5
5
|
import { n as vecScale, j as vecNormalize, b as vecCross, D as DEG2RAD, R as RAD2DEG } from "./vecOps-ZDdZWbwT.js";
|
|
6
|
-
import { r as revolution, k as complexExtrude, t as twistExtrude, i as basicFaceExtrusion, j as genericSweep, l as loft } from "./loft-
|
|
7
|
-
import { p as gcWithScope, u as createFace, n as createWire, t as localGC, o as createEdge } from "./shapeTypes-
|
|
8
|
-
import {
|
|
9
|
-
import { C as Curve2D, i as make2dSegmentCurve, r as approximateAsBSpline, j as make2dArcFromCenter, s as isPoint2D, o as make2dCircle, t as make2dThreePointArc, e as BoundingBox2d, v as viewbox, u as asSVG, B as Blueprint, m as makeFace, d as makeNewFaceWithinFace, w as make2dEllipseArc, x as make2dTangentArc, y as make2dBezierCurve, f as axis2d, z as zip, A as removeDuplicatePoints } from "./Blueprint-
|
|
10
|
-
import { u as uvBounds, p as pointOnSurface, n as normalAt } from "./faceFns-
|
|
6
|
+
import { r as revolution, k as complexExtrude, t as twistExtrude, i as basicFaceExtrusion, j as genericSweep, l as loft } from "./loft-jIkZRqHm.js";
|
|
7
|
+
import { p as gcWithScope, u as createFace, n as createWire, t as localGC, o as createEdge } from "./shapeTypes-i7VwMRwc.js";
|
|
8
|
+
import { p as curveStartPoint, l as curveTangentAt, c as curveIsClosed } from "./curveFns-Cg99XKe2.js";
|
|
9
|
+
import { C as Curve2D, i as make2dSegmentCurve, r as approximateAsBSpline, j as make2dArcFromCenter, s as isPoint2D, o as make2dCircle, t as make2dThreePointArc, e as BoundingBox2d, v as viewbox, u as asSVG, B as Blueprint, m as makeFace, d as makeNewFaceWithinFace, w as make2dEllipseArc, x as make2dTangentArc, y as make2dBezierCurve, f as axis2d, z as zip, A as removeDuplicatePoints } from "./Blueprint-DnAO3gr5.js";
|
|
10
|
+
import { u as uvBounds, p as pointOnSurface, n as normalAt } from "./faceFns-CyokaCDr.js";
|
|
11
11
|
import { bug } from "./result.js";
|
|
12
|
-
import { s as samePoint$1, n as normalize2d, h as subtract2d, i as add2d, j as crossProduct2d, k as scalarMultiply2d, b as polarToCartesian, r as rotate2d, l as cartesianToPolar, d as distance2d, p as polarAngle2d, m as PRECISION_INTERSECTION } from "./helpers-
|
|
13
|
-
import { a as assembleWire } from "./curveBuilders-
|
|
12
|
+
import { s as samePoint$1, n as normalize2d, h as subtract2d, i as add2d, j as crossProduct2d, k as scalarMultiply2d, b as polarToCartesian, r as rotate2d, l as cartesianToPolar, d as distance2d, p as polarAngle2d, m as PRECISION_INTERSECTION } from "./helpers-CRx_ks-u.js";
|
|
13
|
+
import { a as assembleWire } from "./curveBuilders-U26XDfxg.js";
|
|
14
14
|
function* pointsIteration(intersector) {
|
|
15
15
|
const nPoints = intersector.NbPoints();
|
|
16
16
|
if (!nPoints) return;
|
|
@@ -1,17 +1,17 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
const vectors = require("./vectors-
|
|
2
|
+
const vectors = require("./vectors-aQBZK0Sb.cjs");
|
|
3
3
|
const errors = require("./errors-DK1VAdP4.cjs");
|
|
4
|
-
const cast = require("./cast-
|
|
5
|
-
const occtBoundary = require("./occtBoundary-
|
|
4
|
+
const cast = require("./cast-CqDc8oFW.cjs");
|
|
5
|
+
const occtBoundary = require("./occtBoundary-DHtzU4tz.cjs");
|
|
6
6
|
const vecOps = require("./vecOps-CjRL1jau.cjs");
|
|
7
|
-
const loft = require("./loft-
|
|
8
|
-
const shapeTypes = require("./shapeTypes-
|
|
9
|
-
const curveFns = require("./curveFns-
|
|
10
|
-
const Blueprint = require("./Blueprint-
|
|
11
|
-
const faceFns = require("./faceFns-
|
|
7
|
+
const loft = require("./loft-8asn63t4.cjs");
|
|
8
|
+
const shapeTypes = require("./shapeTypes-b_lhwQB7.cjs");
|
|
9
|
+
const curveFns = require("./curveFns-BoG_iA07.cjs");
|
|
10
|
+
const Blueprint = require("./Blueprint-FxmMji4s.cjs");
|
|
11
|
+
const faceFns = require("./faceFns-DcSCjDG0.cjs");
|
|
12
12
|
const result = require("./result.cjs");
|
|
13
|
-
const helpers = require("./helpers
|
|
14
|
-
const curveBuilders = require("./curveBuilders-
|
|
13
|
+
const helpers = require("./helpers--iZxPeJg.cjs");
|
|
14
|
+
const curveBuilders = require("./curveBuilders-BjtdNw1B.cjs");
|
|
15
15
|
function* pointsIteration(intersector) {
|
|
16
16
|
const nPoints = intersector.NbPoints();
|
|
17
17
|
if (!nPoints) return;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { g as getKernel } from "./occtBoundary-
|
|
2
|
-
import { p as gcWithScope, c as castShape, h as isShape3D } from "./shapeTypes-
|
|
1
|
+
import { g as getKernel } from "./occtBoundary-DYsksDtE.js";
|
|
2
|
+
import { p as gcWithScope, c as castShape, h as isShape3D } from "./shapeTypes-i7VwMRwc.js";
|
|
3
3
|
import { l as ok, d as isErr, e as err, x as validationError, B as BrepErrorCode, p as typeCastError, o as occtError } from "./errors-wGhcJMpB.js";
|
|
4
|
-
import { r as resolvePlane } from "./vectors-
|
|
4
|
+
import { r as resolvePlane } from "./vectors-DWLjb9-P.js";
|
|
5
5
|
import { n as vecScale, v as vecAdd } from "./vecOps-ZDdZWbwT.js";
|
|
6
6
|
function applyGlue(op, optimisation) {
|
|
7
7
|
const oc = getKernel().oc;
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
const occtBoundary = require("./occtBoundary-
|
|
3
|
-
const shapeTypes = require("./shapeTypes-
|
|
2
|
+
const occtBoundary = require("./occtBoundary-DHtzU4tz.cjs");
|
|
3
|
+
const shapeTypes = require("./shapeTypes-b_lhwQB7.cjs");
|
|
4
4
|
const errors = require("./errors-DK1VAdP4.cjs");
|
|
5
|
-
const vectors = require("./vectors-
|
|
5
|
+
const vectors = require("./vectors-aQBZK0Sb.cjs");
|
|
6
6
|
const vecOps = require("./vecOps-CjRL1jau.cjs");
|
|
7
7
|
function applyGlue(op, optimisation) {
|
|
8
8
|
const oc = occtBoundary.getKernel().oc;
|
package/dist/brepjs.cjs
CHANGED
|
@@ -1,30 +1,29 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
3
|
-
const occtBoundary = require("./occtBoundary-
|
|
3
|
+
const occtBoundary = require("./occtBoundary-DHtzU4tz.cjs");
|
|
4
4
|
const errors = require("./errors-DK1VAdP4.cjs");
|
|
5
|
-
const shapeTypes = require("./shapeTypes-
|
|
5
|
+
const shapeTypes = require("./shapeTypes-b_lhwQB7.cjs");
|
|
6
6
|
const vecOps = require("./vecOps-CjRL1jau.cjs");
|
|
7
|
-
const Blueprint = require("./Blueprint-
|
|
8
|
-
const curveFns = require("./curveFns-
|
|
9
|
-
const loft$2 = require("./loft-
|
|
10
|
-
const operations = require("./operations-
|
|
11
|
-
const boolean2D = require("./boolean2D-
|
|
7
|
+
const Blueprint = require("./Blueprint-FxmMji4s.cjs");
|
|
8
|
+
const curveFns = require("./curveFns-BoG_iA07.cjs");
|
|
9
|
+
const loft$2 = require("./loft-8asn63t4.cjs");
|
|
10
|
+
const operations = require("./operations-CCFPvtd-.cjs");
|
|
11
|
+
const boolean2D = require("./boolean2D-BrjHZfWn.cjs");
|
|
12
12
|
const _2d = require("./2d.cjs");
|
|
13
|
-
const helpers = require("./helpers
|
|
13
|
+
const helpers = require("./helpers--iZxPeJg.cjs");
|
|
14
14
|
const io = require("./io.cjs");
|
|
15
|
-
const drawFns = require("./drawFns-
|
|
16
|
-
const vectors = require("./vectors-
|
|
17
|
-
const
|
|
18
|
-
const
|
|
19
|
-
const
|
|
20
|
-
const
|
|
21
|
-
const
|
|
22
|
-
const
|
|
23
|
-
const
|
|
24
|
-
const cast = require("./cast-DIiyxDLo.cjs");
|
|
15
|
+
const drawFns = require("./drawFns-C-MCkYj6.cjs");
|
|
16
|
+
const vectors = require("./vectors-aQBZK0Sb.cjs");
|
|
17
|
+
const topology = require("./topology-ByOn_z3E.cjs");
|
|
18
|
+
const faceFns = require("./faceFns-DcSCjDG0.cjs");
|
|
19
|
+
const meshFns = require("./meshFns-DWuLC3fk.cjs");
|
|
20
|
+
const booleanFns = require("./booleanFns-ND7sZvhu.cjs");
|
|
21
|
+
const measurement = require("./measurement-lRLwaoqD.cjs");
|
|
22
|
+
const curveBuilders = require("./curveBuilders-BjtdNw1B.cjs");
|
|
23
|
+
const cast = require("./cast-CqDc8oFW.cjs");
|
|
25
24
|
const query = require("./query.cjs");
|
|
26
25
|
const result = require("./result.cjs");
|
|
27
|
-
const cornerFinder = require("./cornerFinder-
|
|
26
|
+
const cornerFinder = require("./cornerFinder-BKsCkrXd.cjs");
|
|
28
27
|
const worker = require("./worker.cjs");
|
|
29
28
|
const errorFactories = {
|
|
30
29
|
OCCT_OPERATION: (code, message, cause) => ({ kind: "OCCT_OPERATION", code, message, cause }),
|
|
@@ -98,9 +97,9 @@ function withNearestPostFilter(baseFinder, nearestPoint) {
|
|
|
98
97
|
const candidates = baseFinder.findAll(shape2);
|
|
99
98
|
if (candidates.length === 0) return [];
|
|
100
99
|
let bestIdx = 0;
|
|
101
|
-
let bestDist = vecOps.vecDistance(
|
|
100
|
+
let bestDist = vecOps.vecDistance(curveFns.vertexPosition(candidates[0]), nearestPoint);
|
|
102
101
|
for (let i = 1; i < candidates.length; i++) {
|
|
103
|
-
const d = vecOps.vecDistance(
|
|
102
|
+
const d = vecOps.vecDistance(curveFns.vertexPosition(candidates[i]), nearestPoint);
|
|
104
103
|
if (d < bestDist) {
|
|
105
104
|
bestDist = d;
|
|
106
105
|
bestIdx = i;
|
|
@@ -130,13 +129,13 @@ function buildVertexFinder(filters) {
|
|
|
130
129
|
buildVertexFinder,
|
|
131
130
|
(_base, withFilter) => ({
|
|
132
131
|
nearestTo: (point) => withNearestPostFilter(buildVertexFinder(filters), point),
|
|
133
|
-
atPosition: (point, tolerance = 1e-4) => withFilter((vertex2) => vecOps.vecDistance(
|
|
132
|
+
atPosition: (point, tolerance = 1e-4) => withFilter((vertex2) => vecOps.vecDistance(curveFns.vertexPosition(vertex2), point) < tolerance),
|
|
134
133
|
withinBox: (min, max) => withFilter((vertex2) => {
|
|
135
|
-
const pos =
|
|
134
|
+
const pos = curveFns.vertexPosition(vertex2);
|
|
136
135
|
return pos[0] >= min[0] - 1e-6 && pos[0] <= max[0] + 1e-6 && pos[1] >= min[1] - 1e-6 && pos[1] <= max[1] + 1e-6 && pos[2] >= min[2] - 1e-6 && pos[2] <= max[2] + 1e-6;
|
|
137
136
|
}),
|
|
138
137
|
atDistance: (distance, point = [0, 0, 0], tolerance = 1e-4) => withFilter((vertex2) => {
|
|
139
|
-
const pos =
|
|
138
|
+
const pos = curveFns.vertexPosition(vertex2);
|
|
140
139
|
return Math.abs(vecOps.vecDistance(pos, point) - distance) < tolerance;
|
|
141
140
|
})
|
|
142
141
|
})
|
|
@@ -198,7 +197,7 @@ function box(width, depth, height, options) {
|
|
|
198
197
|
const solid2 = shapeTypes.createSolid(maker.Solid());
|
|
199
198
|
const center = options?.at ?? (options?.centered ? [0, 0, 0] : void 0);
|
|
200
199
|
if (center) {
|
|
201
|
-
return
|
|
200
|
+
return curveFns.translate(solid2, [center[0] - width / 2, center[1] - depth / 2, center[2] - height / 2]);
|
|
202
201
|
}
|
|
203
202
|
return solid2;
|
|
204
203
|
}
|
|
@@ -212,14 +211,14 @@ function cylinder(radius, height, options) {
|
|
|
212
211
|
-axis[1] * height * 0.5,
|
|
213
212
|
-axis[2] * height * 0.5
|
|
214
213
|
];
|
|
215
|
-
solid2 =
|
|
214
|
+
solid2 = curveFns.translate(solid2, halfShift);
|
|
216
215
|
}
|
|
217
216
|
return solid2;
|
|
218
217
|
}
|
|
219
218
|
function sphere(radius, options) {
|
|
220
219
|
let solid2 = loft$2.makeSphere(radius);
|
|
221
220
|
if (options?.at) {
|
|
222
|
-
solid2 =
|
|
221
|
+
solid2 = curveFns.translate(solid2, options.at);
|
|
223
222
|
}
|
|
224
223
|
return solid2;
|
|
225
224
|
}
|
|
@@ -233,7 +232,7 @@ function cone(bottomRadius, topRadius, height, options) {
|
|
|
233
232
|
-axis[1] * height * 0.5,
|
|
234
233
|
-axis[2] * height * 0.5
|
|
235
234
|
];
|
|
236
|
-
solid2 =
|
|
235
|
+
solid2 = curveFns.translate(solid2, halfShift);
|
|
237
236
|
}
|
|
238
237
|
return solid2;
|
|
239
238
|
}
|
|
@@ -243,7 +242,7 @@ function torus(majorRadius, minorRadius, options) {
|
|
|
243
242
|
function ellipsoid(rx, ry, rz, options) {
|
|
244
243
|
let solid2 = loft$2.makeEllipsoid(rx, ry, rz);
|
|
245
244
|
if (options?.at) {
|
|
246
|
-
solid2 =
|
|
245
|
+
solid2 = curveFns.translate(solid2, options.at);
|
|
247
246
|
}
|
|
248
247
|
return solid2;
|
|
249
248
|
}
|
|
@@ -365,7 +364,7 @@ function fillet$1(shape2, edges, radius) {
|
|
|
365
364
|
)
|
|
366
365
|
);
|
|
367
366
|
}
|
|
368
|
-
const selectedEdges = edges ??
|
|
367
|
+
const selectedEdges = edges ?? curveFns.getEdges(shape2);
|
|
369
368
|
if (selectedEdges.length === 0) {
|
|
370
369
|
return errors.err(
|
|
371
370
|
errors.validationError(
|
|
@@ -432,7 +431,7 @@ function chamfer$1(shape2, edges, distance) {
|
|
|
432
431
|
)
|
|
433
432
|
);
|
|
434
433
|
}
|
|
435
|
-
const selectedEdges = edges ??
|
|
434
|
+
const selectedEdges = edges ?? curveFns.getEdges(shape2);
|
|
436
435
|
if (selectedEdges.length === 0) {
|
|
437
436
|
return errors.err(errors.validationError("NO_EDGES", "No edges found for chamfer"));
|
|
438
437
|
}
|
|
@@ -511,21 +510,21 @@ function offset$1(shape2, distance, tolerance = 1e-6) {
|
|
|
511
510
|
);
|
|
512
511
|
}
|
|
513
512
|
function translate(shape2, v) {
|
|
514
|
-
return
|
|
513
|
+
return curveFns.translate(resolve(shape2), v);
|
|
515
514
|
}
|
|
516
515
|
function rotate(shape2, angle, options) {
|
|
517
516
|
const pivotPoint = options?.at;
|
|
518
|
-
return
|
|
517
|
+
return curveFns.rotate(resolve(shape2), angle, pivotPoint, options?.axis);
|
|
519
518
|
}
|
|
520
519
|
function mirror(shape2, options) {
|
|
521
520
|
const planeOrigin = options?.at;
|
|
522
|
-
return
|
|
521
|
+
return curveFns.mirror(resolve(shape2), options?.normal ?? [1, 0, 0], planeOrigin);
|
|
523
522
|
}
|
|
524
523
|
function scale(shape2, factor, options) {
|
|
525
|
-
return
|
|
524
|
+
return curveFns.scale(resolve(shape2), factor, options?.center);
|
|
526
525
|
}
|
|
527
526
|
function clone(shape2) {
|
|
528
|
-
return
|
|
527
|
+
return curveFns.clone(resolve(shape2));
|
|
529
528
|
}
|
|
530
529
|
function fuse(a, b, options) {
|
|
531
530
|
return booleanFns.fuse(resolve(a), resolve(b), options);
|
|
@@ -608,7 +607,7 @@ function chamfer(shape2, edgesOrDistance, maybeDistance) {
|
|
|
608
607
|
}
|
|
609
608
|
const normalized = normalizeChamferDistance(distance);
|
|
610
609
|
if (normalized.mode === "distAngle") {
|
|
611
|
-
const selectedEdges = edges ??
|
|
610
|
+
const selectedEdges = edges ?? curveFns.getEdges(s);
|
|
612
611
|
return topology.chamferDistAngle(
|
|
613
612
|
s,
|
|
614
613
|
[...selectedEdges],
|
|
@@ -633,7 +632,7 @@ function heal(shape2) {
|
|
|
633
632
|
return topology.heal(resolve(shape2));
|
|
634
633
|
}
|
|
635
634
|
function simplify(shape2) {
|
|
636
|
-
return
|
|
635
|
+
return curveFns.simplify(resolve(shape2));
|
|
637
636
|
}
|
|
638
637
|
function mesh(shape2, options) {
|
|
639
638
|
return meshFns.mesh(resolve(shape2), options);
|
|
@@ -642,10 +641,10 @@ function meshEdges(shape2, options) {
|
|
|
642
641
|
return meshFns.meshEdges(resolve(shape2), options);
|
|
643
642
|
}
|
|
644
643
|
function describe(shape2) {
|
|
645
|
-
return
|
|
644
|
+
return curveFns.describe(resolve(shape2));
|
|
646
645
|
}
|
|
647
646
|
function toBREP(shape2) {
|
|
648
|
-
return
|
|
647
|
+
return curveFns.toBREP(resolve(shape2));
|
|
649
648
|
}
|
|
650
649
|
function fromBREP(data) {
|
|
651
650
|
return cast.fromBREP(data);
|
|
@@ -654,7 +653,7 @@ function isValid(shape2) {
|
|
|
654
653
|
return topology.isValid(resolve(shape2));
|
|
655
654
|
}
|
|
656
655
|
function isEmpty(shape2) {
|
|
657
|
-
return
|
|
656
|
+
return curveFns.isEmpty(resolve(shape2));
|
|
658
657
|
}
|
|
659
658
|
function loft$1(wires, { ruled = true, startPoint, endPoint } = {}, returnShell = false) {
|
|
660
659
|
if (wires.length === 0 && !startPoint && !endPoint) {
|
|
@@ -707,7 +706,7 @@ function loft(wires, options) {
|
|
|
707
706
|
}
|
|
708
707
|
function resolveTargetFace(shape2, faceSpec) {
|
|
709
708
|
if (faceSpec === void 0) {
|
|
710
|
-
const faces =
|
|
709
|
+
const faces = curveFns.getFaces(shape2);
|
|
711
710
|
if (faces.length === 0) {
|
|
712
711
|
throw new Error("compoundOps: shape has no faces");
|
|
713
712
|
}
|
|
@@ -753,7 +752,7 @@ function drill(shape2, options) {
|
|
|
753
752
|
const pos = at.length === 2 ? [at[0], at[1], 0] : [at[0], at[1], at[2]];
|
|
754
753
|
let depth = options.depth;
|
|
755
754
|
if (depth === void 0) {
|
|
756
|
-
const b =
|
|
755
|
+
const b = curveFns.getBounds(s);
|
|
757
756
|
const dx = b.xMax - b.xMin;
|
|
758
757
|
const dy = b.yMax - b.yMin;
|
|
759
758
|
const dz = b.zMax - b.zMin;
|
|
@@ -761,7 +760,7 @@ function drill(shape2, options) {
|
|
|
761
760
|
}
|
|
762
761
|
const cyl = loft$2.makeCylinder(radius, depth, pos, dir);
|
|
763
762
|
const startOffset = options.depth === void 0 ? vecOps.vecScale(dir, -depth / 2) : [0, 0, 0];
|
|
764
|
-
const tool = startOffset[0] !== 0 || startOffset[1] !== 0 || startOffset[2] !== 0 ?
|
|
763
|
+
const tool = startOffset[0] !== 0 || startOffset[1] !== 0 || startOffset[2] !== 0 ? curveFns.translate(cyl, startOffset) : cyl;
|
|
765
764
|
return booleanFns.cut(s, tool);
|
|
766
765
|
}
|
|
767
766
|
function pocket(shape2, options) {
|
|
@@ -800,7 +799,7 @@ function mirrorJoin(shape2, options) {
|
|
|
800
799
|
const s = resolve(shape2);
|
|
801
800
|
const normal = options?.normal ?? [1, 0, 0];
|
|
802
801
|
const planeOrigin = options?.at;
|
|
803
|
-
const mirrored =
|
|
802
|
+
const mirrored = curveFns.mirror(s, normal, planeOrigin);
|
|
804
803
|
return booleanFns.fuse(s, mirrored);
|
|
805
804
|
}
|
|
806
805
|
function rectangularPattern(shape2, options) {
|
|
@@ -827,7 +826,7 @@ function rectangularPattern(shape2, options) {
|
|
|
827
826
|
xNorm[1] * xSpacing * xi + yNorm[1] * ySpacing * yi,
|
|
828
827
|
xNorm[2] * xSpacing * xi + yNorm[2] * ySpacing * yi
|
|
829
828
|
];
|
|
830
|
-
const copy =
|
|
829
|
+
const copy = curveFns.translate(s, offset2);
|
|
831
830
|
const fuseResult = booleanFns.fuse(result2, copy);
|
|
832
831
|
if (errors.isErr(fuseResult)) return fuseResult;
|
|
833
832
|
result2 = fuseResult.value;
|
|
@@ -876,7 +875,7 @@ function createWrappedBase(val) {
|
|
|
876
875
|
rotateX: (a) => wrapAny(rotate(val, a, { axis: [1, 0, 0] })),
|
|
877
876
|
rotateY: (a) => wrapAny(rotate(val, a, { axis: [0, 1, 0] })),
|
|
878
877
|
rotateZ: (a) => wrapAny(rotate(val, a, { axis: [0, 0, 1] })),
|
|
879
|
-
bounds: () =>
|
|
878
|
+
bounds: () => curveFns.getBounds(val),
|
|
880
879
|
describe: () => describe(val),
|
|
881
880
|
clone: () => wrapAny(clone(val)),
|
|
882
881
|
// Meshing & Rendering
|
|
@@ -937,10 +936,10 @@ function createWrapped3D(val) {
|
|
|
937
936
|
volumeProps: () => measurement.measureVolumeProps(val),
|
|
938
937
|
surfaceProps: () => measurement.measureSurfaceProps(val),
|
|
939
938
|
// Queries
|
|
940
|
-
edges: () =>
|
|
941
|
-
faces: () =>
|
|
942
|
-
wires: () =>
|
|
943
|
-
vertices: () =>
|
|
939
|
+
edges: () => curveFns.getEdges(val),
|
|
940
|
+
faces: () => curveFns.getFaces(val),
|
|
941
|
+
wires: () => curveFns.getWires(val),
|
|
942
|
+
vertices: () => curveFns.getVertices(val),
|
|
944
943
|
// Patterns
|
|
945
944
|
linearPattern: (dir, count, spacing) => wrap3D(unwrapOrThrow(operations.linearPattern(val, dir, count, spacing))),
|
|
946
945
|
circularPattern: (axis, count, angle) => wrap3D(unwrapOrThrow(operations.circularPattern(val, axis, count, angle)))
|
|
@@ -1100,10 +1099,23 @@ exports.curveStartPoint = curveFns.curveStartPoint;
|
|
|
1100
1099
|
exports.curveTangentAt = curveFns.curveTangentAt;
|
|
1101
1100
|
exports.findCurveType = curveFns.findCurveType;
|
|
1102
1101
|
exports.flipOrientation = curveFns.flipOrientation;
|
|
1102
|
+
exports.getBounds = curveFns.getBounds;
|
|
1103
1103
|
exports.getCurveType = curveFns.getCurveType;
|
|
1104
|
+
exports.getEdges = curveFns.getEdges;
|
|
1105
|
+
exports.getFaces = curveFns.getFaces;
|
|
1106
|
+
exports.getHashCode = curveFns.getHashCode;
|
|
1104
1107
|
exports.getOrientation = curveFns.getOrientation;
|
|
1108
|
+
exports.getVertices = curveFns.getVertices;
|
|
1109
|
+
exports.getWires = curveFns.getWires;
|
|
1105
1110
|
exports.interpolateCurve = curveFns.interpolateCurve;
|
|
1111
|
+
exports.isEqualShape = curveFns.isEqualShape;
|
|
1112
|
+
exports.isSameShape = curveFns.isSameShape;
|
|
1113
|
+
exports.iterEdges = curveFns.iterEdges;
|
|
1114
|
+
exports.iterFaces = curveFns.iterFaces;
|
|
1115
|
+
exports.iterVertices = curveFns.iterVertices;
|
|
1116
|
+
exports.iterWires = curveFns.iterWires;
|
|
1106
1117
|
exports.offsetWire2D = curveFns.offsetWire2D;
|
|
1118
|
+
exports.vertexPosition = curveFns.vertexPosition;
|
|
1107
1119
|
exports.basicFaceExtrusion = loft$2.basicFaceExtrusion;
|
|
1108
1120
|
exports.genericSweep = loft$2.genericSweep;
|
|
1109
1121
|
exports.revolution = loft$2.revolution;
|
|
@@ -1249,19 +1261,6 @@ exports.createPlane = vectors.createPlane;
|
|
|
1249
1261
|
exports.pivotPlane = vectors.pivotPlane;
|
|
1250
1262
|
exports.resolvePlane = vectors.resolvePlane;
|
|
1251
1263
|
exports.translatePlane = vectors.translatePlane;
|
|
1252
|
-
exports.getBounds = shapeFns.getBounds;
|
|
1253
|
-
exports.getEdges = shapeFns.getEdges;
|
|
1254
|
-
exports.getFaces = shapeFns.getFaces;
|
|
1255
|
-
exports.getHashCode = shapeFns.getHashCode;
|
|
1256
|
-
exports.getVertices = shapeFns.getVertices;
|
|
1257
|
-
exports.getWires = shapeFns.getWires;
|
|
1258
|
-
exports.isEqualShape = shapeFns.isEqualShape;
|
|
1259
|
-
exports.isSameShape = shapeFns.isSameShape;
|
|
1260
|
-
exports.iterEdges = shapeFns.iterEdges;
|
|
1261
|
-
exports.iterFaces = shapeFns.iterFaces;
|
|
1262
|
-
exports.iterVertices = shapeFns.iterVertices;
|
|
1263
|
-
exports.iterWires = shapeFns.iterWires;
|
|
1264
|
-
exports.vertexPosition = shapeFns.vertexPosition;
|
|
1265
1264
|
exports.adjacentFaces = topology.adjacentFaces;
|
|
1266
1265
|
exports.autoHeal = topology.autoHeal;
|
|
1267
1266
|
exports.chamferDistAngleShape = topology.chamferDistAngle;
|