brepjs 20.12.8 → 20.12.10
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/2d.cjs +6 -6
- package/dist/2d.js +6 -6
- package/dist/{adjacencyFns-BfgFo-Rh.cjs → adjacencyFns-CxdCl5WP.cjs} +3 -3
- package/dist/{adjacencyFns-Bl109A3Z.js → adjacencyFns-D5HrKCrU.js} +3 -3
- package/dist/{blueprint-RqemOtg5.js → blueprint-BX9jLBWa.js} +5 -5
- package/dist/{blueprint-DTDSztfd.cjs → blueprint-D_T-AYNd.cjs} +5 -5
- package/dist/{blueprintFns-C7E5R89N.cjs → blueprintFns-COoax_Qd.cjs} +2 -2
- package/dist/{blueprintFns-B9_PhTr8.js → blueprintFns-DD_cM248.js} +2 -2
- package/dist/{blueprintSketcher-B15522Kr.js → blueprintSketcher-DtjZEmgc.js} +3 -3
- package/dist/{blueprintSketcher-Brj4lXjj.cjs → blueprintSketcher-wvZPUAlC.cjs} +3 -3
- package/dist/{boolean2D-_eiIiNw1.js → boolean2D-Bpy4N2Gn.js} +4 -4
- package/dist/{boolean2D-DZ8aJbI-.cjs → boolean2D-DX0exPxi.cjs} +4 -4
- package/dist/{booleanFns-cNfXGqMX.js → booleanFns-BfHFIGG2.js} +4 -4
- package/dist/{booleanFns-D5nQ1nWS.cjs → booleanFns-CJFWBMrz.cjs} +4 -4
- package/dist/brepjs.cjs +72 -55
- package/dist/brepjs.js +72 -55
- package/dist/{cameraFns-YhB7A_Zc.js → cameraFns-CQr0Z3FY.js} +3 -3
- package/dist/{cameraFns-6Er2lhp5.cjs → cameraFns-slop0dGo.cjs} +3 -3
- package/dist/core.cjs +2 -2
- package/dist/core.js +2 -2
- package/dist/{cornerFinder-D9Wx3DWu.cjs → cornerFinder-B-odGaqU.cjs} +1 -1
- package/dist/{cornerFinder-G1WkSkVl.js → cornerFinder-BGktSDIJ.js} +1 -1
- package/dist/{curveFns-B5_N-gMj.cjs → curveFns-B1ZGAua6.cjs} +1 -1
- package/dist/{curveFns-C4CqthJp.js → curveFns-DpAho4sY.js} +1 -1
- package/dist/{drawFns-UPbO2heB.cjs → drawFns-BaX0T4YH.cjs} +12 -12
- package/dist/{drawFns-DU5fewKl.js → drawFns-HPK4VIr4.js} +12 -12
- package/dist/{faceFns-BgRNa5vx.js → faceFns-DvnSVq5k.js} +2 -2
- package/dist/{faceFns-C4NOGZBg.cjs → faceFns-mca5oNNe.cjs} +2 -2
- package/dist/{healingFns-i5gV3BMG.cjs → healingFns-BY_IdHbC.cjs} +91 -22
- package/dist/{healingFns-BzOo0yyz.js → healingFns-DYtkECby.js} +85 -22
- package/dist/{helpers-DJQeDf_5.cjs → helpers-6DyPwHPE.cjs} +6 -6
- package/dist/{helpers-DPHQt2Kr.js → helpers-WdI_vPa4.js} +6 -6
- package/dist/{importFns-CwrJsNvg.js → importFns-D7KuHlJx.js} +5 -5
- package/dist/{importFns-BiRpt227.cjs → importFns-DN5oxh4I.cjs} +5 -5
- package/dist/io.cjs +2 -2
- package/dist/io.js +2 -2
- package/dist/kernel/interfaces/modifierOps.d.ts +12 -0
- package/dist/kernel/occtWasm/evolutionOps.d.ts +4 -3
- package/dist/kernel/occtWasm/helpers.d.ts +14 -3
- package/dist/kernel/occtWasm/ioOps.d.ts +13 -13
- package/dist/kernel/occtWasm/modifierOps.d.ts +13 -3
- package/dist/kernel/occtWasm/occtWasmAdapter.cjs +1 -1
- package/dist/kernel/occtWasm/occtWasmAdapter.d.ts +6 -1
- package/dist/kernel/occtWasm/occtWasmAdapter.js +1 -1
- package/dist/kernel/occtWasm/occtWasmTypes.d.ts +33 -0
- package/dist/{loftFns-lwzTh1fI.js → loftFns-DE21800M.js} +1 -1
- package/dist/{loftFns-DgkK4Kj_.cjs → loftFns-Udobz6tm.cjs} +1 -1
- package/dist/{measureFns-Q3K25IfN.js → measureFns-DmL9FRQC.js} +3 -3
- package/dist/{measureFns-D_RRjCZg.cjs → measureFns-JNQma34N.cjs} +3 -3
- package/dist/measurement.cjs +2 -2
- package/dist/measurement.js +2 -2
- package/dist/{meshFns-BGoJU6_P.js → meshFns-CqLLizwL.js} +4 -4
- package/dist/{meshFns-Djbb4PUC.cjs → meshFns-CsMwXvw3.cjs} +4 -4
- package/dist/{occtWasmAdapter-UcYZRi-w.cjs → occtWasmAdapter-DTEpwXuT.cjs} +316 -81
- package/dist/{occtWasmAdapter-BCCwaYkq.js → occtWasmAdapter-Dr70YU4m.js} +316 -81
- package/dist/operations.cjs +2 -2
- package/dist/operations.js +2 -2
- package/dist/{primitiveFns-CfSnex9P.cjs → primitiveFns-CE8IsnCc.cjs} +5 -5
- package/dist/{primitiveFns-D-aYcwt2.js → primitiveFns-DnzKWigX.js} +5 -5
- package/dist/{principalBoxFns-IY8FfPVj.cjs → principalBoxFns-D_SbLz4g.cjs} +3 -3
- package/dist/{principalBoxFns-Dcp9gg5e.js → principalBoxFns-wy3yRjqt.js} +3 -3
- package/dist/projection.cjs +1 -1
- package/dist/projection.js +1 -1
- package/dist/query.cjs +2 -2
- package/dist/query.js +2 -2
- package/dist/{refResolveFns-gZQ1o5XK.cjs → refResolveFns-Bi9CTJ3m.cjs} +6 -6
- package/dist/{refResolveFns-BPge7T5w.js → refResolveFns-Cd_CuhaX.js} +6 -6
- package/dist/{shapeFns-Bs92VrZh.cjs → shapeFns-DCiFtMCX.cjs} +2 -2
- package/dist/{shapeFns-TWdr4Dv4.js → shapeFns-pMt-Oz0f.js} +2 -2
- package/dist/shapeRef.cjs +1 -1
- package/dist/shapeRef.js +1 -1
- package/dist/{shapeTypes-DmThK_oa.cjs → shapeTypes-B9ACN7a8.cjs} +1 -1
- package/dist/{shapeTypes-CIH-8d_a.js → shapeTypes-Ccp9iVna.js} +1 -1
- package/dist/sketching.cjs +3 -3
- package/dist/sketching.js +3 -3
- package/dist/{solidBuilders-q_hwYsdo.js → solidBuilders-BltNQKqZ.js} +3 -3
- package/dist/{solidBuilders-DGskMugU.cjs → solidBuilders-DwqlsNW1.cjs} +3 -3
- package/dist/{surfaceBuilders-DeSLKg73.cjs → surfaceBuilders-CYuQfMQj.cjs} +3 -3
- package/dist/{surfaceBuilders-DXo4N7wQ.js → surfaceBuilders-CiNyRrC4.js} +3 -3
- package/dist/text.cjs +2 -2
- package/dist/text.js +2 -2
- package/dist/{textBlueprints-BYWZho_c.js → textBlueprints-CHXueg05.js} +8 -8
- package/dist/{textBlueprints-Dz6wNgve.cjs → textBlueprints-DiYY758O.cjs} +8 -8
- package/dist/{textMetrics-k_rGqib2.js → textMetrics-C0rVJZVh.js} +1 -1
- package/dist/{textMetrics-bKoFTj3m.cjs → textMetrics-DJIhwIPL.cjs} +1 -1
- package/dist/{threadFns-BeB8s0tA.js → threadFns-B9uxy9ud.js} +7 -7
- package/dist/{threadFns-CoGAFHHt.cjs → threadFns-ChWU9CVV.cjs} +7 -7
- package/dist/topology/apiTypes.d.ts +6 -2
- package/dist/topology/chamferAngleFns.d.ts +24 -0
- package/dist/topology.cjs +9 -9
- package/dist/topology.js +9 -9
- package/dist/{topologyQueryFns-Cp0yekBh.js → topologyQueryFns-D7j1fl0n.js} +1 -1
- package/dist/{topologyQueryFns-CXbCFaU2.cjs → topologyQueryFns-DEax1nqt.cjs} +1 -1
- package/dist/{validityTypes-DlrWkrSR.js → validityTypes-6AePqp-3.js} +1 -1
- package/dist/{validityTypes-m6eLRTYE.cjs → validityTypes-BolqrAZa.cjs} +1 -1
- package/package.json +2 -2
|
@@ -2299,16 +2299,56 @@ function multiplyMatrices4x4(a, b) {
|
|
|
2299
2299
|
for (let i = 0; i < 4; i++) for (let j = 0; j < 4; j++) for (let k = 0; k < 4; k++) result[i * 4 + j] = result[i * 4 + j] + a[i * 4 + k] * b[k * 4 + j];
|
|
2300
2300
|
return result;
|
|
2301
2301
|
}
|
|
2302
|
+
function resolveEdgeValues(edges, value) {
|
|
2303
|
+
const first = [];
|
|
2304
|
+
const second = [];
|
|
2305
|
+
for (const edge of edges) {
|
|
2306
|
+
const v = typeof value === "function" ? value(edge) : value;
|
|
2307
|
+
first.push(typeof v === "number" ? v : v[0]);
|
|
2308
|
+
second.push(typeof v === "number" ? v : v[1]);
|
|
2309
|
+
}
|
|
2310
|
+
return {
|
|
2311
|
+
first,
|
|
2312
|
+
second
|
|
2313
|
+
};
|
|
2314
|
+
}
|
|
2315
|
+
/** The value every edge takes on both sides, or `undefined` when they differ. */
|
|
2316
|
+
function uniformEdgeValue({ first, second }) {
|
|
2317
|
+
const [value] = first;
|
|
2318
|
+
if (value === void 0) return void 0;
|
|
2319
|
+
return first.every((v) => v === value) && second.every((v) => v === value) ? value : void 0;
|
|
2320
|
+
}
|
|
2302
2321
|
/**
|
|
2303
|
-
*
|
|
2304
|
-
*
|
|
2322
|
+
* Run a fillet or chamfer over `edges`, naming the edges it fails on. Edges
|
|
2323
|
+
* that all take one value go to `uniform`, the single-value entry point every
|
|
2324
|
+
* occt-wasm build has; otherwise `perEdge` gets each edge's pair as `first`
|
|
2325
|
+
* and `second`.
|
|
2305
2326
|
*/
|
|
2306
|
-
function
|
|
2307
|
-
|
|
2308
|
-
|
|
2309
|
-
|
|
2310
|
-
|
|
2311
|
-
|
|
2327
|
+
function runEdgeTreatment(Module, edges, value, uniform, perEdge) {
|
|
2328
|
+
const values = resolveEdgeValues(edges, value);
|
|
2329
|
+
const shared = uniformEdgeValue(values);
|
|
2330
|
+
const edgeVec = makeVecU32(Module, edges.map(unwrap));
|
|
2331
|
+
try {
|
|
2332
|
+
if (shared !== void 0) return reportingFaultyEdges(edges, () => uniform(edgeVec, shared));
|
|
2333
|
+
const first = makeVecDouble(Module, values.first);
|
|
2334
|
+
const second = makeVecDouble(Module, values.second);
|
|
2335
|
+
try {
|
|
2336
|
+
return reportingFaultyEdges(edges, () => perEdge(edgeVec, first, second));
|
|
2337
|
+
} finally {
|
|
2338
|
+
first.delete();
|
|
2339
|
+
second.delete();
|
|
2340
|
+
}
|
|
2341
|
+
} finally {
|
|
2342
|
+
edgeVec.delete();
|
|
2343
|
+
}
|
|
2344
|
+
}
|
|
2345
|
+
/** Each face's draft angle, in radians. */
|
|
2346
|
+
function draftAnglesRad(faces, angleDeg) {
|
|
2347
|
+
return faces.map((face) => (typeof angleDeg === "function" ? angleDeg(face) : angleDeg) * Math.PI / 180);
|
|
2348
|
+
}
|
|
2349
|
+
/** The peer range still admits older builds, which lack the per-edge and unit entry points. */
|
|
2350
|
+
function needsOcctWasm59(what) {
|
|
2351
|
+
return new UnsupportedKernelOperationError(`occt-wasm: ${what} requires occt-wasm >= 5.9.0`);
|
|
2312
2352
|
}
|
|
2313
2353
|
/**
|
|
2314
2354
|
* Rotate a shape from the kernel's default Z-axis to an arbitrary direction.
|
|
@@ -3754,31 +3794,66 @@ function surfaceCurvature(k, face, u, v) {
|
|
|
3754
3794
|
// src/kernel/occtWasm/modifierOps.ts
|
|
3755
3795
|
var HASH_UPPER_BOUND = 2147483647;
|
|
3756
3796
|
function fillet(k, Module, shape, edges, radius) {
|
|
3757
|
-
const
|
|
3758
|
-
|
|
3759
|
-
|
|
3760
|
-
return
|
|
3761
|
-
}
|
|
3762
|
-
vec.delete();
|
|
3763
|
-
}
|
|
3797
|
+
const id = unwrap(shape);
|
|
3798
|
+
return wrapResult(k, runEdgeTreatment(Module, edges, radius, (edgeVec, r) => k.fillet(id, edgeVec, r), (edgeVec, startRadii, endRadii) => {
|
|
3799
|
+
if (!k.filletRadii) throw needsOcctWasm59("per-edge or tapered fillet radii");
|
|
3800
|
+
return k.filletRadii(id, edgeVec, startRadii, endRadii);
|
|
3801
|
+
}));
|
|
3764
3802
|
}
|
|
3765
3803
|
function chamfer(k, Module, shape, edges, distance) {
|
|
3766
|
-
const
|
|
3767
|
-
const
|
|
3804
|
+
const id = unwrap(shape);
|
|
3805
|
+
const faceVec = makeVecU32(Module, []);
|
|
3768
3806
|
try {
|
|
3769
|
-
return wrapResult(k,
|
|
3807
|
+
return wrapResult(k, runEdgeTreatment(Module, edges, distance, (edgeVec, d) => k.chamfer(id, edgeVec, d), (edgeVec, distances1, distances2) => {
|
|
3808
|
+
if (!k.chamferDistances) throw needsOcctWasm59("per-edge or asymmetric chamfer distances");
|
|
3809
|
+
return k.chamferDistances(id, edgeVec, distances1, distances2, faceVec);
|
|
3810
|
+
}));
|
|
3770
3811
|
} finally {
|
|
3771
|
-
|
|
3812
|
+
faceVec.delete();
|
|
3772
3813
|
}
|
|
3773
3814
|
}
|
|
3774
|
-
|
|
3775
|
-
|
|
3815
|
+
/**
|
|
3816
|
+
* Chamfer edge i by `distances[i]` and `anglesDeg[i]`. Builds without the
|
|
3817
|
+
* per-edge entry point take only `shared`, the one value every edge has.
|
|
3818
|
+
*/
|
|
3819
|
+
function runChamferDistAngles(k, Module, shape, edges, distances, anglesDeg, shared) {
|
|
3820
|
+
const id = unwrap(shape);
|
|
3821
|
+
const edgeVec = makeVecU32(Module, edges.map(unwrap));
|
|
3776
3822
|
try {
|
|
3777
|
-
|
|
3823
|
+
if (!k.chamferDistAngles) {
|
|
3824
|
+
if (!shared) throw needsOcctWasm59("per-edge distance-angle chamfers");
|
|
3825
|
+
return wrapResult(k, k.chamferDistAngle(id, edgeVec, shared.distance, shared.angleDeg));
|
|
3826
|
+
}
|
|
3827
|
+
const chamferDistAngles = k.chamferDistAngles.bind(k);
|
|
3828
|
+
const distanceVec = makeVecDouble(Module, distances);
|
|
3829
|
+
const angleVec = makeVecDouble(Module, anglesDeg);
|
|
3830
|
+
const faceVec = makeVecU32(Module, []);
|
|
3831
|
+
try {
|
|
3832
|
+
return wrapResult(k, reportingFaultyEdges(edges, () => chamferDistAngles(id, edgeVec, distanceVec, angleVec, faceVec)));
|
|
3833
|
+
} finally {
|
|
3834
|
+
distanceVec.delete();
|
|
3835
|
+
angleVec.delete();
|
|
3836
|
+
faceVec.delete();
|
|
3837
|
+
}
|
|
3778
3838
|
} finally {
|
|
3779
|
-
|
|
3839
|
+
edgeVec.delete();
|
|
3780
3840
|
}
|
|
3781
3841
|
}
|
|
3842
|
+
function chamferDistAngle(k, Module, shape, edges, distance, angleDeg) {
|
|
3843
|
+
return runChamferDistAngles(k, Module, shape, edges, Array(edges.length).fill(distance), Array(edges.length).fill(angleDeg), {
|
|
3844
|
+
distance,
|
|
3845
|
+
angleDeg
|
|
3846
|
+
});
|
|
3847
|
+
}
|
|
3848
|
+
/** The distance and angle every edge takes, or `undefined` when they differ. */
|
|
3849
|
+
function sharedDistAngle(entries) {
|
|
3850
|
+
const [first] = entries;
|
|
3851
|
+
if (first === void 0) return void 0;
|
|
3852
|
+
return entries.every((e) => e.distance === first.distance && e.angleDeg === first.angleDeg) ? first : void 0;
|
|
3853
|
+
}
|
|
3854
|
+
function chamferDistAngles(k, Module, shape, entries) {
|
|
3855
|
+
return runChamferDistAngles(k, Module, shape, entries.map((e) => e.edge), entries.map((e) => e.distance), entries.map((e) => e.angleDeg), sharedDistAngle(entries));
|
|
3856
|
+
}
|
|
3782
3857
|
function shell(k, Module, shape, faces, thickness, tolerance) {
|
|
3783
3858
|
const vec = makeVecU32(Module, faces.map(unwrap));
|
|
3784
3859
|
try {
|
|
@@ -3858,13 +3933,30 @@ function filletVariable(k, shape, spec) {
|
|
|
3858
3933
|
}
|
|
3859
3934
|
throw new UnsupportedKernelOperationError("occt-wasm: filletVariable: unrecognized spec");
|
|
3860
3935
|
}
|
|
3861
|
-
|
|
3862
|
-
|
|
3863
|
-
|
|
3864
|
-
|
|
3865
|
-
|
|
3936
|
+
/**
|
|
3937
|
+
* Before 5.9 occt-wasm drafts one face per call about the XY plane through the
|
|
3938
|
+
* origin. That is the caller's plane (through `neutralPlane`, normal to the
|
|
3939
|
+
* pull) only for a pull along Z and a point at z = 0.
|
|
3940
|
+
*/
|
|
3941
|
+
function legacyDraft(k, shape, faces, pullDirection, neutralPlane, anglesRad) {
|
|
3942
|
+
const [face] = faces;
|
|
3943
|
+
const [angle] = anglesRad;
|
|
3944
|
+
const [dx, dy, dz] = pullDirection;
|
|
3945
|
+
if (!(faces.length === 1 && dx === 0 && dy === 0 && neutralPlane[2] === 0) || face === void 0 || angle === void 0) throw needsOcctWasm59("drafting several faces, or about a neutral plane off z = 0,");
|
|
3946
|
+
return wrapResult(k, k.draft(unwrap(shape), unwrap(face), angle, dx, dy, dz));
|
|
3947
|
+
}
|
|
3948
|
+
/** Draft every face in one operation about the plane through `neutralPlane` normal to the pull. */
|
|
3949
|
+
function draft(k, Module, shape, faces, pullDirection, neutralPlane, angleDeg) {
|
|
3950
|
+
const anglesRad = draftAnglesRad(faces, angleDeg);
|
|
3951
|
+
if (!k.draftFaces) return legacyDraft(k, shape, faces, pullDirection, neutralPlane, anglesRad);
|
|
3952
|
+
const faceVec = makeVecU32(Module, faces.map(unwrap));
|
|
3953
|
+
const angleVec = makeVecDouble(Module, anglesRad);
|
|
3954
|
+
try {
|
|
3955
|
+
return wrapResult(k, k.draftFaces(unwrap(shape), faceVec, angleVec, ...pullDirection, ...neutralPlane, ...pullDirection));
|
|
3956
|
+
} finally {
|
|
3957
|
+
faceVec.delete();
|
|
3958
|
+
angleVec.delete();
|
|
3866
3959
|
}
|
|
3867
|
-
return wrapResult(k, currentId);
|
|
3868
3960
|
}
|
|
3869
3961
|
function defeature(k, Module, shape, faces) {
|
|
3870
3962
|
const vec = makeVecU32(Module, faces.map(unwrap));
|
|
@@ -4480,10 +4572,85 @@ function buildGltfManifest(vCount, nCount, iCount, posBytes, nrmBytes, idxBytes,
|
|
|
4480
4572
|
]
|
|
4481
4573
|
};
|
|
4482
4574
|
}
|
|
4575
|
+
var MM_PER_UNIT = {
|
|
4576
|
+
mm: 1,
|
|
4577
|
+
millimeter: 1,
|
|
4578
|
+
millimetre: 1,
|
|
4579
|
+
cm: 10,
|
|
4580
|
+
centimeter: 10,
|
|
4581
|
+
centimetre: 10,
|
|
4582
|
+
m: 1e3,
|
|
4583
|
+
meter: 1e3,
|
|
4584
|
+
metre: 1e3,
|
|
4585
|
+
km: 1e6,
|
|
4586
|
+
kilometer: 1e6,
|
|
4587
|
+
kilometre: 1e6,
|
|
4588
|
+
in: 25.4,
|
|
4589
|
+
inch: 25.4,
|
|
4590
|
+
ft: 304.8,
|
|
4591
|
+
foot: 304.8,
|
|
4592
|
+
feet: 304.8,
|
|
4593
|
+
mi: 1609344,
|
|
4594
|
+
mile: 1609344,
|
|
4595
|
+
mil: .0254,
|
|
4596
|
+
thou: .0254,
|
|
4597
|
+
um: .001,
|
|
4598
|
+
micron: .001,
|
|
4599
|
+
micrometer: .001,
|
|
4600
|
+
micrometre: .001,
|
|
4601
|
+
uin: 254e-7,
|
|
4602
|
+
microinch: 254e-7
|
|
4603
|
+
};
|
|
4604
|
+
function mmPerUnit(unit) {
|
|
4605
|
+
const mm = MM_PER_UNIT[unit.toLowerCase()];
|
|
4606
|
+
if (mm === void 0) throw new Error(`occt-wasm: unknown STEP length unit '${unit}'`);
|
|
4607
|
+
return mm;
|
|
4608
|
+
}
|
|
4609
|
+
/**
|
|
4610
|
+
* brepjs writes lengths in `unit` and reads the shapes as `modelUnit`, which
|
|
4611
|
+
* defaults to `unit` (so `unit` alone relabels and does not scale). occt-wasm
|
|
4612
|
+
* reads shapes as millimeters and scales them into the unit written, so a
|
|
4613
|
+
* model in another unit is scaled to millimeters first.
|
|
4614
|
+
*/
|
|
4615
|
+
function resolveStepUnits(options) {
|
|
4616
|
+
const write = options?.unit ?? options?.modelUnit ?? "mm";
|
|
4617
|
+
return {
|
|
4618
|
+
write,
|
|
4619
|
+
modelScale: mmPerUnit(options?.modelUnit ?? write)
|
|
4620
|
+
};
|
|
4621
|
+
}
|
|
4622
|
+
/**
|
|
4623
|
+
* The writer for `units`: the 5.9 unit-aware one, else the millimeter-only
|
|
4624
|
+
* one when the file is in millimeters anyway.
|
|
4625
|
+
*/
|
|
4626
|
+
function stepWriter(withUnit, inMillimeters, units) {
|
|
4627
|
+
if (withUnit) return (id) => withUnit(id, units.write);
|
|
4628
|
+
if (mmPerUnit(units.write) === 1) return inMillimeters;
|
|
4629
|
+
throw needsOcctWasm59(`STEP export in '${units.write}'`);
|
|
4630
|
+
}
|
|
4631
|
+
/** Run `use` on `id` scaled by `factor` about the origin, releasing the scaled copy. */
|
|
4632
|
+
function withScaled(k, id, factor, use) {
|
|
4633
|
+
if (factor === 1) return use(id);
|
|
4634
|
+
const scaled = k.scale(id, 0, 0, 0, factor);
|
|
4635
|
+
try {
|
|
4636
|
+
return use(scaled);
|
|
4637
|
+
} finally {
|
|
4638
|
+
k.release(scaled);
|
|
4639
|
+
}
|
|
4640
|
+
}
|
|
4641
|
+
/** One STEP file holding every shape (as a compound when there are several). */
|
|
4642
|
+
function writeStepShapes(k, makeCompound, shapes, units) {
|
|
4643
|
+
const write = stepWriter(k.exportStepWithUnit?.bind(k), (id) => k.exportStep(id), units);
|
|
4644
|
+
if (shapes.length === 1) return withScaled(k, unwrap(shapes[0]), units.modelScale, write);
|
|
4645
|
+
const compoundId = unwrap(makeCompound(shapes));
|
|
4646
|
+
try {
|
|
4647
|
+
return withScaled(k, compoundId, units.modelScale, write);
|
|
4648
|
+
} finally {
|
|
4649
|
+
k.release(compoundId);
|
|
4650
|
+
}
|
|
4651
|
+
}
|
|
4483
4652
|
function exportSTEP(k, makeCompound, shapes) {
|
|
4484
|
-
|
|
4485
|
-
const compound = makeCompound(shapes);
|
|
4486
|
-
return k.exportStep(unwrap(compound));
|
|
4653
|
+
return writeStepShapes(k, makeCompound, shapes, resolveStepUnits(void 0));
|
|
4487
4654
|
}
|
|
4488
4655
|
function exportSTL(mesh, shape, binary, tolerance = DEFAULT_STL_TOLERANCE, angularTolerance = DEFAULT_STL_ANGULAR_TOLERANCE) {
|
|
4489
4656
|
const { vertices, triangles } = mesh(shape, {
|
|
@@ -4518,14 +4685,9 @@ function importIGES(k, data) {
|
|
|
4518
4685
|
if (!importIges) throw new UnsupportedKernelOperationError("occt-wasm: importIGES is unsupported");
|
|
4519
4686
|
return [wrapResult(k, importIges(typeof data === "string" ? data : new TextDecoder().decode(data)))];
|
|
4520
4687
|
}
|
|
4521
|
-
function exportSTEPAssembly(k,
|
|
4688
|
+
function exportSTEPAssembly(k, parts, options) {
|
|
4522
4689
|
if (parts.length === 0) return "";
|
|
4523
|
-
|
|
4524
|
-
try {
|
|
4525
|
-
return writeXCAFToSTEP(k, doc);
|
|
4526
|
-
} finally {
|
|
4527
|
-
doc.delete();
|
|
4528
|
-
}
|
|
4690
|
+
return writeXcafParts(k, parts, resolveStepUnits(options));
|
|
4529
4691
|
}
|
|
4530
4692
|
function exportGLB(mesh, shape, tolerance) {
|
|
4531
4693
|
const result = mesh(shape, {
|
|
@@ -4653,9 +4815,9 @@ function toBREP(k, shape) {
|
|
|
4653
4815
|
function fromBREP(k, data) {
|
|
4654
4816
|
return wrapResult(k, k.fromBREP(data));
|
|
4655
4817
|
}
|
|
4656
|
-
function
|
|
4818
|
+
function addXcafParts(k, parts) {
|
|
4657
4819
|
const docId = k.xcafNewDocument();
|
|
4658
|
-
for (const entry of
|
|
4820
|
+
for (const entry of parts) {
|
|
4659
4821
|
const labelId = k.xcafAddShape(docId, unwrap(entry.shape));
|
|
4660
4822
|
if (entry.name) k.xcafSetName(docId, labelId, entry.name);
|
|
4661
4823
|
if (entry.color) {
|
|
@@ -4663,37 +4825,94 @@ function createXCAFDocument(k, _Module, shapes) {
|
|
|
4663
4825
|
k.xcafSetColor(docId, labelId, r / 255, g / 255, b / 255);
|
|
4664
4826
|
}
|
|
4665
4827
|
}
|
|
4666
|
-
return
|
|
4828
|
+
return docId;
|
|
4667
4829
|
}
|
|
4668
|
-
function
|
|
4669
|
-
const docId = unwrap(doc);
|
|
4830
|
+
function writeXcafDoc(k, docId, units) {
|
|
4670
4831
|
const roots = k.xcafGetRootLabels(docId);
|
|
4671
|
-
|
|
4832
|
+
try {
|
|
4833
|
+
if (roots.size() === 0) return "";
|
|
4834
|
+
} finally {
|
|
4835
|
+
roots.delete();
|
|
4836
|
+
}
|
|
4837
|
+
return stepWriter(k.xcafExportSTEPWithUnit?.bind(k), (id) => k.xcafExportSTEP(id), units)(docId);
|
|
4838
|
+
}
|
|
4839
|
+
/** Write `parts` as one XCAF STEP file, scaling each into millimeters first if needed. */
|
|
4840
|
+
function writeXcafParts(k, parts, units) {
|
|
4841
|
+
const scaled = [];
|
|
4842
|
+
try {
|
|
4843
|
+
const docId = addXcafParts(k, parts.map((part) => {
|
|
4844
|
+
if (units.modelScale === 1) return part;
|
|
4845
|
+
const id = k.scale(unwrap(part.shape), 0, 0, 0, units.modelScale);
|
|
4846
|
+
scaled.push(id);
|
|
4847
|
+
return {
|
|
4848
|
+
...part,
|
|
4849
|
+
shape: id
|
|
4850
|
+
};
|
|
4851
|
+
}));
|
|
4672
4852
|
try {
|
|
4673
|
-
return
|
|
4853
|
+
return writeXcafDoc(k, docId, units);
|
|
4674
4854
|
} finally {
|
|
4675
|
-
|
|
4855
|
+
k.xcafClose(docId);
|
|
4676
4856
|
}
|
|
4677
|
-
}
|
|
4857
|
+
} finally {
|
|
4858
|
+
for (const id of scaled) k.release(id);
|
|
4859
|
+
}
|
|
4860
|
+
}
|
|
4861
|
+
function createXCAFDocument(k, makeCompound, shapes) {
|
|
4862
|
+
const retainedId = unwrap(makeCompound(shapes.map((s) => s.shape)));
|
|
4678
4863
|
try {
|
|
4679
|
-
return
|
|
4864
|
+
return {
|
|
4865
|
+
...handle("compound", addXcafParts(k, shapes)),
|
|
4866
|
+
retainedId,
|
|
4867
|
+
labels: shapes.map(({ name, color }) => ({
|
|
4868
|
+
name,
|
|
4869
|
+
color
|
|
4870
|
+
}))
|
|
4871
|
+
};
|
|
4872
|
+
} catch (e) {
|
|
4873
|
+
k.release(retainedId);
|
|
4874
|
+
throw e;
|
|
4875
|
+
}
|
|
4876
|
+
}
|
|
4877
|
+
function writeXCAFToSTEP(k, doc, options) {
|
|
4878
|
+
const docId = unwrap(doc);
|
|
4879
|
+
const { retainedId, labels } = doc;
|
|
4880
|
+
try {
|
|
4881
|
+
const units = resolveStepUnits(options);
|
|
4882
|
+
if (units.modelScale === 1) return writeXcafDoc(k, docId, units);
|
|
4883
|
+
if (retainedId === void 0 || labels === void 0) throw new Error("occt-wasm: this XCAF document does not record its parts");
|
|
4884
|
+
return writeScaledXcafParts(k, retainedId, labels, units);
|
|
4680
4885
|
} finally {
|
|
4681
4886
|
k.xcafClose(docId);
|
|
4887
|
+
if (retainedId !== void 0) k.release(retainedId);
|
|
4682
4888
|
}
|
|
4683
4889
|
}
|
|
4684
|
-
|
|
4685
|
-
|
|
4686
|
-
const
|
|
4687
|
-
|
|
4688
|
-
|
|
4689
|
-
color: s.color
|
|
4690
|
-
})));
|
|
4890
|
+
/** Scale the retained compound once and write its children as the labeled parts. */
|
|
4891
|
+
function writeScaledXcafParts(k, retainedId, labels, units) {
|
|
4892
|
+
const scaledId = k.scale(retainedId, 0, 0, 0, units.modelScale);
|
|
4893
|
+
const children = k.iterShapes(scaledId);
|
|
4894
|
+
const childIds = [];
|
|
4691
4895
|
try {
|
|
4692
|
-
|
|
4896
|
+
for (let i = 0; i < children.size(); i++) childIds.push(children.get(i));
|
|
4897
|
+
return writeXcafParts(k, labels.map((label, i) => ({
|
|
4898
|
+
...label,
|
|
4899
|
+
shape: handle("compound", childIds[i] ?? 0)
|
|
4900
|
+
})), {
|
|
4901
|
+
...units,
|
|
4902
|
+
modelScale: 1
|
|
4903
|
+
});
|
|
4693
4904
|
} finally {
|
|
4694
|
-
|
|
4905
|
+
children.delete();
|
|
4906
|
+
for (const id of childIds) k.release(id);
|
|
4907
|
+
k.release(scaledId);
|
|
4695
4908
|
}
|
|
4696
4909
|
}
|
|
4910
|
+
function exportSTEPConfigured(k, makeCompound, shapes, options) {
|
|
4911
|
+
if (shapes.length === 0) return "";
|
|
4912
|
+
const units = resolveStepUnits(options);
|
|
4913
|
+
if (!shapes.some((s) => s.name || s.color)) return writeStepShapes(k, makeCompound, shapes.map((s) => s.shape), units);
|
|
4914
|
+
return writeXcafParts(k, shapes, units);
|
|
4915
|
+
}
|
|
4697
4916
|
// src/kernel/occtWasm/constructionOps.ts
|
|
4698
4917
|
function makeVertex(k, x, y, z) {
|
|
4699
4918
|
return handle("vertex", k.makeVertex(x, y, z));
|
|
@@ -5926,32 +6145,36 @@ function cutAllWithHistory(k, Module, shape, tools, inputFaceHashes, hashUpperBo
|
|
|
5926
6145
|
return withSolidIds(k, [shape], (argIds) => withSolidIds(k, tools, (toolIds) => viaBooleanOp(k, Module, "cut", argIds, toolIds, inputFaceHashes, hashUpperBound, options)));
|
|
5927
6146
|
}
|
|
5928
6147
|
function filletWithHistory(k, Module, shape, edges, radius, inputFaceHashes, hashUpperBound) {
|
|
5929
|
-
const
|
|
5930
|
-
const edgeVec = makeVecU32(Module, edges.map(unwrap));
|
|
6148
|
+
const shapeId = unwrap(shape);
|
|
5931
6149
|
const hashVec = makeVecInt(Module, inputFaceHashes);
|
|
5932
6150
|
try {
|
|
5933
|
-
const { id, evolution } = parseEvolution(
|
|
6151
|
+
const { id, evolution } = parseEvolution(runEdgeTreatment(Module, edges, radius, (edgeVec, r) => k.filletWithHistory(shapeId, edgeVec, r, hashVec, hashUpperBound), (edgeVec, startRadii, endRadii) => {
|
|
6152
|
+
if (!k.filletRadiiWithHistory) throw needsOcctWasm59("per-edge or tapered fillet radii");
|
|
6153
|
+
return k.filletRadiiWithHistory(shapeId, edgeVec, startRadii, endRadii, hashVec, hashUpperBound);
|
|
6154
|
+
}));
|
|
5934
6155
|
return {
|
|
5935
6156
|
shape: wrapResult(k, id),
|
|
5936
6157
|
evolution
|
|
5937
6158
|
};
|
|
5938
6159
|
} finally {
|
|
5939
|
-
edgeVec.delete();
|
|
5940
6160
|
hashVec.delete();
|
|
5941
6161
|
}
|
|
5942
6162
|
}
|
|
5943
6163
|
function chamferWithHistory(k, Module, shape, edges, distance, inputFaceHashes, hashUpperBound) {
|
|
5944
|
-
const
|
|
5945
|
-
const
|
|
6164
|
+
const shapeId = unwrap(shape);
|
|
6165
|
+
const faceVec = makeVecU32(Module, []);
|
|
5946
6166
|
const hashVec = makeVecInt(Module, inputFaceHashes);
|
|
5947
6167
|
try {
|
|
5948
|
-
const { id, evolution } = parseEvolution(
|
|
6168
|
+
const { id, evolution } = parseEvolution(runEdgeTreatment(Module, edges, distance, (edgeVec, d) => k.chamferWithHistory(shapeId, edgeVec, d, hashVec, hashUpperBound), (edgeVec, distances1, distances2) => {
|
|
6169
|
+
if (!k.chamferDistancesWithHistory) throw needsOcctWasm59("per-edge or asymmetric chamfer distances");
|
|
6170
|
+
return k.chamferDistancesWithHistory(shapeId, edgeVec, distances1, distances2, faceVec, hashVec, hashUpperBound);
|
|
6171
|
+
}));
|
|
5949
6172
|
return {
|
|
5950
6173
|
shape: wrapResult(k, id),
|
|
5951
6174
|
evolution
|
|
5952
6175
|
};
|
|
5953
6176
|
} finally {
|
|
5954
|
-
|
|
6177
|
+
faceVec.delete();
|
|
5955
6178
|
hashVec.delete();
|
|
5956
6179
|
}
|
|
5957
6180
|
}
|
|
@@ -5993,21 +6216,30 @@ function offsetWithHistory(k, Module, shape, distance, inputFaceHashes, hashUppe
|
|
|
5993
6216
|
hashVec.delete();
|
|
5994
6217
|
}
|
|
5995
6218
|
}
|
|
5996
|
-
function draftWithHistory(k, shape, faces, pullDirection, angleDeg) {
|
|
5997
|
-
|
|
5998
|
-
|
|
5999
|
-
for (const face of faces) {
|
|
6000
|
-
const angleRad = (typeof angleDeg === "number" ? angleDeg : angleDeg(face)) * Math.PI / 180;
|
|
6001
|
-
currentId = k.draft(currentId, unwrap(face), angleRad, dx, dy, dz);
|
|
6002
|
-
}
|
|
6003
|
-
return {
|
|
6004
|
-
shape: wrapResult(k, currentId),
|
|
6219
|
+
function draftWithHistory(k, Module, shape, faces, pullDirection, neutralPlane, angleDeg, inputFaceHashes, hashUpperBound) {
|
|
6220
|
+
if (!k.draftFacesWithHistory) return {
|
|
6221
|
+
shape: draft(k, Module, shape, faces, pullDirection, neutralPlane, angleDeg),
|
|
6005
6222
|
evolution: {
|
|
6006
6223
|
modified: /* @__PURE__ */ new Map(),
|
|
6007
6224
|
generated: /* @__PURE__ */ new Map(),
|
|
6008
6225
|
deleted: /* @__PURE__ */ new Set()
|
|
6009
6226
|
}
|
|
6010
6227
|
};
|
|
6228
|
+
const anglesRad = draftAnglesRad(faces, angleDeg);
|
|
6229
|
+
const faceVec = makeVecU32(Module, faces.map(unwrap));
|
|
6230
|
+
const angleVec = makeVecDouble(Module, anglesRad);
|
|
6231
|
+
const hashVec = makeVecInt(Module, inputFaceHashes);
|
|
6232
|
+
try {
|
|
6233
|
+
const { id, evolution } = parseEvolution(k.draftFacesWithHistory(unwrap(shape), faceVec, angleVec, ...pullDirection, ...neutralPlane, ...pullDirection, hashVec, hashUpperBound));
|
|
6234
|
+
return {
|
|
6235
|
+
shape: wrapResult(k, id),
|
|
6236
|
+
evolution
|
|
6237
|
+
};
|
|
6238
|
+
} finally {
|
|
6239
|
+
faceVec.delete();
|
|
6240
|
+
angleVec.delete();
|
|
6241
|
+
hashVec.delete();
|
|
6242
|
+
}
|
|
6011
6243
|
}
|
|
6012
6244
|
function applyComposedTransformWithHistory(transformFn, iterShapesFn, hashCodeFn, shape, transformHandle, inputFaceHashes, hashUpperBound) {
|
|
6013
6245
|
const result = transformFn(shape, transformHandle);
|
|
@@ -6356,6 +6588,9 @@ var OcctWasmAdapter = class OcctWasmAdapter {
|
|
|
6356
6588
|
chamferDistAngle(shape, edges, distance, angleDeg) {
|
|
6357
6589
|
return chamferDistAngle(this.k, this.Module, shape, edges, distance, angleDeg);
|
|
6358
6590
|
}
|
|
6591
|
+
chamferDistAngles(shape, edges) {
|
|
6592
|
+
return chamferDistAngles(this.k, this.Module, shape, edges);
|
|
6593
|
+
}
|
|
6359
6594
|
shell(shape, faces, thickness, tolerance) {
|
|
6360
6595
|
return shell(this.k, this.Module, shape, faces, thickness, tolerance);
|
|
6361
6596
|
}
|
|
@@ -6369,7 +6604,7 @@ var OcctWasmAdapter = class OcctWasmAdapter {
|
|
|
6369
6604
|
return filletVariable(this.k, shape, spec);
|
|
6370
6605
|
}
|
|
6371
6606
|
draft(shape, faces, pullDirection, neutralPlane, angleDeg) {
|
|
6372
|
-
return draft(this.k, shape, faces, pullDirection, neutralPlane, angleDeg);
|
|
6607
|
+
return draft(this.k, this.Module, shape, faces, pullDirection, neutralPlane, angleDeg);
|
|
6373
6608
|
}
|
|
6374
6609
|
defeature(shape, faces) {
|
|
6375
6610
|
return defeature(this.k, this.Module, shape, faces);
|
|
@@ -6461,8 +6696,8 @@ var OcctWasmAdapter = class OcctWasmAdapter {
|
|
|
6461
6696
|
offsetWithHistory(shape, distance, inputFaceHashes, hashUpperBound, tolerance) {
|
|
6462
6697
|
return offsetWithHistory(this.k, this.Module, shape, distance, inputFaceHashes, hashUpperBound, tolerance);
|
|
6463
6698
|
}
|
|
6464
|
-
draftWithHistory(shape, faces, pullDirection,
|
|
6465
|
-
return draftWithHistory(this.k, shape, faces, pullDirection, angleDeg);
|
|
6699
|
+
draftWithHistory(shape, faces, pullDirection, neutralPlane, angleDeg, inputFaceHashes, hashUpperBound) {
|
|
6700
|
+
return draftWithHistory(this.k, this.Module, shape, faces, pullDirection, neutralPlane, angleDeg, inputFaceHashes, hashUpperBound);
|
|
6466
6701
|
}
|
|
6467
6702
|
applyComposedTransformWithHistory(shape, transformHandle, inputFaceHashes, hashUpperBound) {
|
|
6468
6703
|
return applyComposedTransformWithHistory((s, t) => this.transform(s, t), (s, t) => this.iterShapes(s, t), (s, ub) => this.hashCode(s, ub), shape, transformHandle, inputFaceHashes, hashUpperBound);
|
|
@@ -6498,7 +6733,7 @@ var OcctWasmAdapter = class OcctWasmAdapter {
|
|
|
6498
6733
|
return importIGES(this.k, data);
|
|
6499
6734
|
}
|
|
6500
6735
|
exportSTEPAssembly(parts, options) {
|
|
6501
|
-
return exportSTEPAssembly(this.k,
|
|
6736
|
+
return exportSTEPAssembly(this.k, parts, options);
|
|
6502
6737
|
}
|
|
6503
6738
|
export3MF(_shape, _tolerance) {
|
|
6504
6739
|
throw new Error("export3MF is only available with the brepkit kernel");
|
|
@@ -6528,13 +6763,13 @@ var OcctWasmAdapter = class OcctWasmAdapter {
|
|
|
6528
6763
|
return fromBREP(this.k, data);
|
|
6529
6764
|
}
|
|
6530
6765
|
createXCAFDocument(shapes) {
|
|
6531
|
-
return createXCAFDocument(this.k, this.
|
|
6766
|
+
return createXCAFDocument(this.k, this.makeCompound.bind(this), shapes);
|
|
6532
6767
|
}
|
|
6533
6768
|
writeXCAFToSTEP(doc, options) {
|
|
6534
6769
|
return writeXCAFToSTEP(this.k, doc, options);
|
|
6535
6770
|
}
|
|
6536
6771
|
exportSTEPConfigured(shapes, options) {
|
|
6537
|
-
return exportSTEPConfigured(this.k, this.
|
|
6772
|
+
return exportSTEPConfigured(this.k, this.makeCompound.bind(this), shapes, options);
|
|
6538
6773
|
}
|
|
6539
6774
|
volume(shape) {
|
|
6540
6775
|
return volume(this.k, shape);
|
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-ChWU9CVV.cjs");
|
|
3
|
+
const require_loftFns = require("./loftFns-Udobz6tm.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 walkAssembly, C as cylindricalJoint, D as planarJoint, E as mechanismDOF, F as countNodes, H as circularPattern, I as createAssemblyNode, L as findNode, M as sphericalJoint, N as addChild, O as prismaticJoint, P as collectShapes, R as removeChild, S as addJoint, T as jointTransform, U as gridPattern, V as exportAssemblySTEP, W as linearPattern, 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, 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 updateNode } from "./threadFns-
|
|
2
|
-
import { c as twistExtrude, o as supportExtrude, r as complexExtrude, s as sweep } from "./loftFns-
|
|
1
|
+
import { A as setJointValue, B as walkAssembly, C as cylindricalJoint, D as planarJoint, E as mechanismDOF, F as countNodes, H as circularPattern, I as createAssemblyNode, L as findNode, M as sphericalJoint, N as addChild, O as prismaticJoint, P as collectShapes, R as removeChild, S as addJoint, T as jointTransform, U as gridPattern, V as exportAssemblySTEP, W as linearPattern, 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, 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 updateNode } from "./threadFns-B9uxy9ud.js";
|
|
2
|
+
import { c as twistExtrude, o as supportExtrude, r as complexExtrude, s as sweep } from "./loftFns-DE21800M.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 };
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
const require_shapeTypes = require("./shapeTypes-
|
|
1
|
+
const require_shapeTypes = require("./shapeTypes-B9ACN7a8.cjs");
|
|
2
2
|
const require_errors = require("./errors-O_blYTWT.cjs");
|
|
3
|
-
const require_validityTypes = require("./validityTypes-
|
|
3
|
+
const require_validityTypes = require("./validityTypes-BolqrAZa.cjs");
|
|
4
4
|
const require_constants = require("./constants-oee0S_x6.cjs");
|
|
5
5
|
const require_vecOps = require("./vecOps-CrGEPPQM.cjs");
|
|
6
|
-
const require_solidBuilders = require("./solidBuilders-
|
|
7
|
-
const require_booleanFns = require("./booleanFns-
|
|
8
|
-
const require_surfaceBuilders = require("./surfaceBuilders-
|
|
6
|
+
const require_solidBuilders = require("./solidBuilders-DwqlsNW1.cjs");
|
|
7
|
+
const require_booleanFns = require("./booleanFns-CJFWBMrz.cjs");
|
|
8
|
+
const require_surfaceBuilders = require("./surfaceBuilders-CYuQfMQj.cjs");
|
|
9
9
|
// src/topology/transformFns.ts
|
|
10
10
|
/**
|
|
11
11
|
* Immutable shape transforms — translate, rotate, scale, mirror, applyMatrix.
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import { E as GeometryCleanupError, G as _usingCtx, d as createSolid, n as castResultShape, q as getKernel } from "./shapeTypes-
|
|
1
|
+
import { E as GeometryCleanupError, G as _usingCtx, d as createSolid, n as castResultShape, q as getKernel } from "./shapeTypes-Ccp9iVna.js";
|
|
2
2
|
import { E as ok, d as validationError, g as err, m as andThen, t as BrepErrorCode } from "./errors-BTccWbtE.js";
|
|
3
|
-
import { n as isClosedWire } from "./validityTypes-
|
|
3
|
+
import { n as isClosedWire } from "./validityTypes-6AePqp-3.js";
|
|
4
4
|
import { n as HASH_CODE_MAX, t as DEG2RAD } from "./constants-iraOnb2p.js";
|
|
5
5
|
import { d as vecNormalize, h as vecScale } from "./vecOps-S-m9H_fe.js";
|
|
6
|
-
import { a as makeOffset, c as makeTorus, i as makeEllipsoid, l as makeVertex, n as makeCone, o as makeSolid, r as makeCylinder, s as makeSphere, t as makeCompound, u as weldShellsAndFaces } from "./solidBuilders-
|
|
7
|
-
import { d as collectInputFaceHashes, f as hasAnyMetadata, h as propagateMetadataThroughRelocation, m as propagateMetadataByHash, p as propagateAllMetadata } from "./booleanFns-
|
|
8
|
-
import { _ as makeThreePointArc, a as makeNonPlanarFace, c as makeBSplineApproximation, d as makeCircle, f as makeEllipse, g as makeTangentArc, h as makeLine, i as makeNewFaceWithinFace, m as makeHelix, o as makePolygon, p as makeEllipseArc, r as makeFace, s as assembleWire, t as addHolesInFace, u as makeBezierCurve } from "./surfaceBuilders-
|
|
6
|
+
import { a as makeOffset, c as makeTorus, i as makeEllipsoid, l as makeVertex, n as makeCone, o as makeSolid, r as makeCylinder, s as makeSphere, t as makeCompound, u as weldShellsAndFaces } from "./solidBuilders-BltNQKqZ.js";
|
|
7
|
+
import { d as collectInputFaceHashes, f as hasAnyMetadata, h as propagateMetadataThroughRelocation, m as propagateMetadataByHash, p as propagateAllMetadata } from "./booleanFns-BfHFIGG2.js";
|
|
8
|
+
import { _ as makeThreePointArc, a as makeNonPlanarFace, c as makeBSplineApproximation, d as makeCircle, f as makeEllipse, g as makeTangentArc, h as makeLine, i as makeNewFaceWithinFace, m as makeHelix, o as makePolygon, p as makeEllipseArc, r as makeFace, s as assembleWire, t as addHolesInFace, u as makeBezierCurve } from "./surfaceBuilders-CiNyRrC4.js";
|
|
9
9
|
// src/topology/transformFns.ts
|
|
10
10
|
/**
|
|
11
11
|
* Immutable shape transforms — translate, rotate, scale, mirror, applyMatrix.
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
const require_shapeTypes = require("./shapeTypes-
|
|
1
|
+
const require_shapeTypes = require("./shapeTypes-B9ACN7a8.cjs");
|
|
2
2
|
const require_bug = require("./bug-CBcpIPuf.cjs");
|
|
3
3
|
const require_errors = require("./errors-O_blYTWT.cjs");
|
|
4
|
-
const require_topologyQueryFns = require("./topologyQueryFns-
|
|
4
|
+
const require_topologyQueryFns = require("./topologyQueryFns-DEax1nqt.cjs");
|
|
5
5
|
const require_vecOps = require("./vecOps-CrGEPPQM.cjs");
|
|
6
|
-
const require_measureFns = require("./measureFns-
|
|
6
|
+
const require_measureFns = require("./measureFns-JNQma34N.cjs");
|
|
7
7
|
// src/measurement/principalBoxFns.ts
|
|
8
8
|
/**
|
|
9
9
|
* Principal-axes bounding box: a solid's extent measured in the frame of its
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { G as _usingCtx, n as castResultShape, q as getKernel } from "./shapeTypes-
|
|
1
|
+
import { G as _usingCtx, n as castResultShape, q as getKernel } from "./shapeTypes-Ccp9iVna.js";
|
|
2
2
|
import { i as wasmIndex } from "./bug-ClMTAJhe.js";
|
|
3
3
|
import { E as ok, d as validationError, g as err, t as BrepErrorCode, u as unsupportedError } from "./errors-BTccWbtE.js";
|
|
4
|
-
import { E as kernelCallRaw, S as subShapeCount } from "./topologyQueryFns-
|
|
4
|
+
import { E as kernelCallRaw, S as subShapeCount } from "./topologyQueryFns-D7j1fl0n.js";
|
|
5
5
|
import { r as vecCross } from "./vecOps-S-m9H_fe.js";
|
|
6
|
-
import { f as getCachedMeasurement, p as setCachedMeasurement } from "./measureFns-
|
|
6
|
+
import { f as getCachedMeasurement, p as setCachedMeasurement } from "./measureFns-DmL9FRQC.js";
|
|
7
7
|
// src/measurement/principalBoxFns.ts
|
|
8
8
|
/**
|
|
9
9
|
* Principal-axes bounding box: a solid's extent measured in the frame of its
|
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-slop0dGo.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 +1 @@
|
|
|
1
|
-
export { o as PROJECTION_PLANES, t as cameraFromPlane, n as cameraLookAt, r as createCamera, s as isProjectionPlane, a as makeProjectedEdges, i as projectEdges } from "./cameraFns-
|
|
1
|
+
export { o as PROJECTION_PLANES, t as cameraFromPlane, n as cameraLookAt, r as createCamera, s as isProjectionPlane, a as makeProjectedEdges, i as projectEdges } from "./cameraFns-CQr0Z3FY.js";
|