brepjs 20.6.0 → 20.7.0
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 +7 -7
- package/dist/2d.js +7 -7
- package/dist/{adjacencyFns-DO9_F2YJ.js → adjacencyFns-BgJQQjdt.js} +3 -3
- package/dist/{adjacencyFns-CmNvIFu1.cjs → adjacencyFns-_RTYhwtD.cjs} +3 -3
- package/dist/{blueprint-DHKul4EN.js → blueprint-Bth4EVaO.js} +7 -7
- package/dist/{blueprint-Ci2Mw5v-.cjs → blueprint-wq2TU1XP.cjs} +7 -7
- package/dist/{blueprintFns-D68_PxRl.js → blueprintFns-DQmNe1p6.js} +3 -3
- package/dist/{blueprintFns-CbJPSd5r.cjs → blueprintFns-Dd0gm1rX.cjs} +3 -3
- package/dist/{blueprintSketcher-pVbM0BHf.cjs → blueprintSketcher-CSDqr27-.cjs} +4 -4
- package/dist/{blueprintSketcher-j9vJAniE.js → blueprintSketcher-DNp87aQZ.js} +4 -4
- package/dist/{boolean2D-D6Oc8tBx.js → boolean2D-BAb4SnIL.js} +5 -5
- package/dist/{boolean2D-Dq29HCr9.cjs → boolean2D-BkgOjMRt.cjs} +5 -5
- package/dist/brepjs.cjs +32 -32
- package/dist/brepjs.js +32 -32
- package/dist/{cameraFns-DVZkA2eq.js → cameraFns-9AGyuZVp.js} +4 -4
- package/dist/{cameraFns-BMXugx7m.cjs → cameraFns-CKUN90f_.cjs} +4 -4
- package/dist/core/errors.d.ts +3 -0
- package/dist/core.cjs +4 -4
- package/dist/core.js +4 -4
- package/dist/{cornerFinder-DSnn8gRP.js → cornerFinder-Cr_04etw.js} +1 -1
- package/dist/{cornerFinder-DshfhGHG.cjs → cornerFinder-DJWo6h1Z.cjs} +1 -1
- package/dist/{curveFns-CEb6TLxC.js → curveFns-CkA2WJP2.js} +2 -2
- package/dist/{curveFns-Cxq5lFqU.cjs → curveFns-U7srQ3ZA.cjs} +2 -2
- package/dist/{drawFns-DMhKXGgG.js → drawFns-C6bmFijD.js} +14 -14
- package/dist/{drawFns-CH0q-0JP.cjs → drawFns-DlCxozRP.cjs} +14 -14
- package/dist/{errors-DoMAp7mQ.cjs → errors-GVyCnpi0.cjs} +3 -0
- package/dist/{errors-B3espUT6.js → errors-vxP5FT8B.js} +3 -0
- package/dist/{faceFns-C-wc4fX-.js → faceFns-BBk6XKJO.js} +3 -3
- package/dist/{faceFns-B8ctN5Te.cjs → faceFns-DSRREV5G.cjs} +3 -3
- package/dist/{healingFns-D3mNy1rp.cjs → healingFns-C9G3yjOe.cjs} +137 -31
- package/dist/{healingFns-CJfuZMw2.js → healingFns-CEr0afli.js} +137 -31
- package/dist/{helpers-BhHbDu6-.cjs → helpers-JuPoaP_b.cjs} +7 -7
- package/dist/{helpers-BXoAMWe3.js → helpers-sDialr0f.js} +7 -7
- package/dist/{importFns-DHaw1x5R.cjs → importFns-ClqPJCFR.cjs} +3 -3
- package/dist/{importFns-YZyGYu_M.js → importFns-DSUfSQn2.js} +3 -3
- package/dist/io.cjs +2 -2
- package/dist/io.js +2 -2
- package/dist/kernel/capabilities.d.ts +8 -0
- package/dist/kernel/occtWasm/occtWasmAdapter.cjs +1 -1
- package/dist/kernel/occtWasm/occtWasmAdapter.js +1 -1
- package/dist/{loftFns-CTTia_cZ.js → loftFns-B8DSoG-F.js} +2 -2
- package/dist/{loftFns-DVr6PaTM.cjs → loftFns-mkJeOaII.cjs} +2 -2
- package/dist/{measureFns-C6wgH_1a.cjs → measureFns-BvNkzSR6.cjs} +4 -4
- package/dist/{measureFns-BmdVG0_8.js → measureFns-PRM3gOjw.js} +4 -4
- package/dist/measurement.cjs +2 -2
- package/dist/measurement.js +2 -2
- package/dist/{meshFns-uNRS602U.js → meshFns-CgbT3uuO.js} +4 -4
- package/dist/{meshFns-r_p0RRoO.cjs → meshFns-W7ZTKqiJ.cjs} +4 -4
- package/dist/{occtWasmAdapter-CxSY6Ty2.cjs → occtWasmAdapter-BSQeA69d.cjs} +12 -1
- package/dist/{occtWasmAdapter-cnV8J7Y-.js → occtWasmAdapter-PzZJHUAd.js} +7 -2
- package/dist/operations.cjs +2 -2
- package/dist/operations.js +2 -2
- package/dist/{originTrackingFns-BIa3TdgX.js → originTrackingFns-D8SNCDKj.js} +2 -2
- package/dist/{originTrackingFns-DgJ-MTtE.cjs → originTrackingFns-DJDTRJh3.cjs} +2 -2
- package/dist/{planeOps-BDt05NAD.cjs → planeOps-C9d2Y56B.cjs} +1 -1
- package/dist/{planeOps-BkwaqhUj.js → planeOps-Dp0YvuFE.js} +1 -1
- package/dist/{primitiveFns-CktCbLBo.cjs → primitiveFns-EtHyTqhw.cjs} +5 -5
- package/dist/{primitiveFns-h_zOAbmf.js → primitiveFns-W3RYNJcm.js} +5 -5
- package/dist/{principalBoxFns-DkP-681E.js → principalBoxFns-Cbtty-2_.js} +4 -4
- package/dist/{principalBoxFns-28BQIeo8.cjs → principalBoxFns-CmZa7qHi.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-DUDJqfOM.js → refResolveFns-BkciKtNP.js} +6 -6
- package/dist/{refResolveFns-fSzDZ1rx.cjs → refResolveFns-D99Vqe7a.cjs} +6 -6
- package/dist/result.cjs +1 -1
- package/dist/result.js +1 -1
- package/dist/{shapeFns-DKDlt3k2.cjs → shapeFns-B54CsPyk.cjs} +3 -3
- package/dist/{shapeFns-B5hzkmwe.js → shapeFns-DB3l3ULC.js} +3 -3
- package/dist/shapeRef.cjs +1 -1
- package/dist/shapeRef.js +1 -1
- package/dist/{shapeTypes-Bva18qvE.js → shapeTypes-CgbUTASh.js} +2 -2
- package/dist/{shapeTypes-CkxvJRpq.cjs → shapeTypes-D_anqiRe.cjs} +2 -2
- package/dist/sketching.cjs +3 -3
- package/dist/sketching.js +3 -3
- package/dist/{solidBuilders-BFEnqrU0.cjs → solidBuilders-CUd-korS.cjs} +7 -7
- package/dist/{solidBuilders-BpTN-NfM.js → solidBuilders-DE_na4G3.js} +7 -7
- package/dist/{surfaceBuilders-CTk2lGlw.cjs → surfaceBuilders-DOn2jWkh.cjs} +4 -4
- package/dist/{surfaceBuilders-DAZCPa5O.js → surfaceBuilders-wdGNiImD.js} +4 -4
- package/dist/text.cjs +2 -2
- package/dist/text.js +2 -2
- package/dist/{textBlueprints-DbEWBdhF.cjs → textBlueprints-BQ60Rc96.cjs} +9 -9
- package/dist/{textBlueprints-DuwP72D6.js → textBlueprints-B_jwMuej.js} +9 -9
- package/dist/{textMetrics-CbNBlPsl.cjs → textMetrics-Bm0a4kh7.cjs} +2 -2
- package/dist/{textMetrics-q6RSXX9Z.js → textMetrics-Dj3yfZNQ.js} +2 -2
- package/dist/{threadFns-5FXCN-9R.cjs → threadFns-BuRPVenB.cjs} +8 -8
- package/dist/{threadFns-BcsScbp4.js → threadFns-DlL5VnMf.js} +8 -8
- package/dist/topology/modifierFns.d.ts +5 -0
- package/dist/topology/thickResultCheck.d.ts +18 -0
- package/dist/topology.cjs +9 -9
- package/dist/topology.js +9 -9
- package/dist/{topologyQueryFns-CY6YiGsk.js → topologyQueryFns-6M_dbT1R.js} +6 -3
- package/dist/{topologyQueryFns-C6HwYYpi.cjs → topologyQueryFns-ENxs8uu2.cjs} +11 -2
- package/dist/{validityTypes-D0IDDMbY.cjs → validityTypes-BPamqRZ8.cjs} +2 -2
- package/dist/{validityTypes-MiXYsBZi.js → validityTypes-BTuI0vcR.js} +2 -2
- package/dist/vectors.cjs +1 -1
- package/dist/vectors.js +1 -1
- package/package.json +1 -1
|
@@ -1,22 +1,22 @@
|
|
|
1
|
-
const require_shapeTypes = require("./shapeTypes-
|
|
1
|
+
const require_shapeTypes = require("./shapeTypes-D_anqiRe.cjs");
|
|
2
2
|
const require_bug = require("./bug-CBcpIPuf.cjs");
|
|
3
|
-
const require_errors = require("./errors-
|
|
4
|
-
const require_topologyQueryFns = require("./topologyQueryFns-
|
|
3
|
+
const require_errors = require("./errors-GVyCnpi0.cjs");
|
|
4
|
+
const require_topologyQueryFns = require("./topologyQueryFns-ENxs8uu2.cjs");
|
|
5
5
|
const require_constants = require("./constants-oee0S_x6.cjs");
|
|
6
6
|
const require_types = require("./types-CjF9Rofr.cjs");
|
|
7
7
|
const require_vecOps = require("./vecOps-CrGEPPQM.cjs");
|
|
8
|
-
const require_planeOps = require("./planeOps-
|
|
9
|
-
const require_faceFns = require("./faceFns-
|
|
10
|
-
const require_curveFns = require("./curveFns-
|
|
8
|
+
const require_planeOps = require("./planeOps-C9d2Y56B.cjs");
|
|
9
|
+
const require_faceFns = require("./faceFns-DSRREV5G.cjs");
|
|
10
|
+
const require_curveFns = require("./curveFns-U7srQ3ZA.cjs");
|
|
11
11
|
const require_arrayAccess = require("./arrayAccess-DpJYARwv.cjs");
|
|
12
|
-
const require_surfaceBuilders = require("./surfaceBuilders-
|
|
13
|
-
const require_blueprintSketcher = require("./blueprintSketcher-
|
|
14
|
-
const require_helpers = require("./helpers-
|
|
15
|
-
const require_blueprint = require("./blueprint-
|
|
16
|
-
const require_cornerFinder = require("./cornerFinder-
|
|
17
|
-
const require_boolean2D = require("./boolean2D-
|
|
18
|
-
const require_textBlueprints = require("./textBlueprints-
|
|
19
|
-
const require_cameraFns = require("./cameraFns-
|
|
12
|
+
const require_surfaceBuilders = require("./surfaceBuilders-DOn2jWkh.cjs");
|
|
13
|
+
const require_blueprintSketcher = require("./blueprintSketcher-CSDqr27-.cjs");
|
|
14
|
+
const require_helpers = require("./helpers-JuPoaP_b.cjs");
|
|
15
|
+
const require_blueprint = require("./blueprint-wq2TU1XP.cjs");
|
|
16
|
+
const require_cornerFinder = require("./cornerFinder-DJWo6h1Z.cjs");
|
|
17
|
+
const require_boolean2D = require("./boolean2D-BkgOjMRt.cjs");
|
|
18
|
+
const require_textBlueprints = require("./textBlueprints-BQ60Rc96.cjs");
|
|
19
|
+
const require_cameraFns = require("./cameraFns-CKUN90f_.cjs");
|
|
20
20
|
// src/2d/lib/stitching.ts
|
|
21
21
|
/**
|
|
22
22
|
* Group a flat list of curves into connected chains by matching endpoints.
|
|
@@ -232,7 +232,10 @@ var BrepErrorCode = {
|
|
|
232
232
|
CHAMFER_ANGLE_FAILED: "CHAMFER_ANGLE_FAILED",
|
|
233
233
|
CSG_NOT_3D: "CSG_NOT_3D",
|
|
234
234
|
SHELL_NOT_3D: "SHELL_NOT_3D",
|
|
235
|
+
SHELL_NO_EFFECT: "SHELL_NO_EFFECT",
|
|
236
|
+
SHELL_INVALID_RESULT: "SHELL_INVALID_RESULT",
|
|
235
237
|
OFFSET_NOT_3D: "OFFSET_NOT_3D",
|
|
238
|
+
OFFSET_INVALID_RESULT: "OFFSET_INVALID_RESULT",
|
|
236
239
|
NULL_SHAPE: "NULL_SHAPE",
|
|
237
240
|
NO_WRAPPER: "NO_WRAPPER",
|
|
238
241
|
WELD_NOT_SHELL: "WELD_NOT_SHELL",
|
|
@@ -232,7 +232,10 @@ var BrepErrorCode = {
|
|
|
232
232
|
CHAMFER_ANGLE_FAILED: "CHAMFER_ANGLE_FAILED",
|
|
233
233
|
CSG_NOT_3D: "CSG_NOT_3D",
|
|
234
234
|
SHELL_NOT_3D: "SHELL_NOT_3D",
|
|
235
|
+
SHELL_NO_EFFECT: "SHELL_NO_EFFECT",
|
|
236
|
+
SHELL_INVALID_RESULT: "SHELL_INVALID_RESULT",
|
|
235
237
|
OFFSET_NOT_3D: "OFFSET_NOT_3D",
|
|
238
|
+
OFFSET_INVALID_RESULT: "OFFSET_INVALID_RESULT",
|
|
236
239
|
NULL_SHAPE: "NULL_SHAPE",
|
|
237
240
|
NO_WRAPPER: "NO_WRAPPER",
|
|
238
241
|
WELD_NOT_SHELL: "WELD_NOT_SHELL",
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { i as castShape, q as getKernel } from "./shapeTypes-
|
|
2
|
-
import { E as ok, P as unwrap, g as err, l as typeCastError } from "./errors-
|
|
3
|
-
import { a as getCachedSurfaceType } from "./topologyQueryFns-
|
|
1
|
+
import { i as castShape, q as getKernel } from "./shapeTypes-CgbUTASh.js";
|
|
2
|
+
import { E as ok, P as unwrap, g as err, l as typeCastError } from "./errors-vxP5FT8B.js";
|
|
3
|
+
import { a as getCachedSurfaceType } from "./topologyQueryFns-6M_dbT1R.js";
|
|
4
4
|
import { r as toVec3 } from "./types-CKXsIm9-.js";
|
|
5
5
|
// src/topology/cast.ts
|
|
6
6
|
var TOPO_ENUM = {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
const require_shapeTypes = require("./shapeTypes-
|
|
2
|
-
const require_errors = require("./errors-
|
|
3
|
-
const require_topologyQueryFns = require("./topologyQueryFns-
|
|
1
|
+
const require_shapeTypes = require("./shapeTypes-D_anqiRe.cjs");
|
|
2
|
+
const require_errors = require("./errors-GVyCnpi0.cjs");
|
|
3
|
+
const require_topologyQueryFns = require("./topologyQueryFns-ENxs8uu2.cjs");
|
|
4
4
|
const require_types = require("./types-CjF9Rofr.cjs");
|
|
5
5
|
// src/topology/cast.ts
|
|
6
6
|
var TOPO_ENUM = {
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
const require_shapeTypes = require("./shapeTypes-
|
|
2
|
-
const require_errors = require("./errors-
|
|
3
|
-
const require_topologyQueryFns = require("./topologyQueryFns-
|
|
1
|
+
const require_shapeTypes = require("./shapeTypes-D_anqiRe.cjs");
|
|
2
|
+
const require_errors = require("./errors-GVyCnpi0.cjs");
|
|
3
|
+
const require_topologyQueryFns = require("./topologyQueryFns-ENxs8uu2.cjs");
|
|
4
4
|
const require_constants = require("./constants-oee0S_x6.cjs");
|
|
5
|
-
const require_faceFns = require("./faceFns-
|
|
6
|
-
const require_solidBuilders = require("./solidBuilders-
|
|
5
|
+
const require_faceFns = require("./faceFns-DSRREV5G.cjs");
|
|
6
|
+
const require_solidBuilders = require("./solidBuilders-CUd-korS.cjs");
|
|
7
7
|
const require_arrayAccess = require("./arrayAccess-DpJYARwv.cjs");
|
|
8
8
|
// src/topology/threeHelpers.ts
|
|
9
9
|
/**
|
|
@@ -106,6 +106,99 @@ function toLODGeometryLevels(lods, options) {
|
|
|
106
106
|
distance: distances?.[idx] ?? (last - idx) * step
|
|
107
107
|
}));
|
|
108
108
|
}
|
|
109
|
+
// src/topology/thickResultCheck.ts
|
|
110
|
+
var UNCHANGED_VOLUME_REL_TOL = 1e-7;
|
|
111
|
+
var WALL_DISTANCE_REL_TOL = .001;
|
|
112
|
+
function facesByHash(shape) {
|
|
113
|
+
const kernel = require_shapeTypes.getKernel();
|
|
114
|
+
const byHash = /* @__PURE__ */ new Map();
|
|
115
|
+
for (const face of require_topologyQueryFns.getFaces(shape)) byHash.set(kernel.hashCode(face.wrapped, require_constants.HASH_CODE_MAX), face);
|
|
116
|
+
return byHash;
|
|
117
|
+
}
|
|
118
|
+
function volumeFailure(distance, input, result) {
|
|
119
|
+
if (Math.abs(result.volume - input.volume) <= UNCHANGED_VOLUME_REL_TOL * Math.abs(input.volume) && result.faceCount === input.faceCount) return "unchanged";
|
|
120
|
+
if (result.volume <= 0) return "volume";
|
|
121
|
+
return result.volume > input.volume === distance > 0 ? void 0 : "volume";
|
|
122
|
+
}
|
|
123
|
+
/** Distance from the middle of a generated wall's surface to its source face. */
|
|
124
|
+
function wallGap(source, generated) {
|
|
125
|
+
const kernel = require_shapeTypes.getKernel();
|
|
126
|
+
const uv = kernel.uvBounds(generated.wrapped);
|
|
127
|
+
const p = kernel.pointOnSurface(generated.wrapped, (uv.uMin + uv.uMax) / 2, (uv.vMin + uv.vMax) / 2);
|
|
128
|
+
const q = kernel.projectPointOnFace(source.wrapped, p);
|
|
129
|
+
return Math.hypot(p[0] - q[0], p[1] - q[1], p[2] - q[2]);
|
|
130
|
+
}
|
|
131
|
+
function worstWallDeviation(input, result, evolution, spec) {
|
|
132
|
+
if (evolution.generated.size === 0) return 0;
|
|
133
|
+
const sources = facesByHash(input);
|
|
134
|
+
const produced = facesByHash(result);
|
|
135
|
+
const wall = Math.abs(spec.distance);
|
|
136
|
+
let worst = 0;
|
|
137
|
+
for (const [sourceHash, generatedHashes] of evolution.generated) {
|
|
138
|
+
if (spec.openedFaceHashes?.has(sourceHash)) continue;
|
|
139
|
+
const source = sources.get(sourceHash);
|
|
140
|
+
if (!source) continue;
|
|
141
|
+
for (const hash of generatedHashes) {
|
|
142
|
+
const face = produced.get(hash);
|
|
143
|
+
if (!face) continue;
|
|
144
|
+
worst = Math.max(worst, Math.abs(wallGap(source, face) - wall));
|
|
145
|
+
}
|
|
146
|
+
}
|
|
147
|
+
return worst;
|
|
148
|
+
}
|
|
149
|
+
function failure(spec, reason, metadata) {
|
|
150
|
+
const wall = Math.abs(spec.distance);
|
|
151
|
+
const isShell = spec.operation === "shell";
|
|
152
|
+
if (isShell && reason === "unchanged") {
|
|
153
|
+
const code = require_errors.BrepErrorCode.SHELL_NO_EFFECT;
|
|
154
|
+
return require_errors.err(require_errors.kernelError(code, `Shell left the solid unchanged: a ${wall} wall is too thick for this body`, void 0, {
|
|
155
|
+
operation: "shell",
|
|
156
|
+
reason,
|
|
157
|
+
thickness: wall,
|
|
158
|
+
...metadata
|
|
159
|
+
}, require_topologyQueryFns.getSuggestionForCode(code)));
|
|
160
|
+
}
|
|
161
|
+
const code = isShell ? require_errors.BrepErrorCode.SHELL_INVALID_RESULT : require_errors.BrepErrorCode.OFFSET_INVALID_RESULT;
|
|
162
|
+
const what = isShell ? `a ${wall} wall` : `an offset of ${spec.distance}`;
|
|
163
|
+
return require_errors.err(require_errors.kernelError(code, `${spec.operation} gave no usable solid (${reason}): ${what} is too large for this body`, void 0, {
|
|
164
|
+
operation: spec.operation,
|
|
165
|
+
reason,
|
|
166
|
+
distance: spec.distance,
|
|
167
|
+
...metadata
|
|
168
|
+
}, require_topologyQueryFns.getSuggestionForCode(code)));
|
|
169
|
+
}
|
|
170
|
+
/**
|
|
171
|
+
* Verify a shell/offset result against its input. The wall-distance check
|
|
172
|
+
* needs `evolution` built from every input face hash and a kernel with native
|
|
173
|
+
* history; pass `undefined` to skip it.
|
|
174
|
+
*/
|
|
175
|
+
function checkThickResult(input, result, evolution, spec) {
|
|
176
|
+
const kernel = require_shapeTypes.getKernel();
|
|
177
|
+
if (kernel.isNull(result.wrapped)) return failure(spec, "empty", {});
|
|
178
|
+
const inputVolume = kernel.volume(input.wrapped);
|
|
179
|
+
const resultVolume = kernel.volume(result.wrapped);
|
|
180
|
+
const byVolume = volumeFailure(spec.distance, {
|
|
181
|
+
volume: inputVolume,
|
|
182
|
+
faceCount: require_topologyQueryFns.getFaces(input).length
|
|
183
|
+
}, {
|
|
184
|
+
volume: resultVolume,
|
|
185
|
+
faceCount: require_topologyQueryFns.getFaces(result).length
|
|
186
|
+
});
|
|
187
|
+
if (byVolume) return failure(spec, byVolume, {
|
|
188
|
+
inputVolume,
|
|
189
|
+
resultVolume
|
|
190
|
+
});
|
|
191
|
+
if (!kernel.isValid(result.wrapped)) return failure(spec, "invalid", {});
|
|
192
|
+
if (evolution && require_shapeTypes.getKernelCapabilities().nativeHistory === true) {
|
|
193
|
+
const deviation = worstWallDeviation(input, result, evolution, spec);
|
|
194
|
+
const allowed = Math.max(10 * spec.tolerance, WALL_DISTANCE_REL_TOL * Math.abs(spec.distance));
|
|
195
|
+
if (deviation > allowed) return failure(spec, "wall-distance", {
|
|
196
|
+
deviation,
|
|
197
|
+
allowed
|
|
198
|
+
});
|
|
199
|
+
}
|
|
200
|
+
return require_errors.ok(void 0);
|
|
201
|
+
}
|
|
109
202
|
// src/topology/modifierFns.ts
|
|
110
203
|
/**
|
|
111
204
|
* Functional modifier operations — fillet, chamfer, shell, thicken, offset, draft.
|
|
@@ -324,6 +417,22 @@ function chamfer(shape, edges, distance) {
|
|
|
324
417
|
}));
|
|
325
418
|
}
|
|
326
419
|
}
|
|
420
|
+
function acceptThickResult(input, cast, evolution, spec, propagateMetadata = true) {
|
|
421
|
+
let checked;
|
|
422
|
+
try {
|
|
423
|
+
if (require_shapeTypes.isShape3D(cast) || require_shapeTypes.getKernel().isNull(cast.wrapped)) checked = checkThickResult(input, cast, evolution, spec);
|
|
424
|
+
else checked = require_errors.err(spec.operation === "shell" ? require_errors.kernelError("SHELL_RESULT_NOT_3D", "Shell result is not a 3D shape") : require_errors.kernelError("OFFSET_RESULT_NOT_3D", "Offset result is not a 3D shape"));
|
|
425
|
+
} catch (e) {
|
|
426
|
+
require_shapeTypes.disposeResultShape(cast);
|
|
427
|
+
throw e;
|
|
428
|
+
}
|
|
429
|
+
if (require_errors.isErr(checked)) {
|
|
430
|
+
require_shapeTypes.disposeResultShape(cast);
|
|
431
|
+
return checked;
|
|
432
|
+
}
|
|
433
|
+
if (evolution && propagateMetadata) require_solidBuilders.propagateAllMetadata(evolution, [input], cast);
|
|
434
|
+
return require_errors.ok(cast);
|
|
435
|
+
}
|
|
327
436
|
/**
|
|
328
437
|
* Create a hollow shell by removing faces and offsetting remaining walls.
|
|
329
438
|
*
|
|
@@ -331,31 +440,29 @@ function chamfer(shape, edges, distance) {
|
|
|
331
440
|
* @param faces - Faces to remove.
|
|
332
441
|
* @param thickness - Wall thickness.
|
|
333
442
|
* @param tolerance - Shell operation tolerance (default 1e-3).
|
|
443
|
+
* @returns Err `SHELL_NO_EFFECT` when the wall is too thick and the kernel
|
|
444
|
+
* hands back the input, `SHELL_INVALID_RESULT` when the result is not a
|
|
445
|
+
* usable hollow body.
|
|
334
446
|
*/
|
|
335
447
|
function shell(shape, faces, thickness, tolerance = .001, { trackEvolution = true } = {}) {
|
|
336
448
|
const check = validateNotNull$1(shape, "shell: shape");
|
|
337
449
|
if (require_errors.isErr(check)) return check;
|
|
338
450
|
if (thickness <= 0) return require_errors.err(require_errors.validationError("INVALID_THICKNESS", "Shell thickness must be positive"));
|
|
339
451
|
if (faces.length === 0) return require_errors.err(require_errors.validationError("NO_FACES", "At least one face must be specified for shell"));
|
|
452
|
+
const kernel = require_shapeTypes.getKernel();
|
|
453
|
+
const spec = {
|
|
454
|
+
operation: "shell",
|
|
455
|
+
distance: -thickness,
|
|
456
|
+
tolerance,
|
|
457
|
+
openedFaceHashes: new Set(faces.map((f) => kernel.hashCode(f.wrapped, require_constants.HASH_CODE_MAX)))
|
|
458
|
+
};
|
|
340
459
|
try {
|
|
341
|
-
if (!trackEvolution) {
|
|
342
|
-
const resultShape =
|
|
343
|
-
|
|
344
|
-
if (!require_shapeTypes.isShape3D(cast)) {
|
|
345
|
-
require_shapeTypes.disposeResultShape(cast);
|
|
346
|
-
return require_errors.err(require_errors.kernelError("SHELL_RESULT_NOT_3D", "Shell result is not a 3D shape"));
|
|
347
|
-
}
|
|
348
|
-
return require_errors.ok(cast);
|
|
349
|
-
}
|
|
350
|
-
const inputFaceHashes = require_solidBuilders.collectInputFaceHashes([shape]);
|
|
351
|
-
const { shape: resultShape, evolution } = require_shapeTypes.getKernel().shellWithHistory(shape.wrapped, faces.map((f) => f.wrapped), thickness, inputFaceHashes, require_constants.HASH_CODE_MAX, tolerance);
|
|
352
|
-
const cast = require_shapeTypes.castResultShape(resultShape);
|
|
353
|
-
if (!require_shapeTypes.isShape3D(cast)) {
|
|
354
|
-
require_shapeTypes.disposeResultShape(cast);
|
|
355
|
-
return require_errors.err(require_errors.kernelError("SHELL_RESULT_NOT_3D", "Shell result is not a 3D shape"));
|
|
460
|
+
if (!trackEvolution && require_shapeTypes.getKernelCapabilities().nativeHistory !== true) {
|
|
461
|
+
const resultShape = kernel.shell(shape.wrapped, faces.map((f) => f.wrapped), thickness, tolerance);
|
|
462
|
+
return acceptThickResult(shape, require_shapeTypes.castResultShape(resultShape), void 0, spec);
|
|
356
463
|
}
|
|
357
|
-
|
|
358
|
-
return
|
|
464
|
+
const { shape: resultShape, evolution } = kernel.shellWithHistory(shape.wrapped, faces.map((f) => f.wrapped), thickness, require_topologyQueryFns.subShapeHashes(shape, "face"), require_constants.HASH_CODE_MAX, tolerance);
|
|
465
|
+
return acceptThickResult(shape, require_shapeTypes.castResultShape(resultShape), evolution, spec, trackEvolution);
|
|
359
466
|
} catch (e) {
|
|
360
467
|
const raw = e instanceof Error ? e.message : String(e);
|
|
361
468
|
return require_errors.err(require_errors.kernelError("SHELL_FAILED", `Shell operation failed: ${raw}`, e, {
|
|
@@ -371,21 +478,20 @@ function shell(shape, faces, thickness, tolerance = .001, { trackEvolution = tru
|
|
|
371
478
|
* @param shape - The shape to offset (must be a 3D shape with faces).
|
|
372
479
|
* @param distance - Offset distance (positive = outward, negative = inward).
|
|
373
480
|
* @param tolerance - Offset tolerance (default 1e-6).
|
|
481
|
+
* @returns Err `OFFSET_INVALID_RESULT` when the offset consumes the body or
|
|
482
|
+
* gives no usable solid.
|
|
374
483
|
*/
|
|
375
484
|
function offset(shape, distance, tolerance = 1e-6) {
|
|
376
485
|
const check = validateNotNull$1(shape, "offset: shape");
|
|
377
486
|
if (require_errors.isErr(check)) return check;
|
|
378
487
|
if (Math.abs(distance) < 1e-10) return require_errors.err(require_errors.validationError("ZERO_OFFSET", "Offset distance cannot be zero"));
|
|
379
488
|
try {
|
|
380
|
-
const
|
|
381
|
-
|
|
382
|
-
|
|
383
|
-
|
|
384
|
-
|
|
385
|
-
|
|
386
|
-
}
|
|
387
|
-
require_solidBuilders.propagateAllMetadata(evolution, [shape], cast);
|
|
388
|
-
return require_errors.ok(cast);
|
|
489
|
+
const { shape: resultShape, evolution } = require_shapeTypes.getKernel().offsetWithHistory(shape.wrapped, distance, require_topologyQueryFns.subShapeHashes(shape, "face"), require_constants.HASH_CODE_MAX, tolerance);
|
|
490
|
+
return acceptThickResult(shape, require_shapeTypes.castResultShape(resultShape), evolution, {
|
|
491
|
+
operation: "offset",
|
|
492
|
+
distance,
|
|
493
|
+
tolerance
|
|
494
|
+
});
|
|
389
495
|
} catch (e) {
|
|
390
496
|
const raw = e instanceof Error ? e.message : String(e);
|
|
391
497
|
return require_errors.err(require_errors.kernelError("OFFSET_FAILED", `Offset operation failed: ${raw}`, e));
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { C as isSolid, D as getShapeKind, T as isWire, h as disposeResultShape, i as castShape, m as disposeDowncastSource, n as castResultShape, q as getKernel, x as isShape3D, y as isFace } from "./shapeTypes-
|
|
2
|
-
import { E as ok, b as isErr, d as validationError, g as err, i as kernelError, l as typeCastError, t as BrepErrorCode, x as isOk } from "./errors-
|
|
3
|
-
import { c as getFaces, i as getCachedIsValid, m as invalidateShapeCache, p as getWires, s as getEdges } from "./topologyQueryFns-
|
|
1
|
+
import { C as isSolid, D as getShapeKind, T as isWire, Y as getKernelCapabilities, h as disposeResultShape, i as castShape, m as disposeDowncastSource, n as castResultShape, q as getKernel, x as isShape3D, y as isFace } from "./shapeTypes-CgbUTASh.js";
|
|
2
|
+
import { E as ok, b as isErr, d as validationError, g as err, i as kernelError, l as typeCastError, t as BrepErrorCode, x as isOk } from "./errors-vxP5FT8B.js";
|
|
3
|
+
import { C as subShapeHashes, O as getSuggestionForCode, c as getFaces, i as getCachedIsValid, m as invalidateShapeCache, p as getWires, s as getEdges } from "./topologyQueryFns-6M_dbT1R.js";
|
|
4
4
|
import { n as HASH_CODE_MAX } from "./constants-iraOnb2p.js";
|
|
5
|
-
import { y as downcast } from "./faceFns-
|
|
6
|
-
import { C as propagateAllMetadata, f as cut, h as fuseAll, m as fuse, p as cutAll, x as collectInputFaceHashes } from "./solidBuilders-
|
|
5
|
+
import { y as downcast } from "./faceFns-BBk6XKJO.js";
|
|
6
|
+
import { C as propagateAllMetadata, f as cut, h as fuseAll, m as fuse, p as cutAll, x as collectInputFaceHashes } from "./solidBuilders-DE_na4G3.js";
|
|
7
7
|
import { t as firstOrThrow } from "./arrayAccess-BpgouNir.js";
|
|
8
8
|
// src/topology/threeHelpers.ts
|
|
9
9
|
/**
|
|
@@ -106,6 +106,99 @@ function toLODGeometryLevels(lods, options) {
|
|
|
106
106
|
distance: distances?.[idx] ?? (last - idx) * step
|
|
107
107
|
}));
|
|
108
108
|
}
|
|
109
|
+
// src/topology/thickResultCheck.ts
|
|
110
|
+
var UNCHANGED_VOLUME_REL_TOL = 1e-7;
|
|
111
|
+
var WALL_DISTANCE_REL_TOL = .001;
|
|
112
|
+
function facesByHash(shape) {
|
|
113
|
+
const kernel = getKernel();
|
|
114
|
+
const byHash = /* @__PURE__ */ new Map();
|
|
115
|
+
for (const face of getFaces(shape)) byHash.set(kernel.hashCode(face.wrapped, HASH_CODE_MAX), face);
|
|
116
|
+
return byHash;
|
|
117
|
+
}
|
|
118
|
+
function volumeFailure(distance, input, result) {
|
|
119
|
+
if (Math.abs(result.volume - input.volume) <= UNCHANGED_VOLUME_REL_TOL * Math.abs(input.volume) && result.faceCount === input.faceCount) return "unchanged";
|
|
120
|
+
if (result.volume <= 0) return "volume";
|
|
121
|
+
return result.volume > input.volume === distance > 0 ? void 0 : "volume";
|
|
122
|
+
}
|
|
123
|
+
/** Distance from the middle of a generated wall's surface to its source face. */
|
|
124
|
+
function wallGap(source, generated) {
|
|
125
|
+
const kernel = getKernel();
|
|
126
|
+
const uv = kernel.uvBounds(generated.wrapped);
|
|
127
|
+
const p = kernel.pointOnSurface(generated.wrapped, (uv.uMin + uv.uMax) / 2, (uv.vMin + uv.vMax) / 2);
|
|
128
|
+
const q = kernel.projectPointOnFace(source.wrapped, p);
|
|
129
|
+
return Math.hypot(p[0] - q[0], p[1] - q[1], p[2] - q[2]);
|
|
130
|
+
}
|
|
131
|
+
function worstWallDeviation(input, result, evolution, spec) {
|
|
132
|
+
if (evolution.generated.size === 0) return 0;
|
|
133
|
+
const sources = facesByHash(input);
|
|
134
|
+
const produced = facesByHash(result);
|
|
135
|
+
const wall = Math.abs(spec.distance);
|
|
136
|
+
let worst = 0;
|
|
137
|
+
for (const [sourceHash, generatedHashes] of evolution.generated) {
|
|
138
|
+
if (spec.openedFaceHashes?.has(sourceHash)) continue;
|
|
139
|
+
const source = sources.get(sourceHash);
|
|
140
|
+
if (!source) continue;
|
|
141
|
+
for (const hash of generatedHashes) {
|
|
142
|
+
const face = produced.get(hash);
|
|
143
|
+
if (!face) continue;
|
|
144
|
+
worst = Math.max(worst, Math.abs(wallGap(source, face) - wall));
|
|
145
|
+
}
|
|
146
|
+
}
|
|
147
|
+
return worst;
|
|
148
|
+
}
|
|
149
|
+
function failure(spec, reason, metadata) {
|
|
150
|
+
const wall = Math.abs(spec.distance);
|
|
151
|
+
const isShell = spec.operation === "shell";
|
|
152
|
+
if (isShell && reason === "unchanged") {
|
|
153
|
+
const code = BrepErrorCode.SHELL_NO_EFFECT;
|
|
154
|
+
return err(kernelError(code, `Shell left the solid unchanged: a ${wall} wall is too thick for this body`, void 0, {
|
|
155
|
+
operation: "shell",
|
|
156
|
+
reason,
|
|
157
|
+
thickness: wall,
|
|
158
|
+
...metadata
|
|
159
|
+
}, getSuggestionForCode(code)));
|
|
160
|
+
}
|
|
161
|
+
const code = isShell ? BrepErrorCode.SHELL_INVALID_RESULT : BrepErrorCode.OFFSET_INVALID_RESULT;
|
|
162
|
+
const what = isShell ? `a ${wall} wall` : `an offset of ${spec.distance}`;
|
|
163
|
+
return err(kernelError(code, `${spec.operation} gave no usable solid (${reason}): ${what} is too large for this body`, void 0, {
|
|
164
|
+
operation: spec.operation,
|
|
165
|
+
reason,
|
|
166
|
+
distance: spec.distance,
|
|
167
|
+
...metadata
|
|
168
|
+
}, getSuggestionForCode(code)));
|
|
169
|
+
}
|
|
170
|
+
/**
|
|
171
|
+
* Verify a shell/offset result against its input. The wall-distance check
|
|
172
|
+
* needs `evolution` built from every input face hash and a kernel with native
|
|
173
|
+
* history; pass `undefined` to skip it.
|
|
174
|
+
*/
|
|
175
|
+
function checkThickResult(input, result, evolution, spec) {
|
|
176
|
+
const kernel = getKernel();
|
|
177
|
+
if (kernel.isNull(result.wrapped)) return failure(spec, "empty", {});
|
|
178
|
+
const inputVolume = kernel.volume(input.wrapped);
|
|
179
|
+
const resultVolume = kernel.volume(result.wrapped);
|
|
180
|
+
const byVolume = volumeFailure(spec.distance, {
|
|
181
|
+
volume: inputVolume,
|
|
182
|
+
faceCount: getFaces(input).length
|
|
183
|
+
}, {
|
|
184
|
+
volume: resultVolume,
|
|
185
|
+
faceCount: getFaces(result).length
|
|
186
|
+
});
|
|
187
|
+
if (byVolume) return failure(spec, byVolume, {
|
|
188
|
+
inputVolume,
|
|
189
|
+
resultVolume
|
|
190
|
+
});
|
|
191
|
+
if (!kernel.isValid(result.wrapped)) return failure(spec, "invalid", {});
|
|
192
|
+
if (evolution && getKernelCapabilities().nativeHistory === true) {
|
|
193
|
+
const deviation = worstWallDeviation(input, result, evolution, spec);
|
|
194
|
+
const allowed = Math.max(10 * spec.tolerance, WALL_DISTANCE_REL_TOL * Math.abs(spec.distance));
|
|
195
|
+
if (deviation > allowed) return failure(spec, "wall-distance", {
|
|
196
|
+
deviation,
|
|
197
|
+
allowed
|
|
198
|
+
});
|
|
199
|
+
}
|
|
200
|
+
return ok(void 0);
|
|
201
|
+
}
|
|
109
202
|
// src/topology/modifierFns.ts
|
|
110
203
|
/**
|
|
111
204
|
* Functional modifier operations — fillet, chamfer, shell, thicken, offset, draft.
|
|
@@ -324,6 +417,22 @@ function chamfer(shape, edges, distance) {
|
|
|
324
417
|
}));
|
|
325
418
|
}
|
|
326
419
|
}
|
|
420
|
+
function acceptThickResult(input, cast, evolution, spec, propagateMetadata = true) {
|
|
421
|
+
let checked;
|
|
422
|
+
try {
|
|
423
|
+
if (isShape3D(cast) || getKernel().isNull(cast.wrapped)) checked = checkThickResult(input, cast, evolution, spec);
|
|
424
|
+
else checked = err(spec.operation === "shell" ? kernelError("SHELL_RESULT_NOT_3D", "Shell result is not a 3D shape") : kernelError("OFFSET_RESULT_NOT_3D", "Offset result is not a 3D shape"));
|
|
425
|
+
} catch (e) {
|
|
426
|
+
disposeResultShape(cast);
|
|
427
|
+
throw e;
|
|
428
|
+
}
|
|
429
|
+
if (isErr(checked)) {
|
|
430
|
+
disposeResultShape(cast);
|
|
431
|
+
return checked;
|
|
432
|
+
}
|
|
433
|
+
if (evolution && propagateMetadata) propagateAllMetadata(evolution, [input], cast);
|
|
434
|
+
return ok(cast);
|
|
435
|
+
}
|
|
327
436
|
/**
|
|
328
437
|
* Create a hollow shell by removing faces and offsetting remaining walls.
|
|
329
438
|
*
|
|
@@ -331,31 +440,29 @@ function chamfer(shape, edges, distance) {
|
|
|
331
440
|
* @param faces - Faces to remove.
|
|
332
441
|
* @param thickness - Wall thickness.
|
|
333
442
|
* @param tolerance - Shell operation tolerance (default 1e-3).
|
|
443
|
+
* @returns Err `SHELL_NO_EFFECT` when the wall is too thick and the kernel
|
|
444
|
+
* hands back the input, `SHELL_INVALID_RESULT` when the result is not a
|
|
445
|
+
* usable hollow body.
|
|
334
446
|
*/
|
|
335
447
|
function shell(shape, faces, thickness, tolerance = .001, { trackEvolution = true } = {}) {
|
|
336
448
|
const check = validateNotNull$1(shape, "shell: shape");
|
|
337
449
|
if (isErr(check)) return check;
|
|
338
450
|
if (thickness <= 0) return err(validationError("INVALID_THICKNESS", "Shell thickness must be positive"));
|
|
339
451
|
if (faces.length === 0) return err(validationError("NO_FACES", "At least one face must be specified for shell"));
|
|
452
|
+
const kernel = getKernel();
|
|
453
|
+
const spec = {
|
|
454
|
+
operation: "shell",
|
|
455
|
+
distance: -thickness,
|
|
456
|
+
tolerance,
|
|
457
|
+
openedFaceHashes: new Set(faces.map((f) => kernel.hashCode(f.wrapped, HASH_CODE_MAX)))
|
|
458
|
+
};
|
|
340
459
|
try {
|
|
341
|
-
if (!trackEvolution) {
|
|
342
|
-
const resultShape =
|
|
343
|
-
|
|
344
|
-
if (!isShape3D(cast)) {
|
|
345
|
-
disposeResultShape(cast);
|
|
346
|
-
return err(kernelError("SHELL_RESULT_NOT_3D", "Shell result is not a 3D shape"));
|
|
347
|
-
}
|
|
348
|
-
return ok(cast);
|
|
460
|
+
if (!trackEvolution && getKernelCapabilities().nativeHistory !== true) {
|
|
461
|
+
const resultShape = kernel.shell(shape.wrapped, faces.map((f) => f.wrapped), thickness, tolerance);
|
|
462
|
+
return acceptThickResult(shape, castResultShape(resultShape), void 0, spec);
|
|
349
463
|
}
|
|
350
|
-
const
|
|
351
|
-
|
|
352
|
-
const cast = castResultShape(resultShape);
|
|
353
|
-
if (!isShape3D(cast)) {
|
|
354
|
-
disposeResultShape(cast);
|
|
355
|
-
return err(kernelError("SHELL_RESULT_NOT_3D", "Shell result is not a 3D shape"));
|
|
356
|
-
}
|
|
357
|
-
propagateAllMetadata(evolution, [shape], cast);
|
|
358
|
-
return ok(cast);
|
|
464
|
+
const { shape: resultShape, evolution } = kernel.shellWithHistory(shape.wrapped, faces.map((f) => f.wrapped), thickness, subShapeHashes(shape, "face"), HASH_CODE_MAX, tolerance);
|
|
465
|
+
return acceptThickResult(shape, castResultShape(resultShape), evolution, spec, trackEvolution);
|
|
359
466
|
} catch (e) {
|
|
360
467
|
const raw = e instanceof Error ? e.message : String(e);
|
|
361
468
|
return err(kernelError("SHELL_FAILED", `Shell operation failed: ${raw}`, e, {
|
|
@@ -371,21 +478,20 @@ function shell(shape, faces, thickness, tolerance = .001, { trackEvolution = tru
|
|
|
371
478
|
* @param shape - The shape to offset (must be a 3D shape with faces).
|
|
372
479
|
* @param distance - Offset distance (positive = outward, negative = inward).
|
|
373
480
|
* @param tolerance - Offset tolerance (default 1e-6).
|
|
481
|
+
* @returns Err `OFFSET_INVALID_RESULT` when the offset consumes the body or
|
|
482
|
+
* gives no usable solid.
|
|
374
483
|
*/
|
|
375
484
|
function offset(shape, distance, tolerance = 1e-6) {
|
|
376
485
|
const check = validateNotNull$1(shape, "offset: shape");
|
|
377
486
|
if (isErr(check)) return check;
|
|
378
487
|
if (Math.abs(distance) < 1e-10) return err(validationError("ZERO_OFFSET", "Offset distance cannot be zero"));
|
|
379
488
|
try {
|
|
380
|
-
const
|
|
381
|
-
|
|
382
|
-
|
|
383
|
-
|
|
384
|
-
|
|
385
|
-
|
|
386
|
-
}
|
|
387
|
-
propagateAllMetadata(evolution, [shape], cast);
|
|
388
|
-
return ok(cast);
|
|
489
|
+
const { shape: resultShape, evolution } = getKernel().offsetWithHistory(shape.wrapped, distance, subShapeHashes(shape, "face"), HASH_CODE_MAX, tolerance);
|
|
490
|
+
return acceptThickResult(shape, castResultShape(resultShape), evolution, {
|
|
491
|
+
operation: "offset",
|
|
492
|
+
distance,
|
|
493
|
+
tolerance
|
|
494
|
+
});
|
|
389
495
|
} catch (e) {
|
|
390
496
|
const raw = e instanceof Error ? e.message : String(e);
|
|
391
497
|
return err(kernelError("OFFSET_FAILED", `Offset operation failed: ${raw}`, e));
|
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
const require_shapeTypes = require("./shapeTypes-
|
|
2
|
-
const require_errors = require("./errors-
|
|
3
|
-
const require_topologyQueryFns = require("./topologyQueryFns-
|
|
1
|
+
const require_shapeTypes = require("./shapeTypes-D_anqiRe.cjs");
|
|
2
|
+
const require_errors = require("./errors-GVyCnpi0.cjs");
|
|
3
|
+
const require_topologyQueryFns = require("./topologyQueryFns-ENxs8uu2.cjs");
|
|
4
4
|
const require_constants = require("./constants-oee0S_x6.cjs");
|
|
5
5
|
const require_vecOps = require("./vecOps-CrGEPPQM.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-DSRREV5G.cjs");
|
|
7
|
+
const require_shapeFns = require("./shapeFns-B54CsPyk.cjs");
|
|
8
|
+
const require_curveFns = require("./curveFns-U7srQ3ZA.cjs");
|
|
9
|
+
const require_measureFns = require("./measureFns-BvNkzSR6.cjs");
|
|
10
10
|
// 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 { q as getKernel, y as isFace } from "./shapeTypes-
|
|
2
|
-
import { E as ok, g as err, o as queryError, x as isOk } from "./errors-
|
|
3
|
-
import { c as getFaces, f as getVertices, p as getWires, s as getEdges } from "./topologyQueryFns-
|
|
1
|
+
import { q as getKernel, y as isFace } from "./shapeTypes-CgbUTASh.js";
|
|
2
|
+
import { E as ok, g as err, o as queryError, x as isOk } from "./errors-vxP5FT8B.js";
|
|
3
|
+
import { c as getFaces, f as getVertices, p as getWires, s as getEdges } from "./topologyQueryFns-6M_dbT1R.js";
|
|
4
4
|
import { t as DEG2RAD } from "./constants-iraOnb2p.js";
|
|
5
5
|
import { a as vecDot, d as vecNormalize } from "./vecOps-S-m9H_fe.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-BBk6XKJO.js";
|
|
7
|
+
import { a as isSameShape, n as getHashCode } from "./shapeFns-DB3l3ULC.js";
|
|
8
|
+
import { f as getCurveType, i as curveIsClosed, o as curveLength } from "./curveFns-CkA2WJP2.js";
|
|
9
|
+
import { n as measureArea } from "./measureFns-PRM3gOjw.js";
|
|
10
10
|
// 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
|
-
const require_shapeTypes = require("./shapeTypes-
|
|
1
|
+
const require_shapeTypes = require("./shapeTypes-D_anqiRe.cjs");
|
|
2
2
|
const require_bug = require("./bug-CBcpIPuf.cjs");
|
|
3
|
-
const require_errors = require("./errors-
|
|
3
|
+
const require_errors = require("./errors-GVyCnpi0.cjs");
|
|
4
4
|
const require_arrayAccess = require("./arrayAccess-DpJYARwv.cjs");
|
|
5
|
-
const require_blueprint = require("./blueprint-
|
|
5
|
+
const require_blueprint = require("./blueprint-wq2TU1XP.cjs");
|
|
6
6
|
// 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
|
-
import { n as castResultShape, q as getKernel } from "./shapeTypes-
|
|
1
|
+
import { n as castResultShape, q as getKernel } from "./shapeTypes-CgbUTASh.js";
|
|
2
2
|
import { i as wasmIndex, r as vec3At$1 } from "./bug-ClMTAJhe.js";
|
|
3
|
-
import { E as ok, g as err, r as ioError, t as BrepErrorCode } from "./errors-
|
|
3
|
+
import { E as ok, g as err, r as ioError, t as BrepErrorCode } from "./errors-vxP5FT8B.js";
|
|
4
4
|
import { n as getAtOrThrow } from "./arrayAccess-BpgouNir.js";
|
|
5
|
-
import { c as make2dBezierCurve, h as make2dThreePointArc, p as make2dSegmentCurve, t as Blueprint } from "./blueprint-
|
|
5
|
+
import { c as make2dBezierCurve, h as make2dThreePointArc, p as make2dSegmentCurve, t as Blueprint } from "./blueprint-Bth4EVaO.js";
|
|
6
6
|
// 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-W7ZTKqiJ.cjs");
|
|
3
|
+
const require_importFns = require("./importFns-ClqPJCFR.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-CgbT3uuO.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-DSUfSQn2.js";
|
|
3
3
|
export { blueprintToDXF, exportDXF, exportGlb, exportGltf, exportIGES, exportOBJ, exportSTEP, exportSTEPConfigured, exportSTL, exportThreeMF, importIGES, importSTEP, importSTL, importSVG, importSVGPathD };
|
|
@@ -24,9 +24,17 @@ export interface KernelCapabilities {
|
|
|
24
24
|
readonly exactMeasurement: boolean;
|
|
25
25
|
/** How tessellation resolution is controlled — see module docs. */
|
|
26
26
|
readonly tessellationModel: TessellationModel;
|
|
27
|
+
/**
|
|
28
|
+
* `*WithHistory` maps come from the kernel's own operation history, so a
|
|
29
|
+
* face listed as generated from a source face is that face's offset, sweep,
|
|
30
|
+
* or fillet. Kernels that rebuild the maps by geometric matching leave it unset.
|
|
31
|
+
*/
|
|
32
|
+
readonly nativeHistory?: boolean | undefined;
|
|
27
33
|
}
|
|
28
34
|
/** Default for an exact B-rep kernel (OCCT family, brepkit). */
|
|
29
35
|
export declare const EXACT_BREP_CAPABILITIES: KernelCapabilities;
|
|
36
|
+
/** OCCT-family kernels: exact B-rep with OCCT's own shape history. */
|
|
37
|
+
export declare const OCCT_CAPABILITIES: KernelCapabilities;
|
|
30
38
|
/**
|
|
31
39
|
* Conservative fallback for a kernel that doesn't declare capabilities: assume
|
|
32
40
|
* exact B-rep so export/measurement aren't wrongly blocked, but claim no
|
|
@@ -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-BSQeA69d.cjs");
|
|
3
3
|
exports.OcctWasmAdapter = require_occtWasmAdapter.OcctWasmAdapter;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export { t as OcctWasmAdapter } from "../../occtWasmAdapter-
|
|
1
|
+
export { t as OcctWasmAdapter } from "../../occtWasmAdapter-PzZJHUAd.js";
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { G as _usingCtx, T as isWire, h as disposeResultShape, n as castResultShape, q as getKernel, x as isShape3D } from "./shapeTypes-
|
|
2
|
-
import { E as ok, b as isErr, d as validationError, g as err, i as kernelError, l as typeCastError, t as BrepErrorCode } from "./errors-
|
|
1
|
+
import { G as _usingCtx, T as isWire, h as disposeResultShape, n as castResultShape, q as getKernel, x as isShape3D } from "./shapeTypes-CgbUTASh.js";
|
|
2
|
+
import { E as ok, b as isErr, d as validationError, g as err, i as kernelError, l as typeCastError, t as BrepErrorCode } from "./errors-vxP5FT8B.js";
|
|
3
3
|
import { r as toVec3 } from "./types-CKXsIm9-.js";
|
|
4
4
|
import { c as vecLength, t as vecAdd } from "./vecOps-S-m9H_fe.js";
|
|
5
5
|
// src/operations/extrudeUtils.ts
|