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
|
@@ -1,20 +1,29 @@
|
|
|
1
1
|
import { KernelShape } from '../types.js';
|
|
2
|
+
/** One edge of a distance-angle chamfer that gives each edge its own values. */
|
|
3
|
+
export interface ChamferDistAngleEdge {
|
|
4
|
+
readonly edge: KernelShape;
|
|
5
|
+
/** Setback on the reference face. */
|
|
6
|
+
readonly distance: number;
|
|
7
|
+
/** Angle from the reference face, in degrees. */
|
|
8
|
+
readonly angleDeg: number;
|
|
9
|
+
/**
|
|
10
|
+
* The reference face, one of the two faces the edge joins. Omitted, the
|
|
11
|
+
* kernel picks it as {@link KernelModifierOps.chamferDistAngle} does.
|
|
12
|
+
*/
|
|
13
|
+
readonly face?: KernelShape | undefined;
|
|
14
|
+
}
|
|
2
15
|
export interface KernelModifierOps {
|
|
3
16
|
fillet(shape: KernelShape, edges: KernelShape[], radius: number | [number, number] | ((edge: KernelShape) => number | [number, number])): KernelShape;
|
|
4
17
|
chamfer(shape: KernelShape, edges: KernelShape[], distance: number | [number, number] | ((edge: KernelShape) => number | [number, number])): KernelShape;
|
|
5
18
|
chamferDistAngle(shape: KernelShape, edges: KernelShape[], distance: number, angleDeg: number): KernelShape;
|
|
6
19
|
/**
|
|
7
20
|
* Distance-angle chamfer with its own values on each edge, in one operation:
|
|
8
|
-
* `distance` is set back on the edge's reference face (
|
|
9
|
-
* picks it) and `angleDeg` is measured from that face.
|
|
21
|
+
* `distance` is set back on the edge's reference face (its `face`, or as
|
|
22
|
+
* {@link chamferDistAngle} picks it) and `angleDeg` is measured from that face.
|
|
10
23
|
* Optional: kernels without it can chamfer by distance and angle only with
|
|
11
|
-
* one value for every edge.
|
|
24
|
+
* one value for every edge and no reference faces.
|
|
12
25
|
*/
|
|
13
|
-
chamferDistAngles?(shape: KernelShape, edges: ReadonlyArray<
|
|
14
|
-
edge: KernelShape;
|
|
15
|
-
distance: number;
|
|
16
|
-
angleDeg: number;
|
|
17
|
-
}>): KernelShape;
|
|
26
|
+
chamferDistAngles?(shape: KernelShape, edges: ReadonlyArray<ChamferDistAngleEdge>): KernelShape;
|
|
18
27
|
shell(shape: KernelShape, faces: KernelShape[], thickness: number, tolerance?: number): KernelShape;
|
|
19
28
|
thicken(shape: KernelShape, thickness: number): KernelShape;
|
|
20
29
|
offset(shape: KernelShape, distance: number, tolerance?: number): KernelShape;
|
|
@@ -9,6 +9,7 @@ export type TransformEntry = {
|
|
|
9
9
|
} | {
|
|
10
10
|
readonly type: 'rotate';
|
|
11
11
|
readonly shape: KernelShape;
|
|
12
|
+
/** Degrees, unlike {@link KernelTransformOps.rotate}, which takes radians. */
|
|
12
13
|
readonly angle: number;
|
|
13
14
|
readonly axis: readonly [number, number, number];
|
|
14
15
|
readonly center: readonly [number, number, number];
|
|
@@ -24,7 +25,10 @@ export type TransformEntry = {
|
|
|
24
25
|
readonly normal: readonly [number, number, number];
|
|
25
26
|
};
|
|
26
27
|
export interface KernelTransformOps {
|
|
27
|
-
/**
|
|
28
|
+
/**
|
|
29
|
+
* Create a composed transform from a sequence of translate/rotate operations. Returns an
|
|
30
|
+
* opaque handle. Rotate angles here are in degrees.
|
|
31
|
+
*/
|
|
28
32
|
composeTransform(ops: Array<{
|
|
29
33
|
type: 'translate';
|
|
30
34
|
x: number;
|
|
@@ -51,6 +55,7 @@ export interface KernelTransformOps {
|
|
|
51
55
|
*/
|
|
52
56
|
locate(shape: KernelShape, trsf: KernelType): KernelShape;
|
|
53
57
|
translate(shape: KernelShape, x: number, y: number, z: number): KernelShape;
|
|
58
|
+
/** Rotate by `angle` radians about `axis` (default +Z) through `center` (default origin). */
|
|
54
59
|
rotate(shape: KernelShape, angle: number, axis?: readonly [number, number, number], center?: readonly [number, number, number]): KernelShape;
|
|
55
60
|
mirror(shape: KernelShape, origin: readonly [number, number, number], normal: readonly [number, number, number]): KernelShape;
|
|
56
61
|
scale(shape: KernelShape, center: readonly [number, number, number], factor: number): KernelShape;
|
|
@@ -61,7 +66,7 @@ export interface KernelTransformOps {
|
|
|
61
66
|
positionOnCurve(shape: KernelShape, spine: KernelShape, param: number): KernelShape;
|
|
62
67
|
/** Generate a linear pattern of shapes with pooled transforms for performance. */
|
|
63
68
|
linearPattern(shape: KernelShape, direction: [number, number, number], spacing: number, count: number): KernelShape[];
|
|
64
|
-
/** Generate a circular pattern of shapes. */
|
|
69
|
+
/** Generate a circular pattern of shapes, `angleStep` degrees apart. */
|
|
65
70
|
circularPattern(shape: KernelShape, center: [number, number, number], axis: [number, number, number], angleStep: number, count: number): KernelShape[];
|
|
66
71
|
/** Generate a 2D grid pattern (brepkit-native). Returns a compound. */
|
|
67
72
|
gridPattern?(shape: KernelShape, directionX: [number, number, number], directionY: [number, number, number], spacingX: number, spacingY: number, countX: number, countY: number): KernelShape;
|
|
@@ -24,7 +24,7 @@ export declare function locate(oc: KernelInstance, shape: KernelShape, trsf: Ker
|
|
|
24
24
|
*/
|
|
25
25
|
export declare function translate(oc: KernelInstance, shape: KernelShape, x: number, y: number, z: number): KernelShape;
|
|
26
26
|
/**
|
|
27
|
-
* Rotates a shape around an axis.
|
|
27
|
+
* Rotates a shape by `angle` radians around an axis.
|
|
28
28
|
*/
|
|
29
29
|
export declare function rotate(oc: KernelInstance, shape: KernelShape, angle: number, axis?: readonly [number, number, number], center?: readonly [number, number, number]): KernelShape;
|
|
30
30
|
/**
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { BooleanOptions, DiagnosticOperationResult, KernelShape, KernelType, OperationResult } from '../types.js';
|
|
2
|
+
import { ChamferDistAngleEdge } from '../interfaces/modifierOps.js';
|
|
2
3
|
import { OcctKernelWasm, OcctWasmModule } from './occtWasmTypes.js';
|
|
3
4
|
import { EdgeValueSpec } from './helpers.js';
|
|
4
5
|
/**
|
|
@@ -19,6 +20,7 @@ export declare function fuseAllWithHistory(k: OcctKernelWasm, Module: OcctWasmMo
|
|
|
19
20
|
export declare function cutAllWithHistory(k: OcctKernelWasm, Module: OcctWasmModule, shape: KernelShape, tools: KernelShape[], inputFaceHashes: number[], hashUpperBound: number, options?: BooleanOptions): DiagnosticOperationResult;
|
|
20
21
|
export declare function filletWithHistory(k: OcctKernelWasm, Module: OcctWasmModule, shape: KernelShape, edges: KernelShape[], radius: EdgeValueSpec, inputFaceHashes: number[], hashUpperBound: number): OperationResult;
|
|
21
22
|
export declare function chamferWithHistory(k: OcctKernelWasm, Module: OcctWasmModule, shape: KernelShape, edges: KernelShape[], distance: EdgeValueSpec, inputFaceHashes: number[], hashUpperBound: number): OperationResult;
|
|
23
|
+
export declare function chamferDistAnglesWithHistory(k: OcctKernelWasm, Module: OcctWasmModule, shape: KernelShape, entries: ReadonlyArray<ChamferDistAngleEdge>, inputFaceHashes: number[], hashUpperBound: number): OperationResult;
|
|
22
24
|
export declare function shellWithHistory(k: OcctKernelWasm, Module: OcctWasmModule, shape: KernelShape, faces: KernelShape[], thickness: number, inputFaceHashes: number[], hashUpperBound: number, tolerance?: number): OperationResult;
|
|
23
25
|
export declare function thickenWithHistory(k: OcctKernelWasm, Module: OcctWasmModule, shape: KernelShape, thickness: number, inputFaceHashes: number[], hashUpperBound: number): OperationResult;
|
|
24
26
|
export declare function offsetWithHistory(k: OcctKernelWasm, Module: OcctWasmModule, shape: KernelShape, distance: number, inputFaceHashes: number[], hashUpperBound: number, tolerance?: number): OperationResult;
|
|
@@ -35,11 +35,17 @@ export type EdgeValueSpec = EdgeValue | ((edge: KernelShape) => EdgeValue);
|
|
|
35
35
|
* and `second`.
|
|
36
36
|
*/
|
|
37
37
|
export declare function runEdgeTreatment<T>(Module: OcctWasmModule, edges: KernelShape[], value: EdgeValueSpec, uniform: (edgeVec: EmVectorUint32, value: number) => T, perEdge: (edgeVec: EmVectorUint32, first: EmVectorDouble, second: EmVectorDouble) => T): T;
|
|
38
|
+
/**
|
|
39
|
+
* A per-edge chamfer's `referenceFaceIds`: empty when no edge names its
|
|
40
|
+
* reference face, else one id per edge, 0 where the facade picks the face.
|
|
41
|
+
*/
|
|
42
|
+
export declare function referenceFaceIds(faces: ReadonlyArray<KernelShape | undefined>): number[];
|
|
38
43
|
/** Each face's draft angle, in radians. */
|
|
39
44
|
export declare function draftAnglesRad(faces: readonly KernelShape[], angleDeg: number | ((face: KernelShape) => number)): number[];
|
|
40
45
|
/** The peer range still admits older builds, which lack the per-edge and unit entry points. */
|
|
41
46
|
export declare function needsOcctWasm59(what: string): UnsupportedKernelOperationError;
|
|
42
47
|
export declare function needsOcctWasm510(what: string): UnsupportedKernelOperationError;
|
|
48
|
+
export declare function needsOcctWasm511(what: string): UnsupportedKernelOperationError;
|
|
43
49
|
/**
|
|
44
50
|
* Rotate a shape from the kernel's default Z-axis to an arbitrary direction.
|
|
45
51
|
* Used by primitives whose creation API only takes a Z-aligned form.
|
|
@@ -1,16 +1,11 @@
|
|
|
1
1
|
import { KernelShape } from '../types.js';
|
|
2
|
+
import { ChamferDistAngleEdge } from '../interfaces/modifierOps.js';
|
|
2
3
|
import { OcctKernelWasm, OcctWasmModule } from './occtWasmTypes.js';
|
|
3
4
|
import { EdgeValueSpec } from './helpers.js';
|
|
4
5
|
export declare function fillet(k: OcctKernelWasm, Module: OcctWasmModule, shape: KernelShape, edges: KernelShape[], radius: EdgeValueSpec): KernelShape;
|
|
5
6
|
export declare function chamfer(k: OcctKernelWasm, Module: OcctWasmModule, shape: KernelShape, edges: KernelShape[], distance: EdgeValueSpec): KernelShape;
|
|
6
|
-
interface DistAngle {
|
|
7
|
-
readonly distance: number;
|
|
8
|
-
readonly angleDeg: number;
|
|
9
|
-
}
|
|
10
7
|
export declare function chamferDistAngle(k: OcctKernelWasm, Module: OcctWasmModule, shape: KernelShape, edges: KernelShape[], distance: number, angleDeg: number): KernelShape;
|
|
11
|
-
export declare function chamferDistAngles(k: OcctKernelWasm, Module: OcctWasmModule, shape: KernelShape, entries: ReadonlyArray<
|
|
12
|
-
edge: KernelShape;
|
|
13
|
-
} & DistAngle>): KernelShape;
|
|
8
|
+
export declare function chamferDistAngles(k: OcctKernelWasm, Module: OcctWasmModule, shape: KernelShape, entries: ReadonlyArray<ChamferDistAngleEdge>): KernelShape;
|
|
14
9
|
export declare function shell(k: OcctKernelWasm, Module: OcctWasmModule, shape: KernelShape, faces: KernelShape[], thickness: number, tolerance?: number): KernelShape;
|
|
15
10
|
export declare function thicken(k: OcctKernelWasm, shape: KernelShape, thickness: number): KernelShape;
|
|
16
11
|
export declare function offset(k: OcctKernelWasm, shape: KernelShape, distance: number, tolerance?: number): KernelShape;
|
|
@@ -21,4 +16,3 @@ export declare function defeature(k: OcctKernelWasm, Module: OcctWasmModule, sha
|
|
|
21
16
|
export declare function offsetWire2D(k: OcctKernelWasm, wire: KernelShape, offset: number, joinType?: number | 'arc' | 'intersection' | 'tangent'): KernelShape;
|
|
22
17
|
export declare function simplify(k: OcctKernelWasm, shape: KernelShape): KernelShape;
|
|
23
18
|
export declare function reverseShape(k: OcctKernelWasm, shape: KernelShape): KernelShape;
|
|
24
|
-
export {};
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
2
|
-
const require_occtWasmAdapter = require("../../occtWasmAdapter-
|
|
2
|
+
const require_occtWasmAdapter = require("../../occtWasmAdapter-BNOuP9DA.cjs");
|
|
3
3
|
exports.OcctWasmAdapter = require_occtWasmAdapter.OcctWasmAdapter;
|
|
@@ -2,6 +2,7 @@ import { KernelCapabilities } from '../capabilities.js';
|
|
|
2
2
|
import { BooleanOpType, BooleanOptions, CheckBooleanResult, DiagnosticOperationResult, DistanceResult, KernelAdapter, KernelEdgeMeshResult, KernelInstance, KernelMeshResult, KernelShape, KernelType, MeshOptions, NurbsCurveData, OperationResult, ShapeOrientation, ShapeType, StepAssemblyPart, SurfaceType } from '../types.js';
|
|
3
3
|
import { BulkMeasurement, Matrix3 } from '../interfaces/measureOps.js';
|
|
4
4
|
import { TransformEntry } from '../interfaces/transformOps.js';
|
|
5
|
+
import { ChamferDistAngleEdge } from '../interfaces/modifierOps.js';
|
|
5
6
|
import { Curve2dHandle, BBox2dHandle } from '../kernel2dTypes.js';
|
|
6
7
|
import { OcctWasmModule, OcctKernelWasm } from './occtWasmTypes.js';
|
|
7
8
|
/**
|
|
@@ -166,11 +167,7 @@ export declare class OcctWasmAdapter implements KernelAdapter {
|
|
|
166
167
|
fillet(shape: KernelShape, edges: KernelShape[], radius: number | [number, number] | ((edge: KernelShape) => number | [number, number])): KernelShape;
|
|
167
168
|
chamfer(shape: KernelShape, edges: KernelShape[], distance: number | [number, number] | ((edge: KernelShape) => number | [number, number])): KernelShape;
|
|
168
169
|
chamferDistAngle(shape: KernelShape, edges: KernelShape[], distance: number, angleDeg: number): KernelShape;
|
|
169
|
-
chamferDistAngles(shape: KernelShape, edges: ReadonlyArray<
|
|
170
|
-
edge: KernelShape;
|
|
171
|
-
distance: number;
|
|
172
|
-
angleDeg: number;
|
|
173
|
-
}>): KernelShape;
|
|
170
|
+
chamferDistAngles(shape: KernelShape, edges: ReadonlyArray<ChamferDistAngleEdge>): KernelShape;
|
|
174
171
|
shell(shape: KernelShape, faces: KernelShape[], thickness: number, tolerance?: number): KernelShape;
|
|
175
172
|
thicken(shape: KernelShape, thickness: number): KernelShape;
|
|
176
173
|
offset(shape: KernelShape, distance: number, tolerance?: number): KernelShape;
|
|
@@ -216,6 +213,7 @@ export declare class OcctWasmAdapter implements KernelAdapter {
|
|
|
216
213
|
intersectWithHistory(shape: KernelShape, tool: KernelShape, inputFaceHashes: number[], hashUpperBound: number, options?: BooleanOptions): DiagnosticOperationResult;
|
|
217
214
|
filletWithHistory(shape: KernelShape, edges: KernelShape[], radius: number | [number, number] | ((edge: KernelShape) => number | [number, number]), inputFaceHashes: number[], hashUpperBound: number): OperationResult;
|
|
218
215
|
chamferWithHistory(shape: KernelShape, edges: KernelShape[], distance: number | [number, number] | ((edge: KernelShape) => number | [number, number]), inputFaceHashes: number[], hashUpperBound: number): OperationResult;
|
|
216
|
+
chamferDistAnglesWithHistory(shape: KernelShape, edges: ReadonlyArray<ChamferDistAngleEdge>, inputFaceHashes: number[], hashUpperBound: number): OperationResult;
|
|
219
217
|
shellWithHistory(shape: KernelShape, faces: KernelShape[], thickness: number, inputFaceHashes: number[], hashUpperBound: number, tolerance?: number): OperationResult;
|
|
220
218
|
thickenWithHistory(shape: KernelShape, thickness: number, inputFaceHashes: number[], hashUpperBound: number): OperationResult;
|
|
221
219
|
offsetWithHistory(shape: KernelShape, distance: number, inputFaceHashes: number[], hashUpperBound: number, tolerance?: number): OperationResult;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export { t as OcctWasmAdapter } from "../../occtWasmAdapter-
|
|
1
|
+
export { t as OcctWasmAdapter } from "../../occtWasmAdapter-1k4udeb3.js";
|
|
@@ -333,6 +333,8 @@ export interface OcctKernelWasm {
|
|
|
333
333
|
filletRadiiWithHistory?(solidId: number, edgeIds: EmVectorUint32, startRadii: EmVectorDouble, endRadii: EmVectorDouble, inputFaceHashes: EmVectorInt, hashUpperBound: number): EmEvolutionData;
|
|
334
334
|
/** occt-wasm >= 5.9.0: {@link chamferDistances} with face evolution. */
|
|
335
335
|
chamferDistancesWithHistory?(solidId: number, edgeIds: EmVectorUint32, distances1: EmVectorDouble, distances2: EmVectorDouble, referenceFaceIds: EmVectorUint32, inputFaceHashes: EmVectorInt, hashUpperBound: number): EmEvolutionData;
|
|
336
|
+
/** occt-wasm >= 5.11.0: {@link chamferDistAngles} with face evolution. */
|
|
337
|
+
chamferDistAnglesWithHistory?(solidId: number, edgeIds: EmVectorUint32, distances: EmVectorDouble, anglesDeg: EmVectorDouble, referenceFaceIds: EmVectorUint32, inputFaceHashes: EmVectorInt, hashUpperBound: number): EmEvolutionData;
|
|
336
338
|
/** occt-wasm >= 5.9.0 (npm build): {@link draftFaces} with face evolution. */
|
|
337
339
|
draftFacesWithHistory?(shapeId: number, faceIds: EmVectorUint32, anglesRad: EmVectorDouble, dx: number, dy: number, dz: number, px: number, py: number, pz: number, nx: number, ny: number, nz: number, inputFaceHashes: EmVectorInt, hashUpperBound: number): EmEvolutionData;
|
|
338
340
|
shellWithHistory(solidId: number, faceIds: EmVectorUint32, thickness: number, tolerance: number, inputFaceHashes: EmVectorInt, hashUpperBound: number): EmEvolutionData;
|
|
@@ -1,4 +1,4 @@
|
|
|
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
3
|
const require_types = require("./types-CjF9Rofr.cjs");
|
|
4
4
|
const require_vecOps = require("./vecOps-CrGEPPQM.cjs");
|
|
@@ -81,18 +81,6 @@ function castSweepShellTuple(result) {
|
|
|
81
81
|
endWire
|
|
82
82
|
]);
|
|
83
83
|
}
|
|
84
|
-
/**
|
|
85
|
-
* Sweep a wire profile along a spine wire to create a 3D shape.
|
|
86
|
-
*
|
|
87
|
-
* Supports Frenet framing, auxiliary spine twist, scaling laws, contact
|
|
88
|
-
* detection, and configurable corner transition modes.
|
|
89
|
-
*
|
|
90
|
-
* @param wire - The profile wire to sweep (must be closed for solid output).
|
|
91
|
-
* @param spine - The path wire to sweep along.
|
|
92
|
-
* @param config - Sweep configuration (frenet, transition mode, scaling law, etc.).
|
|
93
|
-
* @param shellMode - When `true`, return `[shell, startWire, endWire]` instead of a solid.
|
|
94
|
-
* @returns `Result` containing either a solid or a `[Shape3D, Wire, Wire]` tuple in shell mode.
|
|
95
|
-
*/
|
|
96
84
|
function sweep(wire, spine, config = {}, shellMode = false) {
|
|
97
85
|
if (config.mode === "simple" && !shellMode) {
|
|
98
86
|
const kernel = require_shapeTypes.getKernel();
|
|
@@ -149,29 +137,23 @@ function sweep(wire, spine, config = {}, shellMode = false) {
|
|
|
149
137
|
* @returns `Result` containing the swept 3D shape.
|
|
150
138
|
*/
|
|
151
139
|
function supportExtrude(wire, center, normal, support) {
|
|
152
|
-
|
|
140
|
+
try {
|
|
141
|
+
var _usingCtx$1 = require_shapeTypes._usingCtx();
|
|
142
|
+
const endPoint = require_vecOps.vecAdd(center, normal);
|
|
143
|
+
return sweep(wire, _usingCtx$1.u(makeSpineWire(center, endPoint)), { support });
|
|
144
|
+
} catch (_) {
|
|
145
|
+
_usingCtx$1.e = _;
|
|
146
|
+
} finally {
|
|
147
|
+
_usingCtx$1.d();
|
|
148
|
+
}
|
|
153
149
|
}
|
|
154
|
-
/**
|
|
155
|
-
* Extrude a wire along a normal with optional profile scaling.
|
|
156
|
-
*
|
|
157
|
-
* Builds a linear spine from `center` to `center + normal` and sweeps the
|
|
158
|
-
* profile wire. When `profileShape` is provided, a scaling law (s-curve or
|
|
159
|
-
* linear) modulates the cross-section size along the path.
|
|
160
|
-
*
|
|
161
|
-
* @param wire - The profile wire to sweep (must be closed).
|
|
162
|
-
* @param center - Start point of the extrusion spine.
|
|
163
|
-
* @param normal - Direction and length of the extrusion. Must be non-zero.
|
|
164
|
-
* @param profileShape - Optional scaling profile applied along the extrusion.
|
|
165
|
-
* @param shellMode - When `true`, return `[shell, startWire, endWire]` instead of a solid.
|
|
166
|
-
* @returns `Result` containing the extruded shape or a shell tuple.
|
|
167
|
-
*/
|
|
168
150
|
function complexExtrude(wire, center, normal, profileShape, shellMode = false) {
|
|
169
151
|
try {
|
|
170
|
-
var
|
|
152
|
+
var _usingCtx3 = require_shapeTypes._usingCtx();
|
|
171
153
|
const extrusionLength = require_vecOps.vecLength(normal);
|
|
172
154
|
if (extrusionLength < 1e-10) return require_errors.err(require_errors.validationError("ZERO_LENGTH_EXTRUSION", "Extrusion vector cannot have zero length"));
|
|
173
155
|
const endPoint = require_vecOps.vecAdd(center, normal);
|
|
174
|
-
const spine =
|
|
156
|
+
const spine = _usingCtx3.u(makeSpineWire(center, endPoint));
|
|
175
157
|
let law = null;
|
|
176
158
|
if (profileShape) {
|
|
177
159
|
const lawResult = buildLawFromProfile(extrusionLength, profileShape);
|
|
@@ -180,37 +162,22 @@ function complexExtrude(wire, center, normal, profileShape, shellMode = false) {
|
|
|
180
162
|
}
|
|
181
163
|
return sweep(wire, spine, { law }, shellMode);
|
|
182
164
|
} catch (_) {
|
|
183
|
-
|
|
165
|
+
_usingCtx3.e = _;
|
|
184
166
|
} finally {
|
|
185
|
-
|
|
167
|
+
_usingCtx3.d();
|
|
186
168
|
}
|
|
187
169
|
}
|
|
188
|
-
/**
|
|
189
|
-
* Extrude a wire along a normal with helical twist and optional profile scaling.
|
|
190
|
-
*
|
|
191
|
-
* Constructs a helical auxiliary spine that rotates the profile by
|
|
192
|
-
* `angleDegrees` over the extrusion length. Combines twist with optional
|
|
193
|
-
* s-curve or linear scaling when `profileShape` is provided.
|
|
194
|
-
*
|
|
195
|
-
* @param wire - The profile wire to sweep (must be closed).
|
|
196
|
-
* @param angleDegrees - Total twist rotation in degrees. Must be non-zero.
|
|
197
|
-
* @param center - Start point of the extrusion spine.
|
|
198
|
-
* @param normal - Direction and length of the extrusion. Must be non-zero.
|
|
199
|
-
* @param profileShape - Optional scaling profile applied along the extrusion.
|
|
200
|
-
* @param shellMode - When `true`, return `[shell, startWire, endWire]` instead of a solid.
|
|
201
|
-
* @returns `Result` containing the twisted extruded shape or a shell tuple.
|
|
202
|
-
*/
|
|
203
170
|
function twistExtrude(wire, angleDegrees, center, normal, profileShape, shellMode = false) {
|
|
204
171
|
try {
|
|
205
|
-
var
|
|
172
|
+
var _usingCtx4 = require_shapeTypes._usingCtx();
|
|
206
173
|
if (Math.abs(angleDegrees) < 1e-10) return require_errors.err(require_errors.validationError("ZERO_TWIST_ANGLE", "Twist angle cannot be zero"));
|
|
207
174
|
const extrusionLength = require_vecOps.vecLength(normal);
|
|
208
175
|
if (extrusionLength < 1e-10) return require_errors.err(require_errors.validationError("ZERO_LENGTH_EXTRUSION", "Extrusion vector cannot have zero length"));
|
|
209
176
|
const endPoint = require_vecOps.vecAdd(center, normal);
|
|
210
|
-
const spine =
|
|
177
|
+
const spine = _usingCtx4.u(makeSpineWire(center, endPoint));
|
|
211
178
|
const leftHanded = angleDegrees < 0;
|
|
212
179
|
const pitch = 360 / Math.abs(angleDegrees) * extrusionLength;
|
|
213
|
-
const auxiliarySpine =
|
|
180
|
+
const auxiliarySpine = _usingCtx4.u(makeHelixWire(pitch, extrusionLength, 1, center, normal, leftHanded));
|
|
214
181
|
let law = null;
|
|
215
182
|
if (profileShape) {
|
|
216
183
|
const lawResult = buildLawFromProfile(extrusionLength, profileShape);
|
|
@@ -222,9 +189,9 @@ function twistExtrude(wire, angleDegrees, center, normal, profileShape, shellMod
|
|
|
222
189
|
law
|
|
223
190
|
}, shellMode);
|
|
224
191
|
} catch (_) {
|
|
225
|
-
|
|
192
|
+
_usingCtx4.e = _;
|
|
226
193
|
} finally {
|
|
227
|
-
|
|
194
|
+
_usingCtx4.d();
|
|
228
195
|
}
|
|
229
196
|
}
|
|
230
197
|
/** Validate that explicit section locations are in [0,1] and strictly increasing. */
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { G as _usingCtx, T as isWire, h as disposeResultShape, n as castResultShape, q as getKernel, x as isShape3D } from "./shapeTypes-
|
|
1
|
+
import { G as _usingCtx, T as isWire, h as disposeResultShape, n as castResultShape, q as getKernel, x as isShape3D } from "./shapeTypes-DbPghQD3.js";
|
|
2
2
|
import { E as ok, b as isErr, d as validationError, g as err, i as kernelError, l as typeCastError, t as BrepErrorCode } from "./errors-BTccWbtE.js";
|
|
3
3
|
import { r as toVec3 } from "./types-CKXsIm9-.js";
|
|
4
4
|
import { c as vecLength, t as vecAdd } from "./vecOps-S-m9H_fe.js";
|
|
@@ -81,18 +81,6 @@ function castSweepShellTuple(result) {
|
|
|
81
81
|
endWire
|
|
82
82
|
]);
|
|
83
83
|
}
|
|
84
|
-
/**
|
|
85
|
-
* Sweep a wire profile along a spine wire to create a 3D shape.
|
|
86
|
-
*
|
|
87
|
-
* Supports Frenet framing, auxiliary spine twist, scaling laws, contact
|
|
88
|
-
* detection, and configurable corner transition modes.
|
|
89
|
-
*
|
|
90
|
-
* @param wire - The profile wire to sweep (must be closed for solid output).
|
|
91
|
-
* @param spine - The path wire to sweep along.
|
|
92
|
-
* @param config - Sweep configuration (frenet, transition mode, scaling law, etc.).
|
|
93
|
-
* @param shellMode - When `true`, return `[shell, startWire, endWire]` instead of a solid.
|
|
94
|
-
* @returns `Result` containing either a solid or a `[Shape3D, Wire, Wire]` tuple in shell mode.
|
|
95
|
-
*/
|
|
96
84
|
function sweep(wire, spine, config = {}, shellMode = false) {
|
|
97
85
|
if (config.mode === "simple" && !shellMode) {
|
|
98
86
|
const kernel = getKernel();
|
|
@@ -149,29 +137,23 @@ function sweep(wire, spine, config = {}, shellMode = false) {
|
|
|
149
137
|
* @returns `Result` containing the swept 3D shape.
|
|
150
138
|
*/
|
|
151
139
|
function supportExtrude(wire, center, normal, support) {
|
|
152
|
-
|
|
140
|
+
try {
|
|
141
|
+
var _usingCtx$1 = _usingCtx();
|
|
142
|
+
const endPoint = vecAdd(center, normal);
|
|
143
|
+
return sweep(wire, _usingCtx$1.u(makeSpineWire(center, endPoint)), { support });
|
|
144
|
+
} catch (_) {
|
|
145
|
+
_usingCtx$1.e = _;
|
|
146
|
+
} finally {
|
|
147
|
+
_usingCtx$1.d();
|
|
148
|
+
}
|
|
153
149
|
}
|
|
154
|
-
/**
|
|
155
|
-
* Extrude a wire along a normal with optional profile scaling.
|
|
156
|
-
*
|
|
157
|
-
* Builds a linear spine from `center` to `center + normal` and sweeps the
|
|
158
|
-
* profile wire. When `profileShape` is provided, a scaling law (s-curve or
|
|
159
|
-
* linear) modulates the cross-section size along the path.
|
|
160
|
-
*
|
|
161
|
-
* @param wire - The profile wire to sweep (must be closed).
|
|
162
|
-
* @param center - Start point of the extrusion spine.
|
|
163
|
-
* @param normal - Direction and length of the extrusion. Must be non-zero.
|
|
164
|
-
* @param profileShape - Optional scaling profile applied along the extrusion.
|
|
165
|
-
* @param shellMode - When `true`, return `[shell, startWire, endWire]` instead of a solid.
|
|
166
|
-
* @returns `Result` containing the extruded shape or a shell tuple.
|
|
167
|
-
*/
|
|
168
150
|
function complexExtrude(wire, center, normal, profileShape, shellMode = false) {
|
|
169
151
|
try {
|
|
170
|
-
var
|
|
152
|
+
var _usingCtx3 = _usingCtx();
|
|
171
153
|
const extrusionLength = vecLength(normal);
|
|
172
154
|
if (extrusionLength < 1e-10) return err(validationError("ZERO_LENGTH_EXTRUSION", "Extrusion vector cannot have zero length"));
|
|
173
155
|
const endPoint = vecAdd(center, normal);
|
|
174
|
-
const spine =
|
|
156
|
+
const spine = _usingCtx3.u(makeSpineWire(center, endPoint));
|
|
175
157
|
let law = null;
|
|
176
158
|
if (profileShape) {
|
|
177
159
|
const lawResult = buildLawFromProfile(extrusionLength, profileShape);
|
|
@@ -180,37 +162,22 @@ function complexExtrude(wire, center, normal, profileShape, shellMode = false) {
|
|
|
180
162
|
}
|
|
181
163
|
return sweep(wire, spine, { law }, shellMode);
|
|
182
164
|
} catch (_) {
|
|
183
|
-
|
|
165
|
+
_usingCtx3.e = _;
|
|
184
166
|
} finally {
|
|
185
|
-
|
|
167
|
+
_usingCtx3.d();
|
|
186
168
|
}
|
|
187
169
|
}
|
|
188
|
-
/**
|
|
189
|
-
* Extrude a wire along a normal with helical twist and optional profile scaling.
|
|
190
|
-
*
|
|
191
|
-
* Constructs a helical auxiliary spine that rotates the profile by
|
|
192
|
-
* `angleDegrees` over the extrusion length. Combines twist with optional
|
|
193
|
-
* s-curve or linear scaling when `profileShape` is provided.
|
|
194
|
-
*
|
|
195
|
-
* @param wire - The profile wire to sweep (must be closed).
|
|
196
|
-
* @param angleDegrees - Total twist rotation in degrees. Must be non-zero.
|
|
197
|
-
* @param center - Start point of the extrusion spine.
|
|
198
|
-
* @param normal - Direction and length of the extrusion. Must be non-zero.
|
|
199
|
-
* @param profileShape - Optional scaling profile applied along the extrusion.
|
|
200
|
-
* @param shellMode - When `true`, return `[shell, startWire, endWire]` instead of a solid.
|
|
201
|
-
* @returns `Result` containing the twisted extruded shape or a shell tuple.
|
|
202
|
-
*/
|
|
203
170
|
function twistExtrude(wire, angleDegrees, center, normal, profileShape, shellMode = false) {
|
|
204
171
|
try {
|
|
205
|
-
var
|
|
172
|
+
var _usingCtx4 = _usingCtx();
|
|
206
173
|
if (Math.abs(angleDegrees) < 1e-10) return err(validationError("ZERO_TWIST_ANGLE", "Twist angle cannot be zero"));
|
|
207
174
|
const extrusionLength = vecLength(normal);
|
|
208
175
|
if (extrusionLength < 1e-10) return err(validationError("ZERO_LENGTH_EXTRUSION", "Extrusion vector cannot have zero length"));
|
|
209
176
|
const endPoint = vecAdd(center, normal);
|
|
210
|
-
const spine =
|
|
177
|
+
const spine = _usingCtx4.u(makeSpineWire(center, endPoint));
|
|
211
178
|
const leftHanded = angleDegrees < 0;
|
|
212
179
|
const pitch = 360 / Math.abs(angleDegrees) * extrusionLength;
|
|
213
|
-
const auxiliarySpine =
|
|
180
|
+
const auxiliarySpine = _usingCtx4.u(makeHelixWire(pitch, extrusionLength, 1, center, normal, leftHanded));
|
|
214
181
|
let law = null;
|
|
215
182
|
if (profileShape) {
|
|
216
183
|
const lawResult = buildLawFromProfile(extrusionLength, profileShape);
|
|
@@ -222,9 +189,9 @@ function twistExtrude(wire, angleDegrees, center, normal, profileShape, shellMod
|
|
|
222
189
|
law
|
|
223
190
|
}, shellMode);
|
|
224
191
|
} catch (_) {
|
|
225
|
-
|
|
192
|
+
_usingCtx4.e = _;
|
|
226
193
|
} finally {
|
|
227
|
-
|
|
194
|
+
_usingCtx4.d();
|
|
228
195
|
}
|
|
229
196
|
}
|
|
230
197
|
/** Validate that explicit section locations are in [0,1] and strictly increasing. */
|
|
@@ -1,7 +1,7 @@
|
|
|
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-
|
|
4
|
-
const require_faceFns = require("./faceFns-
|
|
3
|
+
const require_topologyQueryFns = require("./topologyQueryFns-s0LddGkF.cjs");
|
|
4
|
+
const require_faceFns = require("./faceFns-C7wBHMPv.cjs");
|
|
5
5
|
// src/measurement/measureCache.ts
|
|
6
6
|
var cache = /* @__PURE__ */ new WeakMap();
|
|
7
7
|
function getCachedMeasurement(shape, key) {
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { q as getKernel } from "./shapeTypes-
|
|
1
|
+
import { q as getKernel } from "./shapeTypes-DbPghQD3.js";
|
|
2
2
|
import { E as ok, d as validationError, g as err, t as BrepErrorCode } from "./errors-BTccWbtE.js";
|
|
3
|
-
import { E as kernelCallRaw } from "./topologyQueryFns-
|
|
4
|
-
import { m as uvBounds } from "./faceFns-
|
|
3
|
+
import { E as kernelCallRaw } from "./topologyQueryFns-J2ae_Gvc.js";
|
|
4
|
+
import { m as uvBounds } from "./faceFns-DaPoCzd-.js";
|
|
5
5
|
// src/measurement/measureCache.ts
|
|
6
6
|
var cache = /* @__PURE__ */ new WeakMap();
|
|
7
7
|
function getCachedMeasurement(shape, key) {
|
package/dist/measurement.cjs
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
2
|
-
const require_measureFns = require("./measureFns-
|
|
3
|
-
const require_principalBoxFns = require("./principalBoxFns-
|
|
2
|
+
const require_measureFns = require("./measureFns-Bi62maOJ.cjs");
|
|
3
|
+
const require_principalBoxFns = require("./principalBoxFns-DjxE8Rym.cjs");
|
|
4
4
|
exports.createDistanceQuery = require_measureFns.createDistanceQuery;
|
|
5
5
|
exports.measureArea = require_measureFns.measureArea;
|
|
6
6
|
exports.measureDistance = require_measureFns.measureDistance;
|
package/dist/measurement.js
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import { a as measureDistance, c as measureLinearProps, d as measureVolumeProps, l as measureSurfaceProps, n as measureArea, o as measureDistanceProps, s as measureLength, t as createDistanceQuery, u as measureVolume } from "./measureFns-
|
|
2
|
-
import { t as principalBoundingBox } from "./principalBoxFns-
|
|
1
|
+
import { a as measureDistance, c as measureLinearProps, d as measureVolumeProps, l as measureSurfaceProps, n as measureArea, o as measureDistanceProps, s as measureLength, t as createDistanceQuery, u as measureVolume } from "./measureFns-DivR02Xb.js";
|
|
2
|
+
import { t as principalBoundingBox } from "./principalBoxFns-ez0xXLyK.js";
|
|
3
3
|
export { createDistanceQuery, measureArea, measureDistance, measureDistanceProps, measureLength, measureLinearProps, measureSurfaceProps, measureVolume, measureVolumeProps, principalBoundingBox };
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
const require_shapeTypes = require("./shapeTypes-
|
|
2
|
-
const require_occtWasmAdapter = require("./occtWasmAdapter-
|
|
1
|
+
const require_shapeTypes = require("./shapeTypes-BjitsJRQ.cjs");
|
|
2
|
+
const require_occtWasmAdapter = require("./occtWasmAdapter-BNOuP9DA.cjs");
|
|
3
3
|
const require_errors = require("./errors-O_blYTWT.cjs");
|
|
4
|
-
const require_topologyQueryFns = require("./topologyQueryFns-
|
|
5
|
-
const require_solidBuilders = require("./solidBuilders-
|
|
4
|
+
const require_topologyQueryFns = require("./topologyQueryFns-s0LddGkF.cjs");
|
|
5
|
+
const require_solidBuilders = require("./solidBuilders-Bs2NA3xl.cjs");
|
|
6
6
|
// src/topology/meshCache.ts
|
|
7
7
|
/**
|
|
8
8
|
* Build a parameter key for the inner cache map (excludes shape identity).
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { q as getKernel, ut as qualityDeflection } from "./shapeTypes-
|
|
2
|
-
import { j as isUnsupportedKernelOperationError } from "./occtWasmAdapter-
|
|
1
|
+
import { q as getKernel, ut as qualityDeflection } from "./shapeTypes-DbPghQD3.js";
|
|
2
|
+
import { j as isUnsupportedKernelOperationError } from "./occtWasmAdapter-1k4udeb3.js";
|
|
3
3
|
import { E as ok, g as err, r as ioError, t as BrepErrorCode, u as unsupportedError } from "./errors-BTccWbtE.js";
|
|
4
|
-
import { d as getSolids, n as getBounds } from "./topologyQueryFns-
|
|
5
|
-
import { d as getFaceOrigins } from "./solidBuilders-
|
|
4
|
+
import { d as getSolids, n as getBounds } from "./topologyQueryFns-J2ae_Gvc.js";
|
|
5
|
+
import { d as getFaceOrigins } from "./solidBuilders-BUI_fGzR.js";
|
|
6
6
|
// src/topology/meshCache.ts
|
|
7
7
|
/**
|
|
8
8
|
* Build a parameter key for the inner cache map (excludes shape identity).
|
|
@@ -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
|
}
|