brepjs 18.118.2 → 18.118.4
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 +6 -6
- package/dist/2d.js +6 -6
- package/dist/{adjacencyFns-COWMJ1OX.cjs → adjacencyFns-CiDCunAU.cjs} +2 -2
- package/dist/{adjacencyFns-D026zKM3.js → adjacencyFns-CxepMm7H.js} +2 -2
- package/dist/{blueprint-BeCL-AAl.js → blueprint-BIf01dZl.js} +15 -10
- package/dist/{blueprint-xcDMSkia.cjs → blueprint-Bp_sSxx2.cjs} +17 -11
- package/dist/{blueprintFns-DIMiD67q.cjs → blueprintFns-Dc8amB5a.cjs} +2 -2
- package/dist/{blueprintFns-BkSFPipn.js → blueprintFns-Dl_drDhd.js} +2 -2
- package/dist/{blueprintSketcher-DKfkNg71.js → blueprintSketcher-D-xSC6Mp.js} +5 -4
- package/dist/{blueprintSketcher-DGcCDQq2.cjs → blueprintSketcher-XiLc6fJ4.cjs} +5 -4
- package/dist/{boolean2D-BCTOcf19.js → boolean2D-BNjpYyZl.js} +5 -5
- package/dist/{boolean2D-Dh4IPW_X.cjs → boolean2D-BfKG5Wio.cjs} +7 -6
- package/dist/brepjs.cjs +29 -29
- package/dist/brepjs.js +29 -29
- package/dist/{cameraFns-BAm-2Clq.cjs → cameraFns-ClE0QcuX.cjs} +2 -2
- package/dist/{cameraFns-CRln-7RT.js → cameraFns-DyMKpFHq.js} +2 -2
- package/dist/core/shapeTypes.d.ts +32 -0
- package/dist/core.cjs +1 -1
- package/dist/core.js +1 -1
- package/dist/{cornerFinder-DMJBP4I2.cjs → cornerFinder-CINnfCPc.cjs} +1 -1
- package/dist/{cornerFinder-Bu482P3S.js → cornerFinder-DFswCdwf.js} +1 -1
- package/dist/{curveFns-pGQFlJG-.js → curveFns-BYcTyyb7.js} +1 -1
- package/dist/{curveFns-CpaxYpa4.cjs → curveFns-YvH970hp.cjs} +1 -1
- package/dist/{drawFns-D-PqWuBQ.cjs → drawFns-CG3ksr6q.cjs} +14 -13
- package/dist/{drawFns-BAETgRWM.js → drawFns-DkhqDgS5.js} +14 -13
- package/dist/{faceFns-Bc6sBrBV.js → faceFns-CpOAl1K5.js} +2 -2
- package/dist/{faceFns-rbWcdpvj.cjs → faceFns-DnLXDWq2.cjs} +4 -3
- package/dist/{healingFns-DfshoSeQ.cjs → healingFns-BIcPeCM9.cjs} +16 -15
- package/dist/{healingFns-DHxzmeCt.js → healingFns-BP0xjoIs.js} +16 -15
- package/dist/{helpers-YD71h41H.js → helpers-BVkEnH5n.js} +6 -6
- package/dist/{helpers-CKbgoPDr.cjs → helpers-Beq_ugyN.cjs} +6 -6
- package/dist/{importFns-CQ16LqPQ.cjs → importFns-BZYgEOu-.cjs} +4 -4
- package/dist/{importFns-A437Sgj6.js → importFns-DPQmk2TS.js} +4 -4
- package/dist/io.cjs +2 -2
- package/dist/io.js +2 -2
- package/dist/kernel/occtWasm/booleanOps.d.ts +9 -1
- package/dist/kernel/occtWasm/occtWasmAdapter.cjs +1 -1
- package/dist/kernel/occtWasm/occtWasmAdapter.js +1 -1
- package/dist/kernel/types.d.ts +2 -4
- package/dist/{loftFns-BQktV4u4.cjs → loftFns-CZC_NH_h.cjs} +1 -1
- package/dist/{loftFns-CXc9tRv6.js → loftFns-NauDWzek.js} +1 -1
- package/dist/{measureFns-B_vJqwDc.js → measureFns-BLmLZr0K.js} +3 -3
- package/dist/{measureFns-I5KcAgSb.cjs → measureFns-C4BxD4kC.cjs} +3 -3
- package/dist/measurement.cjs +1 -1
- package/dist/measurement.js +1 -1
- package/dist/{meshFns-COdN1kVO.js → meshFns-BK5O_pJ9.js} +3 -3
- package/dist/{meshFns-fPnPGEPl.cjs → meshFns-BoF6g1go.cjs} +3 -3
- package/dist/{occtWasmAdapter-B2TEQOjs.cjs → occtWasmAdapter-Bj9dX3Lb.cjs} +45 -10
- package/dist/{occtWasmAdapter-CKwtxwNH.js → occtWasmAdapter-wBLknH8f.js} +45 -10
- package/dist/operations.cjs +2 -2
- package/dist/operations.js +2 -2
- package/dist/{primitiveFns-DxP7GVQh.js → primitiveFns-DJUXtN6W.js} +4 -4
- package/dist/{primitiveFns-Cohp602Q.cjs → primitiveFns-DOyyz54-.cjs} +4 -4
- package/dist/projection.cjs +1 -1
- package/dist/projection.js +1 -1
- package/dist/query.cjs +2 -2
- package/dist/query.js +2 -2
- package/dist/{refResolveFns-NGXXyTBa.js → refResolveFns-DL1zXF8u.js} +18 -11
- package/dist/{refResolveFns-Du0v4e3Y.cjs → refResolveFns-DbTYd_Nj.cjs} +18 -11
- package/dist/{shapeFns-DqGDtCsE.js → shapeFns-DED4C70_.js} +84 -23
- package/dist/{shapeFns-DvmBIZaX.cjs → shapeFns-DxAhtxFP.cjs} +84 -23
- package/dist/shapeRef.cjs +1 -1
- package/dist/shapeRef.js +1 -1
- package/dist/{shapeTypes-EI4Uxlsb.js → shapeTypes-BguzpBK0.js} +70 -22
- package/dist/{shapeTypes-BLREi6xB.cjs → shapeTypes-Ca76Bklg.cjs} +87 -21
- package/dist/sketching.cjs +3 -3
- package/dist/sketching.js +3 -3
- package/dist/{solidBuilders-Oq-hxTvJ.js → solidBuilders-_8mqPO7I.js} +6 -5
- package/dist/{solidBuilders-B6DBRdRc.cjs → solidBuilders-yyfZ2Q-7.cjs} +6 -5
- package/dist/{surfaceBuilders-C0pJwtCO.js → surfaceBuilders-CT__o6Be.js} +2 -2
- package/dist/{surfaceBuilders-C-UhFlpS.cjs → surfaceBuilders-De2XKidK.cjs} +2 -2
- package/dist/text.cjs +2 -2
- package/dist/text.js +2 -2
- package/dist/{textBlueprints-lSKzw-nT.cjs → textBlueprints-C17PPSzH.cjs} +9 -8
- package/dist/{textBlueprints-fBpuvT3m.js → textBlueprints-D9l3v-f3.js} +9 -8
- package/dist/{textMetrics-BkTdFBwC.cjs → textMetrics-BwQ7TD47.cjs} +1 -1
- package/dist/{textMetrics-CnrAQwLI.js → textMetrics-GSAxEtaJ.js} +1 -1
- package/dist/{threadFns-DJt3EStH.cjs → threadFns-Bu2c-lu_.cjs} +8 -8
- package/dist/{threadFns-Dlts4xFy.js → threadFns-DOqhI5OK.js} +8 -8
- package/dist/topology.cjs +9 -9
- package/dist/topology.js +9 -9
- package/dist/{topologyQueryFns-1PqfeHrV.cjs → topologyQueryFns-B1QAiZVI.cjs} +1 -1
- package/dist/{topologyQueryFns-BjgBf2t-.js → topologyQueryFns-Dl2F-2d9.js} +1 -1
- package/package.json +16 -15
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { C as serializeCurve2d$2, E as quickHull, O as EXACT_BREP_CAPABILITIES, S as scaleCurve2d$2, T as translateCurve2d$2, _ as makeEllipse2d$2, a as buildBinarySTL, b as mirrorAtPoint, c as curveBounds, d as evaluateCurve2d$2, f as intersectCurves2dFn, g as makeCircle2d$2, h as makeBezier2d$2, i as buildAsciiSTL, l as curveTypeName, m as makeArc2dThreePoints, n as DEFAULT_STL_ANGULAR_TOLERANCE, o as addCurveToBBox, p as makeArc2dTangent, r as DEFAULT_STL_TOLERANCE, s as createBBox2d, t as OcctWasmAdapter, u as deserializeCurve2d$2, v as makeLine2d$2, w as tangentCurve2d, x as rotateCurve2d$2, y as mirrorAcrossAxis } from "./occtWasmAdapter-
|
|
1
|
+
import { C as serializeCurve2d$2, E as quickHull, O as EXACT_BREP_CAPABILITIES, S as scaleCurve2d$2, T as translateCurve2d$2, _ as makeEllipse2d$2, a as buildBinarySTL, b as mirrorAtPoint, c as curveBounds, d as evaluateCurve2d$2, f as intersectCurves2dFn, g as makeCircle2d$2, h as makeBezier2d$2, i as buildAsciiSTL, l as curveTypeName, m as makeArc2dThreePoints, n as DEFAULT_STL_ANGULAR_TOLERANCE, o as addCurveToBBox, p as makeArc2dTangent, r as DEFAULT_STL_TOLERANCE, s as createBBox2d, t as OcctWasmAdapter, u as deserializeCurve2d$2, v as makeLine2d$2, w as tangentCurve2d, x as rotateCurve2d$2, y as mirrorAcrossAxis } from "./occtWasmAdapter-wBLknH8f.js";
|
|
2
2
|
import { n as wasmIndex, t as vec3At } from "./vec3-Dpha8d5k.js";
|
|
3
3
|
import { A as ok, b as err } from "./errors-DNWJsfVU.js";
|
|
4
4
|
//#region src/kernel/quality.ts
|
|
@@ -433,7 +433,7 @@ function getShapeTypeMap(oc) {
|
|
|
433
433
|
let map = shapeTypeMaps.get(oc);
|
|
434
434
|
if (!map) {
|
|
435
435
|
const ta = oc.TopAbs_ShapeEnum;
|
|
436
|
-
map = new Map([
|
|
436
|
+
map = /* @__PURE__ */ new Map([
|
|
437
437
|
[ta.TopAbs_VERTEX, "vertex"],
|
|
438
438
|
[ta.TopAbs_EDGE, "edge"],
|
|
439
439
|
[ta.TopAbs_WIRE, "wire"],
|
|
@@ -2350,7 +2350,7 @@ function makeTransformOps$2(oc) {
|
|
|
2350
2350
|
//#region src/kernel/occt/meshOps.ts
|
|
2351
2351
|
/** Slice a Float32Array from the WASM heap, or return empty if size is 0. */
|
|
2352
2352
|
function sliceF32(heap, ptr, size) {
|
|
2353
|
-
if (size === 0) return new Float32Array(0);
|
|
2353
|
+
if (size === 0) return /* @__PURE__ */ new Float32Array(0);
|
|
2354
2354
|
const offset = ptr / 4;
|
|
2355
2355
|
return heap.slice(offset, offset + size);
|
|
2356
2356
|
}
|
|
@@ -2370,10 +2370,10 @@ function mesh$2(oc, shape, options) {
|
|
|
2370
2370
|
const faceGroupsSize = raw.getFaceGroupsSize();
|
|
2371
2371
|
const uvsSize = raw.getUvsSize();
|
|
2372
2372
|
const vertices = sliceF32(oc.HEAPF32, raw.getVerticesPtr(), verticesSize);
|
|
2373
|
-
const normals = options.skipNormals || normalsSize === 0 ? new Float32Array(0) : sliceF32(oc.HEAPF32, raw.getNormalsPtr(), normalsSize);
|
|
2373
|
+
const normals = options.skipNormals || normalsSize === 0 ? /* @__PURE__ */ new Float32Array(0) : sliceF32(oc.HEAPF32, raw.getNormalsPtr(), normalsSize);
|
|
2374
2374
|
const trianglesPtr = raw.getTrianglesPtr() / 4;
|
|
2375
2375
|
const triangles = oc.HEAPU32.slice(trianglesPtr, trianglesPtr + trianglesSize);
|
|
2376
|
-
const uvs = uvsSize > 0 ? sliceF32(oc.HEAPF32, raw.getUvsPtr(), uvsSize) : new Float32Array(0);
|
|
2376
|
+
const uvs = uvsSize > 0 ? sliceF32(oc.HEAPF32, raw.getUvsPtr(), uvsSize) : /* @__PURE__ */ new Float32Array(0);
|
|
2377
2377
|
const faceGroups = [];
|
|
2378
2378
|
if (faceGroupsSize > 0) {
|
|
2379
2379
|
const fgPtr = raw.getFaceGroupsPtr() / 4;
|
|
@@ -2603,7 +2603,7 @@ function vertexPosition$1(oc, vertex) {
|
|
|
2603
2603
|
/** Map from OCCT GeomAbs_SurfaceType enum value to SurfaceType string. */
|
|
2604
2604
|
function buildSurfaceTypeMap(oc) {
|
|
2605
2605
|
const e = oc.GeomAbs_SurfaceType;
|
|
2606
|
-
return new Map([
|
|
2606
|
+
return /* @__PURE__ */ new Map([
|
|
2607
2607
|
[e.GeomAbs_Plane, "plane"],
|
|
2608
2608
|
[e.GeomAbs_Cylinder, "cylinder"],
|
|
2609
2609
|
[e.GeomAbs_Cone, "cone"],
|
|
@@ -6673,7 +6673,7 @@ function meshBoolean(bk, positionsA, indicesA, positionsB, indicesB, op, toleran
|
|
|
6673
6673
|
vertices: new Float32Array(mesh.positions),
|
|
6674
6674
|
normals: new Float32Array(mesh.normals),
|
|
6675
6675
|
triangles: new Uint32Array(mesh.indices),
|
|
6676
|
-
uvs: new Float32Array(0),
|
|
6676
|
+
uvs: /* @__PURE__ */ new Float32Array(0),
|
|
6677
6677
|
faceGroups: [{
|
|
6678
6678
|
start: 0,
|
|
6679
6679
|
count: mesh.indices.length,
|
|
@@ -8089,14 +8089,14 @@ function mesh$1(bk, shape, options) {
|
|
|
8089
8089
|
if (bkHandle.type === "solid") result = meshSolid(bk, h, deflection, !!options.includeUVs, angularTol);
|
|
8090
8090
|
else if (bkHandle.type === "face") result = meshSingleFace(bk, h, deflection, 0, angularTol);
|
|
8091
8091
|
else throw new Error(`brepkit: cannot mesh shape of type '${bkHandle.type}'`);
|
|
8092
|
-
if (options.skipNormals) result.normals = new Float32Array(0);
|
|
8093
|
-
if (!options.includeUVs) result.uvs = new Float32Array(0);
|
|
8092
|
+
if (options.skipNormals) result.normals = /* @__PURE__ */ new Float32Array(0);
|
|
8093
|
+
if (!options.includeUVs) result.uvs = /* @__PURE__ */ new Float32Array(0);
|
|
8094
8094
|
return result;
|
|
8095
8095
|
}
|
|
8096
8096
|
function meshEdges$1(bk, shape, tolerance, angularTolerance) {
|
|
8097
8097
|
const bkHandle = shape;
|
|
8098
8098
|
if (bkHandle.type !== "solid") return {
|
|
8099
|
-
lines: new Float32Array(0),
|
|
8099
|
+
lines: /* @__PURE__ */ new Float32Array(0),
|
|
8100
8100
|
edgeGroups: []
|
|
8101
8101
|
};
|
|
8102
8102
|
const angularTol = angularTolerance > 0 ? angularTolerance : void 0;
|
|
@@ -8170,7 +8170,7 @@ function meshSolidGroupedBinary(bk, solidId, deflection, includeUVs, angularTole
|
|
|
8170
8170
|
faceHash: faceIds[i] ?? 0
|
|
8171
8171
|
});
|
|
8172
8172
|
}
|
|
8173
|
-
let uvs = new Float32Array(0);
|
|
8173
|
+
let uvs = /* @__PURE__ */ new Float32Array(0);
|
|
8174
8174
|
if (includeUVs) {
|
|
8175
8175
|
const expectedUvLen = positions.length / 3 * 2;
|
|
8176
8176
|
try {
|
|
@@ -8207,7 +8207,7 @@ function meshSolidGroupedJson(bk, solidId, deflection, includeUVs, angularTolera
|
|
|
8207
8207
|
faceHash: faceIds[i] ?? 0
|
|
8208
8208
|
});
|
|
8209
8209
|
}
|
|
8210
|
-
let uvs = new Float32Array(0);
|
|
8210
|
+
let uvs = /* @__PURE__ */ new Float32Array(0);
|
|
8211
8211
|
if (includeUVs) {
|
|
8212
8212
|
const expectedUvLen = data.positions.length / 3 * 2;
|
|
8213
8213
|
try {
|
|
@@ -9908,7 +9908,7 @@ var BrepkitAdapter = class {
|
|
|
9908
9908
|
function notImplemented(method) {
|
|
9909
9909
|
throw new Error(`manifold: ${method} is not implemented`);
|
|
9910
9910
|
}
|
|
9911
|
-
var REPLAYABLE_OPS = new Set([
|
|
9911
|
+
var REPLAYABLE_OPS = /* @__PURE__ */ new Set([
|
|
9912
9912
|
"makeBox",
|
|
9913
9913
|
"makeBoxWithCorners",
|
|
9914
9914
|
"makeCylinder",
|
|
@@ -10183,9 +10183,9 @@ function meshToResult(mesh) {
|
|
|
10183
10183
|
}
|
|
10184
10184
|
return {
|
|
10185
10185
|
vertices,
|
|
10186
|
-
normals: new Float32Array(0),
|
|
10186
|
+
normals: /* @__PURE__ */ new Float32Array(0),
|
|
10187
10187
|
triangles,
|
|
10188
|
-
uvs: new Float32Array(0),
|
|
10188
|
+
uvs: /* @__PURE__ */ new Float32Array(0),
|
|
10189
10189
|
faceGroups: [{
|
|
10190
10190
|
start: 0,
|
|
10191
10191
|
count: triangles.length,
|
|
@@ -11925,7 +11925,8 @@ function sweepAlong(module, profile, path, spineNode, op, extraParams, scaleAt)
|
|
|
11925
11925
|
const frames = rotationMinimizingFrames(path, section.xAxis);
|
|
11926
11926
|
const n = frames.length;
|
|
11927
11927
|
return wrap(skinRings(module, frames.map((f, i) => {
|
|
11928
|
-
|
|
11928
|
+
const scale = scaleAt ? scaleAt(n > 1 ? i / (n - 1) : 0) : 1;
|
|
11929
|
+
return placeRing(section, f, scale);
|
|
11929
11930
|
})), makeNode(op, {
|
|
11930
11931
|
section: serializeSection(section),
|
|
11931
11932
|
path: path.map((p) => [
|
|
@@ -12417,9 +12418,9 @@ function mesh(shape, options) {
|
|
|
12417
12418
|
const triangles = new Uint32Array(m.triVerts);
|
|
12418
12419
|
return {
|
|
12419
12420
|
vertices,
|
|
12420
|
-
normals: options.skipNormals ? new Float32Array(0) : computeNormals(vertices, triangles),
|
|
12421
|
+
normals: options.skipNormals ? /* @__PURE__ */ new Float32Array(0) : computeNormals(vertices, triangles),
|
|
12421
12422
|
triangles,
|
|
12422
|
-
uvs: options.includeUVs ? new Float32Array(vertices.length / 3 * 2) : new Float32Array(0),
|
|
12423
|
+
uvs: options.includeUVs ? new Float32Array(vertices.length / 3 * 2) : /* @__PURE__ */ new Float32Array(0),
|
|
12423
12424
|
faceGroups: readFaceGroups(m)
|
|
12424
12425
|
};
|
|
12425
12426
|
}
|
|
@@ -15087,11 +15088,12 @@ function makeNativeKernel2DOps(module, occt) {
|
|
|
15087
15088
|
const yx = zy * xz - zz * xy;
|
|
15088
15089
|
const yy = zz * xx - zx * xz;
|
|
15089
15090
|
const yz = zx * xy - zy * xx;
|
|
15090
|
-
|
|
15091
|
+
const pts3d = sample(asC(h)).map(([u, v]) => [
|
|
15091
15092
|
origin[0] + xx * u + yx * v,
|
|
15092
15093
|
origin[1] + xy * u + yy * v,
|
|
15093
15094
|
origin[2] + xz * u + yz * v
|
|
15094
|
-
])
|
|
15095
|
+
]);
|
|
15096
|
+
return wrap(PLACEHOLDER, makeNode("profileEdge", { pts: pts3d }, []));
|
|
15095
15097
|
},
|
|
15096
15098
|
makeBSpline2d: (points, options) => occtOr("makeBSpline2d").makeBSpline2d(points, options),
|
|
15097
15099
|
offsetCurve2d: (c, offset) => occtOr("offsetCurve2d").offsetCurve2d(toOcct(c), offset),
|
|
@@ -15512,7 +15514,7 @@ async function init() {
|
|
|
15512
15514
|
throw new Error("brepjs: no kernel package found. Install one of:\n npm install occt-wasm (recommended, default)\n npm install brepjs-opencascade\n npm install brepkit-wasm");
|
|
15513
15515
|
}
|
|
15514
15516
|
//#endregion
|
|
15515
|
-
//#region \0@oxc-project+runtime@0.
|
|
15517
|
+
//#region \0@oxc-project+runtime@0.138.0/helpers/esm/usingCtx.js
|
|
15516
15518
|
function _usingCtx() {
|
|
15517
15519
|
var r = "function" == typeof SuppressedError ? SuppressedError : function(r, e) {
|
|
15518
15520
|
var n = Error();
|
|
@@ -16068,6 +16070,52 @@ function castShape3D(ocShape) {
|
|
|
16068
16070
|
return castShape(ocShape);
|
|
16069
16071
|
}
|
|
16070
16072
|
/**
|
|
16073
|
+
* Release the pre-downcast handle of a freshly-produced kernel result after it
|
|
16074
|
+
* has been cast to `cast`.
|
|
16075
|
+
*
|
|
16076
|
+
* On occt-wasm `downcast` allocates a new arena slot and orphans the input; a
|
|
16077
|
+
* handle's own `delete()` is a no-op there, so the input must be released via
|
|
16078
|
+
* `getKernel().dispose()` to reclaim the slot. Kernels whose `downcast` is
|
|
16079
|
+
* identity (manifold, brepkit) return the same handle as `cast`, so nothing is
|
|
16080
|
+
* released — doing so would delete the shape being returned.
|
|
16081
|
+
*
|
|
16082
|
+
* Use only for a kernel result the caller owns outright — never for a shape
|
|
16083
|
+
* received from elsewhere.
|
|
16084
|
+
*/
|
|
16085
|
+
function disposeDowncastSource(source, cast) {
|
|
16086
|
+
if (cast.wrapped !== source) getKernel().dispose(source);
|
|
16087
|
+
}
|
|
16088
|
+
/**
|
|
16089
|
+
* Cast a freshly-produced kernel result to its branded type and release the
|
|
16090
|
+
* orphaned pre-downcast handle. The result-owning counterpart to {@link castShape};
|
|
16091
|
+
* see {@link disposeDowncastSource} for the arena semantics.
|
|
16092
|
+
*/
|
|
16093
|
+
function castResultShape(ocShape, dim) {
|
|
16094
|
+
const cast = castShape(ocShape, dim);
|
|
16095
|
+
disposeDowncastSource(ocShape, cast);
|
|
16096
|
+
return cast;
|
|
16097
|
+
}
|
|
16098
|
+
/**
|
|
16099
|
+
* Fully release a transiently-branded sub-shape and the raw handle it was cast
|
|
16100
|
+
* from — for a face/edge iterated only to read a property, then discarded.
|
|
16101
|
+
*
|
|
16102
|
+
* `handle`'s dispose updates stats and, on kernels that own their native object
|
|
16103
|
+
* (Embind, manifold, brepkit), frees it. occt-wasm handles are arena-backed
|
|
16104
|
+
* (their delete is a no-op), so when the downcast produced a distinct handle
|
|
16105
|
+
* (`handle.wrapped !== rawSource`) both arena slots are released explicitly. The
|
|
16106
|
+
* identity guard also skips manifold/brepkit — there `handle` *is* `rawSource`,
|
|
16107
|
+
* already freed above, and their `dispose()` has no double-free guard.
|
|
16108
|
+
*/
|
|
16109
|
+
function disposeTransientSubShape(handle, rawSource) {
|
|
16110
|
+
const downcast = handle.wrapped;
|
|
16111
|
+
handle[Symbol.dispose]();
|
|
16112
|
+
if (downcast !== rawSource) {
|
|
16113
|
+
const kernel = getKernel();
|
|
16114
|
+
kernel.dispose(downcast);
|
|
16115
|
+
kernel.dispose(rawSource);
|
|
16116
|
+
}
|
|
16117
|
+
}
|
|
16118
|
+
/**
|
|
16071
16119
|
* Fast-path cast when the shape type is already known (e.g., from iterShapes).
|
|
16072
16120
|
* Skips the shapeType() WASM call — only performs downcast + branded handle creation.
|
|
16073
16121
|
* Used internally by topology extractors for bulk sub-shape iteration.
|
|
@@ -16085,4 +16133,4 @@ function castShapeWithKnownType(ocShape, knownType, dim) {
|
|
|
16085
16133
|
return createCompound(dc, dim);
|
|
16086
16134
|
}
|
|
16087
16135
|
//#endregion
|
|
16088
|
-
export {
|
|
16136
|
+
export { getActiveKernelId as $, manifoldShell as A, is3D as B, closedWire as C, isPlanarFace as D, isOrientedFace as E, getShapeKind as F, isLive as G, createHandle as H, getOrQueryType as I, unregisterFromCleanup as J, registerForCleanup as K, as2D as L, planarFace as M, planarWire as N, isPlanarWire as O, validSolid as P, _usingCtx as Q, as3D as R, isWire as S, isManifoldShell as T, createKernelHandle as U, DisposalScope as V, getDisposalStats as W, withScopeResult as X, withScope as Y, withScopeResultAsync as Z, isShape1D as _, resetPerformanceStats as _t, createCompound as a, initFromManifold as at, isSolid as b, createShell as c, registerKernel as ct, createWire as d, withQuality as dt, getKernel as et, disposeDowncastSource as f, withTier as ft, isFace as g, getPerformanceStats as gt, isEdge as h, BrepkitAdapter as ht, castShapeWithKnownType as i, init as it, orientedFace as j, isValidSolid as k, createSolid as l, registerKernelTier as lt, isCompound as m, supportsProjection as mt, castShape as n, getKernelCapabilities as nt, createEdge as o, initFromOC as ot, disposeTransientSubShape as p, supportsConstraintSketch as pt, resetDisposalStats as q, castShape3D as r, getKernelTier as rt, createFace as s, prewarm as st, castResultShape as t, getKernel2D as tt, createVertex as u, withKernel as ut, isShape3D as v, currentQuality as vt, isClosedWire as w, isVertex as x, isShell as y, qualityDeflection as yt, is2D as z };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
const require_occtWasmAdapter = require("./occtWasmAdapter-
|
|
1
|
+
const require_occtWasmAdapter = require("./occtWasmAdapter-Bj9dX3Lb.cjs");
|
|
2
2
|
const require_vec3 = require("./vec3-CFwOI0ZI.cjs");
|
|
3
3
|
const require_errors = require("./errors-CXJtc4I7.cjs");
|
|
4
4
|
//#region src/kernel/quality.ts
|
|
@@ -433,7 +433,7 @@ function getShapeTypeMap(oc) {
|
|
|
433
433
|
let map = shapeTypeMaps.get(oc);
|
|
434
434
|
if (!map) {
|
|
435
435
|
const ta = oc.TopAbs_ShapeEnum;
|
|
436
|
-
map = new Map([
|
|
436
|
+
map = /* @__PURE__ */ new Map([
|
|
437
437
|
[ta.TopAbs_VERTEX, "vertex"],
|
|
438
438
|
[ta.TopAbs_EDGE, "edge"],
|
|
439
439
|
[ta.TopAbs_WIRE, "wire"],
|
|
@@ -2350,7 +2350,7 @@ function makeTransformOps$2(oc) {
|
|
|
2350
2350
|
//#region src/kernel/occt/meshOps.ts
|
|
2351
2351
|
/** Slice a Float32Array from the WASM heap, or return empty if size is 0. */
|
|
2352
2352
|
function sliceF32(heap, ptr, size) {
|
|
2353
|
-
if (size === 0) return new Float32Array(0);
|
|
2353
|
+
if (size === 0) return /* @__PURE__ */ new Float32Array(0);
|
|
2354
2354
|
const offset = ptr / 4;
|
|
2355
2355
|
return heap.slice(offset, offset + size);
|
|
2356
2356
|
}
|
|
@@ -2370,10 +2370,10 @@ function mesh$2(oc, shape, options) {
|
|
|
2370
2370
|
const faceGroupsSize = raw.getFaceGroupsSize();
|
|
2371
2371
|
const uvsSize = raw.getUvsSize();
|
|
2372
2372
|
const vertices = sliceF32(oc.HEAPF32, raw.getVerticesPtr(), verticesSize);
|
|
2373
|
-
const normals = options.skipNormals || normalsSize === 0 ? new Float32Array(0) : sliceF32(oc.HEAPF32, raw.getNormalsPtr(), normalsSize);
|
|
2373
|
+
const normals = options.skipNormals || normalsSize === 0 ? /* @__PURE__ */ new Float32Array(0) : sliceF32(oc.HEAPF32, raw.getNormalsPtr(), normalsSize);
|
|
2374
2374
|
const trianglesPtr = raw.getTrianglesPtr() / 4;
|
|
2375
2375
|
const triangles = oc.HEAPU32.slice(trianglesPtr, trianglesPtr + trianglesSize);
|
|
2376
|
-
const uvs = uvsSize > 0 ? sliceF32(oc.HEAPF32, raw.getUvsPtr(), uvsSize) : new Float32Array(0);
|
|
2376
|
+
const uvs = uvsSize > 0 ? sliceF32(oc.HEAPF32, raw.getUvsPtr(), uvsSize) : /* @__PURE__ */ new Float32Array(0);
|
|
2377
2377
|
const faceGroups = [];
|
|
2378
2378
|
if (faceGroupsSize > 0) {
|
|
2379
2379
|
const fgPtr = raw.getFaceGroupsPtr() / 4;
|
|
@@ -2603,7 +2603,7 @@ function vertexPosition$1(oc, vertex) {
|
|
|
2603
2603
|
/** Map from OCCT GeomAbs_SurfaceType enum value to SurfaceType string. */
|
|
2604
2604
|
function buildSurfaceTypeMap(oc) {
|
|
2605
2605
|
const e = oc.GeomAbs_SurfaceType;
|
|
2606
|
-
return new Map([
|
|
2606
|
+
return /* @__PURE__ */ new Map([
|
|
2607
2607
|
[e.GeomAbs_Plane, "plane"],
|
|
2608
2608
|
[e.GeomAbs_Cylinder, "cylinder"],
|
|
2609
2609
|
[e.GeomAbs_Cone, "cone"],
|
|
@@ -6677,7 +6677,7 @@ function meshBoolean(bk, positionsA, indicesA, positionsB, indicesB, op, toleran
|
|
|
6677
6677
|
vertices: new Float32Array(mesh.positions),
|
|
6678
6678
|
normals: new Float32Array(mesh.normals),
|
|
6679
6679
|
triangles: new Uint32Array(mesh.indices),
|
|
6680
|
-
uvs: new Float32Array(0),
|
|
6680
|
+
uvs: /* @__PURE__ */ new Float32Array(0),
|
|
6681
6681
|
faceGroups: [{
|
|
6682
6682
|
start: 0,
|
|
6683
6683
|
count: mesh.indices.length,
|
|
@@ -8093,14 +8093,14 @@ function mesh$1(bk, shape, options) {
|
|
|
8093
8093
|
if (bkHandle.type === "solid") result = meshSolid(bk, h, deflection, !!options.includeUVs, angularTol);
|
|
8094
8094
|
else if (bkHandle.type === "face") result = meshSingleFace(bk, h, deflection, 0, angularTol);
|
|
8095
8095
|
else throw new Error(`brepkit: cannot mesh shape of type '${bkHandle.type}'`);
|
|
8096
|
-
if (options.skipNormals) result.normals = new Float32Array(0);
|
|
8097
|
-
if (!options.includeUVs) result.uvs = new Float32Array(0);
|
|
8096
|
+
if (options.skipNormals) result.normals = /* @__PURE__ */ new Float32Array(0);
|
|
8097
|
+
if (!options.includeUVs) result.uvs = /* @__PURE__ */ new Float32Array(0);
|
|
8098
8098
|
return result;
|
|
8099
8099
|
}
|
|
8100
8100
|
function meshEdges$1(bk, shape, tolerance, angularTolerance) {
|
|
8101
8101
|
const bkHandle = shape;
|
|
8102
8102
|
if (bkHandle.type !== "solid") return {
|
|
8103
|
-
lines: new Float32Array(0),
|
|
8103
|
+
lines: /* @__PURE__ */ new Float32Array(0),
|
|
8104
8104
|
edgeGroups: []
|
|
8105
8105
|
};
|
|
8106
8106
|
const angularTol = angularTolerance > 0 ? angularTolerance : void 0;
|
|
@@ -8174,7 +8174,7 @@ function meshSolidGroupedBinary(bk, solidId, deflection, includeUVs, angularTole
|
|
|
8174
8174
|
faceHash: faceIds[i] ?? 0
|
|
8175
8175
|
});
|
|
8176
8176
|
}
|
|
8177
|
-
let uvs = new Float32Array(0);
|
|
8177
|
+
let uvs = /* @__PURE__ */ new Float32Array(0);
|
|
8178
8178
|
if (includeUVs) {
|
|
8179
8179
|
const expectedUvLen = positions.length / 3 * 2;
|
|
8180
8180
|
try {
|
|
@@ -8211,7 +8211,7 @@ function meshSolidGroupedJson(bk, solidId, deflection, includeUVs, angularTolera
|
|
|
8211
8211
|
faceHash: faceIds[i] ?? 0
|
|
8212
8212
|
});
|
|
8213
8213
|
}
|
|
8214
|
-
let uvs = new Float32Array(0);
|
|
8214
|
+
let uvs = /* @__PURE__ */ new Float32Array(0);
|
|
8215
8215
|
if (includeUVs) {
|
|
8216
8216
|
const expectedUvLen = data.positions.length / 3 * 2;
|
|
8217
8217
|
try {
|
|
@@ -9916,7 +9916,7 @@ var BrepkitAdapter = class {
|
|
|
9916
9916
|
function notImplemented(method) {
|
|
9917
9917
|
throw new Error(`manifold: ${method} is not implemented`);
|
|
9918
9918
|
}
|
|
9919
|
-
var REPLAYABLE_OPS = new Set([
|
|
9919
|
+
var REPLAYABLE_OPS = /* @__PURE__ */ new Set([
|
|
9920
9920
|
"makeBox",
|
|
9921
9921
|
"makeBoxWithCorners",
|
|
9922
9922
|
"makeCylinder",
|
|
@@ -10191,9 +10191,9 @@ function meshToResult(mesh) {
|
|
|
10191
10191
|
}
|
|
10192
10192
|
return {
|
|
10193
10193
|
vertices,
|
|
10194
|
-
normals: new Float32Array(0),
|
|
10194
|
+
normals: /* @__PURE__ */ new Float32Array(0),
|
|
10195
10195
|
triangles,
|
|
10196
|
-
uvs: new Float32Array(0),
|
|
10196
|
+
uvs: /* @__PURE__ */ new Float32Array(0),
|
|
10197
10197
|
faceGroups: [{
|
|
10198
10198
|
start: 0,
|
|
10199
10199
|
count: triangles.length,
|
|
@@ -11933,7 +11933,8 @@ function sweepAlong(module, profile, path, spineNode, op, extraParams, scaleAt)
|
|
|
11933
11933
|
const frames = rotationMinimizingFrames(path, section.xAxis);
|
|
11934
11934
|
const n = frames.length;
|
|
11935
11935
|
return wrap(skinRings(module, frames.map((f, i) => {
|
|
11936
|
-
|
|
11936
|
+
const scale = scaleAt ? scaleAt(n > 1 ? i / (n - 1) : 0) : 1;
|
|
11937
|
+
return placeRing(section, f, scale);
|
|
11937
11938
|
})), makeNode(op, {
|
|
11938
11939
|
section: serializeSection(section),
|
|
11939
11940
|
path: path.map((p) => [
|
|
@@ -12425,9 +12426,9 @@ function mesh(shape, options) {
|
|
|
12425
12426
|
const triangles = new Uint32Array(m.triVerts);
|
|
12426
12427
|
return {
|
|
12427
12428
|
vertices,
|
|
12428
|
-
normals: options.skipNormals ? new Float32Array(0) : computeNormals(vertices, triangles),
|
|
12429
|
+
normals: options.skipNormals ? /* @__PURE__ */ new Float32Array(0) : computeNormals(vertices, triangles),
|
|
12429
12430
|
triangles,
|
|
12430
|
-
uvs: options.includeUVs ? new Float32Array(vertices.length / 3 * 2) : new Float32Array(0),
|
|
12431
|
+
uvs: options.includeUVs ? new Float32Array(vertices.length / 3 * 2) : /* @__PURE__ */ new Float32Array(0),
|
|
12431
12432
|
faceGroups: readFaceGroups(m)
|
|
12432
12433
|
};
|
|
12433
12434
|
}
|
|
@@ -15095,11 +15096,12 @@ function makeNativeKernel2DOps(module, occt) {
|
|
|
15095
15096
|
const yx = zy * xz - zz * xy;
|
|
15096
15097
|
const yy = zz * xx - zx * xz;
|
|
15097
15098
|
const yz = zx * xy - zy * xx;
|
|
15098
|
-
|
|
15099
|
+
const pts3d = sample(asC(h)).map(([u, v]) => [
|
|
15099
15100
|
origin[0] + xx * u + yx * v,
|
|
15100
15101
|
origin[1] + xy * u + yy * v,
|
|
15101
15102
|
origin[2] + xz * u + yz * v
|
|
15102
|
-
])
|
|
15103
|
+
]);
|
|
15104
|
+
return wrap(PLACEHOLDER, makeNode("profileEdge", { pts: pts3d }, []));
|
|
15103
15105
|
},
|
|
15104
15106
|
makeBSpline2d: (points, options) => occtOr("makeBSpline2d").makeBSpline2d(points, options),
|
|
15105
15107
|
offsetCurve2d: (c, offset) => occtOr("offsetCurve2d").offsetCurve2d(toOcct(c), offset),
|
|
@@ -15520,7 +15522,7 @@ async function init() {
|
|
|
15520
15522
|
throw new Error("brepjs: no kernel package found. Install one of:\n npm install occt-wasm (recommended, default)\n npm install brepjs-opencascade\n npm install brepkit-wasm");
|
|
15521
15523
|
}
|
|
15522
15524
|
//#endregion
|
|
15523
|
-
//#region \0@oxc-project+runtime@0.
|
|
15525
|
+
//#region \0@oxc-project+runtime@0.138.0/helpers/esm/usingCtx.js
|
|
15524
15526
|
function _usingCtx() {
|
|
15525
15527
|
var r = "function" == typeof SuppressedError ? SuppressedError : function(r, e) {
|
|
15526
15528
|
var n = Error();
|
|
@@ -16076,6 +16078,52 @@ function castShape3D(ocShape) {
|
|
|
16076
16078
|
return castShape(ocShape);
|
|
16077
16079
|
}
|
|
16078
16080
|
/**
|
|
16081
|
+
* Release the pre-downcast handle of a freshly-produced kernel result after it
|
|
16082
|
+
* has been cast to `cast`.
|
|
16083
|
+
*
|
|
16084
|
+
* On occt-wasm `downcast` allocates a new arena slot and orphans the input; a
|
|
16085
|
+
* handle's own `delete()` is a no-op there, so the input must be released via
|
|
16086
|
+
* `getKernel().dispose()` to reclaim the slot. Kernels whose `downcast` is
|
|
16087
|
+
* identity (manifold, brepkit) return the same handle as `cast`, so nothing is
|
|
16088
|
+
* released — doing so would delete the shape being returned.
|
|
16089
|
+
*
|
|
16090
|
+
* Use only for a kernel result the caller owns outright — never for a shape
|
|
16091
|
+
* received from elsewhere.
|
|
16092
|
+
*/
|
|
16093
|
+
function disposeDowncastSource(source, cast) {
|
|
16094
|
+
if (cast.wrapped !== source) getKernel().dispose(source);
|
|
16095
|
+
}
|
|
16096
|
+
/**
|
|
16097
|
+
* Cast a freshly-produced kernel result to its branded type and release the
|
|
16098
|
+
* orphaned pre-downcast handle. The result-owning counterpart to {@link castShape};
|
|
16099
|
+
* see {@link disposeDowncastSource} for the arena semantics.
|
|
16100
|
+
*/
|
|
16101
|
+
function castResultShape(ocShape, dim) {
|
|
16102
|
+
const cast = castShape(ocShape, dim);
|
|
16103
|
+
disposeDowncastSource(ocShape, cast);
|
|
16104
|
+
return cast;
|
|
16105
|
+
}
|
|
16106
|
+
/**
|
|
16107
|
+
* Fully release a transiently-branded sub-shape and the raw handle it was cast
|
|
16108
|
+
* from — for a face/edge iterated only to read a property, then discarded.
|
|
16109
|
+
*
|
|
16110
|
+
* `handle`'s dispose updates stats and, on kernels that own their native object
|
|
16111
|
+
* (Embind, manifold, brepkit), frees it. occt-wasm handles are arena-backed
|
|
16112
|
+
* (their delete is a no-op), so when the downcast produced a distinct handle
|
|
16113
|
+
* (`handle.wrapped !== rawSource`) both arena slots are released explicitly. The
|
|
16114
|
+
* identity guard also skips manifold/brepkit — there `handle` *is* `rawSource`,
|
|
16115
|
+
* already freed above, and their `dispose()` has no double-free guard.
|
|
16116
|
+
*/
|
|
16117
|
+
function disposeTransientSubShape(handle, rawSource) {
|
|
16118
|
+
const downcast = handle.wrapped;
|
|
16119
|
+
handle[Symbol.dispose]();
|
|
16120
|
+
if (downcast !== rawSource) {
|
|
16121
|
+
const kernel = getKernel();
|
|
16122
|
+
kernel.dispose(downcast);
|
|
16123
|
+
kernel.dispose(rawSource);
|
|
16124
|
+
}
|
|
16125
|
+
}
|
|
16126
|
+
/**
|
|
16079
16127
|
* Fast-path cast when the shape type is already known (e.g., from iterShapes).
|
|
16080
16128
|
* Skips the shapeType() WASM call — only performs downcast + branded handle creation.
|
|
16081
16129
|
* Used internally by topology extractors for bulk sub-shape iteration.
|
|
@@ -16123,6 +16171,12 @@ Object.defineProperty(exports, "as3D", {
|
|
|
16123
16171
|
return as3D;
|
|
16124
16172
|
}
|
|
16125
16173
|
});
|
|
16174
|
+
Object.defineProperty(exports, "castResultShape", {
|
|
16175
|
+
enumerable: true,
|
|
16176
|
+
get: function() {
|
|
16177
|
+
return castResultShape;
|
|
16178
|
+
}
|
|
16179
|
+
});
|
|
16126
16180
|
Object.defineProperty(exports, "castShape", {
|
|
16127
16181
|
enumerable: true,
|
|
16128
16182
|
get: function() {
|
|
@@ -16207,6 +16261,18 @@ Object.defineProperty(exports, "currentQuality", {
|
|
|
16207
16261
|
return currentQuality;
|
|
16208
16262
|
}
|
|
16209
16263
|
});
|
|
16264
|
+
Object.defineProperty(exports, "disposeDowncastSource", {
|
|
16265
|
+
enumerable: true,
|
|
16266
|
+
get: function() {
|
|
16267
|
+
return disposeDowncastSource;
|
|
16268
|
+
}
|
|
16269
|
+
});
|
|
16270
|
+
Object.defineProperty(exports, "disposeTransientSubShape", {
|
|
16271
|
+
enumerable: true,
|
|
16272
|
+
get: function() {
|
|
16273
|
+
return disposeTransientSubShape;
|
|
16274
|
+
}
|
|
16275
|
+
});
|
|
16210
16276
|
Object.defineProperty(exports, "getActiveKernelId", {
|
|
16211
16277
|
enumerable: true,
|
|
16212
16278
|
get: function() {
|
package/dist/sketching.cjs
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
2
|
-
const require_textBlueprints = require("./textBlueprints-
|
|
3
|
-
const require_blueprintSketcher = require("./blueprintSketcher-
|
|
4
|
-
const require_drawFns = require("./drawFns-
|
|
2
|
+
const require_textBlueprints = require("./textBlueprints-C17PPSzH.cjs");
|
|
3
|
+
const require_blueprintSketcher = require("./blueprintSketcher-XiLc6fJ4.cjs");
|
|
4
|
+
const require_drawFns = require("./drawFns-CG3ksr6q.cjs");
|
|
5
5
|
//#region src/sketching.ts
|
|
6
6
|
/**
|
|
7
7
|
* brepjs/sketching — Sketcher, Drawing, and sketch-to-shape operations.
|
package/dist/sketching.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { n as BaseSketcher2d, t as BlueprintSketcher } from "./blueprintSketcher-
|
|
2
|
-
import { A as sketchEllipse, C as DrawingPen, D as makeBaseBox, E as deserializeDrawing, F as sketchRectangle, I as sketchRoundedRectangle, L as FaceSketcher, M as sketchHelix, N as sketchParametricFunction, O as polysideInnerRadius, P as sketchPolysides, R as Sketcher, S as drawText, T as Drawing, _ as drawPolysides, a as drawingIntersect, b as drawSingleCircle, c as rotateDrawing, d as drawFaceOutline, f as drawProjection, g as drawPointsInterpolation, h as drawParametricFunction, i as drawingFuse, j as sketchFaceOffset, k as sketchCircle, l as scaleDrawing, m as drawEllipse, n as drawingCut, o as drawingToSketchOnPlane, p as drawCircle, r as drawingFillet, s as mirrorDrawing, t as drawingChamfer, u as translateDrawing, v as drawRectangle, w as draw, x as drawSingleEllipse, y as drawRoundedRectangle } from "./drawFns-
|
|
3
|
-
import { a as Sketch, c as compoundSketchLoft, d as sketchFace, f as sketchLoft, h as sketchWires, i as Sketches, l as compoundSketchRevolve, m as sketchSweep, o as compoundSketchExtrude, p as sketchRevolve, s as compoundSketchFace, u as sketchExtrude, v as CompoundSketch } from "./textBlueprints-
|
|
1
|
+
import { n as BaseSketcher2d, t as BlueprintSketcher } from "./blueprintSketcher-D-xSC6Mp.js";
|
|
2
|
+
import { A as sketchEllipse, C as DrawingPen, D as makeBaseBox, E as deserializeDrawing, F as sketchRectangle, I as sketchRoundedRectangle, L as FaceSketcher, M as sketchHelix, N as sketchParametricFunction, O as polysideInnerRadius, P as sketchPolysides, R as Sketcher, S as drawText, T as Drawing, _ as drawPolysides, a as drawingIntersect, b as drawSingleCircle, c as rotateDrawing, d as drawFaceOutline, f as drawProjection, g as drawPointsInterpolation, h as drawParametricFunction, i as drawingFuse, j as sketchFaceOffset, k as sketchCircle, l as scaleDrawing, m as drawEllipse, n as drawingCut, o as drawingToSketchOnPlane, p as drawCircle, r as drawingFillet, s as mirrorDrawing, t as drawingChamfer, u as translateDrawing, v as drawRectangle, w as draw, x as drawSingleEllipse, y as drawRoundedRectangle } from "./drawFns-DkhqDgS5.js";
|
|
3
|
+
import { a as Sketch, c as compoundSketchLoft, d as sketchFace, f as sketchLoft, h as sketchWires, i as Sketches, l as compoundSketchRevolve, m as sketchSweep, o as compoundSketchExtrude, p as sketchRevolve, s as compoundSketchFace, u as sketchExtrude, v as CompoundSketch } from "./textBlueprints-D9l3v-f3.js";
|
|
4
4
|
//#region src/sketching.ts
|
|
5
5
|
/**
|
|
6
6
|
* brepjs/sketching — Sketcher, Drawing, and sketch-to-shape operations.
|
|
@@ -1,13 +1,13 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { a as createCompound, b as isSolid, et as getKernel, f as disposeDowncastSource, l as createSolid, n as castShape, u as createVertex, v as isShape3D, y as isShell } from "./shapeTypes-BguzpBK0.js";
|
|
2
2
|
import { A as ok, R as unwrap, b as err, d as validationError, i as kernelError, l as typeCastError, t as BrepErrorCode, v as andThen, w as isErr } from "./errors-DNWJsfVU.js";
|
|
3
|
-
import { f as getVertices, p as getWires, s as getEdges } from "./topologyQueryFns-
|
|
3
|
+
import { f as getVertices, p as getWires, s as getEdges } from "./topologyQueryFns-Dl2F-2d9.js";
|
|
4
4
|
import { n as HASH_CODE_MAX } from "./constants-ITRzCnCp.js";
|
|
5
5
|
import { h as vecScale, t as vecAdd } from "./vecOps-SKPRvPH-.js";
|
|
6
6
|
import { o as resolvePlane } from "./planeOps-DSjjtrjg.js";
|
|
7
|
-
import { _ as cast, v as downcast } from "./faceFns-
|
|
8
|
-
import { _ as collectInputFaceHashes, b as propagateMetadataByHash, y as propagateAllMetadata } from "./shapeFns-
|
|
7
|
+
import { _ as cast, v as downcast } from "./faceFns-CpOAl1K5.js";
|
|
8
|
+
import { _ as collectInputFaceHashes, b as propagateMetadataByHash, y as propagateAllMetadata } from "./shapeFns-DED4C70_.js";
|
|
9
9
|
import { n as getAtOrThrow, t as firstOrThrow } from "./arrayAccess-DrUGPADn.js";
|
|
10
|
-
import { r as makeFace } from "./surfaceBuilders-
|
|
10
|
+
import { r as makeFace } from "./surfaceBuilders-CT__o6Be.js";
|
|
11
11
|
//#region src/topology/booleanFns.ts
|
|
12
12
|
/**
|
|
13
13
|
* Boolean and compound operations — functional replacements for _3DShape boolean methods.
|
|
@@ -35,6 +35,7 @@ function castToShape3D(shape, errorCode, errorMsg, suggestion, diagnostics) {
|
|
|
35
35
|
wrapped[Symbol.dispose]();
|
|
36
36
|
return err(typeCastError(errorCode, `${errorMsg}. Got ${typeName} instead.`, void 0, diagnostics ? { diagnostics } : void 0, suggestion));
|
|
37
37
|
}
|
|
38
|
+
disposeDowncastSource(shape, wrapped);
|
|
38
39
|
return ok(wrapped);
|
|
39
40
|
}
|
|
40
41
|
function fuse(a, b, { optimisation = "none", simplify = false, signal, fuzzyValue, unsafe: _unsafe, trackEvolution = true } = {}) {
|
|
@@ -1,13 +1,13 @@
|
|
|
1
|
-
const require_shapeTypes = require("./shapeTypes-
|
|
1
|
+
const require_shapeTypes = require("./shapeTypes-Ca76Bklg.cjs");
|
|
2
2
|
const require_errors = require("./errors-CXJtc4I7.cjs");
|
|
3
|
-
const require_topologyQueryFns = require("./topologyQueryFns-
|
|
3
|
+
const require_topologyQueryFns = require("./topologyQueryFns-B1QAiZVI.cjs");
|
|
4
4
|
const require_constants = require("./constants-BOVyEYGH.cjs");
|
|
5
5
|
const require_vecOps = require("./vecOps-CCnJt-yH.cjs");
|
|
6
6
|
const require_planeOps = require("./planeOps-BA4HfgQu.cjs");
|
|
7
|
-
const require_faceFns = require("./faceFns-
|
|
8
|
-
const require_shapeFns = require("./shapeFns-
|
|
7
|
+
const require_faceFns = require("./faceFns-DnLXDWq2.cjs");
|
|
8
|
+
const require_shapeFns = require("./shapeFns-DxAhtxFP.cjs");
|
|
9
9
|
const require_arrayAccess = require("./arrayAccess-e4H9cBfh.cjs");
|
|
10
|
-
const require_surfaceBuilders = require("./surfaceBuilders-
|
|
10
|
+
const require_surfaceBuilders = require("./surfaceBuilders-De2XKidK.cjs");
|
|
11
11
|
//#region src/topology/booleanFns.ts
|
|
12
12
|
/**
|
|
13
13
|
* Boolean and compound operations — functional replacements for _3DShape boolean methods.
|
|
@@ -35,6 +35,7 @@ function castToShape3D(shape, errorCode, errorMsg, suggestion, diagnostics) {
|
|
|
35
35
|
wrapped[Symbol.dispose]();
|
|
36
36
|
return require_errors.err(require_errors.typeCastError(errorCode, `${errorMsg}. Got ${typeName} instead.`, void 0, diagnostics ? { diagnostics } : void 0, suggestion));
|
|
37
37
|
}
|
|
38
|
+
require_shapeTypes.disposeDowncastSource(shape, wrapped);
|
|
38
39
|
return require_errors.ok(wrapped);
|
|
39
40
|
}
|
|
40
41
|
function fuse(a, b, { optimisation = "none", simplify = false, signal, fuzzyValue, unsafe: _unsafe, trackEvolution = true } = {}) {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { D as isPlanarFace, d as createWire, et as getKernel, g as isFace, o as createEdge, s as createFace } from "./shapeTypes-BguzpBK0.js";
|
|
2
2
|
import { A as ok, b as err, d as validationError, i as kernelError, v as andThen } from "./errors-DNWJsfVU.js";
|
|
3
|
-
import { _ as cast, u as outerWire } from "./faceFns-
|
|
3
|
+
import { _ as cast, u as outerWire } from "./faceFns-CpOAl1K5.js";
|
|
4
4
|
//#region src/utils/range.ts
|
|
5
5
|
/** Generate an array of integers `[0, 1, …, len - 1]`. */
|
|
6
6
|
function range(len) {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
const require_shapeTypes = require("./shapeTypes-
|
|
1
|
+
const require_shapeTypes = require("./shapeTypes-Ca76Bklg.cjs");
|
|
2
2
|
const require_errors = require("./errors-CXJtc4I7.cjs");
|
|
3
|
-
const require_faceFns = require("./faceFns-
|
|
3
|
+
const require_faceFns = require("./faceFns-DnLXDWq2.cjs");
|
|
4
4
|
//#region src/utils/range.ts
|
|
5
5
|
/** Generate an array of integers `[0, 1, …, len - 1]`. */
|
|
6
6
|
function range(len) {
|
package/dist/text.cjs
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
2
|
-
const require_textBlueprints = require("./textBlueprints-
|
|
3
|
-
const require_textMetrics = require("./textMetrics-
|
|
2
|
+
const require_textBlueprints = require("./textBlueprints-C17PPSzH.cjs");
|
|
3
|
+
const require_textMetrics = require("./textMetrics-BwQ7TD47.cjs");
|
|
4
4
|
exports.fontMetrics = require_textMetrics.fontMetrics;
|
|
5
5
|
exports.getFont = require_textBlueprints.getFont;
|
|
6
6
|
exports.loadFont = require_textBlueprints.loadFont;
|
package/dist/text.js
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import { n as getFont, r as loadFont, t as textBlueprints } from "./textBlueprints-
|
|
2
|
-
import { n as textMetrics, r as sketchText, t as fontMetrics } from "./textMetrics-
|
|
1
|
+
import { n as getFont, r as loadFont, t as textBlueprints } from "./textBlueprints-D9l3v-f3.js";
|
|
2
|
+
import { n as textMetrics, r as sketchText, t as fontMetrics } from "./textMetrics-GSAxEtaJ.js";
|
|
3
3
|
export { fontMetrics, getFont, loadFont, sketchText, textBlueprints, textMetrics };
|
|
@@ -29,18 +29,18 @@ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__ge
|
|
|
29
29
|
enumerable: true
|
|
30
30
|
}) : target, mod));
|
|
31
31
|
//#endregion
|
|
32
|
-
const require_shapeTypes = require("./shapeTypes-
|
|
32
|
+
const require_shapeTypes = require("./shapeTypes-Ca76Bklg.cjs");
|
|
33
33
|
const require_errors = require("./errors-CXJtc4I7.cjs");
|
|
34
34
|
const require_types = require("./types-KjA8tY4Y.cjs");
|
|
35
35
|
const require_vecOps = require("./vecOps-CCnJt-yH.cjs");
|
|
36
36
|
const require_planeOps = require("./planeOps-BA4HfgQu.cjs");
|
|
37
|
-
const require_faceFns = require("./faceFns-
|
|
38
|
-
const require_curveFns = require("./curveFns-
|
|
37
|
+
const require_faceFns = require("./faceFns-DnLXDWq2.cjs");
|
|
38
|
+
const require_curveFns = require("./curveFns-YvH970hp.cjs");
|
|
39
39
|
const require_arrayAccess = require("./arrayAccess-e4H9cBfh.cjs");
|
|
40
|
-
const require_surfaceBuilders = require("./surfaceBuilders-
|
|
41
|
-
const require_solidBuilders = require("./solidBuilders-
|
|
42
|
-
const require_blueprintSketcher = require("./blueprintSketcher-
|
|
43
|
-
const require_loftFns = require("./loftFns-
|
|
40
|
+
const require_surfaceBuilders = require("./surfaceBuilders-De2XKidK.cjs");
|
|
41
|
+
const require_solidBuilders = require("./solidBuilders-yyfZ2Q-7.cjs");
|
|
42
|
+
const require_blueprintSketcher = require("./blueprintSketcher-XiLc6fJ4.cjs");
|
|
43
|
+
const require_loftFns = require("./loftFns-CZC_NH_h.cjs");
|
|
44
44
|
let opentype_js = require("opentype.js");
|
|
45
45
|
opentype_js = __toESM(opentype_js, 1);
|
|
46
46
|
//#region src/sketching/compoundSketch.ts
|
|
@@ -368,7 +368,8 @@ var Sketch = class Sketch {
|
|
|
368
368
|
}
|
|
369
369
|
/** Create an independent deep copy of this sketch. */
|
|
370
370
|
clone() {
|
|
371
|
-
const
|
|
371
|
+
const cloned = require_shapeTypes.createWire(require_errors.unwrap(require_faceFns.downcast(this.wire.wrapped)));
|
|
372
|
+
const sketch = new Sketch(cloned, {
|
|
372
373
|
defaultOrigin: this.defaultOrigin,
|
|
373
374
|
defaultDirection: this.defaultDirection
|
|
374
375
|
});
|