brepjs 18.118.13 → 18.118.15
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 +4 -4
- package/dist/2d.js +4 -4
- package/dist/{blueprint-DF-Ig1SW.cjs → blueprint-CN536u9V.cjs} +8 -3
- package/dist/{blueprint-CJ7k25eW.js → blueprint-dqI319c7.js} +8 -3
- package/dist/{blueprintFns-CjvHOuIy.cjs → blueprintFns-CF-6WzuR.cjs} +2 -2
- package/dist/{blueprintFns-BKtVfo16.js → blueprintFns-Ci1QVESM.js} +2 -2
- package/dist/{blueprintSketcher-DRGumaWR.cjs → blueprintSketcher-CGnohIOe.cjs} +1 -1
- package/dist/{blueprintSketcher-BIUHqWo9.js → blueprintSketcher-CY9DgQqk.js} +1 -1
- package/dist/{boolean2D-Buf04D7l.js → boolean2D-CaAwVwCR.js} +2 -2
- package/dist/{boolean2D-5WdQm5Kb.cjs → boolean2D-DnBT9gQ5.cjs} +2 -2
- package/dist/brepjs.cjs +105 -64
- package/dist/brepjs.js +105 -64
- package/dist/{cameraFns-CiGOarQ4.cjs → cameraFns-Ckw5prda.cjs} +28 -12
- package/dist/{cameraFns-MViqtlSh.js → cameraFns-CythF7Ob.js} +30 -14
- package/dist/{drawFns-CWfBvGiY.js → drawFns-ChMP3Ysr.js} +15 -9
- package/dist/{drawFns-DZHPT-nb.cjs → drawFns-DkgFZ0pe.cjs} +15 -9
- package/dist/{importFns-Tgnymh7F.cjs → importFns-CvlUuJ59.cjs} +1 -1
- package/dist/{importFns-CzBtuX0j.js → importFns-TbwuxynG.js} +1 -1
- package/dist/io.cjs +1 -1
- package/dist/io.js +1 -1
- package/dist/{loftFns-DxJAP4Qv.js → loftFns-DdTfJpXF.js} +68 -42
- package/dist/{loftFns-Be0OZxYM.cjs → loftFns-Dp5LpTWq.cjs} +67 -41
- package/dist/operations.cjs +2 -2
- package/dist/operations.js +2 -2
- package/dist/projection.cjs +1 -1
- package/dist/projection.js +1 -1
- package/dist/sketching/compoundSketch.d.ts +9 -1
- package/dist/sketching/sketches.d.ts +7 -1
- package/dist/sketching.cjs +3 -3
- package/dist/sketching.js +3 -3
- package/dist/text.cjs +2 -2
- package/dist/text.js +2 -2
- package/dist/{textBlueprints-CFPE5_QI.js → textBlueprints-DQ8gY3Z1.js} +19 -5
- package/dist/{textBlueprints-DgTBXc6O.cjs → textBlueprints-LhCdarzc.cjs} +19 -5
- package/dist/{textMetrics-BH-izd6N.cjs → textMetrics-DAx0Uue6.cjs} +1 -1
- package/dist/{textMetrics-C2cwK7wU.js → textMetrics-janJT7Ie.js} +1 -1
- package/dist/{threadFns-B6SQd48K.cjs → threadFns-BTFqC3XF.cjs} +1 -1
- package/dist/{threadFns-G71HVwW7.js → threadFns-D8l2-Gek.js} +1 -1
- package/package.json +1 -1
|
@@ -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-BalkiKtK.js";
|
|
1
|
+
import { b as isShape3D, et as _usingCtx, 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";
|
|
@@ -36,7 +36,9 @@ function buildLawFromProfile(extrusionLength, { profile, endFactor = 1 }) {
|
|
|
36
36
|
function makeSpineWire(start, end) {
|
|
37
37
|
const kernel = getKernel();
|
|
38
38
|
const edge = kernel.makeLineEdge([...start], [...end]);
|
|
39
|
-
|
|
39
|
+
const wire = kernel.makeWire([edge]);
|
|
40
|
+
kernel.dispose(edge);
|
|
41
|
+
return castResultShape(wire);
|
|
40
42
|
}
|
|
41
43
|
/** Build a helix wire for twist extrusion. */
|
|
42
44
|
function makeHelixWire(pitch, height, radius, center, dir, leftHanded = false) {
|
|
@@ -147,16 +149,24 @@ function supportExtrude(wire, center, normal, support) {
|
|
|
147
149
|
* @returns `Result` containing the extruded shape or a shell tuple.
|
|
148
150
|
*/
|
|
149
151
|
function complexExtrude(wire, center, normal, profileShape, shellMode = false) {
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
const
|
|
156
|
-
|
|
157
|
-
|
|
152
|
+
try {
|
|
153
|
+
var _usingCtx$1 = _usingCtx();
|
|
154
|
+
const extrusionLength = vecLength(normal);
|
|
155
|
+
if (extrusionLength < 1e-10) return err(validationError("ZERO_LENGTH_EXTRUSION", "Extrusion vector cannot have zero length"));
|
|
156
|
+
const endPoint = vecAdd(center, normal);
|
|
157
|
+
const spine = _usingCtx$1.u(makeSpineWire(center, endPoint));
|
|
158
|
+
let law = null;
|
|
159
|
+
if (profileShape) {
|
|
160
|
+
const lawResult = buildLawFromProfile(extrusionLength, profileShape);
|
|
161
|
+
if (isErr(lawResult)) return lawResult;
|
|
162
|
+
law = lawResult.value;
|
|
163
|
+
}
|
|
164
|
+
return sweep(wire, spine, { law }, shellMode);
|
|
165
|
+
} catch (_) {
|
|
166
|
+
_usingCtx$1.e = _;
|
|
167
|
+
} finally {
|
|
168
|
+
_usingCtx$1.d();
|
|
158
169
|
}
|
|
159
|
-
return sweep(wire, spine, { law }, shellMode);
|
|
160
170
|
}
|
|
161
171
|
/**
|
|
162
172
|
* Extrude a wire along a normal with helical twist and optional profile scaling.
|
|
@@ -174,22 +184,31 @@ function complexExtrude(wire, center, normal, profileShape, shellMode = false) {
|
|
|
174
184
|
* @returns `Result` containing the twisted extruded shape or a shell tuple.
|
|
175
185
|
*/
|
|
176
186
|
function twistExtrude(wire, angleDegrees, center, normal, profileShape, shellMode = false) {
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
const
|
|
186
|
-
|
|
187
|
-
law =
|
|
187
|
+
try {
|
|
188
|
+
var _usingCtx3 = _usingCtx();
|
|
189
|
+
if (Math.abs(angleDegrees) < 1e-10) return err(validationError("ZERO_TWIST_ANGLE", "Twist angle cannot be zero"));
|
|
190
|
+
const extrusionLength = vecLength(normal);
|
|
191
|
+
if (extrusionLength < 1e-10) return err(validationError("ZERO_LENGTH_EXTRUSION", "Extrusion vector cannot have zero length"));
|
|
192
|
+
const endPoint = vecAdd(center, normal);
|
|
193
|
+
const spine = _usingCtx3.u(makeSpineWire(center, endPoint));
|
|
194
|
+
const leftHanded = angleDegrees < 0;
|
|
195
|
+
const pitch = 360 / Math.abs(angleDegrees) * extrusionLength;
|
|
196
|
+
const auxiliarySpine = _usingCtx3.u(makeHelixWire(pitch, extrusionLength, 1, center, normal, leftHanded));
|
|
197
|
+
let law = null;
|
|
198
|
+
if (profileShape) {
|
|
199
|
+
const lawResult = buildLawFromProfile(extrusionLength, profileShape);
|
|
200
|
+
if (isErr(lawResult)) return lawResult;
|
|
201
|
+
law = lawResult.value;
|
|
202
|
+
}
|
|
203
|
+
return sweep(wire, spine, {
|
|
204
|
+
auxiliarySpine,
|
|
205
|
+
law
|
|
206
|
+
}, shellMode);
|
|
207
|
+
} catch (_) {
|
|
208
|
+
_usingCtx3.e = _;
|
|
209
|
+
} finally {
|
|
210
|
+
_usingCtx3.d();
|
|
188
211
|
}
|
|
189
|
-
return sweep(wire, spine, {
|
|
190
|
-
auxiliarySpine,
|
|
191
|
-
law
|
|
192
|
-
}, shellMode);
|
|
193
212
|
}
|
|
194
213
|
/** Validate that explicit section locations are in [0,1] and strictly increasing. */
|
|
195
214
|
function validateSectionLocations(sections) {
|
|
@@ -249,24 +268,31 @@ function multiSectionSweep(sections, spine, options) {
|
|
|
249
268
|
const paramsResult = computeSectionParams(sections, spine, kernel);
|
|
250
269
|
if (isErr(paramsResult)) return paramsResult;
|
|
251
270
|
const params = paramsResult.value;
|
|
271
|
+
const positioned = [];
|
|
252
272
|
const positionedWires = [];
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
273
|
+
try {
|
|
274
|
+
for (let i = 0; i < sections.length; i++) {
|
|
275
|
+
const param = params[i];
|
|
276
|
+
const section = sections[i];
|
|
277
|
+
if (param === void 0 || section === void 0) continue;
|
|
278
|
+
const p = kernel.positionOnCurve(section.wire.wrapped, spine.wrapped, param);
|
|
279
|
+
positioned.push(p);
|
|
280
|
+
positionedWires.push(kernel.downcast(p, "wire"));
|
|
281
|
+
}
|
|
282
|
+
const result = castResultShape(kernel.loftAdvanced(positionedWires, {
|
|
283
|
+
solid,
|
|
284
|
+
ruled,
|
|
285
|
+
tolerance
|
|
286
|
+
}));
|
|
287
|
+
if (!isShape3D(result)) {
|
|
288
|
+
disposeResultShape(result);
|
|
289
|
+
return err(typeCastError("MULTI_SWEEP_NOT_3D", "Multi-section sweep did not produce a 3D shape"));
|
|
290
|
+
}
|
|
291
|
+
return ok(result);
|
|
292
|
+
} finally {
|
|
293
|
+
for (const w of positionedWires) kernel.dispose(w);
|
|
294
|
+
for (const p of positioned) kernel.dispose(p);
|
|
268
295
|
}
|
|
269
|
-
return ok(result);
|
|
270
296
|
} catch (e) {
|
|
271
297
|
const raw = e instanceof Error ? e.message : String(e);
|
|
272
298
|
return err(kernelError(BrepErrorCode.MULTI_SWEEP_FAILED, `Multi-section sweep failed: ${raw}`, e, void 0, "Common causes: profile too large for path curvature, self-intersecting result, or discontinuous path. Try simplifying the profile or path."));
|
|
@@ -36,7 +36,9 @@ function buildLawFromProfile(extrusionLength, { profile, endFactor = 1 }) {
|
|
|
36
36
|
function makeSpineWire(start, end) {
|
|
37
37
|
const kernel = require_shapeTypes.getKernel();
|
|
38
38
|
const edge = kernel.makeLineEdge([...start], [...end]);
|
|
39
|
-
|
|
39
|
+
const wire = kernel.makeWire([edge]);
|
|
40
|
+
kernel.dispose(edge);
|
|
41
|
+
return require_shapeTypes.castResultShape(wire);
|
|
40
42
|
}
|
|
41
43
|
/** Build a helix wire for twist extrusion. */
|
|
42
44
|
function makeHelixWire(pitch, height, radius, center, dir, leftHanded = false) {
|
|
@@ -147,16 +149,24 @@ function supportExtrude(wire, center, normal, support) {
|
|
|
147
149
|
* @returns `Result` containing the extruded shape or a shell tuple.
|
|
148
150
|
*/
|
|
149
151
|
function complexExtrude(wire, center, normal, profileShape, shellMode = false) {
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
const
|
|
156
|
-
|
|
157
|
-
|
|
152
|
+
try {
|
|
153
|
+
var _usingCtx$1 = require_shapeTypes._usingCtx();
|
|
154
|
+
const extrusionLength = require_vecOps.vecLength(normal);
|
|
155
|
+
if (extrusionLength < 1e-10) return require_errors.err(require_errors.validationError("ZERO_LENGTH_EXTRUSION", "Extrusion vector cannot have zero length"));
|
|
156
|
+
const endPoint = require_vecOps.vecAdd(center, normal);
|
|
157
|
+
const spine = _usingCtx$1.u(makeSpineWire(center, endPoint));
|
|
158
|
+
let law = null;
|
|
159
|
+
if (profileShape) {
|
|
160
|
+
const lawResult = buildLawFromProfile(extrusionLength, profileShape);
|
|
161
|
+
if (require_errors.isErr(lawResult)) return lawResult;
|
|
162
|
+
law = lawResult.value;
|
|
163
|
+
}
|
|
164
|
+
return sweep(wire, spine, { law }, shellMode);
|
|
165
|
+
} catch (_) {
|
|
166
|
+
_usingCtx$1.e = _;
|
|
167
|
+
} finally {
|
|
168
|
+
_usingCtx$1.d();
|
|
158
169
|
}
|
|
159
|
-
return sweep(wire, spine, { law }, shellMode);
|
|
160
170
|
}
|
|
161
171
|
/**
|
|
162
172
|
* Extrude a wire along a normal with helical twist and optional profile scaling.
|
|
@@ -174,22 +184,31 @@ function complexExtrude(wire, center, normal, profileShape, shellMode = false) {
|
|
|
174
184
|
* @returns `Result` containing the twisted extruded shape or a shell tuple.
|
|
175
185
|
*/
|
|
176
186
|
function twistExtrude(wire, angleDegrees, center, normal, profileShape, shellMode = false) {
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
const
|
|
186
|
-
|
|
187
|
-
law =
|
|
187
|
+
try {
|
|
188
|
+
var _usingCtx3 = require_shapeTypes._usingCtx();
|
|
189
|
+
if (Math.abs(angleDegrees) < 1e-10) return require_errors.err(require_errors.validationError("ZERO_TWIST_ANGLE", "Twist angle cannot be zero"));
|
|
190
|
+
const extrusionLength = require_vecOps.vecLength(normal);
|
|
191
|
+
if (extrusionLength < 1e-10) return require_errors.err(require_errors.validationError("ZERO_LENGTH_EXTRUSION", "Extrusion vector cannot have zero length"));
|
|
192
|
+
const endPoint = require_vecOps.vecAdd(center, normal);
|
|
193
|
+
const spine = _usingCtx3.u(makeSpineWire(center, endPoint));
|
|
194
|
+
const leftHanded = angleDegrees < 0;
|
|
195
|
+
const pitch = 360 / Math.abs(angleDegrees) * extrusionLength;
|
|
196
|
+
const auxiliarySpine = _usingCtx3.u(makeHelixWire(pitch, extrusionLength, 1, center, normal, leftHanded));
|
|
197
|
+
let law = null;
|
|
198
|
+
if (profileShape) {
|
|
199
|
+
const lawResult = buildLawFromProfile(extrusionLength, profileShape);
|
|
200
|
+
if (require_errors.isErr(lawResult)) return lawResult;
|
|
201
|
+
law = lawResult.value;
|
|
202
|
+
}
|
|
203
|
+
return sweep(wire, spine, {
|
|
204
|
+
auxiliarySpine,
|
|
205
|
+
law
|
|
206
|
+
}, shellMode);
|
|
207
|
+
} catch (_) {
|
|
208
|
+
_usingCtx3.e = _;
|
|
209
|
+
} finally {
|
|
210
|
+
_usingCtx3.d();
|
|
188
211
|
}
|
|
189
|
-
return sweep(wire, spine, {
|
|
190
|
-
auxiliarySpine,
|
|
191
|
-
law
|
|
192
|
-
}, shellMode);
|
|
193
212
|
}
|
|
194
213
|
/** Validate that explicit section locations are in [0,1] and strictly increasing. */
|
|
195
214
|
function validateSectionLocations(sections) {
|
|
@@ -249,24 +268,31 @@ function multiSectionSweep(sections, spine, options) {
|
|
|
249
268
|
const paramsResult = computeSectionParams(sections, spine, kernel);
|
|
250
269
|
if (require_errors.isErr(paramsResult)) return paramsResult;
|
|
251
270
|
const params = paramsResult.value;
|
|
271
|
+
const positioned = [];
|
|
252
272
|
const positionedWires = [];
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
273
|
+
try {
|
|
274
|
+
for (let i = 0; i < sections.length; i++) {
|
|
275
|
+
const param = params[i];
|
|
276
|
+
const section = sections[i];
|
|
277
|
+
if (param === void 0 || section === void 0) continue;
|
|
278
|
+
const p = kernel.positionOnCurve(section.wire.wrapped, spine.wrapped, param);
|
|
279
|
+
positioned.push(p);
|
|
280
|
+
positionedWires.push(kernel.downcast(p, "wire"));
|
|
281
|
+
}
|
|
282
|
+
const result = require_shapeTypes.castResultShape(kernel.loftAdvanced(positionedWires, {
|
|
283
|
+
solid,
|
|
284
|
+
ruled,
|
|
285
|
+
tolerance
|
|
286
|
+
}));
|
|
287
|
+
if (!require_shapeTypes.isShape3D(result)) {
|
|
288
|
+
require_shapeTypes.disposeResultShape(result);
|
|
289
|
+
return require_errors.err(require_errors.typeCastError("MULTI_SWEEP_NOT_3D", "Multi-section sweep did not produce a 3D shape"));
|
|
290
|
+
}
|
|
291
|
+
return require_errors.ok(result);
|
|
292
|
+
} finally {
|
|
293
|
+
for (const w of positionedWires) kernel.dispose(w);
|
|
294
|
+
for (const p of positioned) kernel.dispose(p);
|
|
268
295
|
}
|
|
269
|
-
return require_errors.ok(result);
|
|
270
296
|
} catch (e) {
|
|
271
297
|
const raw = e instanceof Error ? e.message : String(e);
|
|
272
298
|
return require_errors.err(require_errors.kernelError(require_errors.BrepErrorCode.MULTI_SWEEP_FAILED, `Multi-section sweep failed: ${raw}`, e, void 0, "Common causes: profile too large for path curvature, self-intersecting result, or discontinuous path. Try simplifying the profile or path."));
|
package/dist/operations.cjs
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
2
|
-
const require_threadFns = require("./threadFns-
|
|
3
|
-
const require_loftFns = require("./loftFns-
|
|
2
|
+
const require_threadFns = require("./threadFns-BTFqC3XF.cjs");
|
|
3
|
+
const require_loftFns = require("./loftFns-Dp5LpTWq.cjs");
|
|
4
4
|
exports.addChild = require_threadFns.addChild;
|
|
5
5
|
exports.addJoint = require_threadFns.addJoint;
|
|
6
6
|
exports.addStep = require_threadFns.addStep;
|
package/dist/operations.js
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import { A as setJointValue, B as createAssemblyNode, C as cylindricalJoint, D as planarJoint, E as mechanismDOF, G as circularPattern, H as removeChild, J as exportAssemblySTEP, K as gridPattern, L as addChild, M as sphericalJoint, O as prismaticJoint, R as collectShapes, S as addJoint, T as jointTransform, U as updateNode, V as findNode, W as walkAssembly, Y as createAssembly, _ as exportURDF, b as inverseKinematics, c as modifyStep, d as replayFrom, f as replayHistory, g as undoLast, h as stepsFrom, i as createRegistry, j as setJointValues, k as revoluteJoint, l as registerOperation, m as stepCount, n as addStep, o as findStep, q as linearPattern, r as createHistory, s as getShape, t as thread, u as registerShape, v as importURDF, w as forwardKinematics, x as jointTrajectory, y as jointsFromDH, z as countNodes } from "./threadFns-
|
|
2
|
-
import { d as twistExtrude, l as supportExtrude, o as complexExtrude, u as sweep } from "./loftFns-
|
|
1
|
+
import { A as setJointValue, B as createAssemblyNode, C as cylindricalJoint, D as planarJoint, E as mechanismDOF, G as circularPattern, H as removeChild, J as exportAssemblySTEP, K as gridPattern, L as addChild, M as sphericalJoint, O as prismaticJoint, R as collectShapes, S as addJoint, T as jointTransform, U as updateNode, V as findNode, W as walkAssembly, Y as createAssembly, _ as exportURDF, b as inverseKinematics, c as modifyStep, d as replayFrom, f as replayHistory, g as undoLast, h as stepsFrom, i as createRegistry, j as setJointValues, k as revoluteJoint, l as registerOperation, m as stepCount, n as addStep, o as findStep, q as linearPattern, r as createHistory, s as getShape, t as thread, u as registerShape, v as importURDF, w as forwardKinematics, x as jointTrajectory, y as jointsFromDH, z as countNodes } from "./threadFns-D8l2-Gek.js";
|
|
2
|
+
import { d as twistExtrude, l as supportExtrude, o as complexExtrude, u as sweep } from "./loftFns-DdTfJpXF.js";
|
|
3
3
|
export { addChild, addJoint, addStep, circularPattern, collectShapes, complexExtrude, countNodes, createAssembly, createAssemblyNode, createHistory, createRegistry, cylindricalJoint, exportAssemblySTEP, exportURDF, findNode, findStep, forwardKinematics, getShape as getHistoryShape, gridPattern, importURDF, inverseKinematics, jointTrajectory, jointTransform, jointsFromDH, linearPattern, mechanismDOF, modifyStep, planarJoint, prismaticJoint, registerOperation, registerShape, removeChild, replayFrom, replayHistory, revoluteJoint, setJointValue, setJointValues, sphericalJoint, stepCount, stepsFrom, supportExtrude, sweep, thread, twistExtrude, undoLast, updateNode, walkAssembly };
|
package/dist/projection.cjs
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
2
|
-
const require_cameraFns = require("./cameraFns-
|
|
2
|
+
const require_cameraFns = require("./cameraFns-Ckw5prda.cjs");
|
|
3
3
|
exports.PROJECTION_PLANES = require_cameraFns.PROJECTION_PLANES;
|
|
4
4
|
exports.cameraFromPlane = require_cameraFns.cameraFromPlane;
|
|
5
5
|
exports.cameraLookAt = require_cameraFns.cameraLookAt;
|
package/dist/projection.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { a as makeProjectedEdges, i as projectEdges, n as cameraLookAt, o as PROJECTION_PLANES, r as createCamera, s as isProjectionPlane, t as cameraFromPlane } from "./cameraFns-
|
|
1
|
+
import { a as makeProjectedEdges, i as projectEdges, n as cameraLookAt, o as PROJECTION_PLANES, r as createCamera, s as isProjectionPlane, t as cameraFromPlane } from "./cameraFns-CythF7Ob.js";
|
|
2
2
|
export { PROJECTION_PLANES, cameraFromPlane, cameraLookAt, createCamera, isProjectionPlane, makeProjectedEdges, projectEdges };
|
|
@@ -26,7 +26,15 @@ export default class CompoundSketch implements SketchInterface {
|
|
|
26
26
|
get outerSketch(): Sketch;
|
|
27
27
|
/** Get the hole sketches (all but the first). */
|
|
28
28
|
get innerSketches(): Sketch[];
|
|
29
|
-
/**
|
|
29
|
+
/**
|
|
30
|
+
* All wires (outer + holes) combined into a compound shape.
|
|
31
|
+
*
|
|
32
|
+
* @remarks Allocates a **fresh** compound on every access (via `makeCompound`)
|
|
33
|
+
* — it is a caller-owned kernel resource, not a cheap accessor. Dispose the
|
|
34
|
+
* returned compound (`using`/`.delete()` → `Symbol.dispose`) or it leaks an
|
|
35
|
+
* arena slot on arena kernels. The sub-sketch wires themselves belong to this
|
|
36
|
+
* CompoundSketch and are freed with it.
|
|
37
|
+
*/
|
|
30
38
|
get wires(): import('../core/shapeTypes.js').Compound;
|
|
31
39
|
/** Build a face from the outer boundary with inner wires subtracted as holes. */
|
|
32
40
|
face(): Face;
|
|
@@ -33,7 +33,13 @@ export default class Sketches implements SketchInterface {
|
|
|
33
33
|
loftWith(otherSketches: SketchInterface | SketchInterface[], loftConfig?: LoftOptions, returnShell?: boolean): Shape3D;
|
|
34
34
|
/** Sweep a profile along the sole contained sketch's wire. */
|
|
35
35
|
sweepSketch(sketchOnPlane: (plane: Plane, origin: Vec3) => SketchInterface, sweepConfig?: SweepOptions): Shape3D;
|
|
36
|
-
/**
|
|
36
|
+
/**
|
|
37
|
+
* All contour wires combined into a single compound shape.
|
|
38
|
+
*
|
|
39
|
+
* @remarks Allocates a **fresh** compound on every call — the result is a
|
|
40
|
+
* caller-owned kernel resource. Dispose it (`using`/`Symbol.dispose`) or it
|
|
41
|
+
* leaks an arena slot on arena kernels.
|
|
42
|
+
*/
|
|
37
43
|
wires(): Compound;
|
|
38
44
|
/** Return all sketch faces combined into a single compound shape. */
|
|
39
45
|
faces(): Compound;
|
package/dist/sketching.cjs
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
2
|
-
const require_textBlueprints = require("./textBlueprints-
|
|
3
|
-
const require_blueprintSketcher = require("./blueprintSketcher-
|
|
4
|
-
const require_drawFns = require("./drawFns-
|
|
2
|
+
const require_textBlueprints = require("./textBlueprints-LhCdarzc.cjs");
|
|
3
|
+
const require_blueprintSketcher = require("./blueprintSketcher-CGnohIOe.cjs");
|
|
4
|
+
const require_drawFns = require("./drawFns-DkgFZ0pe.cjs");
|
|
5
5
|
//#region src/sketching.ts
|
|
6
6
|
/**
|
|
7
7
|
* brepjs/sketching — Sketcher, Drawing, and sketch-to-shape operations.
|
package/dist/sketching.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { n as BaseSketcher2d, t as BlueprintSketcher } from "./blueprintSketcher-
|
|
2
|
-
import { A as sketchEllipse, C as DrawingPen, D as makeBaseBox, E as deserializeDrawing, F as sketchRectangle, I as sketchRoundedRectangle, L as FaceSketcher, M as sketchHelix, N as sketchParametricFunction, O as polysideInnerRadius, P as sketchPolysides, R as Sketcher, S as drawText, T as Drawing, _ as drawPolysides, a as drawingIntersect, b as drawSingleCircle, c as rotateDrawing, d as drawFaceOutline, f as drawProjection, g as drawPointsInterpolation, h as drawParametricFunction, i as drawingFuse, j as sketchFaceOffset, k as sketchCircle, l as scaleDrawing, m as drawEllipse, n as drawingCut, o as drawingToSketchOnPlane, p as drawCircle, r as drawingFillet, s as mirrorDrawing, t as drawingChamfer, u as translateDrawing, v as drawRectangle, w as draw, x as drawSingleEllipse, y as drawRoundedRectangle } from "./drawFns-
|
|
3
|
-
import { a as Sketch, c as compoundSketchLoft, d as sketchFace, f as sketchLoft, h as sketchWires, i as Sketches, l as compoundSketchRevolve, m as sketchSweep, o as compoundSketchExtrude, p as sketchRevolve, s as compoundSketchFace, u as sketchExtrude, v as CompoundSketch } from "./textBlueprints-
|
|
1
|
+
import { n as BaseSketcher2d, t as BlueprintSketcher } from "./blueprintSketcher-CY9DgQqk.js";
|
|
2
|
+
import { A as sketchEllipse, C as DrawingPen, D as makeBaseBox, E as deserializeDrawing, F as sketchRectangle, I as sketchRoundedRectangle, L as FaceSketcher, M as sketchHelix, N as sketchParametricFunction, O as polysideInnerRadius, P as sketchPolysides, R as Sketcher, S as drawText, T as Drawing, _ as drawPolysides, a as drawingIntersect, b as drawSingleCircle, c as rotateDrawing, d as drawFaceOutline, f as drawProjection, g as drawPointsInterpolation, h as drawParametricFunction, i as drawingFuse, j as sketchFaceOffset, k as sketchCircle, l as scaleDrawing, m as drawEllipse, n as drawingCut, o as drawingToSketchOnPlane, p as drawCircle, r as drawingFillet, s as mirrorDrawing, t as drawingChamfer, u as translateDrawing, v as drawRectangle, w as draw, x as drawSingleEllipse, y as drawRoundedRectangle } from "./drawFns-ChMP3Ysr.js";
|
|
3
|
+
import { a as Sketch, c as compoundSketchLoft, d as sketchFace, f as sketchLoft, h as sketchWires, i as Sketches, l as compoundSketchRevolve, m as sketchSweep, o as compoundSketchExtrude, p as sketchRevolve, s as compoundSketchFace, u as sketchExtrude, v as CompoundSketch } from "./textBlueprints-DQ8gY3Z1.js";
|
|
4
4
|
//#region src/sketching.ts
|
|
5
5
|
/**
|
|
6
6
|
* brepjs/sketching — Sketcher, Drawing, and sketch-to-shape operations.
|
package/dist/text.cjs
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
2
|
-
const require_textBlueprints = require("./textBlueprints-
|
|
3
|
-
const require_textMetrics = require("./textMetrics-
|
|
2
|
+
const require_textBlueprints = require("./textBlueprints-LhCdarzc.cjs");
|
|
3
|
+
const require_textMetrics = require("./textMetrics-DAx0Uue6.cjs");
|
|
4
4
|
exports.fontMetrics = require_textMetrics.fontMetrics;
|
|
5
5
|
exports.getFont = require_textBlueprints.getFont;
|
|
6
6
|
exports.loadFont = require_textBlueprints.loadFont;
|
package/dist/text.js
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import { n as getFont, r as loadFont, t as textBlueprints } from "./textBlueprints-
|
|
2
|
-
import { n as textMetrics, r as sketchText, t as fontMetrics } from "./textMetrics-
|
|
1
|
+
import { n as getFont, r as loadFont, t as textBlueprints } from "./textBlueprints-DQ8gY3Z1.js";
|
|
2
|
+
import { n as textMetrics, r as sketchText, t as fontMetrics } from "./textMetrics-janJT7Ie.js";
|
|
3
3
|
export { fontMetrics, getFont, loadFont, sketchText, textBlueprints, textMetrics };
|
|
@@ -8,8 +8,8 @@ import { l as curveStartPoint, u as curveTangentAt } from "./curveFns-CH6gaGTf.j
|
|
|
8
8
|
import { n as getAtOrThrow, t as firstOrThrow } from "./arrayAccess-DrUGPADn.js";
|
|
9
9
|
import { i as makeNewFaceWithinFace, r as makeFace, t as addHolesInFace } from "./surfaceBuilders-HAF4Xtow.js";
|
|
10
10
|
import { o as makeSolid, p as cutAll, t as makeCompound } from "./solidBuilders-CgEPRock.js";
|
|
11
|
-
import { r as organiseBlueprints, t as BlueprintSketcher } from "./blueprintSketcher-
|
|
12
|
-
import { a as revolve, d as twistExtrude, o as complexExtrude, r as extrude, t as loft, u as sweep } from "./loftFns-
|
|
11
|
+
import { r as organiseBlueprints, t as BlueprintSketcher } from "./blueprintSketcher-CY9DgQqk.js";
|
|
12
|
+
import { a as revolve, d as twistExtrude, o as complexExtrude, r as extrude, t as loft, u as sweep } from "./loftFns-DdTfJpXF.js";
|
|
13
13
|
import opentype from "opentype.js";
|
|
14
14
|
//#region src/sketching/compoundSketch.ts
|
|
15
15
|
/**
|
|
@@ -46,7 +46,15 @@ var CompoundSketch = class CompoundSketch {
|
|
|
46
46
|
get innerSketches() {
|
|
47
47
|
return this.sketches.slice(1);
|
|
48
48
|
}
|
|
49
|
-
/**
|
|
49
|
+
/**
|
|
50
|
+
* All wires (outer + holes) combined into a compound shape.
|
|
51
|
+
*
|
|
52
|
+
* @remarks Allocates a **fresh** compound on every access (via `makeCompound`)
|
|
53
|
+
* — it is a caller-owned kernel resource, not a cheap accessor. Dispose the
|
|
54
|
+
* returned compound (`using`/`.delete()` → `Symbol.dispose`) or it leaks an
|
|
55
|
+
* arena slot on arena kernels. The sub-sketch wires themselves belong to this
|
|
56
|
+
* CompoundSketch and are freed with it.
|
|
57
|
+
*/
|
|
50
58
|
get wires() {
|
|
51
59
|
return compoundSketchWires(this);
|
|
52
60
|
}
|
|
@@ -463,9 +471,15 @@ var Sketches = class {
|
|
|
463
471
|
sweepSketch(sketchOnPlane, sweepConfig) {
|
|
464
472
|
return this.soleSketch("sweepSketch").sweepSketch(sketchOnPlane, sweepConfig);
|
|
465
473
|
}
|
|
466
|
-
/**
|
|
474
|
+
/**
|
|
475
|
+
* All contour wires combined into a single compound shape.
|
|
476
|
+
*
|
|
477
|
+
* @remarks Allocates a **fresh** compound on every call — the result is a
|
|
478
|
+
* caller-owned kernel resource. Dispose it (`using`/`Symbol.dispose`) or it
|
|
479
|
+
* leaks an arena slot on arena kernels.
|
|
480
|
+
*/
|
|
467
481
|
wires() {
|
|
468
|
-
return makeCompound(this.sketches.
|
|
482
|
+
return makeCompound(this.sketches.flatMap((s) => s instanceof Sketch ? [s.wire] : s.sketches.map((sub) => sub.wire)));
|
|
469
483
|
}
|
|
470
484
|
/** Return all sketch faces combined into a single compound shape. */
|
|
471
485
|
faces() {
|
|
@@ -39,8 +39,8 @@ const require_curveFns = require("./curveFns-C2zZ7Xuq.cjs");
|
|
|
39
39
|
const require_arrayAccess = require("./arrayAccess-e4H9cBfh.cjs");
|
|
40
40
|
const require_surfaceBuilders = require("./surfaceBuilders-DWHDogVL.cjs");
|
|
41
41
|
const require_solidBuilders = require("./solidBuilders-CHzmSo67.cjs");
|
|
42
|
-
const require_blueprintSketcher = require("./blueprintSketcher-
|
|
43
|
-
const require_loftFns = require("./loftFns-
|
|
42
|
+
const require_blueprintSketcher = require("./blueprintSketcher-CGnohIOe.cjs");
|
|
43
|
+
const require_loftFns = require("./loftFns-Dp5LpTWq.cjs");
|
|
44
44
|
let opentype_js = require("opentype.js");
|
|
45
45
|
opentype_js = __toESM(opentype_js, 1);
|
|
46
46
|
//#region src/sketching/compoundSketch.ts
|
|
@@ -78,7 +78,15 @@ var CompoundSketch = class CompoundSketch {
|
|
|
78
78
|
get innerSketches() {
|
|
79
79
|
return this.sketches.slice(1);
|
|
80
80
|
}
|
|
81
|
-
/**
|
|
81
|
+
/**
|
|
82
|
+
* All wires (outer + holes) combined into a compound shape.
|
|
83
|
+
*
|
|
84
|
+
* @remarks Allocates a **fresh** compound on every access (via `makeCompound`)
|
|
85
|
+
* — it is a caller-owned kernel resource, not a cheap accessor. Dispose the
|
|
86
|
+
* returned compound (`using`/`.delete()` → `Symbol.dispose`) or it leaks an
|
|
87
|
+
* arena slot on arena kernels. The sub-sketch wires themselves belong to this
|
|
88
|
+
* CompoundSketch and are freed with it.
|
|
89
|
+
*/
|
|
82
90
|
get wires() {
|
|
83
91
|
return compoundSketchWires(this);
|
|
84
92
|
}
|
|
@@ -495,9 +503,15 @@ var Sketches = class {
|
|
|
495
503
|
sweepSketch(sketchOnPlane, sweepConfig) {
|
|
496
504
|
return this.soleSketch("sweepSketch").sweepSketch(sketchOnPlane, sweepConfig);
|
|
497
505
|
}
|
|
498
|
-
/**
|
|
506
|
+
/**
|
|
507
|
+
* All contour wires combined into a single compound shape.
|
|
508
|
+
*
|
|
509
|
+
* @remarks Allocates a **fresh** compound on every call — the result is a
|
|
510
|
+
* caller-owned kernel resource. Dispose it (`using`/`Symbol.dispose`) or it
|
|
511
|
+
* leaks an arena slot on arena kernels.
|
|
512
|
+
*/
|
|
499
513
|
wires() {
|
|
500
|
-
return require_solidBuilders.makeCompound(this.sketches.
|
|
514
|
+
return require_solidBuilders.makeCompound(this.sketches.flatMap((s) => s instanceof Sketch ? [s.wire] : s.sketches.map((sub) => sub.wire)));
|
|
501
515
|
}
|
|
502
516
|
/** Return all sketch faces combined into a single compound shape. */
|
|
503
517
|
faces() {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { A as ok, b as err, d as validationError, t as BrepErrorCode } from "./errors-DNWJsfVU.js";
|
|
2
|
-
import { g as wrapSketchData, i as Sketches, n as getFont, t as textBlueprints, v as CompoundSketch } from "./textBlueprints-
|
|
2
|
+
import { g as wrapSketchData, i as Sketches, n as getFont, t as textBlueprints, v as CompoundSketch } from "./textBlueprints-DQ8gY3Z1.js";
|
|
3
3
|
//#region src/text/sketchText.ts
|
|
4
4
|
/**
|
|
5
5
|
* Render text as 3D sketch outlines on a plane.
|
|
@@ -4,7 +4,7 @@ const require_vecOps = require("./vecOps-CCnJt-yH.cjs");
|
|
|
4
4
|
const require_faceFns = require("./faceFns-BbmIuuFt.cjs");
|
|
5
5
|
const require_shapeFns = require("./shapeFns-m5OBBpM4.cjs");
|
|
6
6
|
const require_solidBuilders = require("./solidBuilders-CHzmSo67.cjs");
|
|
7
|
-
const require_loftFns = require("./loftFns-
|
|
7
|
+
const require_loftFns = require("./loftFns-Dp5LpTWq.cjs");
|
|
8
8
|
const require_refResolveFns = require("./refResolveFns-BLM5XlZR.cjs");
|
|
9
9
|
const require_primitiveFns = require("./primitiveFns-DZkzMLUq.cjs");
|
|
10
10
|
//#region src/utils/uuid.ts
|
|
@@ -4,7 +4,7 @@ import { d as vecNormalize, s as vecIsZero } from "./vecOps-SKPRvPH-.js";
|
|
|
4
4
|
import { b as fromBREP } from "./faceFns-ClvSac1T.js";
|
|
5
5
|
import { s as toBREP } from "./shapeFns-Gzaax25v.js";
|
|
6
6
|
import { h as fuseAll } from "./solidBuilders-CgEPRock.js";
|
|
7
|
-
import { t as loft } from "./loftFns-
|
|
7
|
+
import { t as loft } from "./loftFns-DdTfJpXF.js";
|
|
8
8
|
import { c as resolveRefParams } from "./refResolveFns-_niAxNu8.js";
|
|
9
9
|
import { E as wire, h as line } from "./primitiveFns-1otQpjcN.js";
|
|
10
10
|
//#region src/utils/uuid.ts
|