brepjs 20.12.14 → 20.13.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/2d/blueprints/blueprintFns.d.ts +2 -0
- package/dist/2d.cjs +6 -6
- package/dist/2d.js +6 -6
- package/dist/{adjacencyFns-DyHi1paM.cjs → adjacencyFns-BXzEHSC5.cjs} +3 -3
- package/dist/{adjacencyFns-DT8YVOtE.js → adjacencyFns-BYjzMejn.js} +3 -3
- package/dist/{blueprint-CGBIm-Xk.cjs → blueprint-464KGkzc.cjs} +5 -5
- package/dist/{blueprint-BzgIBZly.js → blueprint-D-4-uTkr.js} +5 -5
- package/dist/{blueprintFns-Crktz0-W.cjs → blueprintFns-BdyFiuiC.cjs} +4 -5
- package/dist/{blueprintFns-CN6koAgD.js → blueprintFns-CE5RdX-E.js} +4 -5
- package/dist/{blueprintSketcher-C5Nn6Yi7.cjs → blueprintSketcher-C4XHzqTw.cjs} +3 -3
- package/dist/{blueprintSketcher-C28vnWYu.js → blueprintSketcher-CQ9LxcIl.js} +3 -3
- package/dist/{boolean2D-BRmFbYsb.cjs → boolean2D-CKE32vHV.cjs} +4 -4
- package/dist/{boolean2D-BWpQMVia.js → boolean2D-DwJvQ4p_.js} +4 -4
- package/dist/{booleanFns-Dcv_aMcv.js → booleanFns-CsTz48A3.js} +5 -5
- package/dist/{booleanFns-CvBttd1y.cjs → booleanFns-MkzdfjDv.cjs} +5 -5
- package/dist/brepjs.cjs +35 -41
- package/dist/brepjs.js +35 -41
- package/dist/{cameraFns-xIy84D75.js → cameraFns-BDl_D28X.js} +3 -3
- package/dist/{cameraFns-Ds_tNjP7.cjs → cameraFns-vHpapIZG.cjs} +3 -3
- package/dist/core/shapeTypes.d.ts +8 -4
- package/dist/core.cjs +2 -2
- package/dist/core.js +2 -2
- package/dist/{cornerFinder-BEUeERZd.js → cornerFinder-Dyk5sKEN.js} +1 -1
- package/dist/{cornerFinder-BUj9Ms_n.cjs → cornerFinder-adDN0_C4.cjs} +1 -1
- package/dist/{curveFns-Dneh4D9N.cjs → curveFns-HtjEh2W-.cjs} +1 -1
- package/dist/{curveFns-DR1JAITD.js → curveFns-RjNVzxNc.js} +1 -1
- package/dist/{drawFns-CkHnrB4o.cjs → drawFns-B5gZtD_P.cjs} +12 -12
- package/dist/{drawFns-BPskIgvL.js → drawFns-stc8-Gma.js} +12 -12
- package/dist/{faceFns-ClpZLuHU.cjs → faceFns-C7wBHMPv.cjs} +2 -2
- package/dist/{faceFns-Ek2vnYA8.js → faceFns-DaPoCzd-.js} +2 -2
- package/dist/{healingFns-CTPsDQkF.js → healingFns-C3Wq_hN3.js} +79 -31
- package/dist/{healingFns-CVGVC3-a.cjs → healingFns-zYCbT8vR.cjs} +79 -31
- package/dist/{helpers-ClWqvNl5.cjs → helpers-BdtYVyP5.cjs} +6 -6
- package/dist/{helpers-TeE5hIEo.js → helpers-CDzSlBi_.js} +6 -6
- package/dist/{importFns-1qi--R8S.cjs → importFns-CotbQ9l7.cjs} +5 -5
- package/dist/{importFns-DTyCvMc3.js → importFns-DR7Adv-W.js} +5 -5
- package/dist/io.cjs +2 -2
- package/dist/io.js +2 -2
- package/dist/kernel/interfaces/evolutionOps.d.ts +9 -0
- package/dist/kernel/interfaces/modifierOps.d.ts +17 -8
- package/dist/kernel/interfaces/transformOps.d.ts +7 -2
- package/dist/kernel/occt/transformOps.d.ts +1 -1
- package/dist/kernel/occtWasm/evolutionOps.d.ts +2 -0
- package/dist/kernel/occtWasm/helpers.d.ts +6 -0
- package/dist/kernel/occtWasm/modifierOps.d.ts +2 -8
- package/dist/kernel/occtWasm/occtWasmAdapter.cjs +1 -1
- package/dist/kernel/occtWasm/occtWasmAdapter.d.ts +3 -5
- package/dist/kernel/occtWasm/occtWasmAdapter.js +1 -1
- package/dist/kernel/occtWasm/occtWasmTypes.d.ts +2 -0
- package/dist/{loftFns-BqA5gWFR.cjs → loftFns-C9k9UAKh.cjs} +19 -52
- package/dist/{loftFns-DbXEtPKz.js → loftFns-Cbnrz3p8.js} +19 -52
- package/dist/{measureFns-_Q-bggOu.cjs → measureFns-Bi62maOJ.cjs} +3 -3
- package/dist/{measureFns-NLCrquKi.js → measureFns-DivR02Xb.js} +3 -3
- package/dist/measurement.cjs +2 -2
- package/dist/measurement.js +2 -2
- package/dist/{meshFns-DmKYxmT_.cjs → meshFns-8MTf0Lo_.cjs} +4 -4
- package/dist/{meshFns-DBN_h_7v.js → meshFns-CcuY52tt.js} +4 -4
- package/dist/{occtWasmAdapter-Be-xZvbQ.js → occtWasmAdapter-1k4udeb3.js} +51 -7
- package/dist/{occtWasmAdapter-TX9M5rkb.cjs → occtWasmAdapter-BNOuP9DA.cjs} +51 -7
- package/dist/operations/instanceFns.d.ts +3 -2
- package/dist/operations/sweepFns.d.ts +15 -3
- package/dist/operations.cjs +2 -2
- package/dist/operations.js +2 -2
- package/dist/{primitiveFns-u5Vnoanh.cjs → primitiveFns-BifV4IGL.cjs} +5 -5
- package/dist/{primitiveFns-D53I6iYC.js → primitiveFns-uDvN1FH6.js} +5 -5
- package/dist/{principalBoxFns-Cs3z4CmX.cjs → principalBoxFns-DjxE8Rym.cjs} +3 -3
- package/dist/{principalBoxFns-B3NAkStp.js → principalBoxFns-ez0xXLyK.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-CEx0Xso0.cjs → refResolveFns-CTkAPUwM.cjs} +6 -6
- package/dist/{refResolveFns-LMvuE8em.js → refResolveFns-CuaYXFya.js} +6 -6
- package/dist/{shapeFns-24B0u4KE.js → shapeFns-DgpWLKra.js} +2 -2
- package/dist/{shapeFns-CahtmyZr.cjs → shapeFns-Rmgd4x9I.cjs} +2 -2
- package/dist/shapeRef.cjs +1 -1
- package/dist/shapeRef.js +1 -1
- package/dist/{shapeTypes-6tBG0xrR.cjs → shapeTypes-BjitsJRQ.cjs} +20 -18
- package/dist/{shapeTypes-DZGS7hgn.js → shapeTypes-DbPghQD3.js} +20 -18
- package/dist/sketching/compoundSketch.d.ts +3 -2
- package/dist/sketching/sketch.d.ts +5 -4
- package/dist/sketching/sketches.d.ts +3 -2
- package/dist/sketching.cjs +3 -3
- package/dist/sketching.js +3 -3
- package/dist/{solidBuilders-BHGa-BWa.js → solidBuilders-BUI_fGzR.js} +3 -3
- package/dist/{solidBuilders-Dl6d8fGZ.cjs → solidBuilders-Bs2NA3xl.cjs} +3 -3
- package/dist/{surfaceBuilders-BVyLEFoG.js → surfaceBuilders-CO_DKhWA.js} +3 -3
- package/dist/{surfaceBuilders-BtYpRGXh.cjs → surfaceBuilders-Cn1mkQ3j.cjs} +3 -3
- package/dist/text.cjs +2 -2
- package/dist/text.js +2 -2
- package/dist/{textBlueprints-CihV6AGR.js → textBlueprints-CT0Kbw1f.js} +8 -8
- package/dist/{textBlueprints-C1aPqvXX.cjs → textBlueprints-P_D0KUVx.cjs} +8 -8
- package/dist/{textMetrics-BhTII8oU.cjs → textMetrics-CVyX8GyL.cjs} +1 -1
- package/dist/{textMetrics-CTA6sIE_.js → textMetrics-CXKdzefS.js} +1 -1
- package/dist/{threadFns-BK2TDl2R.cjs → threadFns-BV4HLdPE.cjs} +7 -7
- package/dist/{threadFns-B2Foaws1.js → threadFns-COs6jmaf.js} +7 -7
- package/dist/topology/apiTypes.d.ts +12 -3
- package/dist/topology/chamferAngleFns.d.ts +18 -9
- package/dist/topology/wrapperFns.d.ts +11 -2
- package/dist/topology.cjs +9 -9
- package/dist/topology.js +9 -9
- package/dist/{topologyQueryFns-BRXpZFCi.js → topologyQueryFns-J2ae_Gvc.js} +1 -1
- package/dist/{topologyQueryFns-t8CbgIAS.cjs → topologyQueryFns-s0LddGkF.cjs} +1 -1
- package/dist/{validityTypes-CT2goK1c.cjs → validityTypes-BVZ0lSNi.cjs} +1 -1
- package/dist/{validityTypes-OSx482aJ.js → validityTypes-CD_Xz0vZ.js} +1 -1
- package/package.json +2 -2
|
@@ -2343,6 +2343,14 @@ function runEdgeTreatment(Module, edges, value, uniform, perEdge) {
|
|
|
2343
2343
|
edgeVec.delete();
|
|
2344
2344
|
}
|
|
2345
2345
|
}
|
|
2346
|
+
/**
|
|
2347
|
+
* A per-edge chamfer's `referenceFaceIds`: empty when no edge names its
|
|
2348
|
+
* reference face, else one id per edge, 0 where the facade picks the face.
|
|
2349
|
+
*/
|
|
2350
|
+
function referenceFaceIds(faces) {
|
|
2351
|
+
if (faces.every((face) => face === void 0)) return [];
|
|
2352
|
+
return faces.map((face) => face === void 0 ? 0 : unwrap(face));
|
|
2353
|
+
}
|
|
2346
2354
|
/** Each face's draft angle, in radians. */
|
|
2347
2355
|
function draftAnglesRad(faces, angleDeg) {
|
|
2348
2356
|
return faces.map((face) => (typeof angleDeg === "function" ? angleDeg(face) : angleDeg) * Math.PI / 180);
|
|
@@ -2354,6 +2362,9 @@ function needsOcctWasm59(what) {
|
|
|
2354
2362
|
function needsOcctWasm510(what) {
|
|
2355
2363
|
return new UnsupportedKernelOperationError(`occt-wasm: ${what} requires occt-wasm >= 5.10.0`);
|
|
2356
2364
|
}
|
|
2365
|
+
function needsOcctWasm511(what) {
|
|
2366
|
+
return new UnsupportedKernelOperationError(`occt-wasm: ${what} requires occt-wasm >= 5.11.0`);
|
|
2367
|
+
}
|
|
2357
2368
|
/**
|
|
2358
2369
|
* Rotate a shape from the kernel's default Z-axis to an arbitrary direction.
|
|
2359
2370
|
* Used by primitives whose creation API only takes a Z-aligned form.
|
|
@@ -3817,21 +3828,23 @@ function chamfer(k, Module, shape, edges, distance) {
|
|
|
3817
3828
|
}
|
|
3818
3829
|
}
|
|
3819
3830
|
/**
|
|
3820
|
-
* Chamfer edge i by `distances[i]` and `anglesDeg[i]
|
|
3821
|
-
*
|
|
3831
|
+
* Chamfer edge i by `distances[i]` and `anglesDeg[i]` from reference face
|
|
3832
|
+
* `faceIds[i]` (see {@link referenceFaceIds}). Builds without the per-edge
|
|
3833
|
+
* entry point take only `shared`, the one value every edge has, and no faces.
|
|
3822
3834
|
*/
|
|
3823
|
-
function runChamferDistAngles(k, Module, shape, edges, distances, anglesDeg, shared) {
|
|
3835
|
+
function runChamferDistAngles(k, Module, shape, edges, distances, anglesDeg, faceIds, shared) {
|
|
3824
3836
|
const id = unwrap(shape);
|
|
3825
3837
|
const edgeVec = makeVecU32(Module, edges.map(unwrap));
|
|
3826
3838
|
try {
|
|
3827
3839
|
if (!k.chamferDistAngles) {
|
|
3840
|
+
if (faceIds.length > 0) throw needsOcctWasm59("distance-angle chamfers measured from a given face");
|
|
3828
3841
|
if (!shared) throw needsOcctWasm59("per-edge distance-angle chamfers");
|
|
3829
3842
|
return wrapResult(k, k.chamferDistAngle(id, edgeVec, shared.distance, shared.angleDeg));
|
|
3830
3843
|
}
|
|
3831
3844
|
const chamferDistAngles = k.chamferDistAngles.bind(k);
|
|
3832
3845
|
const distanceVec = makeVecDouble(Module, distances);
|
|
3833
3846
|
const angleVec = makeVecDouble(Module, anglesDeg);
|
|
3834
|
-
const faceVec = makeVecU32(Module,
|
|
3847
|
+
const faceVec = makeVecU32(Module, faceIds);
|
|
3835
3848
|
try {
|
|
3836
3849
|
return wrapResult(k, reportingFaultyEdges(edges, () => chamferDistAngles(id, edgeVec, distanceVec, angleVec, faceVec)));
|
|
3837
3850
|
} finally {
|
|
@@ -3844,7 +3857,7 @@ function runChamferDistAngles(k, Module, shape, edges, distances, anglesDeg, sha
|
|
|
3844
3857
|
}
|
|
3845
3858
|
}
|
|
3846
3859
|
function chamferDistAngle(k, Module, shape, edges, distance, angleDeg) {
|
|
3847
|
-
return runChamferDistAngles(k, Module, shape, edges, Array(edges.length).fill(distance), Array(edges.length).fill(angleDeg), {
|
|
3860
|
+
return runChamferDistAngles(k, Module, shape, edges, Array(edges.length).fill(distance), Array(edges.length).fill(angleDeg), [], {
|
|
3848
3861
|
distance,
|
|
3849
3862
|
angleDeg
|
|
3850
3863
|
});
|
|
@@ -3856,7 +3869,7 @@ function sharedDistAngle(entries) {
|
|
|
3856
3869
|
return entries.every((e) => e.distance === first.distance && e.angleDeg === first.angleDeg) ? first : void 0;
|
|
3857
3870
|
}
|
|
3858
3871
|
function chamferDistAngles(k, Module, shape, entries) {
|
|
3859
|
-
return runChamferDistAngles(k, Module, shape, entries.map((e) => e.edge), entries.map((e) => e.distance), entries.map((e) => e.angleDeg), sharedDistAngle(entries));
|
|
3872
|
+
return runChamferDistAngles(k, Module, shape, entries.map((e) => e.edge), entries.map((e) => e.distance), entries.map((e) => e.angleDeg), referenceFaceIds(entries.map((e) => e.face)), sharedDistAngle(entries));
|
|
3860
3873
|
}
|
|
3861
3874
|
function shell(k, Module, shape, faces, thickness, tolerance) {
|
|
3862
3875
|
const vec = makeVecU32(Module, faces.map(unwrap));
|
|
@@ -4466,7 +4479,7 @@ function transformBatch(k, entries) {
|
|
|
4466
4479
|
return entries.map((entry) => {
|
|
4467
4480
|
switch (entry.type) {
|
|
4468
4481
|
case "translate": return translate(k, entry.shape, entry.x, entry.y, entry.z);
|
|
4469
|
-
case "rotate": return rotate(k, entry.shape, entry.angle, entry.axis, entry.center);
|
|
4482
|
+
case "rotate": return rotate(k, entry.shape, entry.angle * Math.PI / 180, entry.axis, entry.center);
|
|
4470
4483
|
case "scale": return scale(k, entry.shape, entry.center, entry.factor);
|
|
4471
4484
|
case "mirror": return mirror(k, entry.shape, entry.origin, entry.normal);
|
|
4472
4485
|
default: throw new Error("occt-wasm: transformBatch unknown type");
|
|
@@ -6204,6 +6217,34 @@ function chamferWithHistory(k, Module, shape, edges, distance, inputFaceHashes,
|
|
|
6204
6217
|
hashVec.delete();
|
|
6205
6218
|
}
|
|
6206
6219
|
}
|
|
6220
|
+
function chamferDistAnglesWithHistory(k, Module, shape, entries, inputFaceHashes, hashUpperBound) {
|
|
6221
|
+
if (!k.chamferDistAnglesWithHistory) throw needsOcctWasm511("a distance-angle chamfer with face history");
|
|
6222
|
+
const withHistory = k.chamferDistAnglesWithHistory.bind(k);
|
|
6223
|
+
const shapeId = unwrap(shape);
|
|
6224
|
+
const edges = entries.map((e) => e.edge);
|
|
6225
|
+
const edgeIds = edges.map(unwrap);
|
|
6226
|
+
const distances = entries.map((e) => e.distance);
|
|
6227
|
+
const anglesDeg = entries.map((e) => e.angleDeg);
|
|
6228
|
+
const faceIds = referenceFaceIds(entries.map((e) => e.face));
|
|
6229
|
+
const edgeVec = makeVecU32(Module, edgeIds);
|
|
6230
|
+
const distanceVec = makeVecDouble(Module, distances);
|
|
6231
|
+
const angleVec = makeVecDouble(Module, anglesDeg);
|
|
6232
|
+
const faceVec = makeVecU32(Module, faceIds);
|
|
6233
|
+
const hashVec = makeVecInt(Module, inputFaceHashes);
|
|
6234
|
+
try {
|
|
6235
|
+
const { id, evolution } = parseEvolution(reportingFaultyEdges(edges, () => withHistory(shapeId, edgeVec, distanceVec, angleVec, faceVec, hashVec, hashUpperBound)));
|
|
6236
|
+
return {
|
|
6237
|
+
shape: wrapResult(k, id),
|
|
6238
|
+
evolution
|
|
6239
|
+
};
|
|
6240
|
+
} finally {
|
|
6241
|
+
edgeVec.delete();
|
|
6242
|
+
distanceVec.delete();
|
|
6243
|
+
angleVec.delete();
|
|
6244
|
+
faceVec.delete();
|
|
6245
|
+
hashVec.delete();
|
|
6246
|
+
}
|
|
6247
|
+
}
|
|
6207
6248
|
function shellWithHistory(k, Module, shape, faces, thickness, inputFaceHashes, hashUpperBound, tolerance) {
|
|
6208
6249
|
const faceVec = makeVecU32(Module, faces.map(unwrap));
|
|
6209
6250
|
const hashVec = makeVecInt(Module, inputFaceHashes);
|
|
@@ -6713,6 +6754,9 @@ var OcctWasmAdapter = class OcctWasmAdapter {
|
|
|
6713
6754
|
chamferWithHistory(shape, edges, distance, inputFaceHashes, hashUpperBound) {
|
|
6714
6755
|
return chamferWithHistory(this.k, this.Module, shape, edges, distance, inputFaceHashes, hashUpperBound);
|
|
6715
6756
|
}
|
|
6757
|
+
chamferDistAnglesWithHistory(shape, edges, inputFaceHashes, hashUpperBound) {
|
|
6758
|
+
return chamferDistAnglesWithHistory(this.k, this.Module, shape, edges, inputFaceHashes, hashUpperBound);
|
|
6759
|
+
}
|
|
6716
6760
|
shellWithHistory(shape, faces, thickness, inputFaceHashes, hashUpperBound, tolerance) {
|
|
6717
6761
|
return shellWithHistory(this.k, this.Module, shape, faces, thickness, inputFaceHashes, hashUpperBound, tolerance);
|
|
6718
6762
|
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { Result } from '../core/result.js';
|
|
2
|
-
import { AnyShape, Dimension } from '../core/shapeTypes.js';
|
|
2
|
+
import { AnyShape, Dimension, Shape3D } from '../core/shapeTypes.js';
|
|
3
3
|
import { Matrix4x4, Vec3 } from '../core/types.js';
|
|
4
4
|
import { ShapeMesh, MeshOptions } from '../topology/meshFns.js';
|
|
5
5
|
/** Grid provenance, set by `instanceGrid`, lets `materialize({fuse})` route
|
|
@@ -50,8 +50,9 @@ export interface MaterializeOptions {
|
|
|
50
50
|
* Produce real geometry: a Compound of N placed copies (default), or a single
|
|
51
51
|
* fused solid (`fuse: true`, 3D only). This is where the N kernel transforms
|
|
52
52
|
* happen. A grid-built instance fuses via the faster kernel `gridPattern`.
|
|
53
|
+
* Either result is a {@link Shape3D}.
|
|
53
54
|
*/
|
|
54
|
-
export declare function materialize<D extends Dimension>(inst: InstancedShape<D>, opts?: MaterializeOptions): Result<
|
|
55
|
+
export declare function materialize<D extends Dimension>(inst: InstancedShape<D>, opts?: MaterializeOptions): Result<Shape3D>;
|
|
55
56
|
export interface InstancedMesh {
|
|
56
57
|
/** The source shape meshed ONCE. */
|
|
57
58
|
readonly geometry: ShapeMesh;
|
|
@@ -39,8 +39,12 @@ export interface GuidedSweepOptions {
|
|
|
39
39
|
* @param spine - The path wire to sweep along.
|
|
40
40
|
* @param config - Sweep configuration (frenet, transition mode, scaling law, etc.).
|
|
41
41
|
* @param shellMode - When `true`, return `[shell, startWire, endWire]` instead of a solid.
|
|
42
|
-
* @returns `Result` containing
|
|
42
|
+
* @returns `Result` containing the swept shape, or a `[Shape3D, Wire, Wire]` tuple in shell mode.
|
|
43
43
|
*/
|
|
44
|
+
export declare function sweep(wire: ClosedWire<Dimension>, spine: Wire<Dimension>, config?: SweepOptions, shellMode?: false): Result<Shape3D>;
|
|
45
|
+
/** Sweep in shell mode, returning `[shell, startWire, endWire]`. */
|
|
46
|
+
export declare function sweep(wire: ClosedWire<Dimension>, spine: Wire<Dimension>, config: SweepOptions | undefined, shellMode: true): Result<[Shape3D, Wire, Wire]>;
|
|
47
|
+
/** Sweep with a shell mode known only at runtime. */
|
|
44
48
|
export declare function sweep(wire: ClosedWire<Dimension>, spine: Wire<Dimension>, config?: SweepOptions, shellMode?: boolean): Result<Shape3D | [Shape3D, Wire, Wire]>;
|
|
45
49
|
/**
|
|
46
50
|
* Extrude a wire along a normal constrained to a support surface.
|
|
@@ -67,8 +71,12 @@ export declare function supportExtrude(wire: ClosedWire<Dimension>, center: Vec3
|
|
|
67
71
|
* @param normal - Direction and length of the extrusion. Must be non-zero.
|
|
68
72
|
* @param profileShape - Optional scaling profile applied along the extrusion.
|
|
69
73
|
* @param shellMode - When `true`, return `[shell, startWire, endWire]` instead of a solid.
|
|
70
|
-
* @returns `Result` containing the extruded shape or a shell tuple.
|
|
74
|
+
* @returns `Result` containing the extruded shape, or a shell tuple in shell mode.
|
|
71
75
|
*/
|
|
76
|
+
export declare function complexExtrude(wire: ClosedWire<Dimension>, center: Vec3, normal: Vec3, profileShape?: ExtrusionProfile, shellMode?: false): Result<Shape3D>;
|
|
77
|
+
/** Complex extrusion in shell mode, returning `[shell, startWire, endWire]`. */
|
|
78
|
+
export declare function complexExtrude(wire: ClosedWire<Dimension>, center: Vec3, normal: Vec3, profileShape: ExtrusionProfile | undefined, shellMode: true): Result<[Shape3D, Wire, Wire]>;
|
|
79
|
+
/** Complex extrusion with a shell mode known only at runtime. */
|
|
72
80
|
export declare function complexExtrude(wire: ClosedWire<Dimension>, center: Vec3, normal: Vec3, profileShape?: ExtrusionProfile, shellMode?: boolean): Result<Shape3D | [Shape3D, Wire, Wire]>;
|
|
73
81
|
/**
|
|
74
82
|
* Extrude a wire along a normal with helical twist and optional profile scaling.
|
|
@@ -83,8 +91,12 @@ export declare function complexExtrude(wire: ClosedWire<Dimension>, center: Vec3
|
|
|
83
91
|
* @param normal - Direction and length of the extrusion. Must be non-zero.
|
|
84
92
|
* @param profileShape - Optional scaling profile applied along the extrusion.
|
|
85
93
|
* @param shellMode - When `true`, return `[shell, startWire, endWire]` instead of a solid.
|
|
86
|
-
* @returns `Result` containing the twisted extruded shape or a shell tuple.
|
|
94
|
+
* @returns `Result` containing the twisted extruded shape, or a shell tuple in shell mode.
|
|
87
95
|
*/
|
|
96
|
+
export declare function twistExtrude(wire: ClosedWire<Dimension>, angleDegrees: number, center: Vec3, normal: Vec3, profileShape?: ExtrusionProfile, shellMode?: false): Result<Shape3D>;
|
|
97
|
+
/** Twisted extrusion in shell mode, returning `[shell, startWire, endWire]`. */
|
|
98
|
+
export declare function twistExtrude(wire: ClosedWire<Dimension>, angleDegrees: number, center: Vec3, normal: Vec3, profileShape: ExtrusionProfile | undefined, shellMode: true): Result<[Shape3D, Wire, Wire]>;
|
|
99
|
+
/** Twisted extrusion with a shell mode known only at runtime. */
|
|
88
100
|
export declare function twistExtrude(wire: ClosedWire<Dimension>, angleDegrees: number, center: Vec3, normal: Vec3, profileShape?: ExtrusionProfile, shellMode?: boolean): Result<Shape3D | [Shape3D, Wire, Wire]>;
|
|
89
101
|
/**
|
|
90
102
|
* Sweep multiple profile sections along a spine wire.
|
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-BV4HLdPE.cjs");
|
|
3
|
+
const require_loftFns = require("./loftFns-C9k9UAKh.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-COs6jmaf.js";
|
|
2
|
+
import { c as twistExtrude, o as supportExtrude, r as complexExtrude, s as sweep } from "./loftFns-Cbnrz3p8.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-BjitsJRQ.cjs");
|
|
2
2
|
const require_errors = require("./errors-O_blYTWT.cjs");
|
|
3
|
-
const require_validityTypes = require("./validityTypes-
|
|
3
|
+
const require_validityTypes = require("./validityTypes-BVZ0lSNi.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-Bs2NA3xl.cjs");
|
|
7
|
+
const require_booleanFns = require("./booleanFns-MkzdfjDv.cjs");
|
|
8
|
+
const require_surfaceBuilders = require("./surfaceBuilders-Cn1mkQ3j.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-DbPghQD3.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-CD_Xz0vZ.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 { f as collectInputFaceHashes, g as propagateMetadataThroughRelocation, h as propagateMetadataByHash, m as propagateAllMetadata, p as hasAnyMetadata } 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-BUI_fGzR.js";
|
|
7
|
+
import { f as collectInputFaceHashes, g as propagateMetadataThroughRelocation, h as propagateMetadataByHash, m as propagateAllMetadata, p as hasAnyMetadata } from "./booleanFns-CsTz48A3.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-CO_DKhWA.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-BjitsJRQ.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-s0LddGkF.cjs");
|
|
5
5
|
const require_vecOps = require("./vecOps-CrGEPPQM.cjs");
|
|
6
|
-
const require_measureFns = require("./measureFns-
|
|
6
|
+
const require_measureFns = require("./measureFns-Bi62maOJ.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-DbPghQD3.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 } from "./topologyQueryFns-
|
|
4
|
+
import { E as kernelCallRaw } from "./topologyQueryFns-J2ae_Gvc.js";
|
|
5
5
|
import { r as vecCross } from "./vecOps-S-m9H_fe.js";
|
|
6
|
-
import { f as withCompoundOf, h as setCachedMeasurement, m as getCachedMeasurement, p as withSubShapes } from "./measureFns-
|
|
6
|
+
import { f as withCompoundOf, h as setCachedMeasurement, m as getCachedMeasurement, p as withSubShapes } from "./measureFns-DivR02Xb.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-vHpapIZG.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-BDl_D28X.js";
|
package/dist/query.cjs
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
2
|
-
const require_helpers = require("./helpers-
|
|
3
|
-
const require_cornerFinder = require("./cornerFinder-
|
|
2
|
+
const require_helpers = require("./helpers-BdtYVyP5.cjs");
|
|
3
|
+
const require_cornerFinder = require("./cornerFinder-adDN0_C4.cjs");
|
|
4
4
|
exports.cornerFinder = require_cornerFinder.cornerFinder;
|
|
5
5
|
exports.edgeFinder = require_helpers.edgeFinder;
|
|
6
6
|
exports.faceFinder = require_helpers.faceFinder;
|
package/dist/query.js
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import { n as edgeFinder, r as faceFinder, t as getSingleFace } from "./helpers-
|
|
2
|
-
import { t as cornerFinder } from "./cornerFinder-
|
|
1
|
+
import { n as edgeFinder, r as faceFinder, t as getSingleFace } from "./helpers-CDzSlBi_.js";
|
|
2
|
+
import { t as cornerFinder } from "./cornerFinder-Dyk5sKEN.js";
|
|
3
3
|
export { cornerFinder, edgeFinder, faceFinder, getSingleFace };
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
const require_shapeTypes = require("./shapeTypes-
|
|
2
|
-
const require_topologyQueryFns = require("./topologyQueryFns-
|
|
3
|
-
const require_faceFns = require("./faceFns-
|
|
1
|
+
const require_shapeTypes = require("./shapeTypes-BjitsJRQ.cjs");
|
|
2
|
+
const require_topologyQueryFns = require("./topologyQueryFns-s0LddGkF.cjs");
|
|
3
|
+
const require_faceFns = require("./faceFns-C7wBHMPv.cjs");
|
|
4
4
|
const require_faceRoleFns = require("./faceRoleFns-Db5bYj4Q.cjs");
|
|
5
|
-
const require_shapeFns = require("./shapeFns-
|
|
6
|
-
const require_measureFns = require("./measureFns-
|
|
7
|
-
const require_adjacencyFns = require("./adjacencyFns-
|
|
5
|
+
const require_shapeFns = require("./shapeFns-Rmgd4x9I.cjs");
|
|
6
|
+
const require_measureFns = require("./measureFns-Bi62maOJ.cjs");
|
|
7
|
+
const require_adjacencyFns = require("./adjacencyFns-BXzEHSC5.cjs");
|
|
8
8
|
// src/topology/shapeRef/scoring.ts
|
|
9
9
|
/**
|
|
10
10
|
* Default face scorer combining surface type, normal alignment, centroid proximity,
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import { g as disposeTransientSubShape, o as castShapeWithKnownType, q as getKernel } from "./shapeTypes-
|
|
2
|
-
import { c as getFaces, w as vertexPosition } from "./topologyQueryFns-
|
|
3
|
-
import { i as faceGeomType, l as normalAt, r as faceCenter } from "./faceFns-
|
|
1
|
+
import { g as disposeTransientSubShape, o as castShapeWithKnownType, q as getKernel } from "./shapeTypes-DbPghQD3.js";
|
|
2
|
+
import { c as getFaces, w as vertexPosition } from "./topologyQueryFns-J2ae_Gvc.js";
|
|
3
|
+
import { i as faceGeomType, l as normalAt, r as faceCenter } from "./faceFns-DaPoCzd-.js";
|
|
4
4
|
import { t as getFaceRoles } from "./faceRoleFns-BPxzQF-n.js";
|
|
5
|
-
import { n as getHashCode } from "./shapeFns-
|
|
6
|
-
import { n as measureArea, s as measureLength } from "./measureFns-
|
|
7
|
-
import { a as facesOfVertex, c as verticesOfFace, i as facesOfEdge, o as sharedEdges, s as verticesOfEdge, t as adjacentFaceHashes } from "./adjacencyFns-
|
|
5
|
+
import { n as getHashCode } from "./shapeFns-DgpWLKra.js";
|
|
6
|
+
import { n as measureArea, s as measureLength } from "./measureFns-DivR02Xb.js";
|
|
7
|
+
import { a as facesOfVertex, c as verticesOfFace, i as facesOfEdge, o as sharedEdges, s as verticesOfEdge, t as adjacentFaceHashes } from "./adjacencyFns-BYjzMejn.js";
|
|
8
8
|
// src/topology/shapeRef/scoring.ts
|
|
9
9
|
/**
|
|
10
10
|
* Default face scorer combining surface type, normal alignment, centroid proximity,
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { q as getKernel } from "./shapeTypes-
|
|
1
|
+
import { q as getKernel } from "./shapeTypes-DbPghQD3.js";
|
|
2
2
|
import { t as BrepErrorCode } from "./errors-BTccWbtE.js";
|
|
3
|
-
import { E as kernelCallRaw, T as kernelCall } from "./topologyQueryFns-
|
|
3
|
+
import { E as kernelCallRaw, T as kernelCall } from "./topologyQueryFns-J2ae_Gvc.js";
|
|
4
4
|
import { n as HASH_CODE_MAX } from "./constants-iraOnb2p.js";
|
|
5
5
|
// src/topology/shapeFns.ts
|
|
6
6
|
/**
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
const require_shapeTypes = require("./shapeTypes-
|
|
1
|
+
const require_shapeTypes = require("./shapeTypes-BjitsJRQ.cjs");
|
|
2
2
|
const require_errors = require("./errors-O_blYTWT.cjs");
|
|
3
|
-
const require_topologyQueryFns = require("./topologyQueryFns-
|
|
3
|
+
const require_topologyQueryFns = require("./topologyQueryFns-s0LddGkF.cjs");
|
|
4
4
|
const require_constants = require("./constants-oee0S_x6.cjs");
|
|
5
5
|
// src/topology/shapeFns.ts
|
|
6
6
|
/**
|
package/dist/shapeRef.cjs
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
2
|
-
const require_refResolveFns = require("./refResolveFns-
|
|
2
|
+
const require_refResolveFns = require("./refResolveFns-CTkAPUwM.cjs");
|
|
3
3
|
exports.assignRoles = require_refResolveFns.assignRoles;
|
|
4
4
|
exports.captureHint = require_refResolveFns.captureHint;
|
|
5
5
|
exports.createDerivedFaceRef = require_refResolveFns.createDerivedFaceRef;
|
package/dist/shapeRef.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export { h as assignRoles, g as captureHint, l as createDerivedFaceRef, p as createEdgeRef, _ as createRef, d as createVertexRef, b as defaultScorer, t as isDerivedFaceRef, n as isEdgeRef, r as isFaceRef, i as isLineageRef, a as isVertexRef, u as resolveDerivedFaceRef, m as resolveEdgeRef, o as resolveLineageRef, v as resolveRef, s as resolveRefIn, c as resolveRefParams, f as resolveVertexRef, y as updateRoles } from "./refResolveFns-
|
|
1
|
+
export { h as assignRoles, g as captureHint, l as createDerivedFaceRef, p as createEdgeRef, _ as createRef, d as createVertexRef, b as defaultScorer, t as isDerivedFaceRef, n as isEdgeRef, r as isFaceRef, i as isLineageRef, a as isVertexRef, u as resolveDerivedFaceRef, m as resolveEdgeRef, o as resolveLineageRef, v as resolveRef, s as resolveRefIn, c as resolveRefParams, f as resolveVertexRef, y as updateRoles } from "./refResolveFns-CuaYXFya.js";
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
const require_occtWasmAdapter = require("./occtWasmAdapter-
|
|
1
|
+
const require_occtWasmAdapter = require("./occtWasmAdapter-BNOuP9DA.cjs");
|
|
2
2
|
const require_bug = require("./bug-CBcpIPuf.cjs");
|
|
3
3
|
// src/kernel/quality.ts
|
|
4
4
|
/**
|
|
@@ -2184,7 +2184,7 @@ function transformBatch$2(oc, entries) {
|
|
|
2184
2184
|
return entries.map((e) => {
|
|
2185
2185
|
switch (e.type) {
|
|
2186
2186
|
case "translate": return translate$2(oc, e.shape, e.x, e.y, e.z);
|
|
2187
|
-
case "rotate": return rotate$2(oc, e.shape, e.angle, [...e.axis], [...e.center]);
|
|
2187
|
+
case "rotate": return rotate$2(oc, e.shape, e.angle * Math.PI / 180, [...e.axis], [...e.center]);
|
|
2188
2188
|
case "scale": return scale$2(oc, e.shape, [...e.center], e.factor);
|
|
2189
2189
|
case "mirror": return mirror$2(oc, e.shape, [...e.origin], [...e.normal]);
|
|
2190
2190
|
}
|
|
@@ -2229,7 +2229,7 @@ function translate$2(oc, shape, x, y, z) {
|
|
|
2229
2229
|
return result;
|
|
2230
2230
|
}
|
|
2231
2231
|
/**
|
|
2232
|
-
* Rotates a shape around an axis.
|
|
2232
|
+
* Rotates a shape by `angle` radians around an axis.
|
|
2233
2233
|
*/
|
|
2234
2234
|
function rotate$2(oc, shape, angle, axis = [
|
|
2235
2235
|
0,
|
|
@@ -2244,7 +2244,7 @@ function rotate$2(oc, shape, angle, axis = [
|
|
|
2244
2244
|
const origin = new oc.gp_Pnt_3(...center);
|
|
2245
2245
|
const dir = new oc.gp_Dir_5(...axis);
|
|
2246
2246
|
const ax1 = new oc.gp_Ax1_2(origin, dir);
|
|
2247
|
-
trsf.SetRotation_1(ax1, angle
|
|
2247
|
+
trsf.SetRotation_1(ax1, angle);
|
|
2248
2248
|
const result = transform$3(oc, shape, trsf);
|
|
2249
2249
|
trsf.delete();
|
|
2250
2250
|
ax1.delete();
|
|
@@ -6199,7 +6199,7 @@ function translate$1(bk, shape, x, y, z) {
|
|
|
6199
6199
|
return applyMatrix$1(bk, shape, translationMatrix$1(x, y, z));
|
|
6200
6200
|
}
|
|
6201
6201
|
function rotate$1(bk, shape, angle, axis, center) {
|
|
6202
|
-
return applyMatrix$1(bk, shape, rotationMatrix$1(angle, axis, center));
|
|
6202
|
+
return applyMatrix$1(bk, shape, rotationMatrix$1(angle * 180 / Math.PI, axis, center));
|
|
6203
6203
|
}
|
|
6204
6204
|
function mirror$1(bk, shape, origin, normal) {
|
|
6205
6205
|
const h = shape;
|
|
@@ -6223,7 +6223,7 @@ function positionOnCurve(bk, shape, spine, param) {
|
|
|
6223
6223
|
const nx = tx / len, ny = ty / len;
|
|
6224
6224
|
const dot = tz / len;
|
|
6225
6225
|
let result = shape;
|
|
6226
|
-
if (Math.abs(dot + 1) < 1e-10) result = rotate$1(bk, result,
|
|
6226
|
+
if (Math.abs(dot + 1) < 1e-10) result = rotate$1(bk, result, Math.PI, [
|
|
6227
6227
|
1,
|
|
6228
6228
|
0,
|
|
6229
6229
|
0
|
|
@@ -6234,8 +6234,7 @@ function positionOnCurve(bk, shape, spine, param) {
|
|
|
6234
6234
|
nx,
|
|
6235
6235
|
0
|
|
6236
6236
|
];
|
|
6237
|
-
|
|
6238
|
-
result = rotate$1(bk, result, angleDeg, axis);
|
|
6237
|
+
result = rotate$1(bk, result, Math.acos(Math.max(-1, Math.min(1, dot))), axis);
|
|
6239
6238
|
}
|
|
6240
6239
|
return translate$1(bk, result, point[0], point[1], point[2]);
|
|
6241
6240
|
}
|
|
@@ -6249,7 +6248,7 @@ function linearPattern$1(bk, shape, direction, spacing, count) {
|
|
|
6249
6248
|
}
|
|
6250
6249
|
function circularPattern$1(bk, shape, center, axis, angleStep, count) {
|
|
6251
6250
|
const results = [shape];
|
|
6252
|
-
for (let i = 1; i < count; i++) results.push(rotate$1(bk, shape, angleStep * i, axis, center));
|
|
6251
|
+
for (let i = 1; i < count; i++) results.push(rotate$1(bk, shape, angleStep * i * Math.PI / 180, axis, center));
|
|
6253
6252
|
return results;
|
|
6254
6253
|
}
|
|
6255
6254
|
function gridPattern$1(bk, shape, directionX, directionY, spacingX, spacingY, countX, countY) {
|
|
@@ -6260,7 +6259,7 @@ function transformBatch$1(bk, entries) {
|
|
|
6260
6259
|
return entries.map((e) => {
|
|
6261
6260
|
switch (e.type) {
|
|
6262
6261
|
case "translate": return translate$1(bk, e.shape, e.x, e.y, e.z);
|
|
6263
|
-
case "rotate": return rotate$1(bk, e.shape, e.angle, e.axis, e.center);
|
|
6262
|
+
case "rotate": return rotate$1(bk, e.shape, e.angle * Math.PI / 180, e.axis, e.center);
|
|
6264
6263
|
case "scale": return scale$1(bk, e.shape, e.center, e.factor);
|
|
6265
6264
|
case "mirror": return mirror$1(bk, e.shape, e.origin, e.normal);
|
|
6266
6265
|
}
|
|
@@ -6356,7 +6355,7 @@ function transformToPlacement(bk, shape, center, direction) {
|
|
|
6356
6355
|
const nx = dx / len;
|
|
6357
6356
|
const ny = dy / len;
|
|
6358
6357
|
const dot = dz / len;
|
|
6359
|
-
if (Math.abs(dot + 1) < 1e-10) result = rotate$1(bk, result,
|
|
6358
|
+
if (Math.abs(dot + 1) < 1e-10) result = rotate$1(bk, result, Math.PI, [
|
|
6360
6359
|
1,
|
|
6361
6360
|
0,
|
|
6362
6361
|
0
|
|
@@ -6367,8 +6366,7 @@ function transformToPlacement(bk, shape, center, direction) {
|
|
|
6367
6366
|
nx,
|
|
6368
6367
|
0
|
|
6369
6368
|
];
|
|
6370
|
-
|
|
6371
|
-
result = rotate$1(bk, result, angleDeg, axis);
|
|
6369
|
+
result = rotate$1(bk, result, Math.acos(Math.max(-1, Math.min(1, dot))), axis);
|
|
6372
6370
|
}
|
|
6373
6371
|
}
|
|
6374
6372
|
if (center && (center[0] !== 0 || center[1] !== 0 || center[2] !== 0)) result = translate$1(bk, result, center[0], center[1], center[2]);
|
|
@@ -8068,7 +8066,7 @@ function translateWithHistory(bk, shape, x, y, z, inputFaceHashes, hashUpperBoun
|
|
|
8068
8066
|
return buildEvolution(bk, translate$1(bk, shape, x, y, z), inputFaceHashes, hashUpperBound, true);
|
|
8069
8067
|
}
|
|
8070
8068
|
function rotateWithHistory(bk, shape, angle, inputFaceHashes, hashUpperBound, axis, center) {
|
|
8071
|
-
return buildEvolution(bk, rotate$1(bk, shape, angle
|
|
8069
|
+
return buildEvolution(bk, rotate$1(bk, shape, angle, axis, center), inputFaceHashes, hashUpperBound, true);
|
|
8072
8070
|
}
|
|
8073
8071
|
function mirrorWithHistory(bk, shape, origin, normal, inputFaceHashes, hashUpperBound) {
|
|
8074
8072
|
return buildEvolution(bk, mirror$1(bk, shape, origin, normal), inputFaceHashes, hashUpperBound, true);
|
|
@@ -16711,9 +16709,8 @@ function isShape1D(s) {
|
|
|
16711
16709
|
*
|
|
16712
16710
|
* **Note**: When `D` is `'2D'`, Shell/Solid/CompSolid are not valid members
|
|
16713
16711
|
* of `AnyShape<'2D'>`. If the kernel shape happens to be one of these types,
|
|
16714
|
-
* they will be cast unsoundly.
|
|
16715
|
-
*
|
|
16716
|
-
* for normal usage.
|
|
16712
|
+
* they will be cast unsoundly. For normal usage, call `castShape()` without a
|
|
16713
|
+
* dimension (it defaults to `'3D'`) or {@link castShape3D}, which does the same.
|
|
16717
16714
|
*/
|
|
16718
16715
|
function castShape(ocShape, dim) {
|
|
16719
16716
|
const kernel = getKernel();
|
|
@@ -16728,7 +16725,12 @@ function castShape(ocShape, dim) {
|
|
|
16728
16725
|
if (st === "compsolid") return createCompSolid(dc);
|
|
16729
16726
|
return createCompound(dc, dim);
|
|
16730
16727
|
}
|
|
16731
|
-
/**
|
|
16728
|
+
/**
|
|
16729
|
+
* Cast a raw kernel shape with the `'3D'` dimension brand, the same as
|
|
16730
|
+
* `castShape(ocShape)`. The 3D is the space the shape lives in, not its
|
|
16731
|
+
* topology: the result can be any kind from vertex to compound. Narrow it with
|
|
16732
|
+
* {@link isShape3D} to get a {@link Shape3D} (shell, solid, compsolid, or compound).
|
|
16733
|
+
*/
|
|
16732
16734
|
function castShape3D(ocShape) {
|
|
16733
16735
|
return castShape(ocShape);
|
|
16734
16736
|
}
|