brepjs 7.4.2 → 8.0.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/README.md +179 -17
- package/dist/2d/blueprints/blueprintFns.d.ts +0 -22
- package/dist/2d/blueprints/blueprintFns.d.ts.map +1 -1
- package/dist/2d/blueprints/boolean2D.d.ts +3 -3
- package/dist/2d.cjs +2 -58
- package/dist/2d.d.ts +1 -2
- package/dist/2d.d.ts.map +1 -1
- package/dist/2d.js +7 -64
- package/dist/{Blueprint-3Dyu0OL6.cjs → Blueprint-CVctc41Z.cjs} +4 -4
- package/dist/{Blueprint-DSHD89bZ.js → Blueprint-D3JfGJTz.js} +4 -4
- package/dist/{boolean2D-BwOpOv6L.cjs → boolean2D-BdZATaHs.cjs} +9 -9
- package/dist/{boolean2D-CtyE2hK5.js → boolean2D-hOw5Qay5.js} +9 -9
- package/dist/{booleanFns-5KSbtLBU.cjs → booleanFns-BBSVKhL2.cjs} +27 -31
- package/dist/{booleanFns-DcxqLQSG.js → booleanFns-CqehfzcK.js} +27 -31
- package/dist/brepjs.cjs +95 -106
- package/dist/brepjs.js +129 -140
- package/dist/{cast-D1s7Im9E.js → cast-DQaUibmm.js} +3 -3
- package/dist/{cast-DsxJk_F0.cjs → cast-DkB0GKmQ.cjs} +2 -2
- package/dist/{drawFns-CSbH7uoI.js → drawFns-921SkhDL.js} +9 -9
- package/dist/{drawFns-C6KQjmQj.cjs → drawFns-CUyx50gi.cjs} +9 -9
- package/dist/{faceFns-B9if-FPW.cjs → faceFns-BwK7FP7N.cjs} +1 -1
- package/dist/{faceFns-Bl6HHbqO.js → faceFns-DHu-2JpA.js} +1 -1
- package/dist/index.d.ts +9 -11
- package/dist/index.d.ts.map +1 -1
- package/dist/io.cjs +2 -2
- package/dist/io.js +2 -2
- package/dist/{loft-Cc5E5pAf.cjs → loft-BzWFokmC.cjs} +2 -2
- package/dist/{loft-BlNndTOR.js → loft-CtG5nMq5.js} +2 -2
- package/dist/{measurement-D75pyJi1.js → measurement-C5JGCuUP.js} +1 -1
- package/dist/{measurement-BVdZ9cG3.cjs → measurement-fxm_pW7x.cjs} +1 -1
- package/dist/measurement.cjs +1 -1
- package/dist/measurement.js +1 -1
- package/dist/{meshFns-p_kv--PW.js → meshFns-AqAjTTVl.js} +11 -11
- package/dist/{meshFns-mVlogI3J.cjs → meshFns-BhrZGi6w.cjs} +11 -11
- package/dist/operations/api.d.ts +4 -6
- package/dist/operations/api.d.ts.map +1 -1
- package/dist/operations/exporterFns.d.ts +0 -2
- package/dist/operations/exporterFns.d.ts.map +1 -1
- package/dist/operations/extrude.d.ts +2 -4
- package/dist/operations/extrude.d.ts.map +1 -1
- package/dist/operations/extrudeFns.d.ts +4 -4
- package/dist/operations/extrudeFns.d.ts.map +1 -1
- package/dist/operations/extrudeUtils.d.ts +0 -2
- package/dist/operations/extrudeUtils.d.ts.map +1 -1
- package/dist/operations/loft.d.ts +1 -1
- package/dist/operations/loftFns.d.ts +2 -4
- package/dist/operations/loftFns.d.ts.map +1 -1
- package/dist/{operations-SRN-mfTx.cjs → operations-BP1wVDw0.cjs} +14 -20
- package/dist/{operations-CEV-gqkX.js → operations-C1rWoba2.js} +14 -20
- package/dist/operations.cjs +2 -2
- package/dist/operations.d.ts +3 -3
- package/dist/operations.d.ts.map +1 -1
- package/dist/operations.js +2 -2
- package/dist/{query-D7XclvBZ.js → query-V6nV-VfL.js} +4 -4
- package/dist/{query-DkcMfh6j.cjs → query-hMSmOWJP.cjs} +4 -4
- package/dist/query.cjs +1 -1
- package/dist/query.js +1 -1
- package/dist/{shapeFns-BpCPVHFT.js → shapeFns-BrF97sKt.js} +19 -19
- package/dist/{shapeFns-DjsWo98C.cjs → shapeFns-BvOndshS.cjs} +19 -19
- package/dist/{shapeHelpers-BBSVHPGk.cjs → shapeHelpers-B2SXz1p4.cjs} +2 -2
- package/dist/{shapeHelpers-C4QIp7u5.js → shapeHelpers-BcoZf2N9.js} +2 -2
- package/dist/sketching/sketcherlib.d.ts +2 -4
- package/dist/sketching/sketcherlib.d.ts.map +1 -1
- package/dist/sketching.cjs +2 -2
- package/dist/sketching.d.ts +2 -2
- package/dist/sketching.d.ts.map +1 -1
- package/dist/sketching.js +2 -2
- package/dist/topology/api.d.ts +11 -15
- package/dist/topology/api.d.ts.map +1 -1
- package/dist/topology/apiTypes.d.ts +0 -2
- package/dist/topology/apiTypes.d.ts.map +1 -1
- package/dist/topology/booleanFns.d.ts +9 -9
- package/dist/topology/booleanFns.d.ts.map +1 -1
- package/dist/topology/cast.d.ts +2 -2
- package/dist/topology/cast.d.ts.map +1 -1
- package/dist/topology/chamferAngleFns.d.ts +1 -1
- package/dist/topology/chamferAngleFns.d.ts.map +1 -1
- package/dist/topology/healingFns.d.ts +2 -2
- package/dist/topology/healingFns.d.ts.map +1 -1
- package/dist/topology/index.d.ts +2 -2
- package/dist/topology/index.d.ts.map +1 -1
- package/dist/topology/meshCache.d.ts +2 -4
- package/dist/topology/meshCache.d.ts.map +1 -1
- package/dist/topology/meshFns.d.ts +2 -2
- package/dist/topology/meshFns.d.ts.map +1 -1
- package/dist/topology/modifierFns.d.ts +5 -5
- package/dist/topology/modifierFns.d.ts.map +1 -1
- package/dist/topology/primitiveFns.d.ts +4 -8
- package/dist/topology/primitiveFns.d.ts.map +1 -1
- package/dist/topology/shapeFns.d.ts +9 -9
- package/dist/topology/shapeFns.d.ts.map +1 -1
- package/dist/topology/shapeModifiers.d.ts +0 -2
- package/dist/topology/shapeModifiers.d.ts.map +1 -1
- package/dist/topology/wrapperFns.d.ts +3 -3
- package/dist/topology/wrapperFns.d.ts.map +1 -1
- package/dist/{topology-Bb1W3SyF.cjs → topology-CIooytHH.cjs} +18 -18
- package/dist/{topology-BEMrS4WZ.js → topology-tFzqSrGH.js} +18 -18
- package/dist/topology.cjs +8 -8
- package/dist/topology.d.ts +1 -1
- package/dist/topology.d.ts.map +1 -1
- package/dist/topology.js +8 -8
- package/package.json +3 -3
- package/dist/2d/blueprints/boolean2dFns.d.ts +0 -46
- package/dist/2d/blueprints/boolean2dFns.d.ts.map +0 -1
- package/dist/core/geometry.d.ts +0 -26
- package/dist/core/geometry.d.ts.map +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"extrudeUtils.d.ts","sourceRoot":"","sources":["../../src/operations/extrudeUtils.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAGH,KAAK,MAAM,GAAG,GAAG,CAAC;AAIlB,OAAO,EAAE,KAAK,MAAM,EAAW,MAAM,mBAAmB,CAAC;AAOzD,6DAA6D;AAC7D,MAAM,WAAW,YAAY;IAC3B,mDAAmD;IACnD,MAAM,CAAC,EAAE,OAAO,CAAC;IACjB,wCAAwC;IACxC,cAAc,CAAC,EAAE;QAAE,OAAO,EAAE,MAAM,CAAA;KAAE,CAAC;IACrC,iCAAiC;IACjC,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,6EAA6E;IAC7E,cAAc,CAAC,EAAE,OAAO,GAAG,aAAa,GAAG,OAAO,CAAC;IACnD,+BAA+B;IAC/B,WAAW,CAAC,EAAE,OAAO,CAAC;IACtB,6CAA6C;IAC7C,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,8CAA8C;IAC9C,6BAA6B,CAAC,EAAE,OAAO,CAAC;CACzC;
|
|
1
|
+
{"version":3,"file":"extrudeUtils.d.ts","sourceRoot":"","sources":["../../src/operations/extrudeUtils.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAGH,KAAK,MAAM,GAAG,GAAG,CAAC;AAIlB,OAAO,EAAE,KAAK,MAAM,EAAW,MAAM,mBAAmB,CAAC;AAOzD,6DAA6D;AAC7D,MAAM,WAAW,YAAY;IAC3B,mDAAmD;IACnD,MAAM,CAAC,EAAE,OAAO,CAAC;IACjB,wCAAwC;IACxC,cAAc,CAAC,EAAE;QAAE,OAAO,EAAE,MAAM,CAAA;KAAE,CAAC;IACrC,iCAAiC;IACjC,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,6EAA6E;IAC7E,cAAc,CAAC,EAAE,OAAO,GAAG,aAAa,GAAG,OAAO,CAAC;IACnD,+BAA+B;IAC/B,WAAW,CAAC,EAAE,OAAO,CAAC;IACtB,6CAA6C;IAC7C,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,8CAA8C;IAC9C,6BAA6B,CAAC,EAAE,OAAO,CAAC;CACzC;AAMD,kEAAkE;AAClE,MAAM,WAAW,gBAAgB;IAC/B,qFAAqF;IACrF,OAAO,CAAC,EAAE,SAAS,GAAG,QAAQ,CAAC;IAC/B,+DAA+D;IAC/D,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAMD;;;;;;;;;;;GAWG;AACH,wBAAgB,mBAAmB,CACjC,eAAe,EAAE,MAAM,EACvB,EAAE,OAAO,EAAE,SAAa,EAAE,EAAE,gBAAgB,GAC3C,MAAM,CAAC,MAAM,CAAC,CAkBhB"}
|
|
@@ -27,7 +27,7 @@ export interface LoftOptions {
|
|
|
27
27
|
* const result = loft([bottomWire, topWire], { ruled: false });
|
|
28
28
|
* ```
|
|
29
29
|
*
|
|
30
|
-
* @see {@link loftFns!
|
|
30
|
+
* @see {@link loftFns!loft | loft} for the functional API equivalent.
|
|
31
31
|
*/
|
|
32
32
|
export declare const loft: (wires: Wire[], { ruled, startPoint, endPoint }?: LoftOptions, returnShell?: boolean) => Result<Shape3D>;
|
|
33
33
|
//# sourceMappingURL=loft.d.ts.map
|
|
@@ -10,8 +10,6 @@ export interface LoftOptions {
|
|
|
10
10
|
/** Optional end vertex after the last wire profile. */
|
|
11
11
|
endPoint?: PointInput;
|
|
12
12
|
}
|
|
13
|
-
/** @deprecated Use LoftOptions instead. Will be removed in v8.0.0. */
|
|
14
|
-
export type LoftConfig = LoftOptions;
|
|
15
13
|
/**
|
|
16
14
|
* Loft through a set of wire profiles to create a 3D shape.
|
|
17
15
|
*
|
|
@@ -26,10 +24,10 @@ export type LoftConfig = LoftOptions;
|
|
|
26
24
|
*
|
|
27
25
|
* @example
|
|
28
26
|
* ```ts
|
|
29
|
-
* const result =
|
|
27
|
+
* const result = loft([bottomWire, topWire], { ruled: false });
|
|
30
28
|
* ```
|
|
31
29
|
*
|
|
32
30
|
* @see {@link loft!loft | loft} for the OOP API equivalent.
|
|
33
31
|
*/
|
|
34
|
-
export declare function
|
|
32
|
+
export declare function loft(wires: Wire[], { ruled, startPoint, endPoint }?: LoftOptions, returnShell?: boolean): Result<Shape3D>;
|
|
35
33
|
//# sourceMappingURL=loftFns.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"loftFns.d.ts","sourceRoot":"","sources":["../../src/operations/loftFns.ts"],"names":[],"mappings":"AAAA;;GAEG;AAGH,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAC;AAGnD,OAAO,KAAK,EAAE,IAAI,EAAE,OAAO,EAAE,MAAM,uBAAuB,CAAC;AAG3D,OAAO,EAAE,KAAK,MAAM,EAAW,MAAM,mBAAmB,CAAC;AAGzD,uDAAuD;AACvD,MAAM,WAAW,WAAW;IAC1B,+EAA+E;IAC/E,KAAK,CAAC,EAAE,OAAO,CAAC;IAChB,2DAA2D;IAC3D,UAAU,CAAC,EAAE,UAAU,CAAC;IACxB,uDAAuD;IACvD,QAAQ,CAAC,EAAE,UAAU,CAAC;CACvB;AAED
|
|
1
|
+
{"version":3,"file":"loftFns.d.ts","sourceRoot":"","sources":["../../src/operations/loftFns.ts"],"names":[],"mappings":"AAAA;;GAEG;AAGH,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAC;AAGnD,OAAO,KAAK,EAAE,IAAI,EAAE,OAAO,EAAE,MAAM,uBAAuB,CAAC;AAG3D,OAAO,EAAE,KAAK,MAAM,EAAW,MAAM,mBAAmB,CAAC;AAGzD,uDAAuD;AACvD,MAAM,WAAW,WAAW;IAC1B,+EAA+E;IAC/E,KAAK,CAAC,EAAE,OAAO,CAAC;IAChB,2DAA2D;IAC3D,UAAU,CAAC,EAAE,UAAU,CAAC;IACxB,uDAAuD;IACvD,QAAQ,CAAC,EAAE,UAAU,CAAC;CACvB;AAED;;;;;;;;;;;;;;;;;;GAkBG;AACH,wBAAgB,IAAI,CAClB,KAAK,EAAE,IAAI,EAAE,EACb,EAAE,KAAY,EAAE,UAAU,EAAE,QAAQ,EAAE,GAAE,WAAgB,EACxD,WAAW,UAAQ,GAClB,MAAM,CAAC,OAAO,CAAC,CAoCjB"}
|
|
@@ -2,11 +2,11 @@
|
|
|
2
2
|
const occtBoundary = require("./occtBoundary-du8_ex-p.cjs");
|
|
3
3
|
const vecOps = require("./vecOps-CjRL1jau.cjs");
|
|
4
4
|
const shapeTypes = require("./shapeTypes-DKhwEnUM.cjs");
|
|
5
|
-
const cast = require("./cast-
|
|
5
|
+
const cast = require("./cast-DkB0GKmQ.cjs");
|
|
6
6
|
const errors = require("./errors-DK1VAdP4.cjs");
|
|
7
|
-
const loft = require("./loft-
|
|
8
|
-
const shapeFns = require("./shapeFns-
|
|
9
|
-
const booleanFns = require("./booleanFns-
|
|
7
|
+
const loft = require("./loft-BzWFokmC.cjs");
|
|
8
|
+
const shapeFns = require("./shapeFns-BvOndshS.cjs");
|
|
9
|
+
const booleanFns = require("./booleanFns-BBSVKhL2.cjs");
|
|
10
10
|
function uuidv() {
|
|
11
11
|
return (String([1e7]) + String(-1e3) + String(-4e3) + String(-8e3) + String(-1e11)).replace(
|
|
12
12
|
/[018]/g,
|
|
@@ -105,16 +105,12 @@ function makeHelixWire(pitch, height, radius, center, dir, lefthand = false) {
|
|
|
105
105
|
oc.BRepLib.BuildCurves3d_2(w);
|
|
106
106
|
return shapeTypes.castShape(w);
|
|
107
107
|
}
|
|
108
|
-
function
|
|
108
|
+
function extrude(face, extrusionVec) {
|
|
109
109
|
if (face.wrapped.IsNull()) {
|
|
110
|
-
return errors.err(
|
|
111
|
-
errors.validationError(errors.BrepErrorCode.NULL_SHAPE_INPUT, "extrudeFace: face is a null shape")
|
|
112
|
-
);
|
|
110
|
+
return errors.err(errors.validationError(errors.BrepErrorCode.NULL_SHAPE_INPUT, "extrude: face is a null shape"));
|
|
113
111
|
}
|
|
114
112
|
if (vecOps.vecLength(extrusionVec) === 0) {
|
|
115
|
-
return errors.err(
|
|
116
|
-
errors.validationError("EXTRUDE_ZERO_VECTOR", "extrudeFace: extrusion vector has zero length")
|
|
117
|
-
);
|
|
113
|
+
return errors.err(errors.validationError("EXTRUDE_ZERO_VECTOR", "extrude: extrusion vector has zero length"));
|
|
118
114
|
}
|
|
119
115
|
try {
|
|
120
116
|
const oc = occtBoundary.getKernel().oc;
|
|
@@ -131,17 +127,15 @@ function extrudeFace(face, extrusionVec) {
|
|
|
131
127
|
} catch (e) {
|
|
132
128
|
return errors.err(
|
|
133
129
|
errors.occtError("EXTRUDE_FAILED", "Extrusion operation failed", e, {
|
|
134
|
-
operation: "
|
|
130
|
+
operation: "extrude",
|
|
135
131
|
vectorLength: vecOps.vecLength(extrusionVec)
|
|
136
132
|
})
|
|
137
133
|
);
|
|
138
134
|
}
|
|
139
135
|
}
|
|
140
|
-
function
|
|
136
|
+
function revolve(face, center = [0, 0, 0], direction = [0, 0, 1], angle = 360) {
|
|
141
137
|
if (face.wrapped.IsNull()) {
|
|
142
|
-
return errors.err(
|
|
143
|
-
errors.validationError(errors.BrepErrorCode.NULL_SHAPE_INPUT, "revolveFace: face is a null shape")
|
|
144
|
-
);
|
|
138
|
+
return errors.err(errors.validationError(errors.BrepErrorCode.NULL_SHAPE_INPUT, "revolve: face is a null shape"));
|
|
145
139
|
}
|
|
146
140
|
const oc = occtBoundary.getKernel().oc;
|
|
147
141
|
const r = shapeTypes.gcWithScope();
|
|
@@ -296,7 +290,7 @@ function linearPattern(shape, direction, count, spacing, options) {
|
|
|
296
290
|
const copies = [shape];
|
|
297
291
|
for (let i = 1; i < count; i++) {
|
|
298
292
|
const offset = vecOps.vecScale(dir, spacing * i);
|
|
299
|
-
copies.push(shapeFns.
|
|
293
|
+
copies.push(shapeFns.translate(shape, offset));
|
|
300
294
|
}
|
|
301
295
|
return booleanFns.fuseAll(copies, options);
|
|
302
296
|
}
|
|
@@ -309,7 +303,7 @@ function circularPattern(shape, axis, count, fullAngle = 360, center = [0, 0, 0]
|
|
|
309
303
|
const angleStep = fullAngle / count;
|
|
310
304
|
const copies = [shape];
|
|
311
305
|
for (let i = 1; i < count; i++) {
|
|
312
|
-
copies.push(shapeFns.
|
|
306
|
+
copies.push(shapeFns.rotate(shape, angleStep * i, center, axis));
|
|
313
307
|
}
|
|
314
308
|
return booleanFns.fuseAll(copies, options);
|
|
315
309
|
}
|
|
@@ -552,7 +546,7 @@ exports.createAssemblyNode = createAssemblyNode;
|
|
|
552
546
|
exports.createHistory = createHistory;
|
|
553
547
|
exports.createRegistry = createRegistry;
|
|
554
548
|
exports.exportAssemblySTEP = exportAssemblySTEP;
|
|
555
|
-
exports.
|
|
549
|
+
exports.extrude = extrude;
|
|
556
550
|
exports.findNode = findNode;
|
|
557
551
|
exports.findStep = findStep;
|
|
558
552
|
exports.getShape = getShape;
|
|
@@ -563,7 +557,7 @@ exports.registerShape = registerShape;
|
|
|
563
557
|
exports.removeChild = removeChild;
|
|
564
558
|
exports.replayFrom = replayFrom;
|
|
565
559
|
exports.replayHistory = replayHistory;
|
|
566
|
-
exports.
|
|
560
|
+
exports.revolve = revolve;
|
|
567
561
|
exports.stepCount = stepCount;
|
|
568
562
|
exports.stepsFrom = stepsFrom;
|
|
569
563
|
exports.supportExtrude = supportExtrude;
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import { g as getKernel, b as toOcVec, d as toOcPnt, e as makeOcAx3, u as uniqueIOFilename } from "./occtBoundary-CwegMzqc.js";
|
|
2
2
|
import { g as vecLength, v as vecAdd, D as DEG2RAD, f as vecIsZero, j as vecNormalize, n as vecScale } from "./vecOps-ZDdZWbwT.js";
|
|
3
3
|
import { b as createOcHandle, c as castShape, h as isShape3D, m as isWire, n as gcWithScope, p as createSolid } from "./shapeTypes-BlSElW8z.js";
|
|
4
|
-
import { d as downcast } from "./cast-
|
|
4
|
+
import { d as downcast } from "./cast-DQaUibmm.js";
|
|
5
5
|
import { e as err, x as validationError, u as unwrap, p as typeCastError, l as ok, B as BrepErrorCode, d as isErr, o as occtError, i as ioError, b as computationError } from "./errors-wGhcJMpB.js";
|
|
6
|
-
import { a as buildLawFromProfile } from "./loft-
|
|
7
|
-
import { r as
|
|
8
|
-
import { g as fuseAll } from "./booleanFns-
|
|
6
|
+
import { a as buildLawFromProfile } from "./loft-CtG5nMq5.js";
|
|
7
|
+
import { r as rotate, t as translate } from "./shapeFns-BrF97sKt.js";
|
|
8
|
+
import { g as fuseAll } from "./booleanFns-CqehfzcK.js";
|
|
9
9
|
function uuidv() {
|
|
10
10
|
return (String([1e7]) + String(-1e3) + String(-4e3) + String(-8e3) + String(-1e11)).replace(
|
|
11
11
|
/[018]/g,
|
|
@@ -104,16 +104,12 @@ function makeHelixWire(pitch, height, radius, center, dir, lefthand = false) {
|
|
|
104
104
|
oc.BRepLib.BuildCurves3d_2(w);
|
|
105
105
|
return castShape(w);
|
|
106
106
|
}
|
|
107
|
-
function
|
|
107
|
+
function extrude(face, extrusionVec) {
|
|
108
108
|
if (face.wrapped.IsNull()) {
|
|
109
|
-
return err(
|
|
110
|
-
validationError(BrepErrorCode.NULL_SHAPE_INPUT, "extrudeFace: face is a null shape")
|
|
111
|
-
);
|
|
109
|
+
return err(validationError(BrepErrorCode.NULL_SHAPE_INPUT, "extrude: face is a null shape"));
|
|
112
110
|
}
|
|
113
111
|
if (vecLength(extrusionVec) === 0) {
|
|
114
|
-
return err(
|
|
115
|
-
validationError("EXTRUDE_ZERO_VECTOR", "extrudeFace: extrusion vector has zero length")
|
|
116
|
-
);
|
|
112
|
+
return err(validationError("EXTRUDE_ZERO_VECTOR", "extrude: extrusion vector has zero length"));
|
|
117
113
|
}
|
|
118
114
|
try {
|
|
119
115
|
const oc = getKernel().oc;
|
|
@@ -130,17 +126,15 @@ function extrudeFace(face, extrusionVec) {
|
|
|
130
126
|
} catch (e) {
|
|
131
127
|
return err(
|
|
132
128
|
occtError("EXTRUDE_FAILED", "Extrusion operation failed", e, {
|
|
133
|
-
operation: "
|
|
129
|
+
operation: "extrude",
|
|
134
130
|
vectorLength: vecLength(extrusionVec)
|
|
135
131
|
})
|
|
136
132
|
);
|
|
137
133
|
}
|
|
138
134
|
}
|
|
139
|
-
function
|
|
135
|
+
function revolve(face, center = [0, 0, 0], direction = [0, 0, 1], angle = 360) {
|
|
140
136
|
if (face.wrapped.IsNull()) {
|
|
141
|
-
return err(
|
|
142
|
-
validationError(BrepErrorCode.NULL_SHAPE_INPUT, "revolveFace: face is a null shape")
|
|
143
|
-
);
|
|
137
|
+
return err(validationError(BrepErrorCode.NULL_SHAPE_INPUT, "revolve: face is a null shape"));
|
|
144
138
|
}
|
|
145
139
|
const oc = getKernel().oc;
|
|
146
140
|
const r = gcWithScope();
|
|
@@ -295,7 +289,7 @@ function linearPattern(shape, direction, count, spacing, options) {
|
|
|
295
289
|
const copies = [shape];
|
|
296
290
|
for (let i = 1; i < count; i++) {
|
|
297
291
|
const offset = vecScale(dir, spacing * i);
|
|
298
|
-
copies.push(
|
|
292
|
+
copies.push(translate(shape, offset));
|
|
299
293
|
}
|
|
300
294
|
return fuseAll(copies, options);
|
|
301
295
|
}
|
|
@@ -308,7 +302,7 @@ function circularPattern(shape, axis, count, fullAngle = 360, center = [0, 0, 0]
|
|
|
308
302
|
const angleStep = fullAngle / count;
|
|
309
303
|
const copies = [shape];
|
|
310
304
|
for (let i = 1; i < count; i++) {
|
|
311
|
-
copies.push(
|
|
305
|
+
copies.push(rotate(shape, angleStep * i, center, axis));
|
|
312
306
|
}
|
|
313
307
|
return fuseAll(copies, options);
|
|
314
308
|
}
|
|
@@ -550,7 +544,7 @@ export {
|
|
|
550
544
|
addStep as b,
|
|
551
545
|
circularPattern as c,
|
|
552
546
|
collectShapes as d,
|
|
553
|
-
|
|
547
|
+
extrude as e,
|
|
554
548
|
complexExtrude as f,
|
|
555
549
|
countNodes as g,
|
|
556
550
|
createAssembly as h,
|
|
@@ -563,7 +557,7 @@ export {
|
|
|
563
557
|
findStep as o,
|
|
564
558
|
getShape as p,
|
|
565
559
|
modifyStep as q,
|
|
566
|
-
|
|
560
|
+
revolve as r,
|
|
567
561
|
sweep as s,
|
|
568
562
|
registerOperation as t,
|
|
569
563
|
registerShape as u,
|
package/dist/operations.cjs
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
3
|
-
const operations = require("./operations-
|
|
4
|
-
const loft = require("./loft-
|
|
3
|
+
const operations = require("./operations-BP1wVDw0.cjs");
|
|
4
|
+
const loft = require("./loft-BzWFokmC.cjs");
|
|
5
5
|
exports.addChild = operations.addChild;
|
|
6
6
|
exports.addStep = operations.addStep;
|
|
7
7
|
exports.circularPattern = operations.circularPattern;
|
package/dist/operations.d.ts
CHANGED
|
@@ -6,12 +6,12 @@
|
|
|
6
6
|
* import { sweep, linearPattern } from 'brepjs/operations';
|
|
7
7
|
* ```
|
|
8
8
|
*/
|
|
9
|
-
export { sweep, supportExtrude, complexExtrude, twistExtrude, type SweepOptions, type
|
|
9
|
+
export { sweep, supportExtrude, complexExtrude, twistExtrude, type SweepOptions, type ExtrusionProfile, } from './operations/extrudeFns.js';
|
|
10
10
|
export { linearPattern, circularPattern } from './operations/patternFns.js';
|
|
11
11
|
export { createAssemblyNode, addChild, removeChild, updateNode, findNode, walkAssembly, countNodes, collectShapes, type AssemblyNode, type AssemblyNodeOptions, } from './operations/assemblyFns.js';
|
|
12
|
-
export { exportAssemblySTEP, type ShapeOptions, type
|
|
12
|
+
export { exportAssemblySTEP, type ShapeOptions, type SupportedUnit, } from './operations/exporterFns.js';
|
|
13
13
|
export { createHistory, addStep, undoLast, findStep, getShape as getHistoryShape, stepCount, stepsFrom, registerShape, createRegistry, registerOperation, replayHistory, replayFrom, modifyStep, type OperationStep, type ModelHistory, type OperationFn, type OperationRegistry as HistoryOperationRegistry, } from './operations/historyFns.js';
|
|
14
|
-
export { basicFaceExtrusion, revolution, genericSweep, type GenericSweepOptions,
|
|
14
|
+
export { basicFaceExtrusion, revolution, genericSweep, type GenericSweepOptions, } from './operations/extrude.js';
|
|
15
15
|
export { loft } from './operations/loft.js';
|
|
16
16
|
export { type AssemblyExporter, createAssembly } from './operations/exporters.js';
|
|
17
17
|
//# sourceMappingURL=operations.d.ts.map
|
package/dist/operations.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"operations.d.ts","sourceRoot":"","sources":["../src/operations.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAIH,OAAO,EACL,KAAK,EACL,cAAc,EACd,cAAc,EACd,YAAY,EACZ,KAAK,YAAY,EACjB,KAAK,
|
|
1
|
+
{"version":3,"file":"operations.d.ts","sourceRoot":"","sources":["../src/operations.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAIH,OAAO,EACL,KAAK,EACL,cAAc,EACd,cAAc,EACd,YAAY,EACZ,KAAK,YAAY,EACjB,KAAK,gBAAgB,GACtB,MAAM,4BAA4B,CAAC;AAIpC,OAAO,EAAE,aAAa,EAAE,eAAe,EAAE,MAAM,4BAA4B,CAAC;AAI5E,OAAO,EACL,kBAAkB,EAClB,QAAQ,EACR,WAAW,EACX,UAAU,EACV,QAAQ,EACR,YAAY,EACZ,UAAU,EACV,aAAa,EACb,KAAK,YAAY,EACjB,KAAK,mBAAmB,GACzB,MAAM,6BAA6B,CAAC;AAErC,OAAO,EACL,kBAAkB,EAClB,KAAK,YAAY,EACjB,KAAK,aAAa,GACnB,MAAM,6BAA6B,CAAC;AAIrC,OAAO,EACL,aAAa,EACb,OAAO,EACP,QAAQ,EACR,QAAQ,EACR,QAAQ,IAAI,eAAe,EAC3B,SAAS,EACT,SAAS,EACT,aAAa,EACb,cAAc,EACd,iBAAiB,EACjB,aAAa,EACb,UAAU,EACV,UAAU,EACV,KAAK,aAAa,EAClB,KAAK,YAAY,EACjB,KAAK,WAAW,EAChB,KAAK,iBAAiB,IAAI,wBAAwB,GACnD,MAAM,4BAA4B,CAAC;AAIpC,OAAO,EACL,kBAAkB,EAClB,UAAU,EACV,YAAY,EACZ,KAAK,mBAAmB,GACzB,MAAM,yBAAyB,CAAC;AAEjC,OAAO,EAAE,IAAI,EAAE,MAAM,sBAAsB,CAAC;AAE5C,OAAO,EAAE,KAAK,gBAAgB,EAAE,cAAc,EAAE,MAAM,2BAA2B,CAAC"}
|
package/dist/operations.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { a, b, c, d, f, g, h, i, j, k, m, n, o, p, l, q, t, u, v, w, x, y, z, A, s, B, C, D, E } from "./operations-
|
|
2
|
-
import { b as b2, g as g2, l as l2, r } from "./loft-
|
|
1
|
+
import { a, b, c, d, f, g, h, i, j, k, m, n, o, p, l, q, t, u, v, w, x, y, z, A, s, B, C, D, E } from "./operations-C1rWoba2.js";
|
|
2
|
+
import { b as b2, g as g2, l as l2, r } from "./loft-CtG5nMq5.js";
|
|
3
3
|
export {
|
|
4
4
|
a as addChild,
|
|
5
5
|
b as addStep,
|
|
@@ -2,10 +2,10 @@ import { g as getKernel, d as toOcPnt } from "./occtBoundary-CwegMzqc.js";
|
|
|
2
2
|
import { c as castShape, n as gcWithScope, e as isFace } from "./shapeTypes-BlSElW8z.js";
|
|
3
3
|
import { j as vecNormalize, c as vecDistance, d as vecDot, D as DEG2RAD } from "./vecOps-ZDdZWbwT.js";
|
|
4
4
|
import { bug } from "./result.js";
|
|
5
|
-
import { i as iterTopo, d as downcast } from "./cast-
|
|
6
|
-
import { v as vertexPosition, k as getHashCode, n as isSameShape } from "./shapeFns-
|
|
7
|
-
import { g as getSurfaceType, n as normalAt } from "./faceFns-
|
|
8
|
-
import { m as measureArea } from "./measurement-
|
|
5
|
+
import { i as iterTopo, d as downcast } from "./cast-DQaUibmm.js";
|
|
6
|
+
import { v as vertexPosition, k as getHashCode, n as isSameShape } from "./shapeFns-BrF97sKt.js";
|
|
7
|
+
import { g as getSurfaceType, n as normalAt } from "./faceFns-DHu-2JpA.js";
|
|
8
|
+
import { m as measureArea } from "./measurement-C5JGCuUP.js";
|
|
9
9
|
import { l as getCurveType, f as curveLength, c as curveIsClosed } from "./curveFns-CdVE4da7.js";
|
|
10
10
|
import { e as err, q as queryError, l as ok, u as unwrap } from "./errors-wGhcJMpB.js";
|
|
11
11
|
const PRECISION_INTERSECTION = 1e-9;
|
|
@@ -3,10 +3,10 @@ const occtBoundary = require("./occtBoundary-du8_ex-p.cjs");
|
|
|
3
3
|
const shapeTypes = require("./shapeTypes-DKhwEnUM.cjs");
|
|
4
4
|
const vecOps = require("./vecOps-CjRL1jau.cjs");
|
|
5
5
|
const result = require("./result.cjs");
|
|
6
|
-
const cast = require("./cast-
|
|
7
|
-
const shapeFns = require("./shapeFns-
|
|
8
|
-
const faceFns = require("./faceFns-
|
|
9
|
-
const measurement = require("./measurement-
|
|
6
|
+
const cast = require("./cast-DkB0GKmQ.cjs");
|
|
7
|
+
const shapeFns = require("./shapeFns-BvOndshS.cjs");
|
|
8
|
+
const faceFns = require("./faceFns-BwK7FP7N.cjs");
|
|
9
|
+
const measurement = require("./measurement-fxm_pW7x.cjs");
|
|
10
10
|
const curveFns = require("./curveFns-BilyYL_s.cjs");
|
|
11
11
|
const errors = require("./errors-DK1VAdP4.cjs");
|
|
12
12
|
const PRECISION_INTERSECTION = 1e-9;
|
package/dist/query.cjs
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
3
|
-
const query = require("./query-
|
|
3
|
+
const query = require("./query-hMSmOWJP.cjs");
|
|
4
4
|
exports.cornerFinder = query.cornerFinder;
|
|
5
5
|
exports.edgeFinder = query.edgeFinder;
|
|
6
6
|
exports.faceFinder = query.faceFinder;
|
package/dist/query.js
CHANGED
|
@@ -1,19 +1,19 @@
|
|
|
1
1
|
import { g as getKernel, b as toOcVec, m as makeOcAx1, c as makeOcAx2, d as toOcPnt } from "./occtBoundary-CwegMzqc.js";
|
|
2
2
|
import { c as castShape, g as getShapeKind } from "./shapeTypes-BlSElW8z.js";
|
|
3
3
|
import { H as HASH_CODE_MAX, D as DEG2RAD } from "./vecOps-ZDdZWbwT.js";
|
|
4
|
-
import { i as iterTopo, d as downcast } from "./cast-
|
|
4
|
+
import { i as iterTopo, d as downcast } from "./cast-DQaUibmm.js";
|
|
5
5
|
import { u as unwrap } from "./errors-wGhcJMpB.js";
|
|
6
|
-
function
|
|
6
|
+
function clone(shape) {
|
|
7
7
|
return castShape(unwrap(downcast(shape.wrapped)));
|
|
8
8
|
}
|
|
9
|
-
function
|
|
9
|
+
function toBREP(shape) {
|
|
10
10
|
const oc = getKernel().oc;
|
|
11
11
|
return oc.BRepToolsWrapper.Write(shape.wrapped);
|
|
12
12
|
}
|
|
13
13
|
function getHashCode(shape) {
|
|
14
14
|
return shape.wrapped.HashCode(HASH_CODE_MAX);
|
|
15
15
|
}
|
|
16
|
-
function
|
|
16
|
+
function isEmpty(shape) {
|
|
17
17
|
return shape.wrapped.IsNull();
|
|
18
18
|
}
|
|
19
19
|
function isSameShape(a, b) {
|
|
@@ -22,7 +22,7 @@ function isSameShape(a, b) {
|
|
|
22
22
|
function isEqualShape(a, b) {
|
|
23
23
|
return a.wrapped.IsEqual(b.wrapped);
|
|
24
24
|
}
|
|
25
|
-
function
|
|
25
|
+
function simplify(shape) {
|
|
26
26
|
const oc = getKernel().oc;
|
|
27
27
|
const upgrader = new oc.ShapeUpgrade_UnifySameDomain_2(shape.wrapped, true, true, false);
|
|
28
28
|
upgrader.Build();
|
|
@@ -30,7 +30,7 @@ function simplifyShape(shape) {
|
|
|
30
30
|
upgrader.delete();
|
|
31
31
|
return result;
|
|
32
32
|
}
|
|
33
|
-
function
|
|
33
|
+
function translate(shape, v) {
|
|
34
34
|
const oc = getKernel().oc;
|
|
35
35
|
const trsf = new oc.gp_Trsf_1();
|
|
36
36
|
const vec = toOcVec(v);
|
|
@@ -42,7 +42,7 @@ function translateShape(shape, v) {
|
|
|
42
42
|
vec.delete();
|
|
43
43
|
return result;
|
|
44
44
|
}
|
|
45
|
-
function
|
|
45
|
+
function rotate(shape, angle, position = [0, 0, 0], direction = [0, 0, 1]) {
|
|
46
46
|
const oc = getKernel().oc;
|
|
47
47
|
const trsf = new oc.gp_Trsf_1();
|
|
48
48
|
const ax1 = makeOcAx1(position, direction);
|
|
@@ -54,7 +54,7 @@ function rotateShape(shape, angle, position = [0, 0, 0], direction = [0, 0, 1])
|
|
|
54
54
|
ax1.delete();
|
|
55
55
|
return result;
|
|
56
56
|
}
|
|
57
|
-
function
|
|
57
|
+
function mirror(shape, planeNormal = [0, 1, 0], planeOrigin = [0, 0, 0]) {
|
|
58
58
|
const oc = getKernel().oc;
|
|
59
59
|
const trsf = new oc.gp_Trsf_1();
|
|
60
60
|
const ax2 = makeOcAx2(planeOrigin, planeNormal);
|
|
@@ -66,7 +66,7 @@ function mirrorShape(shape, planeNormal = [0, 1, 0], planeOrigin = [0, 0, 0]) {
|
|
|
66
66
|
ax2.delete();
|
|
67
67
|
return result;
|
|
68
68
|
}
|
|
69
|
-
function
|
|
69
|
+
function scale(shape, factor, center = [0, 0, 0]) {
|
|
70
70
|
const oc = getKernel().oc;
|
|
71
71
|
const trsf = new oc.gp_Trsf_1();
|
|
72
72
|
const pnt = toOcPnt(center);
|
|
@@ -160,7 +160,7 @@ function getBounds(shape) {
|
|
|
160
160
|
zMax: zMax.current
|
|
161
161
|
};
|
|
162
162
|
}
|
|
163
|
-
function
|
|
163
|
+
function describe(shape) {
|
|
164
164
|
return {
|
|
165
165
|
kind: getShapeKind(shape),
|
|
166
166
|
faceCount: getFaces(shape).length,
|
|
@@ -179,26 +179,26 @@ function vertexPosition(vertex) {
|
|
|
179
179
|
return result;
|
|
180
180
|
}
|
|
181
181
|
export {
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
182
|
+
simplify as a,
|
|
183
|
+
toBREP as b,
|
|
184
|
+
clone as c,
|
|
185
|
+
describe as d,
|
|
186
186
|
getBounds as e,
|
|
187
187
|
getFaces as f,
|
|
188
188
|
getEdges as g,
|
|
189
189
|
getVertices as h,
|
|
190
|
-
|
|
190
|
+
isEmpty as i,
|
|
191
191
|
getWires as j,
|
|
192
192
|
getHashCode as k,
|
|
193
193
|
isEqualShape as l,
|
|
194
|
-
|
|
194
|
+
mirror as m,
|
|
195
195
|
isSameShape as n,
|
|
196
196
|
iterEdges as o,
|
|
197
197
|
iterFaces as p,
|
|
198
198
|
iterVertices as q,
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
199
|
+
rotate as r,
|
|
200
|
+
scale as s,
|
|
201
|
+
translate as t,
|
|
202
202
|
iterWires as u,
|
|
203
203
|
vertexPosition as v
|
|
204
204
|
};
|
|
@@ -2,19 +2,19 @@
|
|
|
2
2
|
const occtBoundary = require("./occtBoundary-du8_ex-p.cjs");
|
|
3
3
|
const shapeTypes = require("./shapeTypes-DKhwEnUM.cjs");
|
|
4
4
|
const vecOps = require("./vecOps-CjRL1jau.cjs");
|
|
5
|
-
const cast = require("./cast-
|
|
5
|
+
const cast = require("./cast-DkB0GKmQ.cjs");
|
|
6
6
|
const errors = require("./errors-DK1VAdP4.cjs");
|
|
7
|
-
function
|
|
7
|
+
function clone(shape) {
|
|
8
8
|
return shapeTypes.castShape(errors.unwrap(cast.downcast(shape.wrapped)));
|
|
9
9
|
}
|
|
10
|
-
function
|
|
10
|
+
function toBREP(shape) {
|
|
11
11
|
const oc = occtBoundary.getKernel().oc;
|
|
12
12
|
return oc.BRepToolsWrapper.Write(shape.wrapped);
|
|
13
13
|
}
|
|
14
14
|
function getHashCode(shape) {
|
|
15
15
|
return shape.wrapped.HashCode(vecOps.HASH_CODE_MAX);
|
|
16
16
|
}
|
|
17
|
-
function
|
|
17
|
+
function isEmpty(shape) {
|
|
18
18
|
return shape.wrapped.IsNull();
|
|
19
19
|
}
|
|
20
20
|
function isSameShape(a, b) {
|
|
@@ -23,7 +23,7 @@ function isSameShape(a, b) {
|
|
|
23
23
|
function isEqualShape(a, b) {
|
|
24
24
|
return a.wrapped.IsEqual(b.wrapped);
|
|
25
25
|
}
|
|
26
|
-
function
|
|
26
|
+
function simplify(shape) {
|
|
27
27
|
const oc = occtBoundary.getKernel().oc;
|
|
28
28
|
const upgrader = new oc.ShapeUpgrade_UnifySameDomain_2(shape.wrapped, true, true, false);
|
|
29
29
|
upgrader.Build();
|
|
@@ -31,7 +31,7 @@ function simplifyShape(shape) {
|
|
|
31
31
|
upgrader.delete();
|
|
32
32
|
return result;
|
|
33
33
|
}
|
|
34
|
-
function
|
|
34
|
+
function translate(shape, v) {
|
|
35
35
|
const oc = occtBoundary.getKernel().oc;
|
|
36
36
|
const trsf = new oc.gp_Trsf_1();
|
|
37
37
|
const vec = occtBoundary.toOcVec(v);
|
|
@@ -43,7 +43,7 @@ function translateShape(shape, v) {
|
|
|
43
43
|
vec.delete();
|
|
44
44
|
return result;
|
|
45
45
|
}
|
|
46
|
-
function
|
|
46
|
+
function rotate(shape, angle, position = [0, 0, 0], direction = [0, 0, 1]) {
|
|
47
47
|
const oc = occtBoundary.getKernel().oc;
|
|
48
48
|
const trsf = new oc.gp_Trsf_1();
|
|
49
49
|
const ax1 = occtBoundary.makeOcAx1(position, direction);
|
|
@@ -55,7 +55,7 @@ function rotateShape(shape, angle, position = [0, 0, 0], direction = [0, 0, 1])
|
|
|
55
55
|
ax1.delete();
|
|
56
56
|
return result;
|
|
57
57
|
}
|
|
58
|
-
function
|
|
58
|
+
function mirror(shape, planeNormal = [0, 1, 0], planeOrigin = [0, 0, 0]) {
|
|
59
59
|
const oc = occtBoundary.getKernel().oc;
|
|
60
60
|
const trsf = new oc.gp_Trsf_1();
|
|
61
61
|
const ax2 = occtBoundary.makeOcAx2(planeOrigin, planeNormal);
|
|
@@ -67,7 +67,7 @@ function mirrorShape(shape, planeNormal = [0, 1, 0], planeOrigin = [0, 0, 0]) {
|
|
|
67
67
|
ax2.delete();
|
|
68
68
|
return result;
|
|
69
69
|
}
|
|
70
|
-
function
|
|
70
|
+
function scale(shape, factor, center = [0, 0, 0]) {
|
|
71
71
|
const oc = occtBoundary.getKernel().oc;
|
|
72
72
|
const trsf = new oc.gp_Trsf_1();
|
|
73
73
|
const pnt = occtBoundary.toOcPnt(center);
|
|
@@ -161,7 +161,7 @@ function getBounds(shape) {
|
|
|
161
161
|
zMax: zMax.current
|
|
162
162
|
};
|
|
163
163
|
}
|
|
164
|
-
function
|
|
164
|
+
function describe(shape) {
|
|
165
165
|
return {
|
|
166
166
|
kind: shapeTypes.getShapeKind(shape),
|
|
167
167
|
faceCount: getFaces(shape).length,
|
|
@@ -179,25 +179,25 @@ function vertexPosition(vertex) {
|
|
|
179
179
|
pnt.delete();
|
|
180
180
|
return result;
|
|
181
181
|
}
|
|
182
|
-
exports.
|
|
183
|
-
exports.
|
|
182
|
+
exports.clone = clone;
|
|
183
|
+
exports.describe = describe;
|
|
184
184
|
exports.getBounds = getBounds;
|
|
185
185
|
exports.getEdges = getEdges;
|
|
186
186
|
exports.getFaces = getFaces;
|
|
187
187
|
exports.getHashCode = getHashCode;
|
|
188
188
|
exports.getVertices = getVertices;
|
|
189
189
|
exports.getWires = getWires;
|
|
190
|
+
exports.isEmpty = isEmpty;
|
|
190
191
|
exports.isEqualShape = isEqualShape;
|
|
191
192
|
exports.isSameShape = isSameShape;
|
|
192
|
-
exports.isShapeNull = isShapeNull;
|
|
193
193
|
exports.iterEdges = iterEdges;
|
|
194
194
|
exports.iterFaces = iterFaces;
|
|
195
195
|
exports.iterVertices = iterVertices;
|
|
196
196
|
exports.iterWires = iterWires;
|
|
197
|
-
exports.
|
|
198
|
-
exports.
|
|
199
|
-
exports.
|
|
200
|
-
exports.
|
|
201
|
-
exports.
|
|
202
|
-
exports.
|
|
197
|
+
exports.mirror = mirror;
|
|
198
|
+
exports.rotate = rotate;
|
|
199
|
+
exports.scale = scale;
|
|
200
|
+
exports.simplify = simplify;
|
|
201
|
+
exports.toBREP = toBREP;
|
|
202
|
+
exports.translate = translate;
|
|
203
203
|
exports.vertexPosition = vertexPosition;
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
const occtBoundary = require("./occtBoundary-du8_ex-p.cjs");
|
|
3
|
-
const cast = require("./cast-
|
|
3
|
+
const cast = require("./cast-DkB0GKmQ.cjs");
|
|
4
4
|
const errors = require("./errors-DK1VAdP4.cjs");
|
|
5
5
|
const shapeTypes = require("./shapeTypes-DKhwEnUM.cjs");
|
|
6
|
-
const shapeFns = require("./shapeFns-
|
|
6
|
+
const shapeFns = require("./shapeFns-BvOndshS.cjs");
|
|
7
7
|
function range(len) {
|
|
8
8
|
return Array.from(Array(len).keys());
|
|
9
9
|
}
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { g as getKernel, d as toOcPnt, b as toOcVec, c as makeOcAx2, e as makeOcAx3, m as makeOcAx1 } from "./occtBoundary-CwegMzqc.js";
|
|
2
|
-
import { c as cast, d as downcast } from "./cast-
|
|
2
|
+
import { c as cast, d as downcast } from "./cast-DQaUibmm.js";
|
|
3
3
|
import { e as err, o as occtError, l as ok, a as andThen, x as validationError, u as unwrap, p as typeCastError } from "./errors-wGhcJMpB.js";
|
|
4
4
|
import { q as createFace, r as createCompound, o as localGC, d as isEdge, m as isWire, s as createWire, t as createEdge, n as gcWithScope, u as createVertex, p as createSolid, e as isFace, h as isShape3D, j as isShell, k as isSolid } from "./shapeTypes-BlSElW8z.js";
|
|
5
|
-
import { g as getEdges } from "./shapeFns-
|
|
5
|
+
import { g as getEdges } from "./shapeFns-BrF97sKt.js";
|
|
6
6
|
function range(len) {
|
|
7
7
|
return Array.from(Array(len).keys());
|
|
8
8
|
}
|
|
@@ -14,10 +14,8 @@ export type SplineOptions = SplineTangent | {
|
|
|
14
14
|
startFactor?: number;
|
|
15
15
|
endFactor?: number;
|
|
16
16
|
};
|
|
17
|
-
/** @
|
|
18
|
-
export
|
|
19
|
-
/** Resolve a {@link SplineConfig} into fully-expanded tangent directions and factors. */
|
|
20
|
-
export declare const defaultsSplineConfig: (config?: SplineOptions) => {
|
|
17
|
+
/** Resolve a {@link SplineOptions} into fully-expanded tangent directions and factors. */
|
|
18
|
+
export declare const defaultsSplineOptions: (config?: SplineOptions) => {
|
|
21
19
|
endTangent: Point2D | "symmetric";
|
|
22
20
|
startTangent?: Point2D | undefined;
|
|
23
21
|
startFactor: number;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"sketcherlib.d.ts","sourceRoot":"","sources":["../../src/sketching/sketcherlib.ts"],"names":[],"mappings":"AACA,OAAO,EAAoB,KAAK,OAAO,EAAE,MAAM,oBAAoB,CAAC;AAGpE,KAAK,kBAAkB,GAAG,MAAM,GAAG,OAAO,CAAC;AAC3C,+GAA+G;AAC/G,MAAM,MAAM,aAAa,GAAG,kBAAkB,GAAG,WAAW,CAAC;AAE7D;;;;;GAKG;AACH,MAAM,MAAM,aAAa,GACrB,aAAa,GACb;IACE,UAAU,CAAC,EAAE,aAAa,CAAC;IAC3B,YAAY,CAAC,EAAE,kBAAkB,CAAC;IAClC,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB,CAAC;
|
|
1
|
+
{"version":3,"file":"sketcherlib.d.ts","sourceRoot":"","sources":["../../src/sketching/sketcherlib.ts"],"names":[],"mappings":"AACA,OAAO,EAAoB,KAAK,OAAO,EAAE,MAAM,oBAAoB,CAAC;AAGpE,KAAK,kBAAkB,GAAG,MAAM,GAAG,OAAO,CAAC;AAC3C,+GAA+G;AAC/G,MAAM,MAAM,aAAa,GAAG,kBAAkB,GAAG,WAAW,CAAC;AAE7D;;;;;GAKG;AACH,MAAM,MAAM,aAAa,GACrB,aAAa,GACb;IACE,UAAU,CAAC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,aAAa,GAAG,IAAI,CAAC;IAE9E;;OAEG;IACH,IAAI,IAAI,UAAU,CAAC;IACnB;;;OAGG;IACH,KAAK,IAAI,UAAU,CAAC;IACpB;;;OAGG;IACH,eAAe,IAAI,UAAU,CAAC;CAC/B;AAkBD;;;;;;;GAOG;AACH,wBAAgB,uBAAuB,CACrC,CAAC,EAAE,EAAE,EAAE,CAAC,EAAE,CAAC,MAAM,EAAE,MAAM,CAAC,EAC1B,CAAC,EAAE,EAAE,EAAE,CAAC,EAAE,CAAC,MAAM,EAAE,MAAM,CAAC,EAC1B,EAAE,EAAE,MAAM,EACV,EAAE,EAAE,MAAM,EACV,GAAG,EAAE,MAAM,EACX,EAAE,EAAE,OAAO,EACX,EAAE,EAAE,OAAO,GACV;IACD,EAAE,EAAE,MAAM,CAAC;IACX,EAAE,EAAE,MAAM,CAAC;IACX,EAAE,EAAE,MAAM,CAAC;IACX,EAAE,EAAE,MAAM,CAAC;IACX,UAAU,EAAE,MAAM,CAAC;IACnB,UAAU,EAAE,MAAM,CAAC;IACnB,QAAQ,EAAE,MAAM,CAAC;IACjB,SAAS,EAAE,OAAO,CAAC;CACpB,CA4FA"}
|
package/dist/sketching.cjs
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
3
|
-
const drawFns = require("./drawFns-
|
|
4
|
-
const boolean2D = require("./boolean2D-
|
|
3
|
+
const drawFns = require("./drawFns-CUyx50gi.cjs");
|
|
4
|
+
const boolean2D = require("./boolean2D-BdZATaHs.cjs");
|
|
5
5
|
exports.CompoundSketch = drawFns.CompoundSketch;
|
|
6
6
|
exports.Drawing = drawFns.Drawing;
|
|
7
7
|
exports.DrawingPen = drawFns.DrawingPen;
|
package/dist/sketching.d.ts
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { default as Sketcher } from './sketching/Sketcher.js';
|
|
2
2
|
import { default as FaceSketcher, BaseSketcher2d, BlueprintSketcher } from './sketching/Sketcher2d.js';
|
|
3
|
-
import { GenericSketcher, SplineOptions
|
|
3
|
+
import { GenericSketcher, SplineOptions } from './sketching/sketcherlib.js';
|
|
4
4
|
export { Sketcher, FaceSketcher, BaseSketcher2d, BlueprintSketcher };
|
|
5
|
-
export type { GenericSketcher, SplineOptions
|
|
5
|
+
export type { GenericSketcher, SplineOptions };
|
|
6
6
|
export type { SketchInterface } from './sketching/sketchLib.js';
|
|
7
7
|
export { default as Sketch } from './sketching/Sketch.js';
|
|
8
8
|
export { default as CompoundSketch } from './sketching/CompoundSketch.js';
|
package/dist/sketching.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"sketching.d.ts","sourceRoot":"","sources":["../src/sketching.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAIH,OAAO,QAAQ,MAAM,yBAAyB,CAAC;AAC/C,OAAO,YAAY,EAAE,EAAE,cAAc,EAAE,iBAAiB,EAAE,MAAM,2BAA2B,CAAC;AAC5F,OAAO,
|
|
1
|
+
{"version":3,"file":"sketching.d.ts","sourceRoot":"","sources":["../src/sketching.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAIH,OAAO,QAAQ,MAAM,yBAAyB,CAAC;AAC/C,OAAO,YAAY,EAAE,EAAE,cAAc,EAAE,iBAAiB,EAAE,MAAM,2BAA2B,CAAC;AAC5F,OAAO,EAAE,KAAK,eAAe,EAAE,KAAK,aAAa,EAAE,MAAM,4BAA4B,CAAC;AAEtF,OAAO,EAAE,QAAQ,EAAE,YAAY,EAAE,cAAc,EAAE,iBAAiB,EAAE,CAAC;AACrE,YAAY,EAAE,eAAe,EAAE,aAAa,EAAE,CAAC;AAC/C,YAAY,EAAE,eAAe,EAAE,MAAM,0BAA0B,CAAC;AAEhE,OAAO,EAAE,OAAO,IAAI,MAAM,EAAE,MAAM,uBAAuB,CAAC;AAC1D,OAAO,EAAE,OAAO,IAAI,cAAc,EAAE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