brepjs 18.118.12 → 18.118.13
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-BaiFeuKQ.cjs → adjacencyFns-BdxIbZtR.cjs} +2 -2
- package/dist/{adjacencyFns-CRqm5AS0.js → adjacencyFns-qxeJWyj-.js} +2 -2
- package/dist/{blueprint-xYq-5XuV.js → blueprint-CJ7k25eW.js} +5 -5
- package/dist/{blueprint-DI5CF5j9.cjs → blueprint-DF-Ig1SW.cjs} +5 -5
- package/dist/{blueprintFns-BIx82gku.js → blueprintFns-BKtVfo16.js} +2 -2
- package/dist/{blueprintFns-rkE3w33A.cjs → blueprintFns-CjvHOuIy.cjs} +2 -2
- package/dist/{blueprintSketcher-DuNukkBb.js → blueprintSketcher-BIUHqWo9.js} +3 -3
- package/dist/{blueprintSketcher-CW1MTtqe.cjs → blueprintSketcher-DRGumaWR.cjs} +3 -3
- package/dist/{boolean2D-CstWuqo8.cjs → boolean2D-5WdQm5Kb.cjs} +4 -4
- package/dist/{boolean2D-D7WPkRuG.js → boolean2D-Buf04D7l.js} +4 -4
- package/dist/brepjs.cjs +40 -28
- package/dist/brepjs.js +40 -28
- package/dist/{cameraFns-CaG1cMFg.cjs → cameraFns-CiGOarQ4.cjs} +2 -2
- package/dist/{cameraFns-B1P5WTCI.js → cameraFns-MViqtlSh.js} +2 -2
- package/dist/core.cjs +1 -1
- package/dist/core.js +1 -1
- package/dist/{cornerFinder-BZqos_kQ.js → cornerFinder-BEe90gzY.js} +1 -1
- package/dist/{cornerFinder-Ivo7aISl.cjs → cornerFinder-Bss_mZV9.cjs} +1 -1
- package/dist/{curveFns-DDLgrGyy.cjs → curveFns-C2zZ7Xuq.cjs} +1 -1
- package/dist/{curveFns-C5qarKS5.js → curveFns-CH6gaGTf.js} +1 -1
- package/dist/{drawFns-BU7wz6Sh.js → drawFns-CWfBvGiY.js} +47 -33
- package/dist/{drawFns-BX8bt_LP.cjs → drawFns-DZHPT-nb.cjs} +48 -34
- package/dist/{faceFns-RZFix5VU.cjs → faceFns-BbmIuuFt.cjs} +2 -2
- package/dist/{faceFns-Bkno2HCU.js → faceFns-ClvSac1T.js} +2 -2
- package/dist/{healingFns-DbunvjeU.cjs → healingFns-BZ-TOacm.cjs} +5 -5
- package/dist/{healingFns-D3Yl3-zg.js → healingFns-BhB_G0L0.js} +5 -5
- package/dist/{helpers-DVMbGdiy.cjs → helpers-D0be4TzF.cjs} +6 -6
- package/dist/{helpers-XUoXaD5D.js → helpers-zVYq0h_A.js} +6 -6
- package/dist/{importFns-C2z-lgvq.js → importFns-CzBtuX0j.js} +2 -2
- package/dist/{importFns-EwV81J0E.cjs → importFns-Tgnymh7F.cjs} +2 -2
- package/dist/io.cjs +2 -2
- package/dist/io.js +2 -2
- package/dist/kernel/occtWasm/occtWasmAdapter.cjs +1 -1
- package/dist/kernel/occtWasm/occtWasmAdapter.js +1 -1
- package/dist/{loftFns-BWaSzS-2.cjs → loftFns-Be0OZxYM.cjs} +1 -1
- package/dist/{loftFns-DpQTJQgv.js → loftFns-DxJAP4Qv.js} +1 -1
- package/dist/{measureFns-D7FLzPAB.js → measureFns-Bbgcgo9U.js} +3 -3
- package/dist/{measureFns-z1j5oyK6.cjs → measureFns-cK6MSs6B.cjs} +3 -3
- package/dist/measurement.cjs +1 -1
- package/dist/measurement.js +1 -1
- package/dist/{meshFns-DqHpJu5I.js → meshFns-CKXYSlFr.js} +3 -3
- package/dist/{meshFns-CKOXvMDj.cjs → meshFns-Df26UzQ9.cjs} +3 -3
- package/dist/{occtWasmAdapter-nqo3wbVj.js → occtWasmAdapter-BgmRCYeD.js} +29 -11
- package/dist/{occtWasmAdapter-8wX1Z2-I.cjs → occtWasmAdapter-CWX5KCl8.cjs} +29 -11
- package/dist/operations.cjs +2 -2
- package/dist/operations.js +2 -2
- package/dist/{primitiveFns-uXoHZuh9.js → primitiveFns-1otQpjcN.js} +50 -19
- package/dist/{primitiveFns-D0k3Absh.cjs → primitiveFns-DZkzMLUq.cjs} +50 -19
- 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-C1DZyVnQ.cjs → refResolveFns-BLM5XlZR.cjs} +6 -6
- package/dist/{refResolveFns-CEs1EWWI.js → refResolveFns-_niAxNu8.js} +6 -6
- package/dist/{shapeFns-CpopWo8-.js → shapeFns-Gzaax25v.js} +2 -2
- package/dist/{shapeFns-CQVLaU7u.cjs → shapeFns-m5OBBpM4.cjs} +2 -2
- package/dist/shapeRef.cjs +1 -1
- package/dist/shapeRef.js +1 -1
- package/dist/{shapeTypes-BtEERwGK.js → shapeTypes-BalkiKtK.js} +4 -2
- package/dist/{shapeTypes-BsJXkU8g.cjs → shapeTypes-C4gRoPYX.cjs} +4 -2
- package/dist/sketching.cjs +3 -3
- package/dist/sketching.js +3 -3
- package/dist/{solidBuilders-t7TnJXqT.cjs → solidBuilders-CHzmSo67.cjs} +8 -8
- package/dist/{solidBuilders-BRva7VpY.js → solidBuilders-CgEPRock.js} +8 -8
- package/dist/{surfaceBuilders-On9uTEBH.cjs → surfaceBuilders-DWHDogVL.cjs} +13 -4
- package/dist/{surfaceBuilders-Co91_Kh7.js → surfaceBuilders-HAF4Xtow.js} +13 -4
- package/dist/text.cjs +2 -2
- package/dist/text.js +2 -2
- package/dist/{textBlueprints-DdCJocI3.js → textBlueprints-CFPE5_QI.js} +7 -7
- package/dist/{textBlueprints-BoFKAYI9.cjs → textBlueprints-DgTBXc6O.cjs} +7 -7
- package/dist/{textMetrics-CS_JMGf1.cjs → textMetrics-BH-izd6N.cjs} +1 -1
- package/dist/{textMetrics-DYzW2as_.js → textMetrics-C2cwK7wU.js} +1 -1
- package/dist/{threadFns-DwKNCMFx.cjs → threadFns-B6SQd48K.cjs} +32 -18
- package/dist/{threadFns-BKQNkgT6.js → threadFns-G71HVwW7.js} +32 -18
- package/dist/topology.cjs +9 -9
- package/dist/topology.js +9 -9
- package/dist/{topologyQueryFns-5vIsyp4r.cjs → topologyQueryFns-BzIV1jHw.cjs} +1 -1
- package/dist/{topologyQueryFns-BU41SCtU.js → topologyQueryFns-vDjZw1k2.js} +1 -1
- package/package.json +1 -1
|
@@ -1,22 +1,22 @@
|
|
|
1
|
-
import { U as DisposalScope, c as createFace, et as _usingCtx, f as createWire, nt as getKernel, s as createEdge } from "./shapeTypes-
|
|
1
|
+
import { U as DisposalScope, c as createFace, et as _usingCtx, f as createWire, nt as getKernel, s as createEdge } from "./shapeTypes-BalkiKtK.js";
|
|
2
2
|
import { n as wasmIndex } from "./vec3-Dpha8d5k.js";
|
|
3
3
|
import { R as unwrap, h as bug, s as safeIndex } from "./errors-DNWJsfVU.js";
|
|
4
|
-
import { s as getEdges } from "./topologyQueryFns-
|
|
4
|
+
import { s as getEdges } from "./topologyQueryFns-vDjZw1k2.js";
|
|
5
5
|
import { t as DEG2RAD } from "./constants-ITRzCnCp.js";
|
|
6
6
|
import { r as toVec3 } from "./types-D24Y27N0.js";
|
|
7
7
|
import { d as vecNormalize, g as vecSub, h as vecScale, m as vecRotate, r as vecCross } from "./vecOps-SKPRvPH-.js";
|
|
8
8
|
import { a as planeToWorld, o as resolvePlane } from "./planeOps-DSjjtrjg.js";
|
|
9
|
-
import { d as pointOnSurface, l as normalAt, m as uvBounds, r as faceCenter, u as outerWire, v as copyShape, y as downcast } from "./faceFns-
|
|
10
|
-
import { h as offsetWire2D, i as curveIsClosed, l as curveStartPoint } from "./curveFns-
|
|
9
|
+
import { d as pointOnSurface, l as normalAt, m as uvBounds, r as faceCenter, u as outerWire, v as copyShape, y as downcast } from "./faceFns-ClvSac1T.js";
|
|
10
|
+
import { h as offsetWire2D, i as curveIsClosed, l as curveStartPoint } from "./curveFns-CH6gaGTf.js";
|
|
11
11
|
import { n as getAtOrThrow, r as lastOrThrow, t as firstOrThrow } from "./arrayAccess-DrUGPADn.js";
|
|
12
|
-
import { c as makeBSplineApproximation, d as makeCircle, f as makeEllipse, m as makeHelix, r as makeFace, s as assembleWire } from "./surfaceBuilders-
|
|
13
|
-
import { a as Blueprints, c as make2dOffset, i as CompoundBlueprint, l as intersectCurves, n as BaseSketcher2d, o as chamferCurves, s as filletCurves, u as Flatbush } from "./blueprintSketcher-
|
|
14
|
-
import { _ as samePoint$1, b as subtract2d, c as PRECISION_OFFSET, l as add2d, y as squareDistance2d } from "./helpers-
|
|
15
|
-
import { _ as Curve2D, a as edgeToCurve, c as make2dCircle, d as make2dInerpolatedBSplineCurve, f as make2dSegmentCurve, g as approximateAsSvgCompatibleCurve, i as curvesAsEdgesOnPlane, l as make2dEllipse, o as make2dArcFromCenter, t as Blueprint, v as deserializeCurve2D, y as BoundingBox2d } from "./blueprint-
|
|
16
|
-
import { t as cornerFinder } from "./cornerFinder-
|
|
17
|
-
import { c as roundedRectangleBlueprint, n as fuse2D, r as intersect2D, s as polysidesBlueprint, t as cut2D } from "./boolean2D-
|
|
18
|
-
import { _ as wrapSketchDataArray, a as Sketch, g as wrapSketchData, i as Sketches, t as textBlueprints } from "./textBlueprints-
|
|
19
|
-
import { i as projectEdges, t as cameraFromPlane } from "./cameraFns-
|
|
12
|
+
import { c as makeBSplineApproximation, d as makeCircle, f as makeEllipse, m as makeHelix, r as makeFace, s as assembleWire } from "./surfaceBuilders-HAF4Xtow.js";
|
|
13
|
+
import { a as Blueprints, c as make2dOffset, i as CompoundBlueprint, l as intersectCurves, n as BaseSketcher2d, o as chamferCurves, s as filletCurves, u as Flatbush } from "./blueprintSketcher-BIUHqWo9.js";
|
|
14
|
+
import { _ as samePoint$1, b as subtract2d, c as PRECISION_OFFSET, l as add2d, y as squareDistance2d } from "./helpers-zVYq0h_A.js";
|
|
15
|
+
import { _ as Curve2D, a as edgeToCurve, c as make2dCircle, d as make2dInerpolatedBSplineCurve, f as make2dSegmentCurve, g as approximateAsSvgCompatibleCurve, i as curvesAsEdgesOnPlane, l as make2dEllipse, o as make2dArcFromCenter, t as Blueprint, v as deserializeCurve2D, y as BoundingBox2d } from "./blueprint-CJ7k25eW.js";
|
|
16
|
+
import { t as cornerFinder } from "./cornerFinder-BEe90gzY.js";
|
|
17
|
+
import { c as roundedRectangleBlueprint, n as fuse2D, r as intersect2D, s as polysidesBlueprint, t as cut2D } from "./boolean2D-Buf04D7l.js";
|
|
18
|
+
import { _ as wrapSketchDataArray, a as Sketch, g as wrapSketchData, i as Sketches, t as textBlueprints } from "./textBlueprints-CFPE5_QI.js";
|
|
19
|
+
import { i as projectEdges, t as cameraFromPlane } from "./cameraFns-MViqtlSh.js";
|
|
20
20
|
//#region src/2d/lib/stitching.ts
|
|
21
21
|
/**
|
|
22
22
|
* Group a flat list of curves into connected chains by matching endpoints.
|
|
@@ -299,11 +299,18 @@ var FaceSketcher = class extends BaseSketcher2d {
|
|
|
299
299
|
* @category Sketching
|
|
300
300
|
*/
|
|
301
301
|
var sketchCircle = (radius, planeConfig = {}) => {
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
302
|
+
try {
|
|
303
|
+
var _usingCtx$2 = _usingCtx();
|
|
304
|
+
const plane = planeConfig.plane && typeof planeConfig.plane !== "string" ? { ...planeConfig.plane } : unwrap(resolvePlane(planeConfig.plane ?? "XY", planeConfig.origin));
|
|
305
|
+
return new Sketch(unwrap(assembleWire([_usingCtx$2.u(new DisposalScope()).register(makeCircle(radius, plane.origin, plane.zDir))])), {
|
|
306
|
+
defaultOrigin: [...plane.origin],
|
|
307
|
+
defaultDirection: [...plane.zDir]
|
|
308
|
+
});
|
|
309
|
+
} catch (_) {
|
|
310
|
+
_usingCtx$2.e = _;
|
|
311
|
+
} finally {
|
|
312
|
+
_usingCtx$2.d();
|
|
313
|
+
}
|
|
307
314
|
};
|
|
308
315
|
/**
|
|
309
316
|
* Create an elliptical Sketch on a given plane.
|
|
@@ -316,19 +323,26 @@ var sketchCircle = (radius, planeConfig = {}) => {
|
|
|
316
323
|
* @category Sketching
|
|
317
324
|
*/
|
|
318
325
|
var sketchEllipse = (xRadius = 1, yRadius = 2, planeConfig = {}) => {
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
326
|
+
try {
|
|
327
|
+
var _usingCtx3 = _usingCtx();
|
|
328
|
+
const plane = planeConfig.plane && typeof planeConfig.plane !== "string" ? { ...planeConfig.plane } : unwrap(resolvePlane(planeConfig.plane ?? "XY", planeConfig.origin));
|
|
329
|
+
let xDir = plane.xDir;
|
|
330
|
+
let majR = xRadius;
|
|
331
|
+
let minR = yRadius;
|
|
332
|
+
if (yRadius > xRadius) {
|
|
333
|
+
xDir = vecRotate(xDir, plane.zDir, 90 * DEG2RAD);
|
|
334
|
+
majR = yRadius;
|
|
335
|
+
minR = xRadius;
|
|
336
|
+
}
|
|
337
|
+
return new Sketch(unwrap(assembleWire([_usingCtx3.u(new DisposalScope()).register(unwrap(makeEllipse(majR, minR, plane.origin, plane.zDir, xDir)))])), {
|
|
338
|
+
defaultOrigin: [...plane.origin],
|
|
339
|
+
defaultDirection: [...plane.zDir]
|
|
340
|
+
});
|
|
341
|
+
} catch (_) {
|
|
342
|
+
_usingCtx3.e = _;
|
|
343
|
+
} finally {
|
|
344
|
+
_usingCtx3.d();
|
|
327
345
|
}
|
|
328
|
-
return new Sketch(unwrap(assembleWire([unwrap(makeEllipse(majR, minR, plane.origin, plane.zDir, xDir))])), {
|
|
329
|
-
defaultOrigin: [...plane.origin],
|
|
330
|
-
defaultDirection: [...plane.zDir]
|
|
331
|
-
});
|
|
332
346
|
};
|
|
333
347
|
/**
|
|
334
348
|
* Create a rectangular Sketch centered on a given plane.
|
|
@@ -446,8 +460,8 @@ var sketchFaceOffset = (face, offset) => {
|
|
|
446
460
|
*/
|
|
447
461
|
var sketchParametricFunction = (func, planeConfig = {}, { pointsCount = 400, start = 0, stop = 1 } = {}, approximationConfig = {}) => {
|
|
448
462
|
try {
|
|
449
|
-
var
|
|
450
|
-
const scope =
|
|
463
|
+
var _usingCtx4 = _usingCtx();
|
|
464
|
+
const scope = _usingCtx4.u(new DisposalScope());
|
|
451
465
|
const plane = planeConfig.plane && typeof planeConfig.plane !== "string" ? { ...planeConfig.plane } : unwrap(resolvePlane(planeConfig.plane ?? "XY", planeConfig.origin));
|
|
452
466
|
const stepSize = (stop - start) / pointsCount;
|
|
453
467
|
const points = [...Array(pointsCount + 1).keys()].map((t) => {
|
|
@@ -459,9 +473,9 @@ var sketchParametricFunction = (func, planeConfig = {}, { pointsCount = 400, sta
|
|
|
459
473
|
defaultDirection: [...plane.zDir]
|
|
460
474
|
});
|
|
461
475
|
} catch (_) {
|
|
462
|
-
|
|
476
|
+
_usingCtx4.e = _;
|
|
463
477
|
} finally {
|
|
464
|
-
|
|
478
|
+
_usingCtx4.d();
|
|
465
479
|
}
|
|
466
480
|
};
|
|
467
481
|
/**
|
|
@@ -1,22 +1,22 @@
|
|
|
1
|
-
const require_textBlueprints = require("./textBlueprints-
|
|
2
|
-
const require_shapeTypes = require("./shapeTypes-
|
|
1
|
+
const require_textBlueprints = require("./textBlueprints-DgTBXc6O.cjs");
|
|
2
|
+
const require_shapeTypes = require("./shapeTypes-C4gRoPYX.cjs");
|
|
3
3
|
const require_vec3 = require("./vec3-CFwOI0ZI.cjs");
|
|
4
4
|
const require_errors = require("./errors-CXJtc4I7.cjs");
|
|
5
|
-
const require_topologyQueryFns = require("./topologyQueryFns-
|
|
5
|
+
const require_topologyQueryFns = require("./topologyQueryFns-BzIV1jHw.cjs");
|
|
6
6
|
const require_constants = require("./constants-BOVyEYGH.cjs");
|
|
7
7
|
const require_types = require("./types-KjA8tY4Y.cjs");
|
|
8
8
|
const require_vecOps = require("./vecOps-CCnJt-yH.cjs");
|
|
9
9
|
const require_planeOps = require("./planeOps-BA4HfgQu.cjs");
|
|
10
|
-
const require_faceFns = require("./faceFns-
|
|
11
|
-
const require_curveFns = require("./curveFns-
|
|
10
|
+
const require_faceFns = require("./faceFns-BbmIuuFt.cjs");
|
|
11
|
+
const require_curveFns = require("./curveFns-C2zZ7Xuq.cjs");
|
|
12
12
|
const require_arrayAccess = require("./arrayAccess-e4H9cBfh.cjs");
|
|
13
|
-
const require_surfaceBuilders = require("./surfaceBuilders-
|
|
14
|
-
const require_blueprintSketcher = require("./blueprintSketcher-
|
|
15
|
-
const require_helpers = require("./helpers-
|
|
16
|
-
const require_blueprint = require("./blueprint-
|
|
17
|
-
const require_cornerFinder = require("./cornerFinder-
|
|
18
|
-
const require_boolean2D = require("./boolean2D-
|
|
19
|
-
const require_cameraFns = require("./cameraFns-
|
|
13
|
+
const require_surfaceBuilders = require("./surfaceBuilders-DWHDogVL.cjs");
|
|
14
|
+
const require_blueprintSketcher = require("./blueprintSketcher-DRGumaWR.cjs");
|
|
15
|
+
const require_helpers = require("./helpers-D0be4TzF.cjs");
|
|
16
|
+
const require_blueprint = require("./blueprint-DF-Ig1SW.cjs");
|
|
17
|
+
const require_cornerFinder = require("./cornerFinder-Bss_mZV9.cjs");
|
|
18
|
+
const require_boolean2D = require("./boolean2D-5WdQm5Kb.cjs");
|
|
19
|
+
const require_cameraFns = require("./cameraFns-CiGOarQ4.cjs");
|
|
20
20
|
//#region src/2d/lib/stitching.ts
|
|
21
21
|
/**
|
|
22
22
|
* Group a flat list of curves into connected chains by matching endpoints.
|
|
@@ -299,11 +299,18 @@ var FaceSketcher = class extends require_blueprintSketcher.BaseSketcher2d {
|
|
|
299
299
|
* @category Sketching
|
|
300
300
|
*/
|
|
301
301
|
var sketchCircle = (radius, planeConfig = {}) => {
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
302
|
+
try {
|
|
303
|
+
var _usingCtx$2 = require_shapeTypes._usingCtx();
|
|
304
|
+
const plane = planeConfig.plane && typeof planeConfig.plane !== "string" ? { ...planeConfig.plane } : require_errors.unwrap(require_planeOps.resolvePlane(planeConfig.plane ?? "XY", planeConfig.origin));
|
|
305
|
+
return new require_textBlueprints.Sketch(require_errors.unwrap(require_surfaceBuilders.assembleWire([_usingCtx$2.u(new require_shapeTypes.DisposalScope()).register(require_surfaceBuilders.makeCircle(radius, plane.origin, plane.zDir))])), {
|
|
306
|
+
defaultOrigin: [...plane.origin],
|
|
307
|
+
defaultDirection: [...plane.zDir]
|
|
308
|
+
});
|
|
309
|
+
} catch (_) {
|
|
310
|
+
_usingCtx$2.e = _;
|
|
311
|
+
} finally {
|
|
312
|
+
_usingCtx$2.d();
|
|
313
|
+
}
|
|
307
314
|
};
|
|
308
315
|
/**
|
|
309
316
|
* Create an elliptical Sketch on a given plane.
|
|
@@ -316,19 +323,26 @@ var sketchCircle = (radius, planeConfig = {}) => {
|
|
|
316
323
|
* @category Sketching
|
|
317
324
|
*/
|
|
318
325
|
var sketchEllipse = (xRadius = 1, yRadius = 2, planeConfig = {}) => {
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
326
|
+
try {
|
|
327
|
+
var _usingCtx3 = require_shapeTypes._usingCtx();
|
|
328
|
+
const plane = planeConfig.plane && typeof planeConfig.plane !== "string" ? { ...planeConfig.plane } : require_errors.unwrap(require_planeOps.resolvePlane(planeConfig.plane ?? "XY", planeConfig.origin));
|
|
329
|
+
let xDir = plane.xDir;
|
|
330
|
+
let majR = xRadius;
|
|
331
|
+
let minR = yRadius;
|
|
332
|
+
if (yRadius > xRadius) {
|
|
333
|
+
xDir = require_vecOps.vecRotate(xDir, plane.zDir, 90 * require_constants.DEG2RAD);
|
|
334
|
+
majR = yRadius;
|
|
335
|
+
minR = xRadius;
|
|
336
|
+
}
|
|
337
|
+
return new require_textBlueprints.Sketch(require_errors.unwrap(require_surfaceBuilders.assembleWire([_usingCtx3.u(new require_shapeTypes.DisposalScope()).register(require_errors.unwrap(require_surfaceBuilders.makeEllipse(majR, minR, plane.origin, plane.zDir, xDir)))])), {
|
|
338
|
+
defaultOrigin: [...plane.origin],
|
|
339
|
+
defaultDirection: [...plane.zDir]
|
|
340
|
+
});
|
|
341
|
+
} catch (_) {
|
|
342
|
+
_usingCtx3.e = _;
|
|
343
|
+
} finally {
|
|
344
|
+
_usingCtx3.d();
|
|
345
|
+
}
|
|
332
346
|
};
|
|
333
347
|
/**
|
|
334
348
|
* Create a rectangular Sketch centered on a given plane.
|
|
@@ -446,8 +460,8 @@ var sketchFaceOffset = (face, offset) => {
|
|
|
446
460
|
*/
|
|
447
461
|
var sketchParametricFunction = (func, planeConfig = {}, { pointsCount = 400, start = 0, stop = 1 } = {}, approximationConfig = {}) => {
|
|
448
462
|
try {
|
|
449
|
-
var
|
|
450
|
-
const scope =
|
|
463
|
+
var _usingCtx4 = require_shapeTypes._usingCtx();
|
|
464
|
+
const scope = _usingCtx4.u(new require_shapeTypes.DisposalScope());
|
|
451
465
|
const plane = planeConfig.plane && typeof planeConfig.plane !== "string" ? { ...planeConfig.plane } : require_errors.unwrap(require_planeOps.resolvePlane(planeConfig.plane ?? "XY", planeConfig.origin));
|
|
452
466
|
const stepSize = (stop - start) / pointsCount;
|
|
453
467
|
const points = [...Array(pointsCount + 1).keys()].map((t) => {
|
|
@@ -459,9 +473,9 @@ var sketchParametricFunction = (func, planeConfig = {}, { pointsCount = 400, sta
|
|
|
459
473
|
defaultDirection: [...plane.zDir]
|
|
460
474
|
});
|
|
461
475
|
} catch (_) {
|
|
462
|
-
|
|
476
|
+
_usingCtx4.e = _;
|
|
463
477
|
} finally {
|
|
464
|
-
|
|
478
|
+
_usingCtx4.d();
|
|
465
479
|
}
|
|
466
480
|
};
|
|
467
481
|
/**
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
const require_shapeTypes = require("./shapeTypes-
|
|
1
|
+
const require_shapeTypes = require("./shapeTypes-C4gRoPYX.cjs");
|
|
2
2
|
const require_errors = require("./errors-CXJtc4I7.cjs");
|
|
3
|
-
const require_topologyQueryFns = require("./topologyQueryFns-
|
|
3
|
+
const require_topologyQueryFns = require("./topologyQueryFns-BzIV1jHw.cjs");
|
|
4
4
|
const require_types = require("./types-KjA8tY4Y.cjs");
|
|
5
5
|
//#region src/topology/cast.ts
|
|
6
6
|
var TOPO_ENUM = {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { nt as getKernel, r as castShape } from "./shapeTypes-
|
|
1
|
+
import { nt as getKernel, r as castShape } from "./shapeTypes-BalkiKtK.js";
|
|
2
2
|
import { A as ok, R as unwrap, b as err, l as typeCastError } from "./errors-DNWJsfVU.js";
|
|
3
|
-
import { a as getCachedSurfaceType } from "./topologyQueryFns-
|
|
3
|
+
import { a as getCachedSurfaceType } from "./topologyQueryFns-vDjZw1k2.js";
|
|
4
4
|
import { r as toVec3 } from "./types-D24Y27N0.js";
|
|
5
5
|
//#region src/topology/cast.ts
|
|
6
6
|
var TOPO_ENUM = {
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
const require_shapeTypes = require("./shapeTypes-
|
|
1
|
+
const require_shapeTypes = require("./shapeTypes-C4gRoPYX.cjs");
|
|
2
2
|
const require_errors = require("./errors-CXJtc4I7.cjs");
|
|
3
|
-
const require_topologyQueryFns = require("./topologyQueryFns-
|
|
3
|
+
const require_topologyQueryFns = require("./topologyQueryFns-BzIV1jHw.cjs");
|
|
4
4
|
const require_constants = require("./constants-BOVyEYGH.cjs");
|
|
5
|
-
const require_faceFns = require("./faceFns-
|
|
6
|
-
const require_shapeFns = require("./shapeFns-
|
|
5
|
+
const require_faceFns = require("./faceFns-BbmIuuFt.cjs");
|
|
6
|
+
const require_shapeFns = require("./shapeFns-m5OBBpM4.cjs");
|
|
7
7
|
const require_arrayAccess = require("./arrayAccess-e4H9cBfh.cjs");
|
|
8
|
-
const require_solidBuilders = require("./solidBuilders-
|
|
8
|
+
const require_solidBuilders = require("./solidBuilders-CHzmSo67.cjs");
|
|
9
9
|
//#region src/topology/threeHelpers.ts
|
|
10
10
|
/**
|
|
11
11
|
* Convert a ShapeMesh into BufferGeometry-compatible typed arrays.
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import { L as getShapeKind, S as isSolid, b as isShape3D, m as disposeResultShape, nt as getKernel, p as disposeDowncastSource, r as castShape, t as castResultShape, v as isFace, w as isWire } from "./shapeTypes-
|
|
1
|
+
import { L as getShapeKind, S as isSolid, b as isShape3D, m as disposeResultShape, nt as getKernel, p as disposeDowncastSource, r as castShape, t as castResultShape, v as isFace, w as isWire } from "./shapeTypes-BalkiKtK.js";
|
|
2
2
|
import { A as ok, T as isOk, b as err, d as validationError, i as kernelError, l as typeCastError, t as BrepErrorCode, w as isErr } from "./errors-DNWJsfVU.js";
|
|
3
|
-
import { c as getFaces, i as getCachedIsValid, m as invalidateShapeCache, p as getWires, s as getEdges } from "./topologyQueryFns-
|
|
3
|
+
import { c as getFaces, i as getCachedIsValid, m as invalidateShapeCache, p as getWires, s as getEdges } from "./topologyQueryFns-vDjZw1k2.js";
|
|
4
4
|
import { n as HASH_CODE_MAX } from "./constants-ITRzCnCp.js";
|
|
5
|
-
import { y as downcast } from "./faceFns-
|
|
6
|
-
import { _ as collectInputFaceHashes, y as propagateAllMetadata } from "./shapeFns-
|
|
5
|
+
import { y as downcast } from "./faceFns-ClvSac1T.js";
|
|
6
|
+
import { _ as collectInputFaceHashes, y as propagateAllMetadata } from "./shapeFns-Gzaax25v.js";
|
|
7
7
|
import { t as firstOrThrow } from "./arrayAccess-DrUGPADn.js";
|
|
8
|
-
import { f as cut, h as fuseAll, m as fuse, p as cutAll } from "./solidBuilders-
|
|
8
|
+
import { f as cut, h as fuseAll, m as fuse, p as cutAll } from "./solidBuilders-CgEPRock.js";
|
|
9
9
|
//#region src/topology/threeHelpers.ts
|
|
10
10
|
/**
|
|
11
11
|
* Convert a ShapeMesh into BufferGeometry-compatible typed arrays.
|
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
const require_shapeTypes = require("./shapeTypes-
|
|
1
|
+
const require_shapeTypes = require("./shapeTypes-C4gRoPYX.cjs");
|
|
2
2
|
const require_errors = require("./errors-CXJtc4I7.cjs");
|
|
3
|
-
const require_topologyQueryFns = require("./topologyQueryFns-
|
|
3
|
+
const require_topologyQueryFns = require("./topologyQueryFns-BzIV1jHw.cjs");
|
|
4
4
|
const require_constants = require("./constants-BOVyEYGH.cjs");
|
|
5
5
|
const require_vecOps = require("./vecOps-CCnJt-yH.cjs");
|
|
6
|
-
const require_faceFns = require("./faceFns-
|
|
7
|
-
const require_shapeFns = require("./shapeFns-
|
|
8
|
-
const require_curveFns = require("./curveFns-
|
|
9
|
-
const require_measureFns = require("./measureFns-
|
|
6
|
+
const require_faceFns = require("./faceFns-BbmIuuFt.cjs");
|
|
7
|
+
const require_shapeFns = require("./shapeFns-m5OBBpM4.cjs");
|
|
8
|
+
const require_curveFns = require("./curveFns-C2zZ7Xuq.cjs");
|
|
9
|
+
const require_measureFns = require("./measureFns-cK6MSs6B.cjs");
|
|
10
10
|
//#region src/utils/vec2d.ts
|
|
11
11
|
/** Precision for curve intersection and parameter operations. */
|
|
12
12
|
var PRECISION_INTERSECTION = 1e-9;
|
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
import { nt as getKernel, v as isFace } from "./shapeTypes-
|
|
1
|
+
import { nt as getKernel, v as isFace } from "./shapeTypes-BalkiKtK.js";
|
|
2
2
|
import { A as ok, T as isOk, b as err, h as bug, o as queryError } from "./errors-DNWJsfVU.js";
|
|
3
|
-
import { c as getFaces, f as getVertices, p as getWires, s as getEdges } from "./topologyQueryFns-
|
|
3
|
+
import { c as getFaces, f as getVertices, p as getWires, s as getEdges } from "./topologyQueryFns-vDjZw1k2.js";
|
|
4
4
|
import { t as DEG2RAD } from "./constants-ITRzCnCp.js";
|
|
5
5
|
import { a as vecDot, d as vecNormalize } from "./vecOps-SKPRvPH-.js";
|
|
6
|
-
import { l as normalAt, s as getSurfaceType } from "./faceFns-
|
|
7
|
-
import { a as isSameShape, n as getHashCode } from "./shapeFns-
|
|
8
|
-
import { f as getCurveType, i as curveIsClosed, o as curveLength } from "./curveFns-
|
|
9
|
-
import { n as measureArea } from "./measureFns-
|
|
6
|
+
import { l as normalAt, s as getSurfaceType } from "./faceFns-ClvSac1T.js";
|
|
7
|
+
import { a as isSameShape, n as getHashCode } from "./shapeFns-Gzaax25v.js";
|
|
8
|
+
import { f as getCurveType, i as curveIsClosed, o as curveLength } from "./curveFns-CH6gaGTf.js";
|
|
9
|
+
import { n as measureArea } from "./measureFns-Bbgcgo9U.js";
|
|
10
10
|
//#region src/utils/vec2d.ts
|
|
11
11
|
/** Precision for curve intersection and parameter operations. */
|
|
12
12
|
var PRECISION_INTERSECTION = 1e-9;
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { nt as getKernel, r as castShape } from "./shapeTypes-
|
|
1
|
+
import { nt as getKernel, r as castShape } from "./shapeTypes-BalkiKtK.js";
|
|
2
2
|
import { n as wasmIndex, t as vec3At$1 } from "./vec3-Dpha8d5k.js";
|
|
3
3
|
import { A as ok, b as err, r as ioError, t as BrepErrorCode } from "./errors-DNWJsfVU.js";
|
|
4
4
|
import { n as getAtOrThrow } from "./arrayAccess-DrUGPADn.js";
|
|
5
|
-
import { f as make2dSegmentCurve, m as make2dThreePointArc, s as make2dBezierCurve, t as Blueprint } from "./blueprint-
|
|
5
|
+
import { f as make2dSegmentCurve, m as make2dThreePointArc, s as make2dBezierCurve, t as Blueprint } from "./blueprint-CJ7k25eW.js";
|
|
6
6
|
//#region src/io/objExportFns.ts
|
|
7
7
|
/** Read a vec3 from a typed array at the given vertex index. */
|
|
8
8
|
function vec3At(arr, i) {
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
const require_shapeTypes = require("./shapeTypes-
|
|
1
|
+
const require_shapeTypes = require("./shapeTypes-C4gRoPYX.cjs");
|
|
2
2
|
const require_vec3 = require("./vec3-CFwOI0ZI.cjs");
|
|
3
3
|
const require_errors = require("./errors-CXJtc4I7.cjs");
|
|
4
4
|
const require_arrayAccess = require("./arrayAccess-e4H9cBfh.cjs");
|
|
5
|
-
const require_blueprint = require("./blueprint-
|
|
5
|
+
const require_blueprint = require("./blueprint-DF-Ig1SW.cjs");
|
|
6
6
|
//#region src/io/objExportFns.ts
|
|
7
7
|
/** Read a vec3 from a typed array at the given vertex index. */
|
|
8
8
|
function vec3At(arr, i) {
|
package/dist/io.cjs
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
2
|
-
const require_meshFns = require("./meshFns-
|
|
3
|
-
const require_importFns = require("./importFns-
|
|
2
|
+
const require_meshFns = require("./meshFns-Df26UzQ9.cjs");
|
|
3
|
+
const require_importFns = require("./importFns-Tgnymh7F.cjs");
|
|
4
4
|
exports.blueprintToDXF = require_importFns.blueprintToDXF;
|
|
5
5
|
exports.exportDXF = require_importFns.exportDXF;
|
|
6
6
|
exports.exportGlb = require_importFns.exportGlb;
|
package/dist/io.js
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import { n as exportSTEP, r as exportSTL, t as exportIGES } from "./meshFns-
|
|
2
|
-
import { a as importSVG, c as blueprintToDXF, d as exportGltf, f as exportOBJ, i as exportSTEPConfigured, l as exportDXF, n as importSTEP, o as importSVGPathD, r as importSTL, s as exportThreeMF, t as importIGES, u as exportGlb } from "./importFns-
|
|
1
|
+
import { n as exportSTEP, r as exportSTL, t as exportIGES } from "./meshFns-CKXYSlFr.js";
|
|
2
|
+
import { a as importSVG, c as blueprintToDXF, d as exportGltf, f as exportOBJ, i as exportSTEPConfigured, l as exportDXF, n as importSTEP, o as importSVGPathD, r as importSTL, s as exportThreeMF, t as importIGES, u as exportGlb } from "./importFns-CzBtuX0j.js";
|
|
3
3
|
export { blueprintToDXF, exportDXF, exportGlb, exportGltf, exportIGES, exportOBJ, exportSTEP, exportSTEPConfigured, exportSTL, exportThreeMF, importIGES, importSTEP, importSTL, importSVG, importSVGPathD };
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
2
|
-
const require_occtWasmAdapter = require("../../occtWasmAdapter-
|
|
2
|
+
const require_occtWasmAdapter = require("../../occtWasmAdapter-CWX5KCl8.cjs");
|
|
3
3
|
exports.OcctWasmAdapter = require_occtWasmAdapter.OcctWasmAdapter;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { t as OcctWasmAdapter } from "../../occtWasmAdapter-
|
|
1
|
+
import { t as OcctWasmAdapter } from "../../occtWasmAdapter-BgmRCYeD.js";
|
|
2
2
|
export { OcctWasmAdapter };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
const require_shapeTypes = require("./shapeTypes-
|
|
1
|
+
const require_shapeTypes = require("./shapeTypes-C4gRoPYX.cjs");
|
|
2
2
|
const require_errors = require("./errors-CXJtc4I7.cjs");
|
|
3
3
|
const require_types = require("./types-KjA8tY4Y.cjs");
|
|
4
4
|
const require_vecOps = require("./vecOps-CCnJt-yH.cjs");
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { b as isShape3D, m as disposeResultShape, nt as getKernel, p as disposeDowncastSource, t as castResultShape, u as createSolid, w as isWire } from "./shapeTypes-
|
|
1
|
+
import { b as isShape3D, m as disposeResultShape, nt as getKernel, p as disposeDowncastSource, t as castResultShape, u as createSolid, w as isWire } from "./shapeTypes-BalkiKtK.js";
|
|
2
2
|
import { A as ok, b as err, d as validationError, i as kernelError, l as typeCastError, t as BrepErrorCode, w as isErr } from "./errors-DNWJsfVU.js";
|
|
3
3
|
import { r as toVec3 } from "./types-D24Y27N0.js";
|
|
4
4
|
import { c as vecLength, d as vecNormalize, t as vecAdd } from "./vecOps-SKPRvPH-.js";
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { nt as getKernel } from "./shapeTypes-
|
|
1
|
+
import { nt as getKernel } from "./shapeTypes-BalkiKtK.js";
|
|
2
2
|
import { A as ok, b as err, d as validationError, t as BrepErrorCode } from "./errors-DNWJsfVU.js";
|
|
3
|
-
import { w as kernelCallRaw } from "./topologyQueryFns-
|
|
4
|
-
import { m as uvBounds } from "./faceFns-
|
|
3
|
+
import { w as kernelCallRaw } from "./topologyQueryFns-vDjZw1k2.js";
|
|
4
|
+
import { m as uvBounds } from "./faceFns-ClvSac1T.js";
|
|
5
5
|
//#region src/measurement/measureCache.ts
|
|
6
6
|
var cache = /* @__PURE__ */ new WeakMap();
|
|
7
7
|
function getCachedMeasurement(shape, key) {
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
const require_shapeTypes = require("./shapeTypes-
|
|
1
|
+
const require_shapeTypes = require("./shapeTypes-C4gRoPYX.cjs");
|
|
2
2
|
const require_errors = require("./errors-CXJtc4I7.cjs");
|
|
3
|
-
const require_topologyQueryFns = require("./topologyQueryFns-
|
|
4
|
-
const require_faceFns = require("./faceFns-
|
|
3
|
+
const require_topologyQueryFns = require("./topologyQueryFns-BzIV1jHw.cjs");
|
|
4
|
+
const require_faceFns = require("./faceFns-BbmIuuFt.cjs");
|
|
5
5
|
//#region src/measurement/measureCache.ts
|
|
6
6
|
var cache = /* @__PURE__ */ new WeakMap();
|
|
7
7
|
function getCachedMeasurement(shape, key) {
|
package/dist/measurement.cjs
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
2
|
-
const require_measureFns = require("./measureFns-
|
|
2
|
+
const require_measureFns = require("./measureFns-cK6MSs6B.cjs");
|
|
3
3
|
exports.createDistanceQuery = require_measureFns.createDistanceQuery;
|
|
4
4
|
exports.measureArea = require_measureFns.measureArea;
|
|
5
5
|
exports.measureDistance = require_measureFns.measureDistance;
|
package/dist/measurement.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { a as measureDistance, c as measureLinearProps, d as measureVolumeProps, l as measureSurfaceProps, n as measureArea, o as measureDistanceProps, s as measureLength, t as createDistanceQuery, u as measureVolume } from "./measureFns-
|
|
1
|
+
import { a as measureDistance, c as measureLinearProps, d as measureVolumeProps, l as measureSurfaceProps, n as measureArea, o as measureDistanceProps, s as measureLength, t as createDistanceQuery, u as measureVolume } from "./measureFns-Bbgcgo9U.js";
|
|
2
2
|
export { createDistanceQuery, measureArea, measureDistance, measureDistanceProps, measureLength, measureLinearProps, measureSurfaceProps, measureVolume, measureVolumeProps };
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { nt as getKernel, xt as qualityDeflection } from "./shapeTypes-
|
|
1
|
+
import { nt as getKernel, xt as qualityDeflection } from "./shapeTypes-BalkiKtK.js";
|
|
2
2
|
import { A as ok, b as err, r as ioError } from "./errors-DNWJsfVU.js";
|
|
3
|
-
import { d as getSolids, n as getBounds } from "./topologyQueryFns-
|
|
4
|
-
import { j as getFaceOrigins } from "./shapeFns-
|
|
3
|
+
import { d as getSolids, n as getBounds } from "./topologyQueryFns-vDjZw1k2.js";
|
|
4
|
+
import { j as getFaceOrigins } from "./shapeFns-Gzaax25v.js";
|
|
5
5
|
//#region src/topology/meshCache.ts
|
|
6
6
|
/**
|
|
7
7
|
* Build a parameter key for the inner cache map (excludes shape identity).
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
const require_shapeTypes = require("./shapeTypes-
|
|
1
|
+
const require_shapeTypes = require("./shapeTypes-C4gRoPYX.cjs");
|
|
2
2
|
const require_errors = require("./errors-CXJtc4I7.cjs");
|
|
3
|
-
const require_topologyQueryFns = require("./topologyQueryFns-
|
|
4
|
-
const require_shapeFns = require("./shapeFns-
|
|
3
|
+
const require_topologyQueryFns = require("./topologyQueryFns-BzIV1jHw.cjs");
|
|
4
|
+
const require_shapeFns = require("./shapeFns-m5OBBpM4.cjs");
|
|
5
5
|
//#region src/topology/meshCache.ts
|
|
6
6
|
/**
|
|
7
7
|
* Build a parameter key for the inner cache map (excludes shape identity).
|
|
@@ -1441,30 +1441,40 @@ function meshBoolean(_positionsA, _indicesA, _positionsB, _indicesB, _op, _toler
|
|
|
1441
1441
|
}
|
|
1442
1442
|
//#endregion
|
|
1443
1443
|
//#region src/kernel/occtWasm/primitiveOps.ts
|
|
1444
|
+
/**
|
|
1445
|
+
* Apply an id-remapping positioning step (rotate/translate), releasing the
|
|
1446
|
+
* orphaned source slot. rotate/translate return fresh arena slots on occt-wasm;
|
|
1447
|
+
* the repositioned result shares the source's refcounted TShape and survives, so
|
|
1448
|
+
* releasing the pre-move id here plugs a per-positioned-primitive slot leak.
|
|
1449
|
+
*/
|
|
1450
|
+
function remap(k, id, next) {
|
|
1451
|
+
if (next !== id) k.release(id);
|
|
1452
|
+
return next;
|
|
1453
|
+
}
|
|
1444
1454
|
function makeBox(k, width, height, depth) {
|
|
1445
1455
|
return handle("solid", k.makeBox(width, height, depth));
|
|
1446
1456
|
}
|
|
1447
1457
|
function makeCylinder(k, radius, height, center, direction) {
|
|
1448
1458
|
let id = k.makeCylinder(radius, height);
|
|
1449
|
-
if (direction) id = rotateZToDirection(k, id, direction);
|
|
1450
|
-
if (center && (center[0] !== 0 || center[1] !== 0 || center[2] !== 0)) id = k.translate(id, center[0], center[1], center[2]);
|
|
1459
|
+
if (direction) id = remap(k, id, rotateZToDirection(k, id, direction));
|
|
1460
|
+
if (center && (center[0] !== 0 || center[1] !== 0 || center[2] !== 0)) id = remap(k, id, k.translate(id, center[0], center[1], center[2]));
|
|
1451
1461
|
return handle("solid", id);
|
|
1452
1462
|
}
|
|
1453
1463
|
function makeSphere(k, radius, center) {
|
|
1454
1464
|
let id = k.makeSphere(radius);
|
|
1455
|
-
if (center && (center[0] !== 0 || center[1] !== 0 || center[2] !== 0)) id = k.translate(id, center[0], center[1], center[2]);
|
|
1465
|
+
if (center && (center[0] !== 0 || center[1] !== 0 || center[2] !== 0)) id = remap(k, id, k.translate(id, center[0], center[1], center[2]));
|
|
1456
1466
|
return handle("solid", id);
|
|
1457
1467
|
}
|
|
1458
1468
|
function makeCone(k, radius1, radius2, height, center, direction) {
|
|
1459
1469
|
let id = k.makeCone(radius1, radius2, height);
|
|
1460
|
-
if (direction) id = rotateZToDirection(k, id, direction);
|
|
1461
|
-
if (center && (center[0] !== 0 || center[1] !== 0 || center[2] !== 0)) id = k.translate(id, center[0], center[1], center[2]);
|
|
1470
|
+
if (direction) id = remap(k, id, rotateZToDirection(k, id, direction));
|
|
1471
|
+
if (center && (center[0] !== 0 || center[1] !== 0 || center[2] !== 0)) id = remap(k, id, k.translate(id, center[0], center[1], center[2]));
|
|
1462
1472
|
return handle("solid", id);
|
|
1463
1473
|
}
|
|
1464
1474
|
function makeTorus(k, majorRadius, minorRadius, center, direction) {
|
|
1465
1475
|
let id = k.makeTorus(majorRadius, minorRadius);
|
|
1466
|
-
if (direction) id = rotateZToDirection(k, id, direction);
|
|
1467
|
-
if (center && (center[0] !== 0 || center[1] !== 0 || center[2] !== 0)) id = k.translate(id, center[0], center[1], center[2]);
|
|
1476
|
+
if (direction) id = remap(k, id, rotateZToDirection(k, id, direction));
|
|
1477
|
+
if (center && (center[0] !== 0 || center[1] !== 0 || center[2] !== 0)) id = remap(k, id, k.translate(id, center[0], center[1], center[2]));
|
|
1468
1478
|
return handle("solid", id);
|
|
1469
1479
|
}
|
|
1470
1480
|
function makeEllipsoid(k, aLength, bLength, cLength) {
|
|
@@ -2942,6 +2952,7 @@ function linearPattern(k, shape, direction, spacing, count) {
|
|
|
2942
2952
|
iter.delete();
|
|
2943
2953
|
}
|
|
2944
2954
|
}
|
|
2955
|
+
k.release(compoundId);
|
|
2945
2956
|
return results;
|
|
2946
2957
|
}
|
|
2947
2958
|
function circularPattern(k, shape, center, axis, angleStep, count) {
|
|
@@ -2963,6 +2974,7 @@ function circularPattern(k, shape, center, axis, angleStep, count) {
|
|
|
2963
2974
|
iter.delete();
|
|
2964
2975
|
}
|
|
2965
2976
|
}
|
|
2977
|
+
k.release(compoundId);
|
|
2966
2978
|
return results;
|
|
2967
2979
|
}
|
|
2968
2980
|
function transformBatch(k, entries) {
|
|
@@ -3311,6 +3323,7 @@ function makeWire(k, Module, edges) {
|
|
|
3311
3323
|
}
|
|
3312
3324
|
function makeWireFromMixed(k, Module, items) {
|
|
3313
3325
|
const edgeIds = [];
|
|
3326
|
+
const inputIds = new Set(items.map((it) => unwrap(it)));
|
|
3314
3327
|
for (const item of items) {
|
|
3315
3328
|
const sub = k.getSubShapes(unwrap(item), "edge");
|
|
3316
3329
|
try {
|
|
@@ -3325,6 +3338,7 @@ function makeWireFromMixed(k, Module, items) {
|
|
|
3325
3338
|
return handle("wire", k.makeWire(vec));
|
|
3326
3339
|
} finally {
|
|
3327
3340
|
vec.delete();
|
|
3341
|
+
for (const id of edgeIds) if (!inputIds.has(id)) k.release(id);
|
|
3328
3342
|
}
|
|
3329
3343
|
}
|
|
3330
3344
|
function makeFace(k, wire, _planar) {
|
|
@@ -3397,11 +3411,13 @@ function buildSolidFromFaces(k, Module, points, faces, tolerance) {
|
|
|
3397
3411
|
}
|
|
3398
3412
|
const vec = makeVecU32(Module, faceIds);
|
|
3399
3413
|
try {
|
|
3400
|
-
|
|
3401
|
-
sewn = k.fixFaceOrientations(
|
|
3414
|
+
const sewn0 = k.sewAndSolidify(vec, tolerance);
|
|
3415
|
+
const sewn = k.fixFaceOrientations(sewn0);
|
|
3416
|
+
if (sewn !== sewn0) k.release(sewn0);
|
|
3402
3417
|
return wrapResult(k, sewn);
|
|
3403
3418
|
} finally {
|
|
3404
3419
|
vec.delete();
|
|
3420
|
+
for (const id of faceIds) k.release(id);
|
|
3405
3421
|
}
|
|
3406
3422
|
}
|
|
3407
3423
|
function makeNonPlanarFace(k, wire) {
|
|
@@ -3469,6 +3485,7 @@ function triangulatedSurface(k, Module, points, rows, cols) {
|
|
|
3469
3485
|
return wrapResult(k, k.sewAndSolidify(vec, .001));
|
|
3470
3486
|
} finally {
|
|
3471
3487
|
vec.delete();
|
|
3488
|
+
for (const id of faceIds) k.release(id);
|
|
3472
3489
|
}
|
|
3473
3490
|
}
|
|
3474
3491
|
function buildTriFace(k, a, b, c) {
|
|
@@ -3479,8 +3496,9 @@ function buildTriFace(k, a, b, c) {
|
|
|
3479
3496
|
function sewAndSolidify(k, Module, faces, tolerance) {
|
|
3480
3497
|
const vec = makeVecU32(Module, faces.map(unwrap));
|
|
3481
3498
|
try {
|
|
3482
|
-
|
|
3483
|
-
sewn = k.fixFaceOrientations(
|
|
3499
|
+
const sewn0 = k.sewAndSolidify(vec, tolerance);
|
|
3500
|
+
const sewn = k.fixFaceOrientations(sewn0);
|
|
3501
|
+
if (sewn !== sewn0) k.release(sewn0);
|
|
3484
3502
|
return handle("solid", sewn);
|
|
3485
3503
|
} finally {
|
|
3486
3504
|
vec.delete();
|