brepjs 18.39.0 → 18.40.1
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/{blueprint-Dt8UBapg.cjs → blueprint-B0_xM93f.cjs} +5 -5
- package/dist/{blueprint-DFX9Mice.js → blueprint-DGPC8bjk.js} +5 -5
- package/dist/{blueprintFns-DUrh_Vuo.cjs → blueprintFns-D8-3CcI7.cjs} +2 -2
- package/dist/{blueprintFns-DKm_TMpq.js → blueprintFns-DDU4nEC4.js} +2 -2
- package/dist/{blueprintSketcher-CqdAW9fb.js → blueprintSketcher-CMcZhA20.js} +3 -3
- package/dist/{blueprintSketcher-CSWQy4s0.cjs → blueprintSketcher-Dg22-24R.cjs} +3 -3
- package/dist/{boolean2D-CAMPcmle.js → boolean2D-BrhrzzT5.js} +4 -4
- package/dist/{boolean2D-LKA2WvT1.cjs → boolean2D-BtLSFZ3U.cjs} +4 -4
- package/dist/{booleanFns-BherB6vd.cjs → booleanFns-D_XT8nXq.cjs} +4 -4
- package/dist/{booleanFns-ky-zHUHR.js → booleanFns-DthZnyWl.js} +4 -4
- package/dist/brepjs.cjs +227 -32
- package/dist/brepjs.js +220 -33
- package/dist/{cameraFns-AIlIbZXo.js → cameraFns-BBC_mCJX.js} +2 -2
- package/dist/{cameraFns-D_6uvLNa.cjs → cameraFns-N7btylSp.cjs} +2 -2
- package/dist/core.cjs +1 -1
- package/dist/core.js +1 -1
- package/dist/{cornerFinder-D0D01Iv4.cjs → cornerFinder-BrRfeGOx.cjs} +1 -1
- package/dist/{cornerFinder-CHrWbA9J.js → cornerFinder-BxFYMbKt.js} +1 -1
- package/dist/{curveFns-DC4gwhim.js → curveFns-CWpRYhZ8.js} +1 -1
- package/dist/{curveFns-DplagD2s.cjs → curveFns-Cka3gEep.cjs} +1 -1
- package/dist/{drawFns-shtE96tg.cjs → drawFns-BBXf1AmG.cjs} +12 -12
- package/dist/{drawFns-2FS4bc0v.js → drawFns-Wck6Yw-Z.js} +12 -12
- package/dist/{extrudeFns-CGXjoiA3.cjs → extrudeFns-BESH_tno.cjs} +1 -1
- package/dist/{extrudeFns-B2koxf8d.js → extrudeFns-Dx6KA3po.js} +1 -1
- package/dist/{faceFns-D9IXo1EY.js → faceFns-BuDNpvDH.js} +2 -2
- package/dist/{faceFns-D-i7rp7Y.cjs → faceFns-ZhwskGuW.cjs} +2 -2
- package/dist/{helpers-6tUnAb2m.js → helpers-Ceyjiq3b.js} +6 -6
- package/dist/{helpers-DoflJrR5.cjs → helpers-QPPvHzFe.cjs} +6 -6
- package/dist/{historyFns-1a841VzH.cjs → historyFns-QbZ_1wDe.cjs} +4 -4
- package/dist/{historyFns-Y0v0weT9.js → historyFns-vMIhK4q_.js} +4 -4
- package/dist/{importFns-BsE_nugZ.js → importFns-DWphNxxR.js} +2 -2
- package/dist/{importFns-CzArHdFY.cjs → importFns-pGOL3CD4.cjs} +2 -2
- package/dist/index.d.ts +3 -3
- package/dist/io.cjs +2 -2
- package/dist/io.js +2 -2
- package/dist/kernel/interfaces/ioOps.d.ts +1 -1
- package/dist/kernel/occtWasm/booleanOps.d.ts +8 -0
- package/dist/kernel/occtWasm/ioOps.d.ts +1 -1
- package/dist/kernel/occtWasm/occtWasmAdapter.cjs +1 -1
- package/dist/kernel/occtWasm/occtWasmAdapter.d.ts +1 -1
- package/dist/kernel/occtWasm/occtWasmAdapter.js +1 -1
- package/dist/lattice/index.d.ts +1 -1
- package/dist/lattice/latticeFns.d.ts +7 -0
- package/dist/{measureFns-ry6_O167.js → measureFns-BTcMyzXv.js} +3 -3
- package/dist/{measureFns-gkq2sYtY.cjs → measureFns-DD5O45zv.cjs} +3 -3
- package/dist/measurement.cjs +1 -1
- package/dist/measurement.js +1 -1
- package/dist/{meshFns-D-4VAld_.cjs → meshFns-CckSsqhi.cjs} +4 -4
- package/dist/{meshFns-CEECiqKQ.js → meshFns-Qkk4e--0.js} +4 -4
- package/dist/{occtWasmAdapter-DNXBos24.js → occtWasmAdapter-8XGnYsEi.js} +79 -19
- package/dist/{occtWasmAdapter-sH6wg1Z6.cjs → occtWasmAdapter-ddZvP8Ns.cjs} +79 -19
- package/dist/operations.cjs +2 -2
- package/dist/operations.js +2 -2
- package/dist/{primitiveFns-BiEXbXUy.js → primitiveFns-BgvbV1Xe.js} +7 -7
- package/dist/{primitiveFns-IFpwC8fs.cjs → primitiveFns-MYl8wCQ_.cjs} +7 -7
- 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/{shapeFns-BsNw-egb.cjs → shapeFns-CUjmsc5n.cjs} +2 -2
- package/dist/{shapeFns-2ZBm7gZd.js → shapeFns-DLKjTl1m.js} +2 -2
- package/dist/shapeRef.cjs +1 -1
- package/dist/shapeRef.js +1 -1
- package/dist/{shapeRefFns-4I03ZCKU.cjs → shapeRefFns-AlYSd7xG.cjs} +4 -4
- package/dist/{shapeRefFns-VuIGZejB.js → shapeRefFns-BCBT3qjs.js} +4 -4
- package/dist/{shapeTypes-CiEgOVu3.js → shapeTypes-B7GYg91f.js} +1 -1
- package/dist/{shapeTypes-CUTaIMCC.cjs → shapeTypes-BwbnQSzG.cjs} +1 -1
- package/dist/sketching.cjs +3 -3
- package/dist/sketching.js +3 -3
- package/dist/{solidBuilders-0Y1U2uMs.cjs → solidBuilders-C_CVKD9y.cjs} +2 -2
- package/dist/{solidBuilders-DV8lvLq3.js → solidBuilders-E9QDs2AH.js} +2 -2
- package/dist/{surfaceBuilders-OUTnDgr5.cjs → surfaceBuilders-Ae2XRahr.cjs} +2 -2
- package/dist/{surfaceBuilders-DYzjeM-y.js → surfaceBuilders-DbqaooTh.js} +2 -2
- package/dist/text.cjs +2 -2
- package/dist/text.js +2 -2
- package/dist/{textBlueprints-00P4WdIq.js → textBlueprints-CStv8fXQ.js} +7 -7
- package/dist/{textBlueprints-DQcSGfcQ.cjs → textBlueprints-IJMNaWq4.cjs} +7 -7
- package/dist/{textMetrics-8KJFgEn5.js → textMetrics-B5sFd2Mb.js} +1 -1
- package/dist/{textMetrics-Av8N82V_.cjs → textMetrics-CL4DE2-I.cjs} +1 -1
- package/dist/topology.cjs +7 -7
- package/dist/topology.js +7 -7
- package/dist/{topologyQueryFns-DXKyoFvA.js → topologyQueryFns-CBIJ7Ixi.js} +1 -1
- package/dist/{topologyQueryFns-j7sTNssl.cjs → topologyQueryFns-Cb25Braq.cjs} +1 -1
- package/dist/voxel/engine.d.ts +6 -0
- package/dist/voxel/index.d.ts +3 -0
- package/dist/voxel/meshOpsFns.d.ts +52 -0
- package/dist/voxel/shapeMesh.d.ts +10 -0
- package/package.json +1 -1
package/dist/2d.cjs
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
2
|
-
const require_shapeTypes = require("./shapeTypes-
|
|
2
|
+
const require_shapeTypes = require("./shapeTypes-BwbnQSzG.cjs");
|
|
3
3
|
const require_errors = require("./errors-CXJtc4I7.cjs");
|
|
4
|
-
const require_topologyQueryFns = require("./topologyQueryFns-
|
|
5
|
-
const require_blueprintSketcher = require("./blueprintSketcher-
|
|
6
|
-
const require_blueprint = require("./blueprint-
|
|
7
|
-
const require_boolean2D = require("./boolean2D-
|
|
8
|
-
const require_blueprintFns = require("./blueprintFns-
|
|
4
|
+
const require_topologyQueryFns = require("./topologyQueryFns-Cb25Braq.cjs");
|
|
5
|
+
const require_blueprintSketcher = require("./blueprintSketcher-Dg22-24R.cjs");
|
|
6
|
+
const require_blueprint = require("./blueprint-B0_xM93f.cjs");
|
|
7
|
+
const require_boolean2D = require("./boolean2D-BtLSFZ3U.cjs");
|
|
8
|
+
const require_blueprintFns = require("./blueprintFns-D8-3CcI7.cjs");
|
|
9
9
|
//#region src/core/curve2dHandle.ts
|
|
10
10
|
/**
|
|
11
11
|
* Wrap a raw kernel 2D curve handle with brand + disposal tracking.
|
package/dist/2d.js
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import { B as createKernelHandle, Q as getKernel2D, a as createEdge } from "./shapeTypes-
|
|
1
|
+
import { B as createKernelHandle, Q as getKernel2D, a as createEdge } from "./shapeTypes-B7GYg91f.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 { a as Blueprints, i as CompoundBlueprint, r as organiseBlueprints } from "./blueprintSketcher-
|
|
5
|
-
import { _ as Curve2D, t as Blueprint, y as BoundingBox2d } from "./blueprint-
|
|
6
|
-
import { a as fuseBlueprints, c as roundedRectangleBlueprint, i as cutBlueprints, n as fuse2D, o as intersectBlueprints, r as intersect2D, s as polysidesBlueprint, t as cut2D } from "./boolean2D-
|
|
7
|
-
import { S as reverseCurve, _ as curve2dIsOnCurve, a as isInside2D, b as curve2dSplitAt, c as scale2D, d as stretch2D, f as toSVGPathD, g as curve2dFirstPoint, h as curve2dDistanceFrom, i as getOrientation2D, l as sketchOnFace2D, m as curve2dBoundingBox, o as mirror2D, p as translate2D, r as getBounds2D, s as rotate2D, t as createBlueprint, u as sketchOnPlane2D, v as curve2dLastPoint, x as curve2dTangentAt, y as curve2dParameter } from "./blueprintFns-
|
|
3
|
+
import { w as kernelCallRaw } from "./topologyQueryFns-CBIJ7Ixi.js";
|
|
4
|
+
import { a as Blueprints, i as CompoundBlueprint, r as organiseBlueprints } from "./blueprintSketcher-CMcZhA20.js";
|
|
5
|
+
import { _ as Curve2D, t as Blueprint, y as BoundingBox2d } from "./blueprint-DGPC8bjk.js";
|
|
6
|
+
import { a as fuseBlueprints, c as roundedRectangleBlueprint, i as cutBlueprints, n as fuse2D, o as intersectBlueprints, r as intersect2D, s as polysidesBlueprint, t as cut2D } from "./boolean2D-BrhrzzT5.js";
|
|
7
|
+
import { S as reverseCurve, _ as curve2dIsOnCurve, a as isInside2D, b as curve2dSplitAt, c as scale2D, d as stretch2D, f as toSVGPathD, g as curve2dFirstPoint, h as curve2dDistanceFrom, i as getOrientation2D, l as sketchOnFace2D, m as curve2dBoundingBox, o as mirror2D, p as translate2D, r as getBounds2D, s as rotate2D, t as createBlueprint, u as sketchOnPlane2D, v as curve2dLastPoint, x as curve2dTangentAt, y as curve2dParameter } from "./blueprintFns-DDU4nEC4.js";
|
|
8
8
|
//#region src/core/curve2dHandle.ts
|
|
9
9
|
/**
|
|
10
10
|
* Wrap a raw kernel 2D curve handle with brand + disposal tracking.
|
|
@@ -1,14 +1,14 @@
|
|
|
1
|
-
const require_shapeTypes = require("./shapeTypes-
|
|
1
|
+
const require_shapeTypes = require("./shapeTypes-BwbnQSzG.cjs");
|
|
2
2
|
const require_vec3 = require("./vec3-CFwOI0ZI.cjs");
|
|
3
3
|
const require_errors = require("./errors-CXJtc4I7.cjs");
|
|
4
4
|
const require_constants = require("./constants-BOVyEYGH.cjs");
|
|
5
5
|
const require_types = require("./types-KjA8tY4Y.cjs");
|
|
6
6
|
const require_planeOps = require("./planeOps-BA4HfgQu.cjs");
|
|
7
|
-
const require_faceFns = require("./faceFns-
|
|
8
|
-
const require_curveFns = require("./curveFns-
|
|
7
|
+
const require_faceFns = require("./faceFns-ZhwskGuW.cjs");
|
|
8
|
+
const require_curveFns = require("./curveFns-Cka3gEep.cjs");
|
|
9
9
|
const require_arrayAccess = require("./arrayAccess-e4H9cBfh.cjs");
|
|
10
|
-
const require_surfaceBuilders = require("./surfaceBuilders-
|
|
11
|
-
const require_helpers = require("./helpers-
|
|
10
|
+
const require_surfaceBuilders = require("./surfaceBuilders-Ae2XRahr.cjs");
|
|
11
|
+
const require_helpers = require("./helpers-QPPvHzFe.cjs");
|
|
12
12
|
//#region src/2d/lib/definitions.ts
|
|
13
13
|
/** Type guard that checks whether a value is a `Point2D`. */
|
|
14
14
|
function isPoint2D(point) {
|
|
@@ -1,14 +1,14 @@
|
|
|
1
|
-
import { G as unregisterFromCleanup, Q as getKernel2D, U as registerForCleanup, Z as getKernel, a as createEdge, u as createWire } from "./shapeTypes-
|
|
1
|
+
import { G as unregisterFromCleanup, Q as getKernel2D, U as registerForCleanup, Z as getKernel, a as createEdge, u as createWire } from "./shapeTypes-B7GYg91f.js";
|
|
2
2
|
import { n as wasmIndex } from "./vec3-Dpha8d5k.js";
|
|
3
3
|
import { A as ok, R as unwrap, b as err, d as validationError, h as bug, n as computationError } from "./errors-DNWJsfVU.js";
|
|
4
4
|
import { r as RAD2DEG, t as DEG2RAD } from "./constants-ITRzCnCp.js";
|
|
5
5
|
import { r as toVec3 } from "./types-D24Y27N0.js";
|
|
6
6
|
import { r as makePlane } from "./planeOps-DSjjtrjg.js";
|
|
7
|
-
import { g as cast, m as uvCoordinates, n as faceCenter, p as uvBounds, r as faceGeomType } from "./faceFns-
|
|
8
|
-
import { f as getOrientation } from "./curveFns-
|
|
7
|
+
import { g as cast, m as uvCoordinates, n as faceCenter, p as uvBounds, r as faceGeomType } from "./faceFns-BuDNpvDH.js";
|
|
8
|
+
import { f as getOrientation } from "./curveFns-CWpRYhZ8.js";
|
|
9
9
|
import { n as getAtOrThrow, r as lastOrThrow, t as firstOrThrow } from "./arrayAccess-DrUGPADn.js";
|
|
10
|
-
import { r as makeFace } from "./surfaceBuilders-
|
|
11
|
-
import { _ as samePoint, b as subtract2d, l as add2d, o as normalize2d, p as distance2d, t as getSingleFace, v as scalarMultiply2d } from "./helpers-
|
|
10
|
+
import { r as makeFace } from "./surfaceBuilders-DbqaooTh.js";
|
|
11
|
+
import { _ as samePoint, b as subtract2d, l as add2d, o as normalize2d, p as distance2d, t as getSingleFace, v as scalarMultiply2d } from "./helpers-Ceyjiq3b.js";
|
|
12
12
|
//#region src/2d/lib/definitions.ts
|
|
13
13
|
/** Type guard that checks whether a value is a `Point2D`. */
|
|
14
14
|
function isPoint2D(point) {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
const require_errors = require("./errors-CXJtc4I7.cjs");
|
|
2
|
-
const require_blueprintSketcher = require("./blueprintSketcher-
|
|
3
|
-
const require_blueprint = require("./blueprint-
|
|
2
|
+
const require_blueprintSketcher = require("./blueprintSketcher-Dg22-24R.cjs");
|
|
3
|
+
const require_blueprint = require("./blueprint-B0_xM93f.cjs");
|
|
4
4
|
//#region src/2d/lib/curve2dFns.ts
|
|
5
5
|
/**
|
|
6
6
|
* Return a reversed copy of the curve (non-mutating).
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { A as ok, b as err, d as validationError, t as BrepErrorCode } from "./errors-DNWJsfVU.js";
|
|
2
|
-
import { i as CompoundBlueprint } from "./blueprintSketcher-
|
|
3
|
-
import { t as Blueprint } from "./blueprint-
|
|
2
|
+
import { i as CompoundBlueprint } from "./blueprintSketcher-CMcZhA20.js";
|
|
3
|
+
import { t as Blueprint } from "./blueprint-DGPC8bjk.js";
|
|
4
4
|
//#region src/2d/lib/curve2dFns.ts
|
|
5
5
|
/**
|
|
6
6
|
* Return a reversed copy of the curve (non-mutating).
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import { Q as getKernel2D, Z as getKernel } from "./shapeTypes-
|
|
1
|
+
import { Q as getKernel2D, Z as getKernel } from "./shapeTypes-B7GYg91f.js";
|
|
2
2
|
import { n as wasmIndex } from "./vec3-Dpha8d5k.js";
|
|
3
3
|
import { A as ok, R as unwrap, T as isOk, b as err, h as bug, n as computationError, s as safeIndex } from "./errors-DNWJsfVU.js";
|
|
4
4
|
import { r as RAD2DEG, t as DEG2RAD } from "./constants-ITRzCnCp.js";
|
|
5
5
|
import { t as firstOrThrow } from "./arrayAccess-DrUGPADn.js";
|
|
6
|
-
import { _ as samePoint, b as subtract2d, d as cartesianToPolar, f as crossProduct2d, g as rotate2d, h as polarToCartesian, l as add2d, m as polarAngle2d, o as normalize2d, p as distance2d, v as scalarMultiply2d } from "./helpers-
|
|
7
|
-
import { _ as Curve2D, c as make2dCircle, f as make2dSegmentCurve, h as approximateAsBSpline, m as make2dThreePointArc, n as asSVG, o as make2dArcFromCenter, p as make2dTangentArc, r as viewbox, s as make2dBezierCurve, t as Blueprint, u as make2dEllipseArc, x as isPoint2D, y as BoundingBox2d } from "./blueprint-
|
|
6
|
+
import { _ as samePoint, b as subtract2d, d as cartesianToPolar, f as crossProduct2d, g as rotate2d, h as polarToCartesian, l as add2d, m as polarAngle2d, o as normalize2d, p as distance2d, v as scalarMultiply2d } from "./helpers-Ceyjiq3b.js";
|
|
7
|
+
import { _ as Curve2D, c as make2dCircle, f as make2dSegmentCurve, h as approximateAsBSpline, m as make2dThreePointArc, n as asSVG, o as make2dArcFromCenter, p as make2dTangentArc, r as viewbox, s as make2dBezierCurve, t as Blueprint, u as make2dEllipseArc, x as isPoint2D, y as BoundingBox2d } from "./blueprint-DGPC8bjk.js";
|
|
8
8
|
//#region node_modules/flatqueue/index.js
|
|
9
9
|
/** @template T */
|
|
10
10
|
var FlatQueue = class {
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
const require_shapeTypes = require("./shapeTypes-
|
|
1
|
+
const require_shapeTypes = require("./shapeTypes-BwbnQSzG.cjs");
|
|
2
2
|
const require_vec3 = require("./vec3-CFwOI0ZI.cjs");
|
|
3
3
|
const require_errors = require("./errors-CXJtc4I7.cjs");
|
|
4
4
|
const require_constants = require("./constants-BOVyEYGH.cjs");
|
|
5
5
|
const require_arrayAccess = require("./arrayAccess-e4H9cBfh.cjs");
|
|
6
|
-
const require_helpers = require("./helpers-
|
|
7
|
-
const require_blueprint = require("./blueprint-
|
|
6
|
+
const require_helpers = require("./helpers-QPPvHzFe.cjs");
|
|
7
|
+
const require_blueprint = require("./blueprint-B0_xM93f.cjs");
|
|
8
8
|
//#region node_modules/flatqueue/index.js
|
|
9
9
|
/** @template T */
|
|
10
10
|
var FlatQueue = class {
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { n as wasmIndex } from "./vec3-Dpha8d5k.js";
|
|
2
2
|
import { R as unwrap, h as bug, s as safeIndex } from "./errors-DNWJsfVU.js";
|
|
3
3
|
import { r as lastOrThrow } from "./arrayAccess-DrUGPADn.js";
|
|
4
|
-
import { v as zip } from "./surfaceBuilders-
|
|
5
|
-
import { a as Blueprints, i as CompoundBlueprint, l as intersectCurves, r as organiseBlueprints, t as BlueprintSketcher, u as Flatbush } from "./blueprintSketcher-
|
|
6
|
-
import { _ as samePoint$1, b as subtract2d, f as crossProduct2d, s as PRECISION_INTERSECTION } from "./helpers-
|
|
7
|
-
import { b as removeDuplicatePoints, f as make2dSegmentCurve, t as Blueprint } from "./blueprint-
|
|
4
|
+
import { v as zip } from "./surfaceBuilders-DbqaooTh.js";
|
|
5
|
+
import { a as Blueprints, i as CompoundBlueprint, l as intersectCurves, r as organiseBlueprints, t as BlueprintSketcher, u as Flatbush } from "./blueprintSketcher-CMcZhA20.js";
|
|
6
|
+
import { _ as samePoint$1, b as subtract2d, f as crossProduct2d, s as PRECISION_INTERSECTION } from "./helpers-Ceyjiq3b.js";
|
|
7
|
+
import { b as removeDuplicatePoints, f as make2dSegmentCurve, t as Blueprint } from "./blueprint-DGPC8bjk.js";
|
|
8
8
|
//#region src/2d/blueprints/cannedBlueprints.ts
|
|
9
9
|
/**
|
|
10
10
|
* Create a regular polygon blueprint inscribed in a circle of the given radius.
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
const require_vec3 = require("./vec3-CFwOI0ZI.cjs");
|
|
2
2
|
const require_errors = require("./errors-CXJtc4I7.cjs");
|
|
3
3
|
const require_arrayAccess = require("./arrayAccess-e4H9cBfh.cjs");
|
|
4
|
-
const require_surfaceBuilders = require("./surfaceBuilders-
|
|
5
|
-
const require_blueprintSketcher = require("./blueprintSketcher-
|
|
6
|
-
const require_helpers = require("./helpers-
|
|
7
|
-
const require_blueprint = require("./blueprint-
|
|
4
|
+
const require_surfaceBuilders = require("./surfaceBuilders-Ae2XRahr.cjs");
|
|
5
|
+
const require_blueprintSketcher = require("./blueprintSketcher-Dg22-24R.cjs");
|
|
6
|
+
const require_helpers = require("./helpers-QPPvHzFe.cjs");
|
|
7
|
+
const require_blueprint = require("./blueprint-B0_xM93f.cjs");
|
|
8
8
|
//#region src/2d/blueprints/cannedBlueprints.ts
|
|
9
9
|
/**
|
|
10
10
|
* Create a regular polygon blueprint inscribed in a circle of the given radius.
|
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
const require_shapeTypes = require("./shapeTypes-
|
|
1
|
+
const require_shapeTypes = require("./shapeTypes-BwbnQSzG.cjs");
|
|
2
2
|
const require_errors = require("./errors-CXJtc4I7.cjs");
|
|
3
|
-
const require_topologyQueryFns = require("./topologyQueryFns-
|
|
3
|
+
const require_topologyQueryFns = require("./topologyQueryFns-Cb25Braq.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_shapeFns = require("./shapeFns-
|
|
7
|
+
const require_shapeFns = require("./shapeFns-CUjmsc5n.cjs");
|
|
8
8
|
const require_arrayAccess = require("./arrayAccess-e4H9cBfh.cjs");
|
|
9
|
-
const require_surfaceBuilders = require("./surfaceBuilders-
|
|
9
|
+
const require_surfaceBuilders = require("./surfaceBuilders-Ae2XRahr.cjs");
|
|
10
10
|
//#region src/topology/booleanFns.ts
|
|
11
11
|
/**
|
|
12
12
|
* Boolean and compound operations — functional replacements for _3DShape boolean methods.
|
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
import { Z as getKernel, h as isShape3D, t as castShape } from "./shapeTypes-
|
|
1
|
+
import { Z as getKernel, h as isShape3D, t as castShape } from "./shapeTypes-B7GYg91f.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, 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-CBIJ7Ixi.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 propagateAllMetadata, g as collectInputFaceHashes, v as propagateMetadataByHash } from "./shapeFns-
|
|
7
|
+
import { _ as propagateAllMetadata, g as collectInputFaceHashes, v as propagateMetadataByHash } from "./shapeFns-DLKjTl1m.js";
|
|
8
8
|
import { n as getAtOrThrow, t as firstOrThrow } from "./arrayAccess-DrUGPADn.js";
|
|
9
|
-
import { r as makeFace } from "./surfaceBuilders-
|
|
9
|
+
import { r as makeFace } from "./surfaceBuilders-DbqaooTh.js";
|
|
10
10
|
//#region src/topology/booleanFns.ts
|
|
11
11
|
/**
|
|
12
12
|
* Boolean and compound operations — functional replacements for _3DShape boolean methods.
|
package/dist/brepjs.cjs
CHANGED
|
@@ -1,36 +1,36 @@
|
|
|
1
1
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
2
|
-
const require_textBlueprints = require("./textBlueprints-
|
|
3
|
-
const require_shapeTypes = require("./shapeTypes-
|
|
2
|
+
const require_textBlueprints = require("./textBlueprints-IJMNaWq4.cjs");
|
|
3
|
+
const require_shapeTypes = require("./shapeTypes-BwbnQSzG.cjs");
|
|
4
4
|
const require_vec3 = require("./vec3-CFwOI0ZI.cjs");
|
|
5
|
-
const require_occtWasmAdapter = require("./occtWasmAdapter-
|
|
5
|
+
const require_occtWasmAdapter = require("./occtWasmAdapter-ddZvP8Ns.cjs");
|
|
6
6
|
const require_errors = require("./errors-CXJtc4I7.cjs");
|
|
7
|
-
const require_topologyQueryFns = require("./topologyQueryFns-
|
|
7
|
+
const require_topologyQueryFns = require("./topologyQueryFns-Cb25Braq.cjs");
|
|
8
8
|
const require_constants = require("./constants-BOVyEYGH.cjs");
|
|
9
9
|
const require_types = require("./types-KjA8tY4Y.cjs");
|
|
10
10
|
const require_vecOps = require("./vecOps-CCnJt-yH.cjs");
|
|
11
11
|
const require_planeOps = require("./planeOps-BA4HfgQu.cjs");
|
|
12
|
-
const require_faceFns = require("./faceFns-
|
|
13
|
-
const require_shapeFns = require("./shapeFns-
|
|
14
|
-
const require_curveFns = require("./curveFns-
|
|
15
|
-
const require_meshFns = require("./meshFns-
|
|
12
|
+
const require_faceFns = require("./faceFns-ZhwskGuW.cjs");
|
|
13
|
+
const require_shapeFns = require("./shapeFns-CUjmsc5n.cjs");
|
|
14
|
+
const require_curveFns = require("./curveFns-Cka3gEep.cjs");
|
|
15
|
+
const require_meshFns = require("./meshFns-CckSsqhi.cjs");
|
|
16
16
|
const require_arrayAccess = require("./arrayAccess-e4H9cBfh.cjs");
|
|
17
|
-
const require_surfaceBuilders = require("./surfaceBuilders-
|
|
18
|
-
const require_booleanFns = require("./booleanFns-
|
|
19
|
-
const require_primitiveFns = require("./primitiveFns-
|
|
20
|
-
const require_historyFns = require("./historyFns-
|
|
21
|
-
const require_blueprintSketcher = require("./blueprintSketcher-
|
|
22
|
-
const require_helpers = require("./helpers-
|
|
23
|
-
const require_drawFns = require("./drawFns-
|
|
24
|
-
const require_solidBuilders = require("./solidBuilders-
|
|
25
|
-
const require_measureFns = require("./measureFns-
|
|
26
|
-
const require_cornerFinder = require("./cornerFinder-
|
|
27
|
-
const require_boolean2D = require("./boolean2D-
|
|
28
|
-
const require_blueprintFns = require("./blueprintFns-
|
|
29
|
-
const require_importFns = require("./importFns-
|
|
30
|
-
const require_extrudeFns = require("./extrudeFns-
|
|
31
|
-
const require_cameraFns = require("./cameraFns-
|
|
32
|
-
const require_textMetrics = require("./textMetrics-
|
|
33
|
-
const require_shapeRefFns = require("./shapeRefFns-
|
|
17
|
+
const require_surfaceBuilders = require("./surfaceBuilders-Ae2XRahr.cjs");
|
|
18
|
+
const require_booleanFns = require("./booleanFns-D_XT8nXq.cjs");
|
|
19
|
+
const require_primitiveFns = require("./primitiveFns-MYl8wCQ_.cjs");
|
|
20
|
+
const require_historyFns = require("./historyFns-QbZ_1wDe.cjs");
|
|
21
|
+
const require_blueprintSketcher = require("./blueprintSketcher-Dg22-24R.cjs");
|
|
22
|
+
const require_helpers = require("./helpers-QPPvHzFe.cjs");
|
|
23
|
+
const require_drawFns = require("./drawFns-BBXf1AmG.cjs");
|
|
24
|
+
const require_solidBuilders = require("./solidBuilders-C_CVKD9y.cjs");
|
|
25
|
+
const require_measureFns = require("./measureFns-DD5O45zv.cjs");
|
|
26
|
+
const require_cornerFinder = require("./cornerFinder-BrRfeGOx.cjs");
|
|
27
|
+
const require_boolean2D = require("./boolean2D-BtLSFZ3U.cjs");
|
|
28
|
+
const require_blueprintFns = require("./blueprintFns-D8-3CcI7.cjs");
|
|
29
|
+
const require_importFns = require("./importFns-pGOL3CD4.cjs");
|
|
30
|
+
const require_extrudeFns = require("./extrudeFns-BESH_tno.cjs");
|
|
31
|
+
const require_cameraFns = require("./cameraFns-N7btylSp.cjs");
|
|
32
|
+
const require_textMetrics = require("./textMetrics-CL4DE2-I.cjs");
|
|
33
|
+
const require_shapeRefFns = require("./shapeRefFns-AlYSd7xG.cjs");
|
|
34
34
|
const require_workerHandler = require("./workerHandler-CdlOTwJg.cjs");
|
|
35
35
|
//#region src/topology/shapeBooleans.ts
|
|
36
36
|
var BOPAlgo_GlueShift = 1;
|
|
@@ -218,8 +218,8 @@ function pointsInside(mesh, queries, id) {
|
|
|
218
218
|
}
|
|
219
219
|
//#endregion
|
|
220
220
|
//#region src/voxel/repairFns.ts
|
|
221
|
-
var DEFAULT_RESOLUTION$
|
|
222
|
-
var DEFAULT_PADDING$
|
|
221
|
+
var DEFAULT_RESOLUTION$2 = 48;
|
|
222
|
+
var DEFAULT_PADDING$2 = 2;
|
|
223
223
|
/**
|
|
224
224
|
* Repair a (possibly non-watertight) triangle-soup mesh into a closed surface:
|
|
225
225
|
* voxelize an FWN-signed SDF, then Surface-Nets contour it back to triangles.
|
|
@@ -232,16 +232,16 @@ function repairMesh(mesh, opts, id) {
|
|
|
232
232
|
const invalid = validateMesh(mesh);
|
|
233
233
|
if (invalid) return require_errors.err(invalid);
|
|
234
234
|
if (mesh.vertices.length === 0 || mesh.triangles.length === 0) return require_errors.err(require_errors.validationError("VOXEL_EMPTY_MESH", "repairMesh requires a non-empty triangle mesh."));
|
|
235
|
-
const resolution = opts?.resolution ?? DEFAULT_RESOLUTION$
|
|
236
|
-
const padding = opts?.padding ?? DEFAULT_PADDING$
|
|
235
|
+
const resolution = opts?.resolution ?? DEFAULT_RESOLUTION$2;
|
|
236
|
+
const padding = opts?.padding ?? DEFAULT_PADDING$2;
|
|
237
237
|
if (!Number.isInteger(resolution) || resolution < 1) return require_errors.err(require_errors.validationError("VOXEL_INVALID_RESOLUTION", "resolution must be an integer >= 1."));
|
|
238
238
|
if (!Number.isInteger(padding) || padding < 1) return require_errors.err(require_errors.validationError("VOXEL_INVALID_PADDING", "padding must be an integer >= 1."));
|
|
239
239
|
const engine = resolveEngine(id);
|
|
240
240
|
if (require_errors.isErr(engine)) return engine;
|
|
241
241
|
try {
|
|
242
242
|
try {
|
|
243
|
-
var _usingCtx$
|
|
244
|
-
const repaired = _usingCtx$
|
|
243
|
+
var _usingCtx$6 = require_shapeTypes._usingCtx();
|
|
244
|
+
const repaired = _usingCtx$6.u(engine.value.repair_mesh(mesh.vertices, mesh.triangles, resolution, padding));
|
|
245
245
|
const vertexCount = repaired.positions.length / 3;
|
|
246
246
|
return require_errors.ok({
|
|
247
247
|
vertices: repaired.positions,
|
|
@@ -254,15 +254,192 @@ function repairMesh(mesh, opts, id) {
|
|
|
254
254
|
faceHash: 0
|
|
255
255
|
}]
|
|
256
256
|
});
|
|
257
|
+
} catch (_) {
|
|
258
|
+
_usingCtx$6.e = _;
|
|
259
|
+
} finally {
|
|
260
|
+
_usingCtx$6.d();
|
|
261
|
+
}
|
|
262
|
+
} catch (cause) {
|
|
263
|
+
return require_errors.err(require_errors.computationError("VOXEL_REPAIR_FAILED", cause instanceof Error ? cause.message : "voxel repair failed (grid too large?).", cause));
|
|
264
|
+
}
|
|
265
|
+
}
|
|
266
|
+
//#endregion
|
|
267
|
+
//#region src/voxel/shapeMesh.ts
|
|
268
|
+
var DEFAULT_DEFLECTION = .001;
|
|
269
|
+
/**
|
|
270
|
+
* Mesh a B-rep shape into the flat triangle-soup {@link VoxelMeshInput} the voxel
|
|
271
|
+
* ops consume. Tessellates via the topology mesh API at `deflection` linear
|
|
272
|
+
* tolerance and forwards its `{ vertices, triangles }` (already Float32Array /
|
|
273
|
+
* Uint32Array). Meshing failures surface as an `err(...)` rather than a throw.
|
|
274
|
+
*/
|
|
275
|
+
function shapeToMeshInput(shape, deflection = DEFAULT_DEFLECTION) {
|
|
276
|
+
try {
|
|
277
|
+
const tessellated = require_meshFns.mesh(shape, { tolerance: deflection });
|
|
278
|
+
if (tessellated.vertices.length === 0 || tessellated.triangles.length === 0) return require_errors.err(require_errors.computationError("VOXEL_SHAPE_MESH_EMPTY", "shape tessellated to an empty triangle mesh."));
|
|
279
|
+
return require_errors.ok({
|
|
280
|
+
vertices: tessellated.vertices,
|
|
281
|
+
triangles: tessellated.triangles
|
|
282
|
+
});
|
|
283
|
+
} catch (cause) {
|
|
284
|
+
return require_errors.err(require_errors.computationError("VOXEL_SHAPE_MESH_FAILED", cause instanceof Error ? cause.message : "failed to mesh shape for voxel op.", cause));
|
|
285
|
+
}
|
|
286
|
+
}
|
|
287
|
+
//#endregion
|
|
288
|
+
//#region src/voxel/meshOpsFns.ts
|
|
289
|
+
var DEFAULT_RESOLUTION$1 = 48;
|
|
290
|
+
var DEFAULT_PADDING$1 = 2;
|
|
291
|
+
var BOOLEAN_OP_CODES = {
|
|
292
|
+
union: 0,
|
|
293
|
+
intersection: 1,
|
|
294
|
+
difference: 2
|
|
295
|
+
};
|
|
296
|
+
function resolveGridParams(opts) {
|
|
297
|
+
const resolution = opts?.resolution ?? DEFAULT_RESOLUTION$1;
|
|
298
|
+
const padding = opts?.padding ?? DEFAULT_PADDING$1;
|
|
299
|
+
if (!Number.isInteger(resolution) || resolution < 1) return require_errors.err(require_errors.validationError("VOXEL_INVALID_RESOLUTION", "resolution must be an integer >= 1."));
|
|
300
|
+
if (!Number.isInteger(padding) || padding < 1) return require_errors.err(require_errors.validationError("VOXEL_INVALID_PADDING", "padding must be an integer >= 1."));
|
|
301
|
+
return require_errors.ok({
|
|
302
|
+
resolution,
|
|
303
|
+
padding
|
|
304
|
+
});
|
|
305
|
+
}
|
|
306
|
+
function meshFromResult(result) {
|
|
307
|
+
if (result.positions.length === 0 || result.indices.length === 0) return require_errors.err(require_errors.computationError("VOXEL_DEGENERATE_RESULT", "the voxel operation produced an empty mesh (over-shrunk offset or disjoint operands?)."));
|
|
308
|
+
const vertexCount = result.positions.length / 3;
|
|
309
|
+
return require_errors.ok({
|
|
310
|
+
vertices: result.positions,
|
|
311
|
+
normals: result.normals,
|
|
312
|
+
triangles: result.indices,
|
|
313
|
+
uvs: new Float32Array(vertexCount * 2),
|
|
314
|
+
faceGroups: [{
|
|
315
|
+
start: 0,
|
|
316
|
+
count: result.indices.length / 3,
|
|
317
|
+
faceHash: 0
|
|
318
|
+
}]
|
|
319
|
+
});
|
|
320
|
+
}
|
|
321
|
+
/**
|
|
322
|
+
* Offset a mesh by `distance` via a true-SDF iso-level shift: voxelize an
|
|
323
|
+
* FWN-signed SDF, subtract `distance`, then Surface-Nets contour it back.
|
|
324
|
+
*
|
|
325
|
+
* `distance > 0` grows the surface outward, `< 0` shrinks it inward. Returns a
|
|
326
|
+
* {@link KernelMeshResult} in world coordinates (a single face group, no UVs).
|
|
327
|
+
*/
|
|
328
|
+
function offsetMesh(mesh, distance, opts, id) {
|
|
329
|
+
const invalid = validateMesh(mesh);
|
|
330
|
+
if (invalid) return require_errors.err(invalid);
|
|
331
|
+
if (mesh.vertices.length === 0 || mesh.triangles.length === 0) return require_errors.err(require_errors.validationError("VOXEL_EMPTY_MESH", "offsetMesh requires a non-empty triangle mesh."));
|
|
332
|
+
if (!Number.isFinite(distance)) return require_errors.err(require_errors.validationError("VOXEL_INVALID_DISTANCE", "distance must be a finite number."));
|
|
333
|
+
const params = resolveGridParams(opts);
|
|
334
|
+
if (require_errors.isErr(params)) return params;
|
|
335
|
+
const engine = resolveEngine(id);
|
|
336
|
+
if (require_errors.isErr(engine)) return engine;
|
|
337
|
+
try {
|
|
338
|
+
try {
|
|
339
|
+
var _usingCtx$5 = require_shapeTypes._usingCtx();
|
|
340
|
+
return meshFromResult(_usingCtx$5.u(engine.value.offset_mesh(mesh.vertices, mesh.triangles, distance, params.value.resolution, params.value.padding)));
|
|
257
341
|
} catch (_) {
|
|
258
342
|
_usingCtx$5.e = _;
|
|
259
343
|
} finally {
|
|
260
344
|
_usingCtx$5.d();
|
|
261
345
|
}
|
|
262
346
|
} catch (cause) {
|
|
263
|
-
return require_errors.err(require_errors.computationError("
|
|
347
|
+
return require_errors.err(require_errors.computationError("VOXEL_OFFSET_FAILED", cause instanceof Error ? cause.message : "voxel offset failed (grid too large?).", cause));
|
|
264
348
|
}
|
|
265
349
|
}
|
|
350
|
+
/**
|
|
351
|
+
* Hollow a solid mesh into a shell of the given inward `thickness`: voxelize an
|
|
352
|
+
* FWN-signed SDF, take `max(solid, -(solid + thickness))`, then contour it.
|
|
353
|
+
*
|
|
354
|
+
* `thickness` must be finite and > 0 (inward-only). Returns a
|
|
355
|
+
* {@link KernelMeshResult} in world coordinates (a single face group, no UVs).
|
|
356
|
+
*/
|
|
357
|
+
function shellMesh(mesh, thickness, opts, id) {
|
|
358
|
+
const invalid = validateMesh(mesh);
|
|
359
|
+
if (invalid) return require_errors.err(invalid);
|
|
360
|
+
if (mesh.vertices.length === 0 || mesh.triangles.length === 0) return require_errors.err(require_errors.validationError("VOXEL_EMPTY_MESH", "shellMesh requires a non-empty triangle mesh."));
|
|
361
|
+
if (!Number.isFinite(thickness) || thickness <= 0) return require_errors.err(require_errors.validationError("VOXEL_INVALID_THICKNESS", "thickness must be a finite number > 0."));
|
|
362
|
+
const params = resolveGridParams(opts);
|
|
363
|
+
if (require_errors.isErr(params)) return params;
|
|
364
|
+
const engine = resolveEngine(id);
|
|
365
|
+
if (require_errors.isErr(engine)) return engine;
|
|
366
|
+
try {
|
|
367
|
+
try {
|
|
368
|
+
var _usingCtx3 = require_shapeTypes._usingCtx();
|
|
369
|
+
return meshFromResult(_usingCtx3.u(engine.value.shell_mesh(mesh.vertices, mesh.triangles, thickness, params.value.resolution, params.value.padding)));
|
|
370
|
+
} catch (_) {
|
|
371
|
+
_usingCtx3.e = _;
|
|
372
|
+
} finally {
|
|
373
|
+
_usingCtx3.d();
|
|
374
|
+
}
|
|
375
|
+
} catch (cause) {
|
|
376
|
+
return require_errors.err(require_errors.computationError("VOXEL_SHELL_FAILED", cause instanceof Error ? cause.message : "voxel shell failed (grid too large?).", cause));
|
|
377
|
+
}
|
|
378
|
+
}
|
|
379
|
+
/**
|
|
380
|
+
* Voxel-based CSG of two meshes: voxelize both onto a shared grid, combine their
|
|
381
|
+
* SDFs (union/intersection/difference), then Surface-Nets contour the result.
|
|
382
|
+
*
|
|
383
|
+
* `op` is `'difference'` = A − B. Robust on non-watertight input (FWN sign).
|
|
384
|
+
* Returns a {@link KernelMeshResult} in world coordinates (single group, no UVs).
|
|
385
|
+
*/
|
|
386
|
+
function voxelBoolean(a, b, op, opts, id) {
|
|
387
|
+
const invalidA = validateMesh(a);
|
|
388
|
+
if (invalidA) return require_errors.err(invalidA);
|
|
389
|
+
const invalidB = validateMesh(b);
|
|
390
|
+
if (invalidB) return require_errors.err(invalidB);
|
|
391
|
+
if (a.vertices.length === 0 || a.triangles.length === 0) return require_errors.err(require_errors.validationError("VOXEL_EMPTY_MESH", "voxelBoolean requires a non-empty mesh for operand A."));
|
|
392
|
+
if (b.vertices.length === 0 || b.triangles.length === 0) return require_errors.err(require_errors.validationError("VOXEL_EMPTY_MESH", "voxelBoolean requires a non-empty mesh for operand B."));
|
|
393
|
+
const opCode = BOOLEAN_OP_CODES[op];
|
|
394
|
+
const params = resolveGridParams(opts);
|
|
395
|
+
if (require_errors.isErr(params)) return params;
|
|
396
|
+
const engine = resolveEngine(id);
|
|
397
|
+
if (require_errors.isErr(engine)) return engine;
|
|
398
|
+
try {
|
|
399
|
+
try {
|
|
400
|
+
var _usingCtx4 = require_shapeTypes._usingCtx();
|
|
401
|
+
return meshFromResult(_usingCtx4.u(engine.value.voxel_boolean(a.vertices, a.triangles, b.vertices, b.triangles, opCode, params.value.resolution, params.value.padding)));
|
|
402
|
+
} catch (_) {
|
|
403
|
+
_usingCtx4.e = _;
|
|
404
|
+
} finally {
|
|
405
|
+
_usingCtx4.d();
|
|
406
|
+
}
|
|
407
|
+
} catch (cause) {
|
|
408
|
+
return require_errors.err(require_errors.computationError("VOXEL_BOOLEAN_FAILED", cause instanceof Error ? cause.message : "voxel boolean failed (grid too large?).", cause));
|
|
409
|
+
}
|
|
410
|
+
}
|
|
411
|
+
/**
|
|
412
|
+
* Offset a B-rep shape by `distance`: tessellate it, then run {@link offsetMesh}
|
|
413
|
+
* on the resulting triangle soup. `distance > 0` grows outward, `< 0` shrinks
|
|
414
|
+
* inward. Threads a meshing failure straight back as an `err(...)`.
|
|
415
|
+
*/
|
|
416
|
+
function offsetShape(shape, distance, opts, id) {
|
|
417
|
+
const meshInput = shapeToMeshInput(shape);
|
|
418
|
+
if (require_errors.isErr(meshInput)) return meshInput;
|
|
419
|
+
return offsetMesh(meshInput.value, distance, opts, id);
|
|
420
|
+
}
|
|
421
|
+
/**
|
|
422
|
+
* Hollow a B-rep shape into a shell of inward `thickness`: tessellate it, then
|
|
423
|
+
* run {@link shellMesh}. `thickness` must be finite and > 0. Threads a meshing
|
|
424
|
+
* failure straight back as an `err(...)`.
|
|
425
|
+
*/
|
|
426
|
+
function shellShape(shape, thickness, opts, id) {
|
|
427
|
+
const meshInput = shapeToMeshInput(shape);
|
|
428
|
+
if (require_errors.isErr(meshInput)) return meshInput;
|
|
429
|
+
return shellMesh(meshInput.value, thickness, opts, id);
|
|
430
|
+
}
|
|
431
|
+
/**
|
|
432
|
+
* Voxel CSG of two B-rep shapes: tessellate both, then run {@link voxelBoolean}.
|
|
433
|
+
* `op` is `'difference'` = A − B. Threads either meshing failure back as an
|
|
434
|
+
* `err(...)`.
|
|
435
|
+
*/
|
|
436
|
+
function voxelBooleanShapes(a, b, op, opts, id) {
|
|
437
|
+
const meshA = shapeToMeshInput(a);
|
|
438
|
+
if (require_errors.isErr(meshA)) return meshA;
|
|
439
|
+
const meshB = shapeToMeshInput(b);
|
|
440
|
+
if (require_errors.isErr(meshB)) return meshB;
|
|
441
|
+
return voxelBoolean(meshA.value, meshB.value, op, opts, id);
|
|
442
|
+
}
|
|
266
443
|
//#endregion
|
|
267
444
|
//#region src/lattice/latticeFns.ts
|
|
268
445
|
var LATTICE_TAGS = {
|
|
@@ -334,6 +511,16 @@ function latticeInfill(mesh, opts, id) {
|
|
|
334
511
|
}
|
|
335
512
|
}
|
|
336
513
|
/**
|
|
514
|
+
* Fill a B-rep shape with a TPMS lattice infill: tessellate the shape, then run
|
|
515
|
+
* {@link latticeInfill} on the resulting triangle soup. Threads a meshing
|
|
516
|
+
* failure straight back as an `err(...)`.
|
|
517
|
+
*/
|
|
518
|
+
function latticeInfillShape(shape, opts, id) {
|
|
519
|
+
const meshInput = shapeToMeshInput(shape);
|
|
520
|
+
if (require_errors.isErr(meshInput)) return meshInput;
|
|
521
|
+
return latticeInfill(meshInput.value, opts, id);
|
|
522
|
+
}
|
|
523
|
+
/**
|
|
337
524
|
* Contour the infinite TPMS lattice clipped to an axis-aligned box.
|
|
338
525
|
*
|
|
339
526
|
* Returns a {@link KernelMeshResult} in world coordinates (a single face group,
|
|
@@ -5725,6 +5912,7 @@ exports.kernelCallRaw = require_topologyQueryFns.kernelCallRaw;
|
|
|
5725
5912
|
exports.kernelCallScoped = require_topologyQueryFns.kernelCallScoped;
|
|
5726
5913
|
exports.kernelError = require_errors.kernelError;
|
|
5727
5914
|
exports.latticeInfill = latticeInfill;
|
|
5915
|
+
exports.latticeInfillShape = latticeInfillShape;
|
|
5728
5916
|
exports.line = require_primitiveFns.line;
|
|
5729
5917
|
exports.linearPattern = require_historyFns.linearPattern;
|
|
5730
5918
|
exports.loadFont = require_textBlueprints.loadFont;
|
|
@@ -5777,6 +5965,8 @@ exports.multiSectionSweep = require_extrudeFns.multiSectionSweep;
|
|
|
5777
5965
|
exports.normalAt = require_faceFns.normalAt;
|
|
5778
5966
|
exports.offset = offset;
|
|
5779
5967
|
exports.offsetFace = require_primitiveFns.offsetFace;
|
|
5968
|
+
exports.offsetMesh = offsetMesh;
|
|
5969
|
+
exports.offsetShape = offsetShape;
|
|
5780
5970
|
exports.offsetWire2D = require_curveFns.offsetWire2D;
|
|
5781
5971
|
exports.ok = require_errors.ok;
|
|
5782
5972
|
exports.or = require_errors.or;
|
|
@@ -5857,9 +6047,12 @@ exports.setShapeOrigin = require_shapeFns.setShapeOrigin;
|
|
|
5857
6047
|
exports.setTagMetadata = require_shapeFns.setTagMetadata;
|
|
5858
6048
|
exports.sewShells = require_primitiveFns.sewShells;
|
|
5859
6049
|
exports.shape = shape;
|
|
6050
|
+
exports.shapeToMeshInput = shapeToMeshInput;
|
|
5860
6051
|
exports.shapeType = require_faceFns.shapeType;
|
|
5861
6052
|
exports.sharedEdges = require_primitiveFns.sharedEdges;
|
|
5862
6053
|
exports.shell = shell;
|
|
6054
|
+
exports.shellMesh = shellMesh;
|
|
6055
|
+
exports.shellShape = shellShape;
|
|
5863
6056
|
exports.shellWithEvolution = require_primitiveFns.shellWithEvolution;
|
|
5864
6057
|
exports.simplify = simplify;
|
|
5865
6058
|
exports.sketchCircle = require_drawFns.sketchCircle;
|
|
@@ -5964,6 +6157,8 @@ exports.vertex = require_primitiveFns.vertex;
|
|
|
5964
6157
|
exports.vertexFinder = vertexFinder;
|
|
5965
6158
|
exports.vertexPosition = require_topologyQueryFns.vertexPosition;
|
|
5966
6159
|
exports.verticesOfEdge = require_primitiveFns.verticesOfEdge;
|
|
6160
|
+
exports.voxelBoolean = voxelBoolean;
|
|
6161
|
+
exports.voxelBooleanShapes = voxelBooleanShapes;
|
|
5967
6162
|
exports.walkAssembly = require_historyFns.walkAssembly;
|
|
5968
6163
|
exports.windingNumbers = windingNumbers;
|
|
5969
6164
|
exports.wire = require_primitiveFns.wire;
|