brepjs 8.8.7 → 8.8.9
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 +2 -2
- package/dist/2d.js +3 -3
- package/dist/{Blueprint-BWLPU0ZC.js → Blueprint-C7JlgasP.js} +2 -2
- package/dist/{Blueprint-CIfiTx-y.cjs → Blueprint-CTrwIDuQ.cjs} +2 -2
- package/dist/{boolean2D-BG9wtSKz.js → boolean2D-CypPzZM1.js} +4 -4
- package/dist/{boolean2D-Bs_OdV2_.cjs → boolean2D-KvkerCI-.cjs} +4 -4
- package/dist/{booleanFns-DHEaBJwW.js → booleanFns-BnLhgDGb.js} +2 -2
- package/dist/{booleanFns-CUxOBNlC.cjs → booleanFns-DEY86xmR.cjs} +2 -2
- package/dist/brepjs.cjs +33 -38
- package/dist/brepjs.js +41 -46
- package/dist/{cornerFinder-DfSdXbxK.js → cornerFinder-BurQenn5.js} +1 -1
- package/dist/{cornerFinder-BijsFhpz.cjs → cornerFinder-DLHDc022.cjs} +1 -1
- package/dist/{drawFns-Df_AbW16.js → drawFns-BY9W9rPP.js} +7 -7
- package/dist/{drawFns-BGGYhul8.cjs → drawFns-ibZFQZkt.cjs} +7 -7
- package/dist/{helpers-Ces6b2wm.cjs → helpers-DQGErXAX.cjs} +1 -1
- package/dist/{helpers-D7hTCTJm.js → helpers-SajoWDKO.js} +1 -1
- package/dist/io.cjs +2 -2
- package/dist/io.js +2 -2
- package/dist/{loft-BpfrTPIR.js → loft-CfKcU3Y1.js} +1 -1
- package/dist/{loft-GLxTzuXU.cjs → loft-hhMumRtt.cjs} +1 -1
- package/dist/{meshFns-BTb2esZJ.cjs → meshFns-CfjNBqS6.cjs} +1 -1
- package/dist/{meshFns-DJx5Yqiy.js → meshFns-Diog9oLS.js} +1 -1
- package/dist/operations/loftFns.d.ts +3 -1
- package/dist/operations/loftFns.d.ts.map +1 -1
- package/dist/{operations-CHIU-aGI.js → operations-BFDNdchq.js} +2 -2
- package/dist/{operations-T5f-v2rF.cjs → operations-CZUFSBuY.cjs} +2 -2
- package/dist/operations.cjs +2 -2
- package/dist/operations.js +2 -2
- package/dist/query.cjs +2 -2
- package/dist/query.js +3 -3
- package/dist/{shapeFns-CbZMmuQA.cjs → shapeFns-D4MYB8um.cjs} +145 -95
- package/dist/{shapeFns-5HlS8wvc.js → shapeFns-DNxuGWvV.js} +146 -96
- package/dist/sketching.cjs +2 -2
- package/dist/sketching.js +2 -2
- package/dist/{surfaceBuilders-zlVu1d-b.js → surfaceBuilders-DEd0HUri.js} +1 -1
- package/dist/{surfaceBuilders-zWnw2I0j.cjs → surfaceBuilders-DeFCNwZl.cjs} +1 -1
- package/dist/topology/shapeFns.d.ts.map +1 -1
- package/dist/topology/surfaceFns.d.ts.map +1 -1
- package/dist/{topology-ZRFxrEEW.cjs → topology-CRPSzNkp.cjs} +3 -3
- package/dist/{topology-CMS8QyJa.js → topology-XD2qFlgc.js} +3 -3
- package/dist/topology.cjs +4 -4
- package/dist/topology.js +4 -4
- package/package.json +2 -3
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-CZUFSBuY.cjs");
|
|
4
|
+
const loft = require("./loft-hhMumRtt.cjs");
|
|
5
5
|
exports.addChild = operations.addChild;
|
|
6
6
|
exports.addStep = operations.addStep;
|
|
7
7
|
exports.circularPattern = operations.circularPattern;
|
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, x, y, z, A, B, s, C, D, E, w } 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, x, y, z, A, B, s, C, D, E, w } from "./operations-BFDNdchq.js";
|
|
2
|
+
import { b as b2, g as g2, l as l2, r } from "./loft-CfKcU3Y1.js";
|
|
3
3
|
export {
|
|
4
4
|
a as addChild,
|
|
5
5
|
b as addStep,
|
package/dist/query.cjs
CHANGED
|
@@ -45,8 +45,8 @@ var __callDispose = (stack, error, hasError) => {
|
|
|
45
45
|
return next();
|
|
46
46
|
};
|
|
47
47
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
48
|
-
const helpers = require("./helpers-
|
|
49
|
-
const cornerFinder = require("./cornerFinder-
|
|
48
|
+
const helpers = require("./helpers-DQGErXAX.cjs");
|
|
49
|
+
const cornerFinder = require("./cornerFinder-DLHDc022.cjs");
|
|
50
50
|
const occtBoundary = require("./occtBoundary-CN_uQJtA.cjs");
|
|
51
51
|
const shapeTypes = require("./shapeTypes-sXITvFkF.cjs");
|
|
52
52
|
const vecOps = require("./vecOps-CjRL1jau.cjs");
|
package/dist/query.js
CHANGED
|
@@ -43,9 +43,9 @@ var __callDispose = (stack, error, hasError) => {
|
|
|
43
43
|
};
|
|
44
44
|
return next();
|
|
45
45
|
};
|
|
46
|
-
import { l as createTypedFinder, o as distanceFromPointFilter, q as resolveDir } from "./helpers-
|
|
47
|
-
import { m, g } from "./helpers-
|
|
48
|
-
import { c } from "./cornerFinder-
|
|
46
|
+
import { l as createTypedFinder, o as distanceFromPointFilter, q as resolveDir } from "./helpers-SajoWDKO.js";
|
|
47
|
+
import { m, g } from "./helpers-SajoWDKO.js";
|
|
48
|
+
import { c } from "./cornerFinder-BurQenn5.js";
|
|
49
49
|
import { g as getKernel } from "./occtBoundary-Ct0tN8cs.js";
|
|
50
50
|
import { D as DisposalScope } from "./shapeTypes-D34s68Xi.js";
|
|
51
51
|
import { j as vecNormalize, d as vecDot, D as DEG2RAD } from "./vecOps-ZDdZWbwT.js";
|
|
@@ -85,56 +85,76 @@ function simplify(shape) {
|
|
|
85
85
|
}
|
|
86
86
|
}
|
|
87
87
|
function translate(shape, v) {
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
88
|
+
var _stack = [];
|
|
89
|
+
try {
|
|
90
|
+
const oc = occtBoundary.getKernel().oc;
|
|
91
|
+
const scope = __using(_stack, new shapeTypes.DisposalScope());
|
|
92
|
+
const trsf = scope.register(new oc.gp_Trsf_1());
|
|
93
|
+
const vec = scope.register(occtBoundary.toOcVec(v));
|
|
94
|
+
trsf.SetTranslation_1(vec);
|
|
95
|
+
const transformer = scope.register(new oc.BRepBuilderAPI_Transform_2(shape.wrapped, trsf, true));
|
|
96
|
+
const result = shapeTypes.castShape(transformer.Shape());
|
|
97
|
+
propagateOrigins(transformer, [shape], result);
|
|
98
|
+
return result;
|
|
99
|
+
} catch (_) {
|
|
100
|
+
var _error = _, _hasError = true;
|
|
101
|
+
} finally {
|
|
102
|
+
__callDispose(_stack, _error, _hasError);
|
|
103
|
+
}
|
|
99
104
|
}
|
|
100
105
|
function rotate(shape, angle, position = [0, 0, 0], direction = [0, 0, 1]) {
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
106
|
+
var _stack = [];
|
|
107
|
+
try {
|
|
108
|
+
const oc = occtBoundary.getKernel().oc;
|
|
109
|
+
const scope = __using(_stack, new shapeTypes.DisposalScope());
|
|
110
|
+
const trsf = scope.register(new oc.gp_Trsf_1());
|
|
111
|
+
const ax1 = scope.register(occtBoundary.makeOcAx1(position, direction));
|
|
112
|
+
trsf.SetRotation_1(ax1, angle * vecOps.DEG2RAD);
|
|
113
|
+
const transformer = scope.register(new oc.BRepBuilderAPI_Transform_2(shape.wrapped, trsf, true));
|
|
114
|
+
const result = shapeTypes.castShape(transformer.Shape());
|
|
115
|
+
propagateOrigins(transformer, [shape], result);
|
|
116
|
+
return result;
|
|
117
|
+
} catch (_) {
|
|
118
|
+
var _error = _, _hasError = true;
|
|
119
|
+
} finally {
|
|
120
|
+
__callDispose(_stack, _error, _hasError);
|
|
121
|
+
}
|
|
112
122
|
}
|
|
113
123
|
function mirror(shape, planeNormal = [0, 1, 0], planeOrigin = [0, 0, 0]) {
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
124
|
+
var _stack = [];
|
|
125
|
+
try {
|
|
126
|
+
const oc = occtBoundary.getKernel().oc;
|
|
127
|
+
const scope = __using(_stack, new shapeTypes.DisposalScope());
|
|
128
|
+
const trsf = scope.register(new oc.gp_Trsf_1());
|
|
129
|
+
const ax2 = scope.register(occtBoundary.makeOcAx2(planeOrigin, planeNormal));
|
|
130
|
+
trsf.SetMirror_3(ax2);
|
|
131
|
+
const transformer = scope.register(new oc.BRepBuilderAPI_Transform_2(shape.wrapped, trsf, true));
|
|
132
|
+
const result = shapeTypes.castShape(transformer.Shape());
|
|
133
|
+
propagateOrigins(transformer, [shape], result);
|
|
134
|
+
return result;
|
|
135
|
+
} catch (_) {
|
|
136
|
+
var _error = _, _hasError = true;
|
|
137
|
+
} finally {
|
|
138
|
+
__callDispose(_stack, _error, _hasError);
|
|
139
|
+
}
|
|
125
140
|
}
|
|
126
141
|
function scale(shape, factor, center = [0, 0, 0]) {
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
142
|
+
var _stack = [];
|
|
143
|
+
try {
|
|
144
|
+
const oc = occtBoundary.getKernel().oc;
|
|
145
|
+
const scope = __using(_stack, new shapeTypes.DisposalScope());
|
|
146
|
+
const trsf = scope.register(new oc.gp_Trsf_1());
|
|
147
|
+
const pnt = scope.register(occtBoundary.toOcPnt(center));
|
|
148
|
+
trsf.SetScale(pnt, factor);
|
|
149
|
+
const transformer = scope.register(new oc.BRepBuilderAPI_Transform_2(shape.wrapped, trsf, true));
|
|
150
|
+
const result = shapeTypes.castShape(transformer.Shape());
|
|
151
|
+
propagateOrigins(transformer, [shape], result);
|
|
152
|
+
return result;
|
|
153
|
+
} catch (_) {
|
|
154
|
+
var _error = _, _hasError = true;
|
|
155
|
+
} finally {
|
|
156
|
+
__callDispose(_stack, _error, _hasError);
|
|
157
|
+
}
|
|
138
158
|
}
|
|
139
159
|
function resize(shape, dimensions, options) {
|
|
140
160
|
const bbox = occtBoundary.getKernel().boundingBox(shape.wrapped);
|
|
@@ -213,27 +233,35 @@ function applyMatrix(shape, matrix) {
|
|
|
213
233
|
const oc = occtBoundary.getKernel().oc;
|
|
214
234
|
const orthogonal = isOrthogonalMatrix(linear);
|
|
215
235
|
if (orthogonal) {
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
236
|
+
var _stack = [];
|
|
237
|
+
try {
|
|
238
|
+
const scope = __using(_stack, new shapeTypes.DisposalScope());
|
|
239
|
+
const trsf = scope.register(new oc.gp_Trsf_1());
|
|
240
|
+
trsf.SetValues(
|
|
241
|
+
linear[0],
|
|
242
|
+
linear[1],
|
|
243
|
+
linear[2],
|
|
244
|
+
translation[0],
|
|
245
|
+
linear[3],
|
|
246
|
+
linear[4],
|
|
247
|
+
linear[5],
|
|
248
|
+
translation[1],
|
|
249
|
+
linear[6],
|
|
250
|
+
linear[7],
|
|
251
|
+
linear[8],
|
|
252
|
+
translation[2]
|
|
253
|
+
);
|
|
254
|
+
const transformer2 = scope.register(
|
|
255
|
+
new oc.BRepBuilderAPI_Transform_2(shape.wrapped, trsf, true)
|
|
256
|
+
);
|
|
257
|
+
const result2 = shapeTypes.castShape(transformer2.Shape());
|
|
258
|
+
propagateOrigins(transformer2, [shape], result2);
|
|
259
|
+
return result2;
|
|
260
|
+
} catch (_) {
|
|
261
|
+
var _error = _, _hasError = true;
|
|
262
|
+
} finally {
|
|
263
|
+
__callDispose(_stack, _error, _hasError);
|
|
264
|
+
}
|
|
237
265
|
}
|
|
238
266
|
const gtrsf = new oc.gp_GTrsf_1();
|
|
239
267
|
for (let row = 0; row < 3; row++) {
|
|
@@ -271,12 +299,21 @@ function composeTransforms(ops) {
|
|
|
271
299
|
return { trsf: result, cleanup: () => result.delete() };
|
|
272
300
|
}
|
|
273
301
|
function transformCopy(shape, composed) {
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
302
|
+
var _stack = [];
|
|
303
|
+
try {
|
|
304
|
+
const oc = occtBoundary.getKernel().oc;
|
|
305
|
+
const scope = __using(_stack, new shapeTypes.DisposalScope());
|
|
306
|
+
const transformer = scope.register(
|
|
307
|
+
new oc.BRepBuilderAPI_Transform_2(shape.wrapped, composed.trsf, true)
|
|
308
|
+
);
|
|
309
|
+
const result = shapeTypes.castShape(transformer.Shape());
|
|
310
|
+
propagateOrigins(transformer, [shape], result);
|
|
311
|
+
return result;
|
|
312
|
+
} catch (_) {
|
|
313
|
+
var _error = _, _hasError = true;
|
|
314
|
+
} finally {
|
|
315
|
+
__callDispose(_stack, _error, _hasError);
|
|
316
|
+
}
|
|
280
317
|
}
|
|
281
318
|
const topoCache = /* @__PURE__ */ new WeakMap();
|
|
282
319
|
function getOrCreateCache(shape) {
|
|
@@ -436,25 +473,32 @@ function* iterVertices(shape) {
|
|
|
436
473
|
}
|
|
437
474
|
}
|
|
438
475
|
function getBounds(shape) {
|
|
439
|
-
|
|
440
|
-
|
|
441
|
-
|
|
442
|
-
|
|
443
|
-
|
|
444
|
-
|
|
445
|
-
|
|
446
|
-
|
|
447
|
-
|
|
448
|
-
|
|
449
|
-
|
|
450
|
-
|
|
451
|
-
xMin
|
|
452
|
-
|
|
453
|
-
|
|
454
|
-
|
|
455
|
-
|
|
456
|
-
|
|
457
|
-
|
|
476
|
+
var _stack = [];
|
|
477
|
+
try {
|
|
478
|
+
const oc = occtBoundary.getKernel().oc;
|
|
479
|
+
const scope = __using(_stack, new shapeTypes.DisposalScope());
|
|
480
|
+
const bbox = scope.register(new oc.Bnd_Box_1());
|
|
481
|
+
oc.BRepBndLib.Add(shape.wrapped, bbox, true);
|
|
482
|
+
const xMin = { current: 0 };
|
|
483
|
+
const yMin = { current: 0 };
|
|
484
|
+
const zMin = { current: 0 };
|
|
485
|
+
const xMax = { current: 0 };
|
|
486
|
+
const yMax = { current: 0 };
|
|
487
|
+
const zMax = { current: 0 };
|
|
488
|
+
bbox.Get(xMin, yMin, zMin, xMax, yMax, zMax);
|
|
489
|
+
return {
|
|
490
|
+
xMin: xMin.current,
|
|
491
|
+
xMax: xMax.current,
|
|
492
|
+
yMin: yMin.current,
|
|
493
|
+
yMax: yMax.current,
|
|
494
|
+
zMin: zMin.current,
|
|
495
|
+
zMax: zMax.current
|
|
496
|
+
};
|
|
497
|
+
} catch (_) {
|
|
498
|
+
var _error = _, _hasError = true;
|
|
499
|
+
} finally {
|
|
500
|
+
__callDispose(_stack, _error, _hasError);
|
|
501
|
+
}
|
|
458
502
|
}
|
|
459
503
|
function describe(shape) {
|
|
460
504
|
return {
|
|
@@ -468,11 +512,17 @@ function describe(shape) {
|
|
|
468
512
|
};
|
|
469
513
|
}
|
|
470
514
|
function vertexPosition(vertex) {
|
|
471
|
-
|
|
472
|
-
|
|
473
|
-
|
|
474
|
-
|
|
475
|
-
|
|
515
|
+
var _stack = [];
|
|
516
|
+
try {
|
|
517
|
+
const oc = occtBoundary.getKernel().oc;
|
|
518
|
+
const scope = __using(_stack, new shapeTypes.DisposalScope());
|
|
519
|
+
const pnt = scope.register(oc.BRep_Tool.Pnt(vertex.wrapped));
|
|
520
|
+
return [pnt.X(), pnt.Y(), pnt.Z()];
|
|
521
|
+
} catch (_) {
|
|
522
|
+
var _error = _, _hasError = true;
|
|
523
|
+
} finally {
|
|
524
|
+
__callDispose(_stack, _error, _hasError);
|
|
525
|
+
}
|
|
476
526
|
}
|
|
477
527
|
exports.applyMatrix = applyMatrix;
|
|
478
528
|
exports.clone = clone;
|
|
@@ -44,7 +44,7 @@ var __callDispose = (stack, error, hasError) => {
|
|
|
44
44
|
return next();
|
|
45
45
|
};
|
|
46
46
|
import { g as getKernel, b as toOcVec, m as makeOcAx1, c as makeOcAx2, d as toOcPnt } from "./occtBoundary-Ct0tN8cs.js";
|
|
47
|
-
import {
|
|
47
|
+
import { D as DisposalScope, c as castShape, g as getShapeKind } from "./shapeTypes-D34s68Xi.js";
|
|
48
48
|
import { D as DEG2RAD, H as HASH_CODE_MAX } from "./vecOps-ZDdZWbwT.js";
|
|
49
49
|
import { i as iterTopo, d as downcast } from "./faceFns-DG4bu-QB.js";
|
|
50
50
|
import { u as unwrap } from "./errors-CHfaHQSt.js";
|
|
@@ -84,56 +84,76 @@ function simplify(shape) {
|
|
|
84
84
|
}
|
|
85
85
|
}
|
|
86
86
|
function translate(shape, v) {
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
87
|
+
var _stack = [];
|
|
88
|
+
try {
|
|
89
|
+
const oc = getKernel().oc;
|
|
90
|
+
const scope = __using(_stack, new DisposalScope());
|
|
91
|
+
const trsf = scope.register(new oc.gp_Trsf_1());
|
|
92
|
+
const vec = scope.register(toOcVec(v));
|
|
93
|
+
trsf.SetTranslation_1(vec);
|
|
94
|
+
const transformer = scope.register(new oc.BRepBuilderAPI_Transform_2(shape.wrapped, trsf, true));
|
|
95
|
+
const result = castShape(transformer.Shape());
|
|
96
|
+
propagateOrigins(transformer, [shape], result);
|
|
97
|
+
return result;
|
|
98
|
+
} catch (_) {
|
|
99
|
+
var _error = _, _hasError = true;
|
|
100
|
+
} finally {
|
|
101
|
+
__callDispose(_stack, _error, _hasError);
|
|
102
|
+
}
|
|
98
103
|
}
|
|
99
104
|
function rotate(shape, angle, position = [0, 0, 0], direction = [0, 0, 1]) {
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
105
|
+
var _stack = [];
|
|
106
|
+
try {
|
|
107
|
+
const oc = getKernel().oc;
|
|
108
|
+
const scope = __using(_stack, new DisposalScope());
|
|
109
|
+
const trsf = scope.register(new oc.gp_Trsf_1());
|
|
110
|
+
const ax1 = scope.register(makeOcAx1(position, direction));
|
|
111
|
+
trsf.SetRotation_1(ax1, angle * DEG2RAD);
|
|
112
|
+
const transformer = scope.register(new oc.BRepBuilderAPI_Transform_2(shape.wrapped, trsf, true));
|
|
113
|
+
const result = castShape(transformer.Shape());
|
|
114
|
+
propagateOrigins(transformer, [shape], result);
|
|
115
|
+
return result;
|
|
116
|
+
} catch (_) {
|
|
117
|
+
var _error = _, _hasError = true;
|
|
118
|
+
} finally {
|
|
119
|
+
__callDispose(_stack, _error, _hasError);
|
|
120
|
+
}
|
|
111
121
|
}
|
|
112
122
|
function mirror(shape, planeNormal = [0, 1, 0], planeOrigin = [0, 0, 0]) {
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
123
|
+
var _stack = [];
|
|
124
|
+
try {
|
|
125
|
+
const oc = getKernel().oc;
|
|
126
|
+
const scope = __using(_stack, new DisposalScope());
|
|
127
|
+
const trsf = scope.register(new oc.gp_Trsf_1());
|
|
128
|
+
const ax2 = scope.register(makeOcAx2(planeOrigin, planeNormal));
|
|
129
|
+
trsf.SetMirror_3(ax2);
|
|
130
|
+
const transformer = scope.register(new oc.BRepBuilderAPI_Transform_2(shape.wrapped, trsf, true));
|
|
131
|
+
const result = castShape(transformer.Shape());
|
|
132
|
+
propagateOrigins(transformer, [shape], result);
|
|
133
|
+
return result;
|
|
134
|
+
} catch (_) {
|
|
135
|
+
var _error = _, _hasError = true;
|
|
136
|
+
} finally {
|
|
137
|
+
__callDispose(_stack, _error, _hasError);
|
|
138
|
+
}
|
|
124
139
|
}
|
|
125
140
|
function scale(shape, factor, center = [0, 0, 0]) {
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
141
|
+
var _stack = [];
|
|
142
|
+
try {
|
|
143
|
+
const oc = getKernel().oc;
|
|
144
|
+
const scope = __using(_stack, new DisposalScope());
|
|
145
|
+
const trsf = scope.register(new oc.gp_Trsf_1());
|
|
146
|
+
const pnt = scope.register(toOcPnt(center));
|
|
147
|
+
trsf.SetScale(pnt, factor);
|
|
148
|
+
const transformer = scope.register(new oc.BRepBuilderAPI_Transform_2(shape.wrapped, trsf, true));
|
|
149
|
+
const result = castShape(transformer.Shape());
|
|
150
|
+
propagateOrigins(transformer, [shape], result);
|
|
151
|
+
return result;
|
|
152
|
+
} catch (_) {
|
|
153
|
+
var _error = _, _hasError = true;
|
|
154
|
+
} finally {
|
|
155
|
+
__callDispose(_stack, _error, _hasError);
|
|
156
|
+
}
|
|
137
157
|
}
|
|
138
158
|
function resize(shape, dimensions, options) {
|
|
139
159
|
const bbox = getKernel().boundingBox(shape.wrapped);
|
|
@@ -212,27 +232,35 @@ function applyMatrix(shape, matrix) {
|
|
|
212
232
|
const oc = getKernel().oc;
|
|
213
233
|
const orthogonal = isOrthogonalMatrix(linear);
|
|
214
234
|
if (orthogonal) {
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
235
|
+
var _stack = [];
|
|
236
|
+
try {
|
|
237
|
+
const scope = __using(_stack, new DisposalScope());
|
|
238
|
+
const trsf = scope.register(new oc.gp_Trsf_1());
|
|
239
|
+
trsf.SetValues(
|
|
240
|
+
linear[0],
|
|
241
|
+
linear[1],
|
|
242
|
+
linear[2],
|
|
243
|
+
translation[0],
|
|
244
|
+
linear[3],
|
|
245
|
+
linear[4],
|
|
246
|
+
linear[5],
|
|
247
|
+
translation[1],
|
|
248
|
+
linear[6],
|
|
249
|
+
linear[7],
|
|
250
|
+
linear[8],
|
|
251
|
+
translation[2]
|
|
252
|
+
);
|
|
253
|
+
const transformer2 = scope.register(
|
|
254
|
+
new oc.BRepBuilderAPI_Transform_2(shape.wrapped, trsf, true)
|
|
255
|
+
);
|
|
256
|
+
const result2 = castShape(transformer2.Shape());
|
|
257
|
+
propagateOrigins(transformer2, [shape], result2);
|
|
258
|
+
return result2;
|
|
259
|
+
} catch (_) {
|
|
260
|
+
var _error = _, _hasError = true;
|
|
261
|
+
} finally {
|
|
262
|
+
__callDispose(_stack, _error, _hasError);
|
|
263
|
+
}
|
|
236
264
|
}
|
|
237
265
|
const gtrsf = new oc.gp_GTrsf_1();
|
|
238
266
|
for (let row = 0; row < 3; row++) {
|
|
@@ -270,12 +298,21 @@ function composeTransforms(ops) {
|
|
|
270
298
|
return { trsf: result, cleanup: () => result.delete() };
|
|
271
299
|
}
|
|
272
300
|
function transformCopy(shape, composed) {
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
301
|
+
var _stack = [];
|
|
302
|
+
try {
|
|
303
|
+
const oc = getKernel().oc;
|
|
304
|
+
const scope = __using(_stack, new DisposalScope());
|
|
305
|
+
const transformer = scope.register(
|
|
306
|
+
new oc.BRepBuilderAPI_Transform_2(shape.wrapped, composed.trsf, true)
|
|
307
|
+
);
|
|
308
|
+
const result = castShape(transformer.Shape());
|
|
309
|
+
propagateOrigins(transformer, [shape], result);
|
|
310
|
+
return result;
|
|
311
|
+
} catch (_) {
|
|
312
|
+
var _error = _, _hasError = true;
|
|
313
|
+
} finally {
|
|
314
|
+
__callDispose(_stack, _error, _hasError);
|
|
315
|
+
}
|
|
279
316
|
}
|
|
280
317
|
const topoCache = /* @__PURE__ */ new WeakMap();
|
|
281
318
|
function getOrCreateCache(shape) {
|
|
@@ -435,25 +472,32 @@ function* iterVertices(shape) {
|
|
|
435
472
|
}
|
|
436
473
|
}
|
|
437
474
|
function getBounds(shape) {
|
|
438
|
-
|
|
439
|
-
|
|
440
|
-
|
|
441
|
-
|
|
442
|
-
|
|
443
|
-
|
|
444
|
-
|
|
445
|
-
|
|
446
|
-
|
|
447
|
-
|
|
448
|
-
|
|
449
|
-
|
|
450
|
-
xMin
|
|
451
|
-
|
|
452
|
-
|
|
453
|
-
|
|
454
|
-
|
|
455
|
-
|
|
456
|
-
|
|
475
|
+
var _stack = [];
|
|
476
|
+
try {
|
|
477
|
+
const oc = getKernel().oc;
|
|
478
|
+
const scope = __using(_stack, new DisposalScope());
|
|
479
|
+
const bbox = scope.register(new oc.Bnd_Box_1());
|
|
480
|
+
oc.BRepBndLib.Add(shape.wrapped, bbox, true);
|
|
481
|
+
const xMin = { current: 0 };
|
|
482
|
+
const yMin = { current: 0 };
|
|
483
|
+
const zMin = { current: 0 };
|
|
484
|
+
const xMax = { current: 0 };
|
|
485
|
+
const yMax = { current: 0 };
|
|
486
|
+
const zMax = { current: 0 };
|
|
487
|
+
bbox.Get(xMin, yMin, zMin, xMax, yMax, zMax);
|
|
488
|
+
return {
|
|
489
|
+
xMin: xMin.current,
|
|
490
|
+
xMax: xMax.current,
|
|
491
|
+
yMin: yMin.current,
|
|
492
|
+
yMax: yMax.current,
|
|
493
|
+
zMin: zMin.current,
|
|
494
|
+
zMax: zMax.current
|
|
495
|
+
};
|
|
496
|
+
} catch (_) {
|
|
497
|
+
var _error = _, _hasError = true;
|
|
498
|
+
} finally {
|
|
499
|
+
__callDispose(_stack, _error, _hasError);
|
|
500
|
+
}
|
|
457
501
|
}
|
|
458
502
|
function describe(shape) {
|
|
459
503
|
return {
|
|
@@ -467,11 +511,17 @@ function describe(shape) {
|
|
|
467
511
|
};
|
|
468
512
|
}
|
|
469
513
|
function vertexPosition(vertex) {
|
|
470
|
-
|
|
471
|
-
|
|
472
|
-
|
|
473
|
-
|
|
474
|
-
|
|
514
|
+
var _stack = [];
|
|
515
|
+
try {
|
|
516
|
+
const oc = getKernel().oc;
|
|
517
|
+
const scope = __using(_stack, new DisposalScope());
|
|
518
|
+
const pnt = scope.register(oc.BRep_Tool.Pnt(vertex.wrapped));
|
|
519
|
+
return [pnt.X(), pnt.Y(), pnt.Z()];
|
|
520
|
+
} catch (_) {
|
|
521
|
+
var _error = _, _hasError = true;
|
|
522
|
+
} finally {
|
|
523
|
+
__callDispose(_stack, _error, _hasError);
|
|
524
|
+
}
|
|
475
525
|
}
|
|
476
526
|
export {
|
|
477
527
|
iterFaces as A,
|
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-ibZFQZkt.cjs");
|
|
4
|
+
const boolean2D = require("./boolean2D-KvkerCI-.cjs");
|
|
5
5
|
exports.CompoundSketch = drawFns.CompoundSketch;
|
|
6
6
|
exports.Drawing = drawFns.Drawing;
|
|
7
7
|
exports.DrawingPen = drawFns.DrawingPen;
|
package/dist/sketching.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { C, D, a, S, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p, q, r, s, t, u, v, w, x, y, z, A, B, E, F, G, H, I, J, K, L, M, N, O, P, Q, R, T, U, V, W } from "./drawFns-
|
|
2
|
-
import { B as B2, a as a2, F as F2, S as S2 } from "./boolean2D-
|
|
1
|
+
import { C, D, a, S, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p, q, r, s, t, u, v, w, x, y, z, A, B, E, F, G, H, I, J, K, L, M, N, O, P, Q, R, T, U, V, W } from "./drawFns-BY9W9rPP.js";
|
|
2
|
+
import { B as B2, a as a2, F as F2, S as S2 } from "./boolean2D-CypPzZM1.js";
|
|
3
3
|
export {
|
|
4
4
|
B2 as BaseSketcher2d,
|
|
5
5
|
a2 as BlueprintSketcher,
|
|
@@ -46,7 +46,7 @@ var __callDispose = (stack, error, hasError) => {
|
|
|
46
46
|
import { g as getKernel, d as toOcPnt, b as toOcVec, c as makeOcAx2, e as makeOcAx3 } from "./occtBoundary-Ct0tN8cs.js";
|
|
47
47
|
import { e as err, o as occtError, l as ok, x as validationError, a as andThen } from "./errors-CHfaHQSt.js";
|
|
48
48
|
import { D as DisposalScope, d as isEdge, n as isWire, q as createWire, r as createEdge, s as createFace, e as isFace } from "./shapeTypes-D34s68Xi.js";
|
|
49
|
-
import { d as getEdges } from "./shapeFns-
|
|
49
|
+
import { d as getEdges } from "./shapeFns-DNxuGWvV.js";
|
|
50
50
|
import { o as outerWire, c as cast } from "./faceFns-DG4bu-QB.js";
|
|
51
51
|
function range(len) {
|
|
52
52
|
return Array.from(Array(len).keys());
|