brepjs 8.8.0 → 8.8.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/2d/lib/vectorOperations.d.ts +1 -3
- package/dist/2d/lib/vectorOperations.d.ts.map +1 -1
- package/dist/2d.cjs +2 -2
- package/dist/2d.js +3 -3
- package/dist/{Blueprint-DEhjUTv4.cjs → Blueprint-BmbNUnGI.cjs} +8 -8
- package/dist/{Blueprint-BihoXiSm.js → Blueprint-C-JJkkwL.js} +8 -8
- package/dist/{boolean2D-B7MAHWWy.js → boolean2D-Dgnuy63w.js} +10 -10
- package/dist/{boolean2D-BMw-2GRS.cjs → boolean2D-q5FOdOQW.cjs} +10 -10
- package/dist/{booleanFns-CxU6z_LD.js → booleanFns--Orezl-b.js} +6 -6
- package/dist/{booleanFns-BOrYk5DW.cjs → booleanFns-CFit7JYt.cjs} +6 -6
- package/dist/brepjs.cjs +33 -148
- package/dist/brepjs.js +85 -200
- package/dist/core/errors.d.ts +0 -1
- package/dist/core/errors.d.ts.map +1 -1
- package/dist/core/occtBoundary.d.ts +1 -5
- package/dist/core/occtBoundary.d.ts.map +1 -1
- package/dist/core/planeOps.d.ts +0 -12
- package/dist/core/planeOps.d.ts.map +1 -1
- package/dist/core/vecOps.d.ts +1 -20
- package/dist/core/vecOps.d.ts.map +1 -1
- package/dist/core.cjs +4 -4
- package/dist/core.js +4 -4
- package/dist/{cornerFinder-Dh6RKiNy.js → cornerFinder-KNTFoGrm.js} +1 -1
- package/dist/{cornerFinder-DilC5fiE.cjs → cornerFinder-v4un1Fr9.cjs} +1 -1
- package/dist/{curveFns-BT8cTVDA.cjs → curveFns-6ovDM_sR.cjs} +3 -3
- package/dist/{curveFns-BJG6oqMt.js → curveFns-BhQECv8e.js} +3 -3
- package/dist/{drawFns-DcEDgZzq.cjs → drawFns-WgXeXHH1.cjs} +13 -13
- package/dist/{drawFns-aKd56G2a.js → drawFns-XwroLxdb.js} +13 -13
- package/dist/{errors-Coh_5_19.js → errors-DJ92ermb.js} +0 -2
- package/dist/{errors-eRQu29oc.cjs → errors-NNmTtM5u.cjs} +0 -2
- package/dist/{faceFns-C8ye0H_K.js → faceFns-3PDjBeW7.js} +3 -3
- package/dist/{faceFns-B8fGirMy.cjs → faceFns-CxaLWOjc.cjs} +3 -3
- package/dist/{helpers-MiJaYJMA.cjs → helpers-CRfqaW0Y.cjs} +6 -6
- package/dist/{helpers-8QToWU3Q.js → helpers-CtBCzEqs.js} +6 -6
- package/dist/io/objImportFns.d.ts.map +1 -1
- package/dist/io/threemfImportFns.d.ts.map +1 -1
- package/dist/io.cjs +5 -5
- package/dist/io.js +5 -5
- package/dist/kernel/constructorOps.d.ts +6 -0
- package/dist/kernel/constructorOps.d.ts.map +1 -1
- package/dist/kernel/hullOps.d.ts.map +1 -1
- package/dist/{loft-DCEZpu53.cjs → loft-CVb-IjEI.cjs} +7 -7
- package/dist/{loft-C810lPN5.js → loft-DMFjK6lk.js} +7 -7
- package/dist/{measurement-BFotSPr0.cjs → measurement-CecYIt3s.cjs} +3 -3
- package/dist/{measurement-BT2jlvKC.js → measurement-DHDLAH7-.js} +3 -3
- package/dist/measurement.cjs +1 -1
- package/dist/measurement.js +1 -1
- package/dist/{meshFns-CxYud6A4.cjs → meshFns-CPNNlpbw.cjs} +3 -3
- package/dist/{meshFns-DPbSUo0q.js → meshFns-DAmWVyEp.js} +3 -3
- package/dist/{occtBoundary-ChEJsbOT.cjs → occtBoundary-Cqfsau2c.cjs} +31 -29
- package/dist/{occtBoundary-DC1yVJex.js → occtBoundary-DvBywHyU.js} +38 -36
- package/dist/operations/exporterUtils.d.ts +0 -9
- package/dist/operations/exporterUtils.d.ts.map +1 -1
- package/dist/operations/roofFns.d.ts.map +1 -1
- package/dist/{operations-CckDdRJ0.cjs → operations-BQ25CPI8.cjs} +6 -6
- package/dist/{operations-IFpeXZme.js → operations-vN0tcoaU.js} +6 -6
- 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/result.cjs +1 -1
- package/dist/result.js +1 -1
- package/dist/{shapeFns-CQWvvjmd.cjs → shapeFns-C785aeVn.cjs} +4 -4
- package/dist/{shapeFns-BTnqah-6.js → shapeFns-ClpALED4.js} +4 -4
- package/dist/{shapeTypes-MK0PKst9.cjs → shapeTypes-CIijJxCz.cjs} +1 -1
- package/dist/{shapeTypes-BVd0rRNe.js → shapeTypes-DnwCo942.js} +1 -1
- package/dist/sketching.cjs +2 -2
- package/dist/sketching.js +2 -2
- package/dist/{surfaceBuilders-5Ci2Du77.cjs → surfaceBuilders-CC0ZQGix.cjs} +5 -5
- package/dist/{surfaceBuilders-nuWe3gns.js → surfaceBuilders-CrJtFu2a.js} +5 -5
- package/dist/topology/api.d.ts.map +1 -1
- package/dist/topology/surfaceFns.d.ts.map +1 -1
- package/dist/{topology-P-u0NDwX.js → topology-CqyxpmEh.js} +8 -8
- package/dist/{topology-C06jndeV.cjs → topology-zG8maSDK.cjs} +8 -8
- package/dist/topology.cjs +6 -6
- package/dist/topology.js +6 -6
- package/dist/{vectors-Dp17lKnm.js → vectors-2lOjaa8N.js} +2 -2
- package/dist/{vectors-DrAMMsHl.cjs → vectors-CGLqemPY.cjs} +2 -2
- package/dist/vectors.cjs +2 -2
- package/dist/vectors.js +2 -2
- package/package.json +4 -4
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { Point2D } from './definitions.js';
|
|
2
2
|
/** Test whether two 2D points are equal within a given precision. */
|
|
3
3
|
export declare const samePoint: ([x0, y0]: Point2D, [x1, y1]: Point2D, precision?: number) => boolean;
|
|
4
4
|
/** Add two 2D vectors component-wise. */
|
|
@@ -42,6 +42,4 @@ export declare const polarToCartesian: (r: number, theta: number) => Point2D;
|
|
|
42
42
|
* @returns A tuple of `[radius, theta]`.
|
|
43
43
|
*/
|
|
44
44
|
export declare const cartesianToPolar: ([x, y]: Point2D) => [number, number];
|
|
45
|
-
/** Compute the determinant of a 2x2 matrix. */
|
|
46
|
-
export declare const determinant2x2: (matrix: Matrix2X2) => number;
|
|
47
45
|
//# sourceMappingURL=vectorOperations.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"vectorOperations.d.ts","sourceRoot":"","sources":["../../../src/2d/lib/vectorOperations.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,
|
|
1
|
+
{"version":3,"file":"vectorOperations.d.ts","sourceRoot":"","sources":["../../../src/2d/lib/vectorOperations.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,kBAAkB,CAAC;AAIhD,qEAAqE;AACrE,eAAO,MAAM,SAAS,GACpB,UAAU,OAAO,EACjB,UAAU,OAAO,EACjB,kBAA2B,KAC1B,OAEF,CAAC;AAEF,yCAAyC;AACzC,eAAO,MAAM,KAAK,GAAI,UAAU,OAAO,EAAE,UAAU,OAAO,KAAG,OAE5D,CAAC;AAEF,oDAAoD;AACpD,eAAO,MAAM,UAAU,GAAI,UAAU,OAAO,EAAE,UAAU,OAAO,KAAG,OAEjE,CAAC;AAEF,wCAAwC;AACxC,eAAO,MAAM,gBAAgB,GAAI,UAAU,OAAO,EAAE,QAAQ,MAAM,KAAG,OAEpE,CAAC;AAEF,+FAA+F;AAC/F,eAAO,MAAM,UAAU,GAAI,UAAU,OAAO,EAAE,WAAU,OAAgB,KAAG,MAE1E,CAAC;AAEF,oFAAoF;AACpF,eAAO,MAAM,gBAAgB,GAAI,UAAU,OAAO,EAAE,WAAU,OAAgB,KAAG,MAEhF,CAAC;AAEF,0EAA0E;AAC1E,wBAAgB,cAAc,CAAC,CAAC,EAAE,EAAE,EAAE,CAAC,EAAE,OAAO,EAAE,CAAC,EAAE,EAAE,EAAE,CAAC,EAAE,OAAO,GAAG,MAAM,CAE3E;AAED,iDAAiD;AACjD,wBAAgB,YAAY,CAAC,CAAC,EAAE,EAAE,EAAE,CAAC,EAAE,OAAO,EAAE,CAAC,EAAE,EAAE,EAAE,CAAC,EAAE,OAAO,GAAG,MAAM,CAEzE;AAED,oEAAoE;AACpE,eAAO,MAAM,OAAO,GAAI,UAAU,OAAO,EAAE,WAAU,OAAgB,KAAG,MAEvE,CAAC;AAEF,+EAA+E;AAC/E,eAAO,MAAM,YAAY,GAAI,UAAU,OAAO,EAAE,WAAU,OAAgB,KAAG,MAE5E,CAAC;AAEF;;;;GAIG;AACH,eAAO,MAAM,WAAW,GAAI,UAAU,OAAO,KAAG,OAM/C,CAAC;AAEF;;;;;;;GAOG;AACH,eAAO,MAAM,QAAQ,GAAI,OAAO,OAAO,EAAE,OAAO,MAAM,EAAE,SAAQ,OAAgB,KAAG,OAclF,CAAC;AAEF,mEAAmE;AACnE,eAAO,MAAM,gBAAgB,GAAI,GAAG,MAAM,EAAE,OAAO,MAAM,KAAG,OAI3D,CAAC;AAEF;;;;GAIG;AACH,eAAO,MAAM,gBAAgB,GAAI,QAAQ,OAAO,KAAG,CAAC,MAAM,EAAE,MAAM,CAKjE,CAAC"}
|
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-BmbNUnGI.cjs");
|
|
4
|
+
const boolean2D = require("./boolean2D-q5FOdOQW.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 { d, C, r } from "./Blueprint-
|
|
3
|
-
import { e, C as C2, f, l, g, n, k, q, o, p, r as r2 } from "./boolean2D-
|
|
1
|
+
import { B as Blueprint } from "./Blueprint-C-JJkkwL.js";
|
|
2
|
+
import { d, C, r } from "./Blueprint-C-JJkkwL.js";
|
|
3
|
+
import { e, C as C2, f, l, g, n, k, q, o, p, r as r2 } from "./boolean2D-Dgnuy63w.js";
|
|
4
4
|
function reverseCurve(curve) {
|
|
5
5
|
const cloned = curve.clone();
|
|
6
6
|
cloned.reverse();
|
|
@@ -1,12 +1,12 @@
|
|
|
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-
|
|
7
|
-
const errors = require("./errors-
|
|
8
|
-
const surfaceBuilders = require("./surfaceBuilders-
|
|
9
|
-
const helpers = require("./helpers-
|
|
2
|
+
const vectors = require("./vectors-CGLqemPY.cjs");
|
|
3
|
+
const occtBoundary = require("./occtBoundary-Cqfsau2c.cjs");
|
|
4
|
+
const shapeTypes = require("./shapeTypes-CIijJxCz.cjs");
|
|
5
|
+
const faceFns = require("./faceFns-CxaLWOjc.cjs");
|
|
6
|
+
const curveFns = require("./curveFns-6ovDM_sR.cjs");
|
|
7
|
+
const errors = require("./errors-NNmTtM5u.cjs");
|
|
8
|
+
const surfaceBuilders = require("./surfaceBuilders-CC0ZQGix.cjs");
|
|
9
|
+
const helpers = require("./helpers-CRfqaW0Y.cjs");
|
|
10
10
|
const vecOps = require("./vecOps-CjRL1jau.cjs");
|
|
11
11
|
const result = require("./result.cjs");
|
|
12
12
|
function makePlane(plane, origin) {
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import { r as resolvePlane } from "./vectors-
|
|
2
|
-
import { g as getKernel, a as toVec3, c as makeOcAx2 } from "./occtBoundary-
|
|
3
|
-
import { r as localGC, v as registerForCleanup, x as unregisterFromCleanup, n as gcWithScope, p as createEdge, o as createWire } from "./shapeTypes-
|
|
4
|
-
import { u as uvBounds, f as faceGeomType, e as faceCenter, h as uvCoordinates, c as cast } from "./faceFns-
|
|
5
|
-
import { f as findCurveType, g as getOrientation } from "./curveFns-
|
|
6
|
-
import { u as unwrap, l as ok, e as err, b as computationError, x as validationError } from "./errors-
|
|
7
|
-
import { z as zip, m as makeFace } from "./surfaceBuilders-
|
|
8
|
-
import { d as distance2d, s as samePoint, b as scalarMultiply2d, c as add2d, n as normalize2d, e as subtract2d, g as getSingleFace } from "./helpers-
|
|
1
|
+
import { r as resolvePlane } from "./vectors-2lOjaa8N.js";
|
|
2
|
+
import { g as getKernel, a as toVec3, c as makeOcAx2 } from "./occtBoundary-DvBywHyU.js";
|
|
3
|
+
import { r as localGC, v as registerForCleanup, x as unregisterFromCleanup, n as gcWithScope, p as createEdge, o as createWire } from "./shapeTypes-DnwCo942.js";
|
|
4
|
+
import { u as uvBounds, f as faceGeomType, e as faceCenter, h as uvCoordinates, c as cast } from "./faceFns-3PDjBeW7.js";
|
|
5
|
+
import { f as findCurveType, g as getOrientation } from "./curveFns-BhQECv8e.js";
|
|
6
|
+
import { u as unwrap, l as ok, e as err, b as computationError, x as validationError } from "./errors-DJ92ermb.js";
|
|
7
|
+
import { z as zip, m as makeFace } from "./surfaceBuilders-CrJtFu2a.js";
|
|
8
|
+
import { d as distance2d, s as samePoint, b as scalarMultiply2d, c as add2d, n as normalize2d, e as subtract2d, g as getSingleFace } from "./helpers-CtBCzEqs.js";
|
|
9
9
|
import { R as RAD2DEG, D as DEG2RAD } from "./vecOps-ZDdZWbwT.js";
|
|
10
10
|
import { bug } from "./result.js";
|
|
11
11
|
function makePlane(plane, origin) {
|
|
@@ -1,15 +1,15 @@
|
|
|
1
|
-
import { a as createPlane } from "./vectors-
|
|
2
|
-
import { l as ok, e as err, b as computationError, u as unwrap, g as isOk } from "./errors-
|
|
3
|
-
import { d as downcast, u as uvBounds, p as pointOnSurface, n as normalAt } from "./faceFns-
|
|
4
|
-
import { g as getKernel, a as toVec3 } from "./occtBoundary-
|
|
1
|
+
import { a as createPlane } from "./vectors-2lOjaa8N.js";
|
|
2
|
+
import { l as ok, e as err, b as computationError, u as unwrap, g as isOk } from "./errors-DJ92ermb.js";
|
|
3
|
+
import { d as downcast, u as uvBounds, p as pointOnSurface, n as normalAt } from "./faceFns-3PDjBeW7.js";
|
|
4
|
+
import { g as getKernel, a as toVec3 } from "./occtBoundary-DvBywHyU.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, c as complexExtrude, t as twistExtrude, b as basicFaceExtrusion, g as genericSweep, l as loft } from "./loft-
|
|
7
|
-
import { n as gcWithScope, q as createFace, o as createWire, r as localGC, p as createEdge } from "./shapeTypes-
|
|
8
|
-
import { d as curveStartPoint, c as curveTangentAt, e as curveIsClosed } from "./curveFns-
|
|
9
|
-
import { m as makeFace, l as makeNewFaceWithinFace, b as assembleWire, z as zip } from "./surfaceBuilders-
|
|
6
|
+
import { r as revolution, c as complexExtrude, t as twistExtrude, b as basicFaceExtrusion, g as genericSweep, l as loft } from "./loft-DMFjK6lk.js";
|
|
7
|
+
import { n as gcWithScope, q as createFace, o as createWire, r as localGC, p as createEdge } from "./shapeTypes-DnwCo942.js";
|
|
8
|
+
import { d as curveStartPoint, c as curveTangentAt, e as curveIsClosed } from "./curveFns-BhQECv8e.js";
|
|
9
|
+
import { m as makeFace, l as makeNewFaceWithinFace, b as assembleWire, z as zip } from "./surfaceBuilders-CrJtFu2a.js";
|
|
10
10
|
import { bug } from "./result.js";
|
|
11
|
-
import { s as samePoint$1, n as normalize2d, e as subtract2d, c as add2d, i as crossProduct2d, b as scalarMultiply2d, f as polarToCartesian, r as rotate2d, j as cartesianToPolar, d as distance2d, p as polarAngle2d, k as PRECISION_INTERSECTION } from "./helpers-
|
|
12
|
-
import { C as Curve2D, a as make2dSegmentCurve, j as approximateAsBSpline, b as make2dArcFromCenter, k as isPoint2D, g as make2dCircle, l as make2dThreePointArc, d as BoundingBox2d, v as viewbox, n as asSVG, B as Blueprint, o as make2dEllipseArc, p as make2dTangentArc, q as make2dBezierCurve, r as axis2d, s as removeDuplicatePoints } from "./Blueprint-
|
|
11
|
+
import { s as samePoint$1, n as normalize2d, e as subtract2d, c as add2d, i as crossProduct2d, b as scalarMultiply2d, f as polarToCartesian, r as rotate2d, j as cartesianToPolar, d as distance2d, p as polarAngle2d, k as PRECISION_INTERSECTION } from "./helpers-CtBCzEqs.js";
|
|
12
|
+
import { C as Curve2D, a as make2dSegmentCurve, j as approximateAsBSpline, b as make2dArcFromCenter, k as isPoint2D, g as make2dCircle, l as make2dThreePointArc, d as BoundingBox2d, v as viewbox, n as asSVG, B as Blueprint, o as make2dEllipseArc, p as make2dTangentArc, q as make2dBezierCurve, r as axis2d, s as removeDuplicatePoints } from "./Blueprint-C-JJkkwL.js";
|
|
13
13
|
function* pointsIteration(intersector) {
|
|
14
14
|
const nPoints = intersector.NbPoints();
|
|
15
15
|
if (!nPoints) return;
|
|
@@ -1,16 +1,16 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
const vectors = require("./vectors-
|
|
3
|
-
const errors = require("./errors-
|
|
4
|
-
const faceFns = require("./faceFns-
|
|
5
|
-
const occtBoundary = require("./occtBoundary-
|
|
2
|
+
const vectors = require("./vectors-CGLqemPY.cjs");
|
|
3
|
+
const errors = require("./errors-NNmTtM5u.cjs");
|
|
4
|
+
const faceFns = require("./faceFns-CxaLWOjc.cjs");
|
|
5
|
+
const occtBoundary = require("./occtBoundary-Cqfsau2c.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 surfaceBuilders = require("./surfaceBuilders-
|
|
7
|
+
const loft = require("./loft-CVb-IjEI.cjs");
|
|
8
|
+
const shapeTypes = require("./shapeTypes-CIijJxCz.cjs");
|
|
9
|
+
const curveFns = require("./curveFns-6ovDM_sR.cjs");
|
|
10
|
+
const surfaceBuilders = require("./surfaceBuilders-CC0ZQGix.cjs");
|
|
11
11
|
const result = require("./result.cjs");
|
|
12
|
-
const helpers = require("./helpers-
|
|
13
|
-
const Blueprint = require("./Blueprint-
|
|
12
|
+
const helpers = require("./helpers-CRfqaW0Y.cjs");
|
|
13
|
+
const Blueprint = require("./Blueprint-BmbNUnGI.cjs");
|
|
14
14
|
function* pointsIteration(intersector) {
|
|
15
15
|
const nPoints = intersector.NbPoints();
|
|
16
16
|
if (!nPoints) return;
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import { g as getKernel } from "./occtBoundary-
|
|
2
|
-
import { n as gcWithScope, c as castShape, h as isShape3D } from "./shapeTypes-
|
|
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-
|
|
4
|
-
import { r as resolvePlane } from "./vectors-
|
|
1
|
+
import { g as getKernel } from "./occtBoundary-DvBywHyU.js";
|
|
2
|
+
import { n as gcWithScope, c as castShape, h as isShape3D } from "./shapeTypes-DnwCo942.js";
|
|
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-DJ92ermb.js";
|
|
4
|
+
import { r as resolvePlane } from "./vectors-2lOjaa8N.js";
|
|
5
5
|
import { H as HASH_CODE_MAX, n as vecScale, v as vecAdd } from "./vecOps-ZDdZWbwT.js";
|
|
6
|
-
import { a as getFaces, p as propagateOrigins, b as propagateOriginsByHash, c as getWires, d as getEdges } from "./shapeFns-
|
|
7
|
-
import { m as makeFace } from "./surfaceBuilders-
|
|
6
|
+
import { a as getFaces, p as propagateOrigins, b as propagateOriginsByHash, c as getWires, d as getEdges } from "./shapeFns-ClpALED4.js";
|
|
7
|
+
import { m as makeFace } from "./surfaceBuilders-CrJtFu2a.js";
|
|
8
8
|
function applyGlue(op, optimisation) {
|
|
9
9
|
const oc = getKernel().oc;
|
|
10
10
|
if (optimisation === "commonFace") {
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
const occtBoundary = require("./occtBoundary-
|
|
3
|
-
const shapeTypes = require("./shapeTypes-
|
|
4
|
-
const errors = require("./errors-
|
|
5
|
-
const vectors = require("./vectors-
|
|
2
|
+
const occtBoundary = require("./occtBoundary-Cqfsau2c.cjs");
|
|
3
|
+
const shapeTypes = require("./shapeTypes-CIijJxCz.cjs");
|
|
4
|
+
const errors = require("./errors-NNmTtM5u.cjs");
|
|
5
|
+
const vectors = require("./vectors-CGLqemPY.cjs");
|
|
6
6
|
const vecOps = require("./vecOps-CjRL1jau.cjs");
|
|
7
|
-
const shapeFns = require("./shapeFns-
|
|
8
|
-
const surfaceBuilders = require("./surfaceBuilders-
|
|
7
|
+
const shapeFns = require("./shapeFns-C785aeVn.cjs");
|
|
8
|
+
const surfaceBuilders = require("./surfaceBuilders-CC0ZQGix.cjs");
|
|
9
9
|
function applyGlue(op, optimisation) {
|
|
10
10
|
const oc = occtBoundary.getKernel().oc;
|
|
11
11
|
if (optimisation === "commonFace") {
|
package/dist/brepjs.cjs
CHANGED
|
@@ -1,29 +1,29 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
3
|
-
const occtBoundary = require("./occtBoundary-
|
|
4
|
-
const errors = require("./errors-
|
|
5
|
-
const shapeTypes = require("./shapeTypes-
|
|
3
|
+
const occtBoundary = require("./occtBoundary-Cqfsau2c.cjs");
|
|
4
|
+
const errors = require("./errors-NNmTtM5u.cjs");
|
|
5
|
+
const shapeTypes = require("./shapeTypes-CIijJxCz.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-BmbNUnGI.cjs");
|
|
8
|
+
const curveFns = require("./curveFns-6ovDM_sR.cjs");
|
|
9
|
+
const loft$2 = require("./loft-CVb-IjEI.cjs");
|
|
10
|
+
const operations = require("./operations-BQ25CPI8.cjs");
|
|
11
|
+
const boolean2D = require("./boolean2D-q5FOdOQW.cjs");
|
|
12
12
|
const _2d = require("./2d.cjs");
|
|
13
|
-
const helpers = require("./helpers-
|
|
13
|
+
const helpers = require("./helpers-CRfqaW0Y.cjs");
|
|
14
14
|
const io = require("./io.cjs");
|
|
15
|
-
const drawFns = require("./drawFns-
|
|
16
|
-
const vectors = require("./vectors-
|
|
17
|
-
const shapeFns = require("./shapeFns-
|
|
18
|
-
const booleanFns = require("./booleanFns-
|
|
19
|
-
const topology = require("./topology-
|
|
20
|
-
const faceFns = require("./faceFns-
|
|
21
|
-
const meshFns = require("./meshFns-
|
|
22
|
-
const measurement = require("./measurement-
|
|
23
|
-
const surfaceBuilders = require("./surfaceBuilders-
|
|
15
|
+
const drawFns = require("./drawFns-WgXeXHH1.cjs");
|
|
16
|
+
const vectors = require("./vectors-CGLqemPY.cjs");
|
|
17
|
+
const shapeFns = require("./shapeFns-C785aeVn.cjs");
|
|
18
|
+
const booleanFns = require("./booleanFns-CFit7JYt.cjs");
|
|
19
|
+
const topology = require("./topology-zG8maSDK.cjs");
|
|
20
|
+
const faceFns = require("./faceFns-CxaLWOjc.cjs");
|
|
21
|
+
const meshFns = require("./meshFns-CPNNlpbw.cjs");
|
|
22
|
+
const measurement = require("./measurement-CecYIt3s.cjs");
|
|
23
|
+
const surfaceBuilders = require("./surfaceBuilders-CC0ZQGix.cjs");
|
|
24
24
|
const query = require("./query.cjs");
|
|
25
25
|
const result = require("./result.cjs");
|
|
26
|
-
const cornerFinder = require("./cornerFinder-
|
|
26
|
+
const cornerFinder = require("./cornerFinder-v4un1Fr9.cjs");
|
|
27
27
|
const worker = require("./worker.cjs");
|
|
28
28
|
const errorFactories = {
|
|
29
29
|
OCCT_OPERATION: (code, message, cause) => ({ kind: "OCCT_OPERATION", code, message, cause }),
|
|
@@ -236,35 +236,7 @@ function buildTriangulatedSurface(heights, rows, cols, dx, dy, scaleZ) {
|
|
|
236
236
|
function pt(r, c) {
|
|
237
237
|
const row = heights[r];
|
|
238
238
|
const z = (row ? row[c] ?? 0 : 0) * scaleZ;
|
|
239
|
-
return
|
|
240
|
-
}
|
|
241
|
-
function buildTriFace2(a, b, c) {
|
|
242
|
-
const gpA = new oc.gp_Pnt_3(a.x, a.y, a.z);
|
|
243
|
-
const gpB = new oc.gp_Pnt_3(b.x, b.y, b.z);
|
|
244
|
-
const gpC = new oc.gp_Pnt_3(c.x, c.y, c.z);
|
|
245
|
-
const e1 = new oc.BRepBuilderAPI_MakeEdge_3(gpA, gpB);
|
|
246
|
-
const e2 = new oc.BRepBuilderAPI_MakeEdge_3(gpB, gpC);
|
|
247
|
-
const e3 = new oc.BRepBuilderAPI_MakeEdge_3(gpC, gpA);
|
|
248
|
-
const wireBuilder = new oc.BRepBuilderAPI_MakeWire_1();
|
|
249
|
-
wireBuilder.Add_1(e1.Edge());
|
|
250
|
-
wireBuilder.Add_1(e2.Edge());
|
|
251
|
-
wireBuilder.Add_1(e3.Edge());
|
|
252
|
-
let face2 = null;
|
|
253
|
-
if (wireBuilder.IsDone()) {
|
|
254
|
-
const makeFace = new oc.BRepBuilderAPI_MakeFace_15(wireBuilder.Wire(), false);
|
|
255
|
-
if (makeFace.IsDone()) {
|
|
256
|
-
face2 = makeFace.Face();
|
|
257
|
-
}
|
|
258
|
-
makeFace.delete();
|
|
259
|
-
}
|
|
260
|
-
wireBuilder.delete();
|
|
261
|
-
e1.delete();
|
|
262
|
-
e2.delete();
|
|
263
|
-
e3.delete();
|
|
264
|
-
gpA.delete();
|
|
265
|
-
gpB.delete();
|
|
266
|
-
gpC.delete();
|
|
267
|
-
return face2;
|
|
239
|
+
return [c * dx, r * dy, z];
|
|
268
240
|
}
|
|
269
241
|
const sewing = new oc.BRepBuilderAPI_Sewing(1e-6, true, true, true, false);
|
|
270
242
|
let faceCount = 0;
|
|
@@ -275,12 +247,12 @@ function buildTriangulatedSurface(heights, rows, cols, dx, dy, scaleZ) {
|
|
|
275
247
|
const p10 = pt(r + 1, c);
|
|
276
248
|
const p11 = pt(r + 1, c + 1);
|
|
277
249
|
const p01 = pt(r, c + 1);
|
|
278
|
-
const f1 =
|
|
250
|
+
const f1 = occtBoundary.makeTriFace(oc, p00, p10, p11);
|
|
279
251
|
if (f1 !== null) {
|
|
280
252
|
sewing.Add(f1);
|
|
281
253
|
faceCount++;
|
|
282
254
|
}
|
|
283
|
-
const f2 =
|
|
255
|
+
const f2 = occtBoundary.makeTriFace(oc, p00, p11, p01);
|
|
284
256
|
if (f2 !== null) {
|
|
285
257
|
sewing.Add(f2);
|
|
286
258
|
faceCount++;
|
|
@@ -494,7 +466,7 @@ function minkowskiSphere(shape2, radius, tolerance) {
|
|
|
494
466
|
);
|
|
495
467
|
}
|
|
496
468
|
}
|
|
497
|
-
function minkowskiGeneral(shape2, tool,
|
|
469
|
+
function minkowskiGeneral(shape2, tool, tolerance) {
|
|
498
470
|
const oc = occtBoundary.getKernel().oc;
|
|
499
471
|
try {
|
|
500
472
|
const shapeVerts = shapeFns.getVertices(shape2);
|
|
@@ -524,7 +496,7 @@ function minkowskiGeneral(shape2, tool, _tolerance) {
|
|
|
524
496
|
}
|
|
525
497
|
}
|
|
526
498
|
const kernel = occtBoundary.getKernel();
|
|
527
|
-
const hullShape = kernel.hullFromPoints(sumPoints,
|
|
499
|
+
const hullShape = kernel.hullFromPoints(sumPoints, tolerance);
|
|
528
500
|
const wrapped = shapeTypes.castShape(hullShape);
|
|
529
501
|
if (!shapeTypes.isShape3D(wrapped)) {
|
|
530
502
|
wrapped[Symbol.dispose]();
|
|
@@ -1078,34 +1050,6 @@ function fanTriangulate(count) {
|
|
|
1078
1050
|
}
|
|
1079
1051
|
return tris;
|
|
1080
1052
|
}
|
|
1081
|
-
function buildTriFace$2(oc, a, b, c) {
|
|
1082
|
-
const gpA = new oc.gp_Pnt_3(a[0], a[1], a[2]);
|
|
1083
|
-
const gpB = new oc.gp_Pnt_3(b[0], b[1], b[2]);
|
|
1084
|
-
const gpC = new oc.gp_Pnt_3(c[0], c[1], c[2]);
|
|
1085
|
-
const e1 = new oc.BRepBuilderAPI_MakeEdge_3(gpA, gpB);
|
|
1086
|
-
const e2 = new oc.BRepBuilderAPI_MakeEdge_3(gpB, gpC);
|
|
1087
|
-
const e3 = new oc.BRepBuilderAPI_MakeEdge_3(gpC, gpA);
|
|
1088
|
-
const wireBuilder = new oc.BRepBuilderAPI_MakeWire_1();
|
|
1089
|
-
wireBuilder.Add_1(e1.Edge());
|
|
1090
|
-
wireBuilder.Add_1(e2.Edge());
|
|
1091
|
-
wireBuilder.Add_1(e3.Edge());
|
|
1092
|
-
let face2 = null;
|
|
1093
|
-
if (wireBuilder.IsDone()) {
|
|
1094
|
-
const makeFace = new oc.BRepBuilderAPI_MakeFace_15(wireBuilder.Wire(), false);
|
|
1095
|
-
if (makeFace.IsDone()) {
|
|
1096
|
-
face2 = makeFace.Face();
|
|
1097
|
-
}
|
|
1098
|
-
makeFace.delete();
|
|
1099
|
-
}
|
|
1100
|
-
wireBuilder.delete();
|
|
1101
|
-
e1.delete();
|
|
1102
|
-
e2.delete();
|
|
1103
|
-
e3.delete();
|
|
1104
|
-
gpA.delete();
|
|
1105
|
-
gpB.delete();
|
|
1106
|
-
gpC.delete();
|
|
1107
|
-
return face2;
|
|
1108
|
-
}
|
|
1109
1053
|
function roof(w, options) {
|
|
1110
1054
|
const angle = (options?.angle ?? 45) * (Math.PI / 180);
|
|
1111
1055
|
const tanAngle = Math.tan(angle);
|
|
@@ -1151,7 +1095,7 @@ function roof(w, options) {
|
|
|
1151
1095
|
const nz = abx * acy - aby * acx;
|
|
1152
1096
|
const areaSq = nx * nx + ny * ny + nz * nz;
|
|
1153
1097
|
if (areaSq < 1e-20) continue;
|
|
1154
|
-
const triFace =
|
|
1098
|
+
const triFace = occtBoundary.makeTriFace(oc, va, vb, vc);
|
|
1155
1099
|
if (triFace !== null) {
|
|
1156
1100
|
sewing.Add(triFace);
|
|
1157
1101
|
faceCount++;
|
|
@@ -1167,7 +1111,7 @@ function roof(w, options) {
|
|
|
1167
1111
|
const va = [p0.x, p0.y, 0];
|
|
1168
1112
|
const vb = [pi.x, pi.y, 0];
|
|
1169
1113
|
const vc = [pi1.x, pi1.y, 0];
|
|
1170
|
-
const triFace =
|
|
1114
|
+
const triFace = occtBoundary.makeTriFace(oc, va, vc, vb);
|
|
1171
1115
|
if (triFace !== null) {
|
|
1172
1116
|
sewing.Add(triFace);
|
|
1173
1117
|
faceCount++;
|
|
@@ -1608,7 +1552,7 @@ function buildSolidFromMesh$1(vertices, faces) {
|
|
|
1608
1552
|
const vb = vertices[bi];
|
|
1609
1553
|
const vc = vertices[ci];
|
|
1610
1554
|
if (!va || !vb || !vc) continue;
|
|
1611
|
-
const triFace =
|
|
1555
|
+
const triFace = occtBoundary.makeTriFace(oc, va, vb, vc);
|
|
1612
1556
|
if (triFace !== null) {
|
|
1613
1557
|
sewing.Add(triFace);
|
|
1614
1558
|
faceCount++;
|
|
@@ -1638,34 +1582,6 @@ function buildSolidFromMesh$1(vertices, faces) {
|
|
|
1638
1582
|
sewing.delete();
|
|
1639
1583
|
}
|
|
1640
1584
|
}
|
|
1641
|
-
function buildTriFace$1(oc, a, b, c) {
|
|
1642
|
-
const gpA = new oc.gp_Pnt_3(a[0], a[1], a[2]);
|
|
1643
|
-
const gpB = new oc.gp_Pnt_3(b[0], b[1], b[2]);
|
|
1644
|
-
const gpC = new oc.gp_Pnt_3(c[0], c[1], c[2]);
|
|
1645
|
-
const e1 = new oc.BRepBuilderAPI_MakeEdge_3(gpA, gpB);
|
|
1646
|
-
const e2 = new oc.BRepBuilderAPI_MakeEdge_3(gpB, gpC);
|
|
1647
|
-
const e3 = new oc.BRepBuilderAPI_MakeEdge_3(gpC, gpA);
|
|
1648
|
-
const wireBuilder = new oc.BRepBuilderAPI_MakeWire_1();
|
|
1649
|
-
wireBuilder.Add_1(e1.Edge());
|
|
1650
|
-
wireBuilder.Add_1(e2.Edge());
|
|
1651
|
-
wireBuilder.Add_1(e3.Edge());
|
|
1652
|
-
let face2 = null;
|
|
1653
|
-
if (wireBuilder.IsDone()) {
|
|
1654
|
-
const makeFace = new oc.BRepBuilderAPI_MakeFace_15(wireBuilder.Wire(), false);
|
|
1655
|
-
if (makeFace.IsDone()) {
|
|
1656
|
-
face2 = makeFace.Face();
|
|
1657
|
-
}
|
|
1658
|
-
makeFace.delete();
|
|
1659
|
-
}
|
|
1660
|
-
wireBuilder.delete();
|
|
1661
|
-
e1.delete();
|
|
1662
|
-
e2.delete();
|
|
1663
|
-
e3.delete();
|
|
1664
|
-
gpA.delete();
|
|
1665
|
-
gpB.delete();
|
|
1666
|
-
gpC.delete();
|
|
1667
|
-
return face2;
|
|
1668
|
-
}
|
|
1669
1585
|
function extractFromZip(data, target) {
|
|
1670
1586
|
let eocdOffset = -1;
|
|
1671
1587
|
for (let i = data.length - 22; i >= 0; i--) {
|
|
@@ -1762,34 +1678,6 @@ function parseModelXml(xml) {
|
|
|
1762
1678
|
}
|
|
1763
1679
|
return { vertices, triangles };
|
|
1764
1680
|
}
|
|
1765
|
-
function buildTriFace(oc, a, b, c) {
|
|
1766
|
-
const gpA = new oc.gp_Pnt_3(a[0], a[1], a[2]);
|
|
1767
|
-
const gpB = new oc.gp_Pnt_3(b[0], b[1], b[2]);
|
|
1768
|
-
const gpC = new oc.gp_Pnt_3(c[0], c[1], c[2]);
|
|
1769
|
-
const e1 = new oc.BRepBuilderAPI_MakeEdge_3(gpA, gpB);
|
|
1770
|
-
const e2 = new oc.BRepBuilderAPI_MakeEdge_3(gpB, gpC);
|
|
1771
|
-
const e3 = new oc.BRepBuilderAPI_MakeEdge_3(gpC, gpA);
|
|
1772
|
-
const wireBuilder = new oc.BRepBuilderAPI_MakeWire_1();
|
|
1773
|
-
wireBuilder.Add_1(e1.Edge());
|
|
1774
|
-
wireBuilder.Add_1(e2.Edge());
|
|
1775
|
-
wireBuilder.Add_1(e3.Edge());
|
|
1776
|
-
let face2 = null;
|
|
1777
|
-
if (wireBuilder.IsDone()) {
|
|
1778
|
-
const makeFace = new oc.BRepBuilderAPI_MakeFace_15(wireBuilder.Wire(), false);
|
|
1779
|
-
if (makeFace.IsDone()) {
|
|
1780
|
-
face2 = makeFace.Face();
|
|
1781
|
-
}
|
|
1782
|
-
makeFace.delete();
|
|
1783
|
-
}
|
|
1784
|
-
wireBuilder.delete();
|
|
1785
|
-
e1.delete();
|
|
1786
|
-
e2.delete();
|
|
1787
|
-
e3.delete();
|
|
1788
|
-
gpA.delete();
|
|
1789
|
-
gpB.delete();
|
|
1790
|
-
gpC.delete();
|
|
1791
|
-
return face2;
|
|
1792
|
-
}
|
|
1793
1681
|
function buildSolidFromMesh(mesh2) {
|
|
1794
1682
|
const oc = occtBoundary.getKernel().oc;
|
|
1795
1683
|
const sewing = new oc.BRepBuilderAPI_Sewing(1e-6, true, true, true, false);
|
|
@@ -1800,7 +1688,7 @@ function buildSolidFromMesh(mesh2) {
|
|
|
1800
1688
|
const vb = mesh2.vertices[v2];
|
|
1801
1689
|
const vc = mesh2.vertices[v3];
|
|
1802
1690
|
if (!va || !vb || !vc) continue;
|
|
1803
|
-
const triFace =
|
|
1691
|
+
const triFace = occtBoundary.makeTriFace(oc, va, vb, vc);
|
|
1804
1692
|
if (triFace !== null) {
|
|
1805
1693
|
sewing.Add(triFace);
|
|
1806
1694
|
faceCount++;
|
|
@@ -2054,7 +1942,7 @@ function fillet$1(shape2, edges, radius) {
|
|
|
2054
1942
|
if (selectedEdges.length === 0) {
|
|
2055
1943
|
return errors.err(
|
|
2056
1944
|
errors.validationError(
|
|
2057
|
-
|
|
1945
|
+
errors.BrepErrorCode.FILLET_NO_EDGES,
|
|
2058
1946
|
"No edges found for fillet",
|
|
2059
1947
|
void 0,
|
|
2060
1948
|
void 0,
|
|
@@ -2080,7 +1968,7 @@ function fillet$1(shape2, edges, radius) {
|
|
|
2080
1968
|
const resultOc = builder.Shape();
|
|
2081
1969
|
const cast = shapeTypes.castShape(resultOc);
|
|
2082
1970
|
if (!shapeTypes.isShape3D(cast)) {
|
|
2083
|
-
return errors.err(errors.occtError(
|
|
1971
|
+
return errors.err(errors.occtError(errors.BrepErrorCode.FILLET_NOT_3D, "Fillet result is not a 3D shape"));
|
|
2084
1972
|
}
|
|
2085
1973
|
shapeFns.propagateOrigins(builder, [shape2], cast);
|
|
2086
1974
|
booleanFns.propagateFaceTags(builder, [shape2], cast);
|
|
@@ -2124,7 +2012,7 @@ function chamfer$1(shape2, edges, distance) {
|
|
|
2124
2012
|
}
|
|
2125
2013
|
const selectedEdges = edges ?? shapeFns.getEdges(shape2);
|
|
2126
2014
|
if (selectedEdges.length === 0) {
|
|
2127
|
-
return errors.err(errors.validationError(
|
|
2015
|
+
return errors.err(errors.validationError(errors.BrepErrorCode.CHAMFER_NO_EDGES, "No edges found for chamfer"));
|
|
2128
2016
|
}
|
|
2129
2017
|
try {
|
|
2130
2018
|
let getEdgeFaceMap = function() {
|
|
@@ -2176,7 +2064,7 @@ function chamfer$1(shape2, edges, distance) {
|
|
|
2176
2064
|
const resultOc = builder.Shape();
|
|
2177
2065
|
const cast = shapeTypes.castShape(resultOc);
|
|
2178
2066
|
if (!shapeTypes.isShape3D(cast)) {
|
|
2179
|
-
return errors.err(errors.occtError(
|
|
2067
|
+
return errors.err(errors.occtError(errors.BrepErrorCode.CHAMFER_NOT_3D, "Chamfer result is not a 3D shape"));
|
|
2180
2068
|
}
|
|
2181
2069
|
shapeFns.propagateOrigins(builder, [shape2], cast);
|
|
2182
2070
|
booleanFns.propagateFaceTags(builder, [shape2], cast);
|
|
@@ -2340,9 +2228,6 @@ function resolveFaces(facesOrFn, shape2) {
|
|
|
2340
2228
|
const finder = facesOrFn(helpers.faceFinder());
|
|
2341
2229
|
return finder.findAll(shape2);
|
|
2342
2230
|
}
|
|
2343
|
-
function normalizeFilletRadius(radius) {
|
|
2344
|
-
return radius;
|
|
2345
|
-
}
|
|
2346
2231
|
function normalizeChamferDistance(distance) {
|
|
2347
2232
|
if (typeof distance === "object" && !Array.isArray(distance) && typeof distance !== "function") {
|
|
2348
2233
|
return { mode: "distAngle", distance: distance.distance, angle: distance.angle };
|
|
@@ -2371,7 +2256,7 @@ function fillet(shape2, edgesOrRadius, maybeRadius) {
|
|
|
2371
2256
|
edges = void 0;
|
|
2372
2257
|
radius = edgesOrRadius;
|
|
2373
2258
|
}
|
|
2374
|
-
return fillet$1(s, edges,
|
|
2259
|
+
return fillet$1(s, edges, radius);
|
|
2375
2260
|
}
|
|
2376
2261
|
function chamfer(shape2, edgesOrDistance, maybeDistance) {
|
|
2377
2262
|
const s = resolve(shape2);
|