brepjs 8.8.4 → 8.8.6
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-C4Rx89oe.js → Blueprint-65SRIESB.js} +2 -2
- package/dist/{Blueprint-D1Dik12C.cjs → Blueprint-CIfBgqlU.cjs} +2 -2
- package/dist/{boolean2D-D4j89vF_.js → boolean2D-BGzBeuy1.js} +4 -4
- package/dist/{boolean2D-BZnkU_aH.cjs → boolean2D-DHfyhBM3.cjs} +4 -4
- package/dist/{booleanFns-Cf_0aWNe.cjs → booleanFns-CUxOBNlC.cjs} +45 -40
- package/dist/{booleanFns-D6SeHoCv.js → booleanFns-DHEaBJwW.js} +45 -40
- package/dist/brepjs.cjs +14 -14
- package/dist/brepjs.js +208 -208
- package/dist/{cornerFinder-DbRL42YI.cjs → cornerFinder-BijsFhpz.cjs} +1 -1
- package/dist/{cornerFinder-CypY3T_w.js → cornerFinder-DfSdXbxK.js} +1 -1
- package/dist/{drawFns-B52K-9DJ.cjs → drawFns-C4q_oQf3.cjs} +7 -7
- package/dist/{drawFns-CVPwl2No.js → drawFns-t6KbXi2Q.js} +7 -7
- package/dist/{helpers-Cfibxk7U.cjs → helpers-Ces6b2wm.cjs} +1 -1
- package/dist/{helpers-zsENdJlc.js → helpers-D7hTCTJm.js} +1 -1
- package/dist/io.cjs +2 -2
- package/dist/io.js +2 -2
- package/dist/{loft-fSnlFn-j.js → loft-BpfrTPIR.js} +1 -1
- package/dist/{loft-Bhnw5Rfr.cjs → loft-GLxTzuXU.cjs} +1 -1
- package/dist/{meshFns-C-6Cq3V-.cjs → meshFns-BTb2esZJ.cjs} +1 -1
- package/dist/{meshFns-Cw3IFJjg.js → meshFns-DJx5Yqiy.js} +1 -1
- package/dist/{operations-PYuj8GLd.js → operations-CHIU-aGI.js} +2 -2
- package/dist/{operations-DvwWDqIp.cjs → operations-T5f-v2rF.cjs} +2 -2
- package/dist/operations.cjs +2 -2
- package/dist/operations.js +2 -2
- package/dist/query/finderFns.d.ts.map +1 -1
- package/dist/query.cjs +2 -2
- package/dist/query.js +3 -3
- package/dist/{shapeFns-QL3zx6uW.js → shapeFns-5HlS8wvc.js} +46 -32
- package/dist/{shapeFns-ByLUl6KE.cjs → shapeFns-CbZMmuQA.cjs} +26 -12
- package/dist/sketching/sketchLib.d.ts.map +1 -1
- package/dist/sketching.cjs +2 -2
- package/dist/sketching.js +2 -2
- package/dist/{surfaceBuilders-hupjYn0W.cjs → surfaceBuilders-zWnw2I0j.cjs} +1 -1
- package/dist/{surfaceBuilders-DYX6h68y.js → surfaceBuilders-zlVu1d-b.js} +1 -1
- package/dist/topology/adjacencyFns.d.ts.map +1 -1
- package/dist/topology/booleanFns.d.ts.map +1 -1
- package/dist/topology/colorFns.d.ts.map +1 -1
- package/dist/topology/faceTagFns.d.ts.map +1 -1
- package/dist/topology/modifierFns.d.ts.map +1 -1
- package/dist/topology/shapeFns.d.ts +13 -1
- package/dist/topology/shapeFns.d.ts.map +1 -1
- package/dist/topology/shapeHelpers.d.ts.map +1 -1
- package/dist/{topology-DWe9SYAy.cjs → topology-CoE5ib_B.cjs} +15 -4
- package/dist/{topology-psR8Hqiz.js → topology-DOvPARZR.js} +15 -4
- package/dist/topology.cjs +4 -4
- package/dist/topology.js +22 -22
- package/package.json +1 -1
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-CIfBgqlU.cjs");
|
|
4
|
+
const boolean2D = require("./boolean2D-DHfyhBM3.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-65SRIESB.js";
|
|
2
|
+
import { d, C, r } from "./Blueprint-65SRIESB.js";
|
|
3
|
+
import { e, C as C2, f, l, g, n, k, q, o, p, r as r2 } from "./boolean2D-BGzBeuy1.js";
|
|
4
4
|
function reverseCurve(curve) {
|
|
5
5
|
const cloned = curve.clone();
|
|
6
6
|
cloned.reverse();
|
|
@@ -49,8 +49,8 @@ import { D as DisposalScope, x as registerForCleanup, y as unregisterFromCleanup
|
|
|
49
49
|
import { u as uvBounds, f as faceGeomType, e as faceCenter, h as uvCoordinates, c as cast } from "./faceFns-DG4bu-QB.js";
|
|
50
50
|
import { f as findCurveType, g as getOrientation } from "./curveFns-VDZEhY97.js";
|
|
51
51
|
import { u as unwrap, l as ok, e as err, b as computationError, x as validationError } from "./errors-CHfaHQSt.js";
|
|
52
|
-
import { z as zip, m as makeFace } from "./surfaceBuilders-
|
|
53
|
-
import { d as distance2d, s as samePoint, b as scalarMultiply2d, c as add2d, n as normalize2d, e as subtract2d, g as getSingleFace } from "./helpers-
|
|
52
|
+
import { z as zip, m as makeFace } from "./surfaceBuilders-zlVu1d-b.js";
|
|
53
|
+
import { d as distance2d, s as samePoint, b as scalarMultiply2d, c as add2d, n as normalize2d, e as subtract2d, g as getSingleFace } from "./helpers-D7hTCTJm.js";
|
|
54
54
|
import { R as RAD2DEG, D as DEG2RAD } from "./vecOps-ZDdZWbwT.js";
|
|
55
55
|
import { bug } from "./result.js";
|
|
56
56
|
function makePlane(plane, origin) {
|
|
@@ -50,8 +50,8 @@ const shapeTypes = require("./shapeTypes-sXITvFkF.cjs");
|
|
|
50
50
|
const faceFns = require("./faceFns-B8xnZw-f.cjs");
|
|
51
51
|
const curveFns = require("./curveFns-KDpL9iyo.cjs");
|
|
52
52
|
const errors = require("./errors-BYb4tL5h.cjs");
|
|
53
|
-
const surfaceBuilders = require("./surfaceBuilders-
|
|
54
|
-
const helpers = require("./helpers-
|
|
53
|
+
const surfaceBuilders = require("./surfaceBuilders-zWnw2I0j.cjs");
|
|
54
|
+
const helpers = require("./helpers-Ces6b2wm.cjs");
|
|
55
55
|
const vecOps = require("./vecOps-CjRL1jau.cjs");
|
|
56
56
|
const result = require("./result.cjs");
|
|
57
57
|
function makePlane(plane, origin) {
|
|
@@ -48,13 +48,13 @@ import { l as ok, e as err, b as computationError, u as unwrap, g as isOk } from
|
|
|
48
48
|
import { d as downcast, u as uvBounds, p as pointOnSurface, n as normalAt } from "./faceFns-DG4bu-QB.js";
|
|
49
49
|
import { g as getKernel, a as toVec3 } from "./occtBoundary-Ct0tN8cs.js";
|
|
50
50
|
import { n as vecScale, j as vecNormalize, b as vecCross, D as DEG2RAD, R as RAD2DEG } from "./vecOps-ZDdZWbwT.js";
|
|
51
|
-
import { r as revolution, c as complexExtrude, t as twistExtrude, b as basicFaceExtrusion, g as genericSweep, l as loft } from "./loft-
|
|
51
|
+
import { r as revolution, c as complexExtrude, t as twistExtrude, b as basicFaceExtrusion, g as genericSweep, l as loft } from "./loft-BpfrTPIR.js";
|
|
52
52
|
import { D as DisposalScope, s as createFace, q as createWire, r as createEdge } from "./shapeTypes-D34s68Xi.js";
|
|
53
53
|
import { d as curveStartPoint, c as curveTangentAt, e as curveIsClosed } from "./curveFns-VDZEhY97.js";
|
|
54
|
-
import { m as makeFace, l as makeNewFaceWithinFace, b as assembleWire, z as zip } from "./surfaceBuilders-
|
|
54
|
+
import { m as makeFace, l as makeNewFaceWithinFace, b as assembleWire, z as zip } from "./surfaceBuilders-zlVu1d-b.js";
|
|
55
55
|
import { bug } from "./result.js";
|
|
56
|
-
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-
|
|
57
|
-
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-
|
|
56
|
+
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-D7hTCTJm.js";
|
|
57
|
+
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-65SRIESB.js";
|
|
58
58
|
function* pointsIteration(intersector) {
|
|
59
59
|
const nPoints = intersector.NbPoints();
|
|
60
60
|
if (!nPoints) return;
|
|
@@ -49,13 +49,13 @@ const errors = require("./errors-BYb4tL5h.cjs");
|
|
|
49
49
|
const faceFns = require("./faceFns-B8xnZw-f.cjs");
|
|
50
50
|
const occtBoundary = require("./occtBoundary-CN_uQJtA.cjs");
|
|
51
51
|
const vecOps = require("./vecOps-CjRL1jau.cjs");
|
|
52
|
-
const loft = require("./loft-
|
|
52
|
+
const loft = require("./loft-GLxTzuXU.cjs");
|
|
53
53
|
const shapeTypes = require("./shapeTypes-sXITvFkF.cjs");
|
|
54
54
|
const curveFns = require("./curveFns-KDpL9iyo.cjs");
|
|
55
|
-
const surfaceBuilders = require("./surfaceBuilders-
|
|
55
|
+
const surfaceBuilders = require("./surfaceBuilders-zWnw2I0j.cjs");
|
|
56
56
|
const result = require("./result.cjs");
|
|
57
|
-
const helpers = require("./helpers-
|
|
58
|
-
const Blueprint = require("./Blueprint-
|
|
57
|
+
const helpers = require("./helpers-Ces6b2wm.cjs");
|
|
58
|
+
const Blueprint = require("./Blueprint-CIfBgqlU.cjs");
|
|
59
59
|
function* pointsIteration(intersector) {
|
|
60
60
|
const nPoints = intersector.NbPoints();
|
|
61
61
|
if (!nPoints) return;
|
|
@@ -49,8 +49,8 @@ const shapeTypes = require("./shapeTypes-sXITvFkF.cjs");
|
|
|
49
49
|
const errors = require("./errors-BYb4tL5h.cjs");
|
|
50
50
|
const vectors = require("./vectors-9rrStq8t.cjs");
|
|
51
51
|
const vecOps = require("./vecOps-CjRL1jau.cjs");
|
|
52
|
-
const shapeFns = require("./shapeFns-
|
|
53
|
-
const surfaceBuilders = require("./surfaceBuilders-
|
|
52
|
+
const shapeFns = require("./shapeFns-CbZMmuQA.cjs");
|
|
53
|
+
const surfaceBuilders = require("./surfaceBuilders-zWnw2I0j.cjs");
|
|
54
54
|
function applyGlue(op, optimisation) {
|
|
55
55
|
const oc = occtBoundary.getKernel().oc;
|
|
56
56
|
if (optimisation === "commonFace") {
|
|
@@ -152,19 +152,14 @@ function propagateFaceTags(op, inputs, result) {
|
|
|
152
152
|
const modifiedList = op.Modified(face.wrapped);
|
|
153
153
|
const modSize = modifiedList.Size?.() ?? 0;
|
|
154
154
|
if (modSize > 0) {
|
|
155
|
-
|
|
156
|
-
const copy = new oc.TopTools_ListOfShape_3(modifiedList);
|
|
157
|
-
while (copy.Size() > 0) {
|
|
158
|
-
const modFace = copy.First_1();
|
|
155
|
+
shapeFns.iterOcList(modifiedList, (modFace) => {
|
|
159
156
|
const modHash = modFace.HashCode(vecOps.HASH_CODE_MAX);
|
|
160
157
|
for (const tag of tags) {
|
|
161
158
|
const set = resultTagMap.get(tag) ?? /* @__PURE__ */ new Set();
|
|
162
159
|
set.add(modHash);
|
|
163
160
|
resultTagMap.set(tag, set);
|
|
164
161
|
}
|
|
165
|
-
|
|
166
|
-
}
|
|
167
|
-
copy.delete();
|
|
162
|
+
});
|
|
168
163
|
} else {
|
|
169
164
|
for (const tag of tags) {
|
|
170
165
|
const set = resultTagMap.get(tag) ?? /* @__PURE__ */ new Set();
|
|
@@ -250,15 +245,9 @@ function propagateColors(op, inputs, result) {
|
|
|
250
245
|
const modifiedList = op.Modified(face.wrapped);
|
|
251
246
|
const modSize = modifiedList.Size?.() ?? 0;
|
|
252
247
|
if (modSize > 0) {
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
const modFace = copy.First_1();
|
|
257
|
-
const modHash = modFace.HashCode(vecOps.HASH_CODE_MAX);
|
|
258
|
-
resultFaceMap.set(modHash, color);
|
|
259
|
-
copy.RemoveFirst();
|
|
260
|
-
}
|
|
261
|
-
copy.delete();
|
|
248
|
+
shapeFns.iterOcList(modifiedList, (modFace) => {
|
|
249
|
+
resultFaceMap.set(modFace.HashCode(vecOps.HASH_CODE_MAX), color);
|
|
250
|
+
});
|
|
262
251
|
} else {
|
|
263
252
|
resultFaceMap.set(hash, color);
|
|
264
253
|
}
|
|
@@ -559,28 +548,44 @@ function sectionToFace(shape, plane, options = {}) {
|
|
|
559
548
|
return errors.err(errors.occtError("SECTION_FAILED", "sectionToFace: section produced no geometry"));
|
|
560
549
|
}
|
|
561
550
|
const oc = occtBoundary.getKernel().oc;
|
|
562
|
-
const
|
|
563
|
-
|
|
564
|
-
|
|
565
|
-
|
|
566
|
-
const
|
|
567
|
-
|
|
568
|
-
|
|
569
|
-
|
|
570
|
-
|
|
571
|
-
|
|
572
|
-
|
|
573
|
-
|
|
574
|
-
|
|
575
|
-
|
|
576
|
-
|
|
577
|
-
|
|
578
|
-
|
|
579
|
-
|
|
580
|
-
|
|
581
|
-
|
|
582
|
-
|
|
583
|
-
|
|
551
|
+
const vertexToEdges = /* @__PURE__ */ new Map();
|
|
552
|
+
const edgeVertexHashes = /* @__PURE__ */ new Map();
|
|
553
|
+
for (const edge of edges) {
|
|
554
|
+
const verts = shapeFns.getVertices(edge);
|
|
555
|
+
const h0 = verts[0] ? verts[0].wrapped.HashCode(vecOps.HASH_CODE_MAX) : -1;
|
|
556
|
+
const h1 = verts.length > 1 && verts[1] ? verts[1].wrapped.HashCode(vecOps.HASH_CODE_MAX) : h0;
|
|
557
|
+
edgeVertexHashes.set(edge, [h0, h1]);
|
|
558
|
+
for (const h of [h0, h1]) {
|
|
559
|
+
const bucket = vertexToEdges.get(h) ?? [];
|
|
560
|
+
bucket.push(edge);
|
|
561
|
+
vertexToEdges.set(h, bucket);
|
|
562
|
+
}
|
|
563
|
+
}
|
|
564
|
+
const visited = /* @__PURE__ */ new Set();
|
|
565
|
+
for (const startEdge of edges) {
|
|
566
|
+
if (visited.has(startEdge)) continue;
|
|
567
|
+
const wireEdges = [startEdge];
|
|
568
|
+
visited.add(startEdge);
|
|
569
|
+
const hashes = edgeVertexHashes.get(startEdge);
|
|
570
|
+
if (!hashes) continue;
|
|
571
|
+
const endpoints = [hashes[1], hashes[0]];
|
|
572
|
+
for (let dir = 0; dir < 2; dir++) {
|
|
573
|
+
let tip = endpoints[dir];
|
|
574
|
+
if (tip === void 0) continue;
|
|
575
|
+
let found = true;
|
|
576
|
+
while (found) {
|
|
577
|
+
found = false;
|
|
578
|
+
const bucket = vertexToEdges.get(tip);
|
|
579
|
+
if (!bucket) break;
|
|
580
|
+
for (const candidate of bucket) {
|
|
581
|
+
if (visited.has(candidate)) continue;
|
|
582
|
+
const ch = edgeVertexHashes.get(candidate);
|
|
583
|
+
if (!ch) continue;
|
|
584
|
+
visited.add(candidate);
|
|
585
|
+
if (dir === 0) wireEdges.push(candidate);
|
|
586
|
+
else wireEdges.unshift(candidate);
|
|
587
|
+
tip = ch[0] === tip ? ch[1] : ch[0];
|
|
588
|
+
found = true;
|
|
584
589
|
break;
|
|
585
590
|
}
|
|
586
591
|
}
|
|
@@ -48,8 +48,8 @@ import { D as DisposalScope, c as castShape, j as isShape3D } from "./shapeTypes
|
|
|
48
48
|
import { l as ok, d as isErr, e as err, x as validationError, B as BrepErrorCode, p as typeCastError, o as occtError } from "./errors-CHfaHQSt.js";
|
|
49
49
|
import { r as resolvePlane } from "./vectors-Dp5Iu1KH.js";
|
|
50
50
|
import { H as HASH_CODE_MAX, n as vecScale, v as vecAdd } from "./vecOps-ZDdZWbwT.js";
|
|
51
|
-
import { a as getFaces, p as propagateOrigins, b as propagateOriginsByHash, c as getWires, d as getEdges } from "./shapeFns-
|
|
52
|
-
import { m as makeFace } from "./surfaceBuilders-
|
|
51
|
+
import { a as getFaces, i as iterOcList, p as propagateOrigins, b as propagateOriginsByHash, c as getWires, d as getEdges, e as getVertices } from "./shapeFns-5HlS8wvc.js";
|
|
52
|
+
import { m as makeFace } from "./surfaceBuilders-zlVu1d-b.js";
|
|
53
53
|
function applyGlue(op, optimisation) {
|
|
54
54
|
const oc = getKernel().oc;
|
|
55
55
|
if (optimisation === "commonFace") {
|
|
@@ -151,19 +151,14 @@ function propagateFaceTags(op, inputs, result) {
|
|
|
151
151
|
const modifiedList = op.Modified(face.wrapped);
|
|
152
152
|
const modSize = modifiedList.Size?.() ?? 0;
|
|
153
153
|
if (modSize > 0) {
|
|
154
|
-
|
|
155
|
-
const copy = new oc.TopTools_ListOfShape_3(modifiedList);
|
|
156
|
-
while (copy.Size() > 0) {
|
|
157
|
-
const modFace = copy.First_1();
|
|
154
|
+
iterOcList(modifiedList, (modFace) => {
|
|
158
155
|
const modHash = modFace.HashCode(HASH_CODE_MAX);
|
|
159
156
|
for (const tag of tags) {
|
|
160
157
|
const set = resultTagMap.get(tag) ?? /* @__PURE__ */ new Set();
|
|
161
158
|
set.add(modHash);
|
|
162
159
|
resultTagMap.set(tag, set);
|
|
163
160
|
}
|
|
164
|
-
|
|
165
|
-
}
|
|
166
|
-
copy.delete();
|
|
161
|
+
});
|
|
167
162
|
} else {
|
|
168
163
|
for (const tag of tags) {
|
|
169
164
|
const set = resultTagMap.get(tag) ?? /* @__PURE__ */ new Set();
|
|
@@ -249,15 +244,9 @@ function propagateColors(op, inputs, result) {
|
|
|
249
244
|
const modifiedList = op.Modified(face.wrapped);
|
|
250
245
|
const modSize = modifiedList.Size?.() ?? 0;
|
|
251
246
|
if (modSize > 0) {
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
const modFace = copy.First_1();
|
|
256
|
-
const modHash = modFace.HashCode(HASH_CODE_MAX);
|
|
257
|
-
resultFaceMap.set(modHash, color);
|
|
258
|
-
copy.RemoveFirst();
|
|
259
|
-
}
|
|
260
|
-
copy.delete();
|
|
247
|
+
iterOcList(modifiedList, (modFace) => {
|
|
248
|
+
resultFaceMap.set(modFace.HashCode(HASH_CODE_MAX), color);
|
|
249
|
+
});
|
|
261
250
|
} else {
|
|
262
251
|
resultFaceMap.set(hash, color);
|
|
263
252
|
}
|
|
@@ -558,28 +547,44 @@ function sectionToFace(shape, plane, options = {}) {
|
|
|
558
547
|
return err(occtError("SECTION_FAILED", "sectionToFace: section produced no geometry"));
|
|
559
548
|
}
|
|
560
549
|
const oc = getKernel().oc;
|
|
561
|
-
const
|
|
562
|
-
|
|
563
|
-
|
|
564
|
-
|
|
565
|
-
const
|
|
566
|
-
|
|
567
|
-
|
|
568
|
-
|
|
569
|
-
|
|
570
|
-
|
|
571
|
-
|
|
572
|
-
|
|
573
|
-
|
|
574
|
-
|
|
575
|
-
|
|
576
|
-
|
|
577
|
-
|
|
578
|
-
|
|
579
|
-
|
|
580
|
-
|
|
581
|
-
|
|
582
|
-
|
|
550
|
+
const vertexToEdges = /* @__PURE__ */ new Map();
|
|
551
|
+
const edgeVertexHashes = /* @__PURE__ */ new Map();
|
|
552
|
+
for (const edge of edges) {
|
|
553
|
+
const verts = getVertices(edge);
|
|
554
|
+
const h0 = verts[0] ? verts[0].wrapped.HashCode(HASH_CODE_MAX) : -1;
|
|
555
|
+
const h1 = verts.length > 1 && verts[1] ? verts[1].wrapped.HashCode(HASH_CODE_MAX) : h0;
|
|
556
|
+
edgeVertexHashes.set(edge, [h0, h1]);
|
|
557
|
+
for (const h of [h0, h1]) {
|
|
558
|
+
const bucket = vertexToEdges.get(h) ?? [];
|
|
559
|
+
bucket.push(edge);
|
|
560
|
+
vertexToEdges.set(h, bucket);
|
|
561
|
+
}
|
|
562
|
+
}
|
|
563
|
+
const visited = /* @__PURE__ */ new Set();
|
|
564
|
+
for (const startEdge of edges) {
|
|
565
|
+
if (visited.has(startEdge)) continue;
|
|
566
|
+
const wireEdges = [startEdge];
|
|
567
|
+
visited.add(startEdge);
|
|
568
|
+
const hashes = edgeVertexHashes.get(startEdge);
|
|
569
|
+
if (!hashes) continue;
|
|
570
|
+
const endpoints = [hashes[1], hashes[0]];
|
|
571
|
+
for (let dir = 0; dir < 2; dir++) {
|
|
572
|
+
let tip = endpoints[dir];
|
|
573
|
+
if (tip === void 0) continue;
|
|
574
|
+
let found = true;
|
|
575
|
+
while (found) {
|
|
576
|
+
found = false;
|
|
577
|
+
const bucket = vertexToEdges.get(tip);
|
|
578
|
+
if (!bucket) break;
|
|
579
|
+
for (const candidate of bucket) {
|
|
580
|
+
if (visited.has(candidate)) continue;
|
|
581
|
+
const ch = edgeVertexHashes.get(candidate);
|
|
582
|
+
if (!ch) continue;
|
|
583
|
+
visited.add(candidate);
|
|
584
|
+
if (dir === 0) wireEdges.push(candidate);
|
|
585
|
+
else wireEdges.unshift(candidate);
|
|
586
|
+
tip = ch[0] === tip ? ch[1] : ch[0];
|
|
587
|
+
found = true;
|
|
583
588
|
break;
|
|
584
589
|
}
|
|
585
590
|
}
|
package/dist/brepjs.cjs
CHANGED
|
@@ -49,26 +49,26 @@ const occtBoundary = require("./occtBoundary-CN_uQJtA.cjs");
|
|
|
49
49
|
const errors = require("./errors-BYb4tL5h.cjs");
|
|
50
50
|
const shapeTypes = require("./shapeTypes-sXITvFkF.cjs");
|
|
51
51
|
const vecOps = require("./vecOps-CjRL1jau.cjs");
|
|
52
|
-
const Blueprint = require("./Blueprint-
|
|
52
|
+
const Blueprint = require("./Blueprint-CIfBgqlU.cjs");
|
|
53
53
|
const curveFns = require("./curveFns-KDpL9iyo.cjs");
|
|
54
|
-
const loft$2 = require("./loft-
|
|
55
|
-
const operations = require("./operations-
|
|
56
|
-
const boolean2D = require("./boolean2D-
|
|
54
|
+
const loft$2 = require("./loft-GLxTzuXU.cjs");
|
|
55
|
+
const operations = require("./operations-T5f-v2rF.cjs");
|
|
56
|
+
const boolean2D = require("./boolean2D-DHfyhBM3.cjs");
|
|
57
57
|
const _2d = require("./2d.cjs");
|
|
58
|
-
const helpers = require("./helpers-
|
|
58
|
+
const helpers = require("./helpers-Ces6b2wm.cjs");
|
|
59
59
|
const io = require("./io.cjs");
|
|
60
|
-
const drawFns = require("./drawFns-
|
|
60
|
+
const drawFns = require("./drawFns-C4q_oQf3.cjs");
|
|
61
61
|
const vectors = require("./vectors-9rrStq8t.cjs");
|
|
62
|
-
const shapeFns = require("./shapeFns-
|
|
63
|
-
const booleanFns = require("./booleanFns-
|
|
64
|
-
const topology = require("./topology-
|
|
62
|
+
const shapeFns = require("./shapeFns-CbZMmuQA.cjs");
|
|
63
|
+
const booleanFns = require("./booleanFns-CUxOBNlC.cjs");
|
|
64
|
+
const topology = require("./topology-CoE5ib_B.cjs");
|
|
65
65
|
const faceFns = require("./faceFns-B8xnZw-f.cjs");
|
|
66
|
-
const meshFns = require("./meshFns-
|
|
66
|
+
const meshFns = require("./meshFns-BTb2esZJ.cjs");
|
|
67
67
|
const measurement = require("./measurement-C4Ofuy_y.cjs");
|
|
68
|
-
const surfaceBuilders = require("./surfaceBuilders-
|
|
68
|
+
const surfaceBuilders = require("./surfaceBuilders-zWnw2I0j.cjs");
|
|
69
69
|
const query = require("./query.cjs");
|
|
70
70
|
const result = require("./result.cjs");
|
|
71
|
-
const cornerFinder = require("./cornerFinder-
|
|
71
|
+
const cornerFinder = require("./cornerFinder-BijsFhpz.cjs");
|
|
72
72
|
const worker = require("./worker.cjs");
|
|
73
73
|
const errorFactories = {
|
|
74
74
|
OCCT_OPERATION: (code, message, cause) => ({ kind: "OCCT_OPERATION", code, message, cause }),
|
|
@@ -2154,7 +2154,7 @@ function chamfer$1(shape2, edges, distance) {
|
|
|
2154
2154
|
oc.TopAbs_ShapeEnum.TopAbs_SHAPE
|
|
2155
2155
|
);
|
|
2156
2156
|
while (edgeExp.More()) {
|
|
2157
|
-
const hash = edgeExp.Current().HashCode(
|
|
2157
|
+
const hash = edgeExp.Current().HashCode(vecOps.HASH_CODE_MAX);
|
|
2158
2158
|
if (!edgeFaceMap.has(hash)) {
|
|
2159
2159
|
edgeFaceMap.set(hash, face2);
|
|
2160
2160
|
}
|
|
@@ -2177,7 +2177,7 @@ function chamfer$1(shape2, edges, distance) {
|
|
|
2177
2177
|
} else {
|
|
2178
2178
|
const [d1, d2] = d;
|
|
2179
2179
|
if (d1 > 0 && d2 > 0) {
|
|
2180
|
-
const face2 = getEdgeFaceMap().get(edge.wrapped.HashCode(
|
|
2180
|
+
const face2 = getEdgeFaceMap().get(edge.wrapped.HashCode(vecOps.HASH_CODE_MAX));
|
|
2181
2181
|
if (face2) {
|
|
2182
2182
|
builder.Add_3(d1, d2, oc.TopoDS.Edge_1(edge.wrapped), face2);
|
|
2183
2183
|
}
|