brepkit-wasm 4.9.0 → 4.11.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/brepkit_wasm.d.ts +135 -67
- package/brepkit_wasm_bg.js +730 -332
- package/brepkit_wasm_bg.wasm +0 -0
- package/brepkit_wasm_node.cjs +727 -329
- package/package.json +1 -1
package/brepkit_wasm.d.ts
CHANGED
|
@@ -36,7 +36,7 @@ export class BrepKernel {
|
|
|
36
36
|
*
|
|
37
37
|
* Returns a new face handle (`u32`).
|
|
38
38
|
*/
|
|
39
|
-
addHolesToFace(face: number, hole_wire_handles: Uint32Array): number;
|
|
39
|
+
addHolesToFace(face: number, hole_wire_handles: Uint32Array | number[]): number;
|
|
40
40
|
/**
|
|
41
41
|
* Get faces adjacent to a given face within a solid.
|
|
42
42
|
*
|
|
@@ -48,31 +48,31 @@ export class BrepKernel {
|
|
|
48
48
|
*
|
|
49
49
|
* Returns an edge handle.
|
|
50
50
|
*/
|
|
51
|
-
approximateCurveLspia(coords: Float64Array, degree: number, num_control_points: number, tolerance: number, max_iterations: number): number;
|
|
51
|
+
approximateCurveLspia(coords: Float64Array | number[], degree: number, num_control_points: number, tolerance: number, max_iterations: number): number;
|
|
52
52
|
/**
|
|
53
53
|
* Approximate a curve through points (least-squares).
|
|
54
54
|
*
|
|
55
55
|
* Returns an edge handle.
|
|
56
56
|
*/
|
|
57
|
-
approximateCurve(coords: Float64Array, degree: number, num_control_points: number): number;
|
|
57
|
+
approximateCurve(coords: Float64Array | number[], degree: number, num_control_points: number): number;
|
|
58
58
|
/**
|
|
59
59
|
* Approximate a grid of points into a NURBS surface using LSPIA.
|
|
60
60
|
*
|
|
61
61
|
* Returns a face handle.
|
|
62
62
|
*/
|
|
63
|
-
approximateSurfaceLspia(coords: Float64Array, rows: number, cols: number, degree_u: number, degree_v: number, num_cps_u: number, num_cps_v: number, tolerance: number, max_iterations: number): number;
|
|
63
|
+
approximateSurfaceLspia(coords: Float64Array | number[], rows: number, cols: number, degree_u: number, degree_v: number, num_cps_u: number, num_cps_v: number, tolerance: number, max_iterations: number): number;
|
|
64
64
|
/**
|
|
65
65
|
* Add a child component to a parent in an assembly.
|
|
66
66
|
*
|
|
67
67
|
* Returns the component ID.
|
|
68
68
|
*/
|
|
69
|
-
assemblyAddChild(assembly: number, parent: number, name: string, solid: number, matrix: Float64Array): number;
|
|
69
|
+
assemblyAddChild(assembly: number, parent: number, name: string, solid: number, matrix: Float64Array | number[]): number;
|
|
70
70
|
/**
|
|
71
71
|
* Add a root component to an assembly.
|
|
72
72
|
*
|
|
73
73
|
* Returns the component ID.
|
|
74
74
|
*/
|
|
75
|
-
assemblyAddRoot(assembly: number, name: string, solid: number, matrix: Float64Array): number;
|
|
75
|
+
assemblyAddRoot(assembly: number, name: string, solid: number, matrix: Float64Array | number[]): number;
|
|
76
76
|
/**
|
|
77
77
|
* Get the bill of materials for an assembly.
|
|
78
78
|
*
|
|
@@ -89,6 +89,21 @@ export class BrepKernel {
|
|
|
89
89
|
* Create a new empty assembly. Returns an assembly index.
|
|
90
90
|
*/
|
|
91
91
|
assemblyNew(name: string): number;
|
|
92
|
+
/**
|
|
93
|
+
* Bridge two edge chains with a surface G1 or G2 continuous to the face
|
|
94
|
+
* beside each.
|
|
95
|
+
*
|
|
96
|
+
* Each chain lists its edges in running order, each stored either way.
|
|
97
|
+
* `options` is JSON: `{ "continuity": "g1" | "g2", "weights"?: [a, b] }`.
|
|
98
|
+
* Returns a face handle.
|
|
99
|
+
*
|
|
100
|
+
* # Errors
|
|
101
|
+
*
|
|
102
|
+
* Returns an error if a handle or the options are invalid, a weight is not
|
|
103
|
+
* positive, a chain breaks or leaves its face, or one chain is closed and
|
|
104
|
+
* the other open.
|
|
105
|
+
*/
|
|
106
|
+
blendSurface(chain_a: Uint32Array | number[], face_a: number, chain_b: Uint32Array | number[], face_b: number, options: string): number;
|
|
92
107
|
/**
|
|
93
108
|
* Compute the axis-aligned bounding box of a solid.
|
|
94
109
|
*
|
|
@@ -116,7 +131,7 @@ export class BrepKernel {
|
|
|
116
131
|
* `distance` is the chamfer distance from each corner.
|
|
117
132
|
* Returns a flat array of the chamfered polygon coordinates.
|
|
118
133
|
*/
|
|
119
|
-
chamfer2d(coords: Float64Array, distance: number): Float64Array;
|
|
134
|
+
chamfer2d(coords: Float64Array | number[], distance: number): Float64Array;
|
|
120
135
|
/**
|
|
121
136
|
* Chamfer edges with distance and angle using the v2 blend engine.
|
|
122
137
|
*
|
|
@@ -127,7 +142,7 @@ export class BrepKernel {
|
|
|
127
142
|
* Returns an error if the solid or edge handles are invalid, the blend
|
|
128
143
|
* computation fails, or any edge could not be blended.
|
|
129
144
|
*/
|
|
130
|
-
chamferDistanceAngle(solid: number, edge_handles: Uint32Array, distance: number, angle: number): number;
|
|
145
|
+
chamferDistanceAngle(solid: number, edge_handles: Uint32Array | number[], distance: number, angle: number): number;
|
|
131
146
|
/**
|
|
132
147
|
* Chamfer edges with two distances using the v2 blend engine.
|
|
133
148
|
*
|
|
@@ -138,7 +153,7 @@ export class BrepKernel {
|
|
|
138
153
|
* Returns an error if the solid or edge handles are invalid, the blend
|
|
139
154
|
* computation fails, or any edge could not be blended.
|
|
140
155
|
*/
|
|
141
|
-
chamferV2(solid: number, edge_handles: Uint32Array, d1: number, d2: number): number;
|
|
156
|
+
chamferV2(solid: number, edge_handles: Uint32Array | number[], d1: number, d2: number): number;
|
|
142
157
|
/**
|
|
143
158
|
* Chamfer edges of a solid.
|
|
144
159
|
*
|
|
@@ -148,7 +163,7 @@ export class BrepKernel {
|
|
|
148
163
|
*
|
|
149
164
|
* Returns an error if distance is non-positive or edges are invalid.
|
|
150
165
|
*/
|
|
151
|
-
chamfer(solid: number, edge_handles: Uint32Array, distance: number): number;
|
|
166
|
+
chamfer(solid: number, edge_handles: Uint32Array | number[], distance: number): number;
|
|
152
167
|
/**
|
|
153
168
|
* Returns the number of saved checkpoints.
|
|
154
169
|
*/
|
|
@@ -200,7 +215,7 @@ export class BrepKernel {
|
|
|
200
215
|
* Returns a flat array of common segment endpoints `[x1,y1, x2,y2, ...]`,
|
|
201
216
|
* or an empty array if no common segments exist.
|
|
202
217
|
*/
|
|
203
|
-
commonSegment2d(coords_a: Float64Array, coords_b: Float64Array): Float64Array;
|
|
218
|
+
commonSegment2d(coords_a: Float64Array | number[], coords_b: Float64Array | number[]): Float64Array;
|
|
204
219
|
/**
|
|
205
220
|
* Compose (multiply) two 4x4 transformation matrices.
|
|
206
221
|
*
|
|
@@ -211,7 +226,7 @@ export class BrepKernel {
|
|
|
211
226
|
*
|
|
212
227
|
* Returns an error if either matrix doesn't have 16 elements.
|
|
213
228
|
*/
|
|
214
|
-
composeTransforms(matrix_a: Float64Array, matrix_b: Float64Array): Float64Array;
|
|
229
|
+
composeTransforms(matrix_a: Float64Array | number[], matrix_b: Float64Array | number[]): Float64Array;
|
|
215
230
|
/**
|
|
216
231
|
* Cut a target solid by multiple tool solids in a single pass.
|
|
217
232
|
*
|
|
@@ -225,7 +240,7 @@ export class BrepKernel {
|
|
|
225
240
|
*
|
|
226
241
|
* Returns an error if any handle is invalid or the operation fails.
|
|
227
242
|
*/
|
|
228
|
-
compoundCut(target: number, tool_ids: Uint32Array): number;
|
|
243
|
+
compoundCut(target: number, tool_ids: Uint32Array | number[]): number;
|
|
229
244
|
/**
|
|
230
245
|
* Convert all analytic geometry in a solid to NURBS representation.
|
|
231
246
|
*
|
|
@@ -268,7 +283,7 @@ export class BrepKernel {
|
|
|
268
283
|
*
|
|
269
284
|
* Returns an error if fewer than 4 non-coplanar points are provided.
|
|
270
285
|
*/
|
|
271
|
-
convexHull(coords: Float64Array): number;
|
|
286
|
+
convexHull(coords: Float64Array | number[]): number;
|
|
272
287
|
/**
|
|
273
288
|
* Copy a solid and apply a 4×4 row-major affine transform in one pass.
|
|
274
289
|
*
|
|
@@ -280,7 +295,7 @@ export class BrepKernel {
|
|
|
280
295
|
* Returns an error if the solid handle is invalid, the matrix doesn't
|
|
281
296
|
* have 16 elements, or the matrix is singular.
|
|
282
297
|
*/
|
|
283
|
-
copyAndTransformSolid(solid: number, matrix: Float64Array): number;
|
|
298
|
+
copyAndTransformSolid(solid: number, matrix: Float64Array | number[]): number;
|
|
284
299
|
/**
|
|
285
300
|
* Deep copy a face, returning a new independent face handle.
|
|
286
301
|
*
|
|
@@ -369,7 +384,7 @@ export class BrepKernel {
|
|
|
369
384
|
* `face_handles` is an array of face handles to remove.
|
|
370
385
|
* Returns a new solid handle.
|
|
371
386
|
*/
|
|
372
|
-
defeature(solid: number, face_handles: Uint32Array): number;
|
|
387
|
+
defeature(solid: number, face_handles: Uint32Array | number[]): number;
|
|
373
388
|
/**
|
|
374
389
|
* Reconstruct a solid from a buffer produced by [`Self::serialize_solid`].
|
|
375
390
|
*
|
|
@@ -377,7 +392,7 @@ export class BrepKernel {
|
|
|
377
392
|
*
|
|
378
393
|
* Returns an error if the buffer is malformed or reconstruction fails.
|
|
379
394
|
*/
|
|
380
|
-
deserializeSolid(data: Uint8Array): number;
|
|
395
|
+
deserializeSolid(data: Uint8Array | number[]): number;
|
|
381
396
|
/**
|
|
382
397
|
* Detect surface-level coincident face pairs between two solids
|
|
383
398
|
* without performing a boolean operation.
|
|
@@ -422,7 +437,7 @@ export class BrepKernel {
|
|
|
422
437
|
*
|
|
423
438
|
* Returns an error if angle is zero or faces are invalid.
|
|
424
439
|
*/
|
|
425
|
-
draft(solid: number, face_handles: Uint32Array, pull_x: number, pull_y: number, pull_z: number, neutral_x: number, neutral_y: number, neutral_z: number, angle_degrees: number): number;
|
|
440
|
+
draft(solid: number, face_handles: Uint32Array | number[], pull_x: number, pull_y: number, pull_z: number, neutral_x: number, neutral_y: number, neutral_z: number, angle_degrees: number): number;
|
|
426
441
|
/**
|
|
427
442
|
* Compute the length of an edge.
|
|
428
443
|
*
|
|
@@ -518,7 +533,7 @@ export class BrepKernel {
|
|
|
518
533
|
*
|
|
519
534
|
* Returns an error if a solid handle is invalid or export fails.
|
|
520
535
|
*/
|
|
521
|
-
exportIgesSolids(solids: Uint32Array): Uint8Array;
|
|
536
|
+
exportIgesSolids(solids: Uint32Array | number[]): Uint8Array;
|
|
522
537
|
/**
|
|
523
538
|
* Export a solid to IGES format.
|
|
524
539
|
*
|
|
@@ -619,6 +634,17 @@ export class BrepKernel {
|
|
|
619
634
|
* Returns an array of wire handles.
|
|
620
635
|
*/
|
|
621
636
|
faceWires(face: number): Uint32Array;
|
|
637
|
+
/**
|
|
638
|
+
* Smooth a surface, staying within `tolerance` of it, with its boundary
|
|
639
|
+
* held. A surface with no bumps to remove comes back unchanged.
|
|
640
|
+
*
|
|
641
|
+
* Returns a new face handle.
|
|
642
|
+
*
|
|
643
|
+
* # Errors
|
|
644
|
+
*
|
|
645
|
+
* Returns an error if the handle is invalid or `tolerance` is not positive.
|
|
646
|
+
*/
|
|
647
|
+
fairSurface(face: number, tolerance: number): number;
|
|
622
648
|
/**
|
|
623
649
|
* Fill a 4-sided boundary with a Coons patch surface.
|
|
624
650
|
*
|
|
@@ -626,7 +652,7 @@ export class BrepKernel {
|
|
|
626
652
|
* `curve_lengths` is `[n0, n1, n2, n3]` — number of points per curve.
|
|
627
653
|
* Returns a face handle.
|
|
628
654
|
*/
|
|
629
|
-
fillCoonsPatch(boundary_coords: Float64Array, curve_lengths: Uint32Array): number;
|
|
655
|
+
fillCoonsPatch(boundary_coords: Float64Array | number[], curve_lengths: Uint32Array | number[]): number;
|
|
630
656
|
/**
|
|
631
657
|
* Round corners of a 2D polygon by inserting arc-approximation vertices.
|
|
632
658
|
*
|
|
@@ -634,7 +660,22 @@ export class BrepKernel {
|
|
|
634
660
|
* `radius` is the fillet radius.
|
|
635
661
|
* Returns a flat array of the filleted polygon coordinates.
|
|
636
662
|
*/
|
|
637
|
-
fillet2d(coords: Float64Array, radius: number): Float64Array;
|
|
663
|
+
fillet2d(coords: Float64Array | number[], radius: number): Float64Array;
|
|
664
|
+
/**
|
|
665
|
+
* Fillet edges with options at corners where three of them meet: how far
|
|
666
|
+
* back along each edge its round stops, and what closes the hole that
|
|
667
|
+
* leaves. `corners_json` is an array of
|
|
668
|
+
* `{"vertex": h, "setbacks": [{"edge": h, "distance": d}, ...], "corner": "rolling" | "g2"}`,
|
|
669
|
+
* with `setbacks` and `corner` optional: no set-backs and `"g2"` stops each
|
|
670
|
+
* round one radius past where a ball would.
|
|
671
|
+
*
|
|
672
|
+
* # Errors
|
|
673
|
+
*
|
|
674
|
+
* Returns an error if a handle is invalid, the JSON is malformed, the blend
|
|
675
|
+
* computation fails, or a corner is not three straight rounds between flat
|
|
676
|
+
* faces with set-backs past the ball and short of each edge's far end.
|
|
677
|
+
*/
|
|
678
|
+
filletV2Corners(solid: number, edge_handles: Uint32Array | number[], radius: number, corners_json: string): number;
|
|
638
679
|
/**
|
|
639
680
|
* Fillet edges using the v2 walking-based blend engine.
|
|
640
681
|
*
|
|
@@ -645,7 +686,7 @@ export class BrepKernel {
|
|
|
645
686
|
* Returns an error if the solid or edge handles are invalid, the blend
|
|
646
687
|
* computation fails, or any edge could not be blended.
|
|
647
688
|
*/
|
|
648
|
-
filletV2(solid: number, edge_handles: Uint32Array, radius: number): number;
|
|
689
|
+
filletV2(solid: number, edge_handles: Uint32Array | number[], radius: number): number;
|
|
649
690
|
/**
|
|
650
691
|
* Apply variable-radius fillets to edges.
|
|
651
692
|
*
|
|
@@ -671,7 +712,7 @@ export class BrepKernel {
|
|
|
671
712
|
* Returns an error if a handle is invalid, the radius is non-positive, or
|
|
672
713
|
* the fillet fails.
|
|
673
714
|
*/
|
|
674
|
-
filletWithEvolution(solid: number, edge_handles: Uint32Array, radius: number): any;
|
|
715
|
+
filletWithEvolution(solid: number, edge_handles: Uint32Array | number[], radius: number): any;
|
|
675
716
|
/**
|
|
676
717
|
* Fillet (round) edges of a solid.
|
|
677
718
|
*
|
|
@@ -682,7 +723,7 @@ export class BrepKernel {
|
|
|
682
723
|
* Returns an error if radius is non-positive, edges are invalid, or no
|
|
683
724
|
* fillet engine can produce a valid changed solid.
|
|
684
725
|
*/
|
|
685
|
-
fillet(solid: number, edge_handles: Uint32Array, radius: number): number;
|
|
726
|
+
fillet(solid: number, edge_handles: Uint32Array | number[], radius: number): number;
|
|
686
727
|
/**
|
|
687
728
|
* Fix face orientations to ensure consistent outward normals.
|
|
688
729
|
*
|
|
@@ -718,7 +759,7 @@ export class BrepKernel {
|
|
|
718
759
|
* Returns an error if any solid handle is invalid, the list is empty,
|
|
719
760
|
* or a boolean operation produces an empty or non-manifold result.
|
|
720
761
|
*/
|
|
721
|
-
fuseAll(solid_handles: Uint32Array): number;
|
|
762
|
+
fuseAll(solid_handles: Uint32Array | number[]): number;
|
|
722
763
|
/**
|
|
723
764
|
* Fuse (union) two solids and return evolution tracking data.
|
|
724
765
|
*
|
|
@@ -1018,7 +1059,7 @@ export class BrepKernel {
|
|
|
1018
1059
|
* Returns an error for a non-finite or malformed curve, a non-planar
|
|
1019
1060
|
* profile, or a degenerate path.
|
|
1020
1061
|
*/
|
|
1021
|
-
guidedSweep(face: number, spine_degree: number, spine_knots: Float64Array, spine_control_points: Float64Array, spine_weights: Float64Array, aux_degree: number, aux_knots: Float64Array, aux_control_points: Float64Array, aux_weights: Float64Array): number;
|
|
1062
|
+
guidedSweep(face: number, spine_degree: number, spine_knots: Float64Array | number[], spine_control_points: Float64Array | number[], spine_weights: Float64Array | number[], aux_degree: number, aux_knots: Float64Array | number[], aux_control_points: Float64Array | number[], aux_weights: Float64Array | number[]): number;
|
|
1022
1063
|
/**
|
|
1023
1064
|
* Heal a solid topology.
|
|
1024
1065
|
*
|
|
@@ -1045,7 +1086,7 @@ export class BrepKernel {
|
|
|
1045
1086
|
*
|
|
1046
1087
|
* Returns an error if the 3MF data is malformed.
|
|
1047
1088
|
*/
|
|
1048
|
-
import3mf(data: Uint8Array): Uint32Array;
|
|
1089
|
+
import3mf(data: Uint8Array | number[]): Uint32Array;
|
|
1049
1090
|
/**
|
|
1050
1091
|
* Import a GLB (glTF binary) file and return a solid handle.
|
|
1051
1092
|
*
|
|
@@ -1053,7 +1094,7 @@ export class BrepKernel {
|
|
|
1053
1094
|
*
|
|
1054
1095
|
* Returns an error if the file is malformed or mesh import fails.
|
|
1055
1096
|
*/
|
|
1056
|
-
importGlb(data: Uint8Array): number;
|
|
1097
|
+
importGlb(data: Uint8Array | number[]): number;
|
|
1057
1098
|
/**
|
|
1058
1099
|
* Import an IGES file and return solid handles.
|
|
1059
1100
|
*
|
|
@@ -1061,7 +1102,7 @@ export class BrepKernel {
|
|
|
1061
1102
|
*
|
|
1062
1103
|
* Returns an error if the IGES data is malformed.
|
|
1063
1104
|
*/
|
|
1064
|
-
importIges(data: Uint8Array): Uint32Array;
|
|
1105
|
+
importIges(data: Uint8Array | number[]): Uint32Array;
|
|
1065
1106
|
/**
|
|
1066
1107
|
* Import a triangle mesh from flat vertex/index arrays.
|
|
1067
1108
|
*
|
|
@@ -1073,7 +1114,7 @@ export class BrepKernel {
|
|
|
1073
1114
|
*
|
|
1074
1115
|
* Returns an error if the arrays are malformed or mesh import fails.
|
|
1075
1116
|
*/
|
|
1076
|
-
importIndexedMesh(positions: Float64Array, indices: Uint32Array): number;
|
|
1117
|
+
importIndexedMesh(positions: Float64Array | number[], indices: Uint32Array | number[]): number;
|
|
1077
1118
|
/**
|
|
1078
1119
|
* Import an OBJ file and return a solid handle.
|
|
1079
1120
|
*
|
|
@@ -1081,7 +1122,7 @@ export class BrepKernel {
|
|
|
1081
1122
|
*
|
|
1082
1123
|
* Returns an error if the file is malformed or mesh import fails.
|
|
1083
1124
|
*/
|
|
1084
|
-
importObj(data: Uint8Array): number;
|
|
1125
|
+
importObj(data: Uint8Array | number[]): number;
|
|
1085
1126
|
/**
|
|
1086
1127
|
* Import a STEP file and return solid handles.
|
|
1087
1128
|
*
|
|
@@ -1091,7 +1132,7 @@ export class BrepKernel {
|
|
|
1091
1132
|
*
|
|
1092
1133
|
* Returns an error if the STEP data is malformed.
|
|
1093
1134
|
*/
|
|
1094
|
-
importStep(data: Uint8Array): Uint32Array;
|
|
1135
|
+
importStep(data: Uint8Array | number[]): Uint32Array;
|
|
1095
1136
|
/**
|
|
1096
1137
|
* Import an STL file (binary or ASCII) and return a solid handle.
|
|
1097
1138
|
*
|
|
@@ -1102,7 +1143,7 @@ export class BrepKernel {
|
|
|
1102
1143
|
*
|
|
1103
1144
|
* Returns an error if the STL data is malformed or empty.
|
|
1104
1145
|
*/
|
|
1105
|
-
importStl(data: Uint8Array): number;
|
|
1146
|
+
importStl(data: Uint8Array | number[]): number;
|
|
1106
1147
|
/**
|
|
1107
1148
|
* A copy of a solid with its faces split where the given faces and edges
|
|
1108
1149
|
* meet them.
|
|
@@ -1115,21 +1156,21 @@ export class BrepKernel {
|
|
|
1115
1156
|
* along its marks, or the result would not be a valid solid of the same
|
|
1116
1157
|
* volume.
|
|
1117
1158
|
*/
|
|
1118
|
-
imprintFaces(solid: number, face_handles: Uint32Array, edge_handles: Uint32Array): number;
|
|
1159
|
+
imprintFaces(solid: number, face_handles: Uint32Array | number[], edge_handles: Uint32Array | number[]): number;
|
|
1119
1160
|
/**
|
|
1120
1161
|
* Interpolate a NURBS curve through points and create an edge.
|
|
1121
1162
|
*
|
|
1122
1163
|
* Uses chord-length parameterization with the given degree.
|
|
1123
1164
|
* Returns an edge handle (`u32`).
|
|
1124
1165
|
*/
|
|
1125
|
-
interpolatePoints(coords: Float64Array, degree: number): number;
|
|
1166
|
+
interpolatePoints(coords: Float64Array | number[], degree: number): number;
|
|
1126
1167
|
/**
|
|
1127
1168
|
* Interpolate a grid of points into a NURBS surface.
|
|
1128
1169
|
*
|
|
1129
1170
|
* `coords` is a flat array `[x,y,z, ...]` of `rows * cols` points.
|
|
1130
1171
|
* Returns a face handle.
|
|
1131
1172
|
*/
|
|
1132
|
-
interpolateSurface(coords: Float64Array, rows: number, cols: number, degree_u: number, degree_v: number): number;
|
|
1173
|
+
interpolateSurface(coords: Float64Array | number[], rows: number, cols: number, degree_u: number, degree_v: number): number;
|
|
1133
1174
|
/**
|
|
1134
1175
|
* Compute the boolean intersection of two 2D polygons.
|
|
1135
1176
|
*
|
|
@@ -1139,7 +1180,7 @@ export class BrepKernel {
|
|
|
1139
1180
|
*
|
|
1140
1181
|
* Uses the Sutherland-Hodgman algorithm (convex clipper).
|
|
1141
1182
|
*/
|
|
1142
|
-
intersectPolygons2d(coords_a: Float64Array, coords_b: Float64Array): Float64Array;
|
|
1183
|
+
intersectPolygons2d(coords_a: Float64Array | number[], coords_b: Float64Array | number[]): Float64Array;
|
|
1143
1184
|
/**
|
|
1144
1185
|
* Intersect two solids and return evolution tracking data.
|
|
1145
1186
|
*
|
|
@@ -1191,7 +1232,7 @@ export class BrepKernel {
|
|
|
1191
1232
|
*
|
|
1192
1233
|
* Returns an edge handle (`u32`).
|
|
1193
1234
|
*/
|
|
1194
|
-
liftCurve2dToPlane(curve_type: number, curve_params: Float64Array, origin_x: number, origin_y: number, origin_z: number, x_axis_x: number, x_axis_y: number, x_axis_z: number, normal_x: number, normal_y: number, normal_z: number, t_start: number, t_end: number): number;
|
|
1235
|
+
liftCurve2dToPlane(curve_type: number, curve_params: Float64Array | number[], origin_x: number, origin_y: number, origin_z: number, x_axis_x: number, x_axis_y: number, x_axis_z: number, normal_x: number, normal_y: number, normal_z: number, t_start: number, t_end: number): number;
|
|
1195
1236
|
/**
|
|
1196
1237
|
* Create a linear pattern of a solid.
|
|
1197
1238
|
*
|
|
@@ -1216,7 +1257,7 @@ export class BrepKernel {
|
|
|
1216
1257
|
* Returns an error if fewer than 2 profiles are given, profiles have
|
|
1217
1258
|
* different vertex counts, or surface fitting fails.
|
|
1218
1259
|
*/
|
|
1219
|
-
loftSmooth(faces: Uint32Array): number;
|
|
1260
|
+
loftSmooth(faces: Uint32Array | number[]): number;
|
|
1220
1261
|
/**
|
|
1221
1262
|
* Loft two or more open wires of equal edge counts into an open shell.
|
|
1222
1263
|
*
|
|
@@ -1228,7 +1269,7 @@ export class BrepKernel {
|
|
|
1228
1269
|
* their edge counts differ, a wire is closed, meets itself or breaks, two
|
|
1229
1270
|
* wires touch where they would be joined, or two lines cross or fold over.
|
|
1230
1271
|
*/
|
|
1231
|
-
loftWires(wires: Uint32Array): number;
|
|
1272
|
+
loftWires(wires: Uint32Array | number[]): number;
|
|
1232
1273
|
/**
|
|
1233
1274
|
* Loft profiles with options for start/end points and ruled mode.
|
|
1234
1275
|
*
|
|
@@ -1239,8 +1280,20 @@ export class BrepKernel {
|
|
|
1239
1280
|
* - `solid: bool` — true (default) returns a solid handle; false returns
|
|
1240
1281
|
* a shell handle holding the loft's faces without the caps on its end
|
|
1241
1282
|
* profiles
|
|
1283
|
+
* - `rails: number[]`: edge handles of guide rails, each through a vertex
|
|
1284
|
+
* of every profile
|
|
1285
|
+
* - `railWires: number[]`: wire handles of guide rails, the same
|
|
1286
|
+
* - `start`, `end`: how the surface leaves the first or last profile, as
|
|
1287
|
+
* `"free"` (default), `"normal"`, `{ kind: "normal", weight }` or
|
|
1288
|
+
* `{ kind: "tangent", face, weight }`, `face` the handle of a face the
|
|
1289
|
+
* profile lies on and `weight` scaling the derivative from its natural
|
|
1290
|
+
* size (default 1, negative for the profile's other side)
|
|
1291
|
+
*
|
|
1292
|
+
* Rails and conditions build a surface no ruled loft can, and close their
|
|
1293
|
+
* ends on the profiles: with them, `ruled` defaults to false, and an
|
|
1294
|
+
* explicit `ruled: true`, a `startPoint` or an `endPoint` is refused.
|
|
1242
1295
|
*/
|
|
1243
|
-
loftWithOptions(faces: Uint32Array, options: string): number;
|
|
1296
|
+
loftWithOptions(faces: Uint32Array | number[], options: string): number;
|
|
1244
1297
|
/**
|
|
1245
1298
|
* Loft two or more profile faces into a solid.
|
|
1246
1299
|
*
|
|
@@ -1251,7 +1304,7 @@ export class BrepKernel {
|
|
|
1251
1304
|
* Returns an error if fewer than 2 faces or profiles have
|
|
1252
1305
|
* different vertex counts.
|
|
1253
1306
|
*/
|
|
1254
|
-
loft(faces: Uint32Array): number;
|
|
1307
|
+
loft(faces: Uint32Array | number[]): number;
|
|
1255
1308
|
/**
|
|
1256
1309
|
* Create a box solid with the given dimensions, centered at the origin.
|
|
1257
1310
|
*
|
|
@@ -1333,7 +1386,7 @@ export class BrepKernel {
|
|
|
1333
1386
|
*
|
|
1334
1387
|
* Returns a compound handle (stored as `u32`).
|
|
1335
1388
|
*/
|
|
1336
|
-
makeCompound(solid_handles: Uint32Array): number;
|
|
1389
|
+
makeCompound(solid_handles: Uint32Array | number[]): number;
|
|
1337
1390
|
/**
|
|
1338
1391
|
* Create a cone or frustum solid centered at the origin, axis along +Z.
|
|
1339
1392
|
*
|
|
@@ -1445,7 +1498,7 @@ export class BrepKernel {
|
|
|
1445
1498
|
*
|
|
1446
1499
|
* Returns an edge handle (`u32`).
|
|
1447
1500
|
*/
|
|
1448
|
-
makeNurbsEdge(start_x: number, start_y: number, start_z: number, end_x: number, end_y: number, end_z: number, degree: number, knots: Float64Array, control_points: Float64Array, weights: Float64Array): number;
|
|
1501
|
+
makeNurbsEdge(start_x: number, start_y: number, start_z: number, end_x: number, end_y: number, end_z: number, degree: number, knots: Float64Array | number[], control_points: Float64Array | number[], weights: Float64Array | number[]): number;
|
|
1449
1502
|
/**
|
|
1450
1503
|
* Create a strictly planar face from a wire.
|
|
1451
1504
|
*
|
|
@@ -1461,7 +1514,7 @@ export class BrepKernel {
|
|
|
1461
1514
|
*
|
|
1462
1515
|
* Returns a wire handle.
|
|
1463
1516
|
*/
|
|
1464
|
-
makePolygonWire(coords: Float64Array): number;
|
|
1517
|
+
makePolygonWire(coords: Float64Array | number[]): number;
|
|
1465
1518
|
/**
|
|
1466
1519
|
* Create a polygonal face from flat coordinate triples `[x,y,z, ...]`.
|
|
1467
1520
|
*
|
|
@@ -1473,7 +1526,7 @@ export class BrepKernel {
|
|
|
1473
1526
|
* Returns an error if `coords` length is not a multiple of 3,
|
|
1474
1527
|
* fewer than 3 points are provided, or the face normal is degenerate.
|
|
1475
1528
|
*/
|
|
1476
|
-
makePolygon(coords: Float64Array): number;
|
|
1529
|
+
makePolygon(coords: Float64Array | number[]): number;
|
|
1477
1530
|
/**
|
|
1478
1531
|
* Create a rectangular face on the XY plane centered at the origin.
|
|
1479
1532
|
*
|
|
@@ -1497,7 +1550,7 @@ export class BrepKernel {
|
|
|
1497
1550
|
* Alias for `sewFaces` with a default tolerance. This is the equivalent
|
|
1498
1551
|
* of sewing faces into a closed shell and building a solid.
|
|
1499
1552
|
*/
|
|
1500
|
-
makeSolid(face_handles: Uint32Array): number;
|
|
1553
|
+
makeSolid(face_handles: Uint32Array | number[]): number;
|
|
1501
1554
|
/**
|
|
1502
1555
|
* Create a sphere solid centered at the origin.
|
|
1503
1556
|
*
|
|
@@ -1539,7 +1592,22 @@ export class BrepKernel {
|
|
|
1539
1592
|
*
|
|
1540
1593
|
* Returns a wire handle (`u32`).
|
|
1541
1594
|
*/
|
|
1542
|
-
makeWire(edge_handles: Uint32Array, closed: boolean): number;
|
|
1595
|
+
makeWire(edge_handles: Uint32Array | number[], closed: boolean): number;
|
|
1596
|
+
/**
|
|
1597
|
+
* Move one surface's edge on to another's at G0, G1 or G2, keeping the
|
|
1598
|
+
* rest of the surface as close as the move allows.
|
|
1599
|
+
*
|
|
1600
|
+
* `options` is JSON: `{ "continuity": "g0" | "g1" | "g2", "targetFace"?: face }`.
|
|
1601
|
+
* `targetFace` names the face a solid's edge is matched to, since it
|
|
1602
|
+
* bounds two. Returns a new face handle.
|
|
1603
|
+
*
|
|
1604
|
+
* # Errors
|
|
1605
|
+
*
|
|
1606
|
+
* Returns an error if a handle or the options are invalid, `edge` is not on
|
|
1607
|
+
* the face's outer boundary, or the target bounds no face or several when
|
|
1608
|
+
* a surface is needed and none is named.
|
|
1609
|
+
*/
|
|
1610
|
+
matchSurface(face: number, edge: number, target_edge: number, options: string): number;
|
|
1543
1611
|
/**
|
|
1544
1612
|
* Measure curvature of an edge curve at parameter `t`.
|
|
1545
1613
|
*
|
|
@@ -1565,7 +1633,7 @@ export class BrepKernel {
|
|
|
1565
1633
|
*
|
|
1566
1634
|
* Returns a `JsMesh` with the result.
|
|
1567
1635
|
*/
|
|
1568
|
-
meshBoolean(positions_a: Float64Array, indices_a: Uint32Array, positions_b: Float64Array, indices_b: Uint32Array, op: string, tolerance: number): JsMesh;
|
|
1636
|
+
meshBoolean(positions_a: Float64Array | number[], indices_a: Uint32Array | number[], positions_b: Float64Array | number[], indices_b: Uint32Array | number[], op: string, tolerance: number): JsMesh;
|
|
1569
1637
|
/**
|
|
1570
1638
|
* Sample ALL edges of a solid (no smooth-edge filtering).
|
|
1571
1639
|
*
|
|
@@ -1635,7 +1703,7 @@ export class BrepKernel {
|
|
|
1635
1703
|
* Returns an error for fewer than two sections, mismatched array lengths, a
|
|
1636
1704
|
* non-finite or out-of-range value, a non-planar profile, or loft failure.
|
|
1637
1705
|
*/
|
|
1638
|
-
multiSectionSweep(face_handles: Uint32Array, params: Float64Array, spine_degree: number, spine_knots: Float64Array, spine_control_points: Float64Array, spine_weights: Float64Array, ruled: boolean): number;
|
|
1706
|
+
multiSectionSweep(face_handles: Uint32Array | number[], params: Float64Array | number[], spine_degree: number, spine_knots: Float64Array | number[], spine_control_points: Float64Array | number[], spine_weights: Float64Array | number[], ruled: boolean): number;
|
|
1639
1707
|
/**
|
|
1640
1708
|
* Create a new, empty kernel.
|
|
1641
1709
|
*/
|
|
@@ -1656,7 +1724,7 @@ export class BrepKernel {
|
|
|
1656
1724
|
* `coords` is a flat array `[x,y, x,y, ...]` of 2D points.
|
|
1657
1725
|
* Returns a flat array of offset polygon coordinates.
|
|
1658
1726
|
*/
|
|
1659
|
-
offsetPolygon2d(coords: Float64Array, distance: number, tolerance: number): Float64Array;
|
|
1727
|
+
offsetPolygon2d(coords: Float64Array | number[], distance: number, tolerance: number): Float64Array;
|
|
1660
1728
|
/**
|
|
1661
1729
|
* Offset all faces of a solid outward or inward (V2 pipeline).
|
|
1662
1730
|
*
|
|
@@ -1724,14 +1792,14 @@ export class BrepKernel {
|
|
|
1724
1792
|
*
|
|
1725
1793
|
* Returns an error if the face or path is invalid.
|
|
1726
1794
|
*/
|
|
1727
|
-
pipe(face: number, path_degree: number, path_knots: Float64Array, path_control_points: Float64Array, path_weights: Float64Array): number;
|
|
1795
|
+
pipe(face: number, path_degree: number, path_knots: Float64Array | number[], path_control_points: Float64Array | number[], path_weights: Float64Array | number[]): number;
|
|
1728
1796
|
/**
|
|
1729
1797
|
* Test if a 2D point is inside a closed polygon.
|
|
1730
1798
|
*
|
|
1731
1799
|
* `polygon_coords` is a flat array `[x,y, x,y, ...]`.
|
|
1732
1800
|
* Returns `true` if the point is inside the polygon (winding number test).
|
|
1733
1801
|
*/
|
|
1734
|
-
pointInPolygon2d(polygon_coords: Float64Array, px: number, py: number): boolean;
|
|
1802
|
+
pointInPolygon2d(polygon_coords: Float64Array | number[], px: number, py: number): boolean;
|
|
1735
1803
|
/**
|
|
1736
1804
|
* Compute minimum distance from a point to an edge.
|
|
1737
1805
|
*
|
|
@@ -1769,7 +1837,7 @@ export class BrepKernel {
|
|
|
1769
1837
|
* Returns `true` if any vertex of one polygon is inside the other
|
|
1770
1838
|
* or if any edges cross.
|
|
1771
1839
|
*/
|
|
1772
|
-
polygonsIntersect2d(coords_a: Float64Array, coords_b: Float64Array): boolean;
|
|
1840
|
+
polygonsIntersect2d(coords_a: Float64Array | number[], coords_b: Float64Array | number[]): boolean;
|
|
1773
1841
|
/**
|
|
1774
1842
|
* Project a solid's edges onto a view plane with hidden-line removal.
|
|
1775
1843
|
*
|
|
@@ -1800,7 +1868,7 @@ export class BrepKernel {
|
|
|
1800
1868
|
* Returns an error for an empty list, an invalid handle, a non-positive
|
|
1801
1869
|
* `deflection`, or a degenerate `dir`/`x_axis`.
|
|
1802
1870
|
*/
|
|
1803
|
-
projectSolidsEdges(solids: Uint32Array, origin_x: number, origin_y: number, origin_z: number, dir_x: number, dir_y: number, dir_z: number, x_axis_x: number, x_axis_y: number, x_axis_z: number, hidden_lines: boolean, deflection: number): any;
|
|
1871
|
+
projectSolidsEdges(solids: Uint32Array | number[], origin_x: number, origin_y: number, origin_z: number, dir_x: number, dir_y: number, dir_z: number, x_axis_x: number, x_axis_y: number, x_axis_z: number, hidden_lines: boolean, deflection: number): any;
|
|
1804
1872
|
/**
|
|
1805
1873
|
* Recognize geometric features in a solid.
|
|
1806
1874
|
*
|
|
@@ -1918,7 +1986,7 @@ export class BrepKernel {
|
|
|
1918
1986
|
*
|
|
1919
1987
|
* Returns an error if fewer than 2 faces or sewing fails.
|
|
1920
1988
|
*/
|
|
1921
|
-
sewFaces(face_handles: Uint32Array, tolerance: number): number;
|
|
1989
|
+
sewFaces(face_handles: Uint32Array | number[], tolerance: number): number;
|
|
1922
1990
|
/**
|
|
1923
1991
|
* Get edges shared between two faces.
|
|
1924
1992
|
*
|
|
@@ -1935,7 +2003,7 @@ export class BrepKernel {
|
|
|
1935
2003
|
*
|
|
1936
2004
|
* Returns an error if thickness is non-positive or the solid is invalid.
|
|
1937
2005
|
*/
|
|
1938
|
-
shell(solid: number, thickness: number, open_faces: Uint32Array): number;
|
|
2006
|
+
shell(solid: number, thickness: number, open_faces: Uint32Array | number[]): number;
|
|
1939
2007
|
/**
|
|
1940
2008
|
* Add an arc to a sketch (defined by center, start, end point indices).
|
|
1941
2009
|
* Returns the arc index.
|
|
@@ -2011,7 +2079,7 @@ export class BrepKernel {
|
|
|
2011
2079
|
* along its marks, or the pieces would not be valid solids summing to the
|
|
2012
2080
|
* solid's volume.
|
|
2013
2081
|
*/
|
|
2014
|
-
splitByFaces(solid: number, face_handles: Uint32Array): Uint32Array;
|
|
2082
|
+
splitByFaces(solid: number, face_handles: Uint32Array | number[]): Uint32Array;
|
|
2015
2083
|
/**
|
|
2016
2084
|
* Split a solid into two halves along a plane.
|
|
2017
2085
|
*
|
|
@@ -2044,7 +2112,7 @@ export class BrepKernel {
|
|
|
2044
2112
|
*
|
|
2045
2113
|
* Returns an error if fewer than 2 edges or the fit fails.
|
|
2046
2114
|
*/
|
|
2047
|
-
sweepAlongEdges(face: number, edge_handles: Uint32Array): number;
|
|
2115
|
+
sweepAlongEdges(face: number, edge_handles: Uint32Array | number[]): number;
|
|
2048
2116
|
/**
|
|
2049
2117
|
* Sweep a face along a path with smooth NURBS side surfaces.
|
|
2050
2118
|
*
|
|
@@ -2058,7 +2126,7 @@ export class BrepKernel {
|
|
|
2058
2126
|
*
|
|
2059
2127
|
* Returns an error if the face or path is invalid, or surface fitting fails.
|
|
2060
2128
|
*/
|
|
2061
|
-
sweepSmooth(face: number, path_degree: number, path_knots: Float64Array, path_control_points: Float64Array, path_weights: Float64Array): number;
|
|
2129
|
+
sweepSmooth(face: number, path_degree: number, path_knots: Float64Array | number[], path_control_points: Float64Array | number[], path_weights: Float64Array | number[]): number;
|
|
2062
2130
|
/**
|
|
2063
2131
|
* Sweep an open wire along a chain of path edges into an open shell.
|
|
2064
2132
|
*
|
|
@@ -2072,7 +2140,7 @@ export class BrepKernel {
|
|
|
2072
2140
|
* Returns an error if a handle is invalid, the chain has no edges, breaks,
|
|
2073
2141
|
* closes or has a kink, or the wire is closed.
|
|
2074
2142
|
*/
|
|
2075
|
-
sweepWire(wire: number, path_edges: Uint32Array): number;
|
|
2143
|
+
sweepWire(wire: number, path_edges: Uint32Array | number[]): number;
|
|
2076
2144
|
/**
|
|
2077
2145
|
* Sweep a face along a NURBS path with advanced options.
|
|
2078
2146
|
*
|
|
@@ -2081,7 +2149,7 @@ export class BrepKernel {
|
|
|
2081
2149
|
* `corner_mode`: "smooth" (default), "miter", or "round"
|
|
2082
2150
|
* Returns a solid handle.
|
|
2083
2151
|
*/
|
|
2084
|
-
sweepWithOptions(profile: number, path_edge: number, contact_mode: string, scale_values: Float64Array, segments: number, corner_mode: string): number;
|
|
2152
|
+
sweepWithOptions(profile: number, path_edge: number, contact_mode: string, scale_values: Float64Array | number[], segments: number, corner_mode: string): number;
|
|
2085
2153
|
/**
|
|
2086
2154
|
* Sweep a planar face along a NURBS curve path to create a solid.
|
|
2087
2155
|
*
|
|
@@ -2098,7 +2166,7 @@ export class BrepKernel {
|
|
|
2098
2166
|
* Returns an error if the face handle is invalid, the NURBS arrays have
|
|
2099
2167
|
* inconsistent lengths, or the sweep operation fails.
|
|
2100
2168
|
*/
|
|
2101
|
-
sweep(face: number, path_degree: number, path_knots: Float64Array, path_control_points: Float64Array, path_weights: Float64Array): number;
|
|
2169
|
+
sweep(face: number, path_degree: number, path_knots: Float64Array | number[], path_control_points: Float64Array | number[], path_weights: Float64Array | number[]): number;
|
|
2102
2170
|
/**
|
|
2103
2171
|
* Tessellate an edge curve into polyline segments.
|
|
2104
2172
|
*
|
|
@@ -2208,7 +2276,7 @@ export class BrepKernel {
|
|
|
2208
2276
|
* Returns an error if the face handle is invalid, the matrix doesn't
|
|
2209
2277
|
* have 16 elements, or the matrix is singular.
|
|
2210
2278
|
*/
|
|
2211
|
-
transformFace(face: number, matrix: Float64Array): void;
|
|
2279
|
+
transformFace(face: number, matrix: Float64Array | number[]): void;
|
|
2212
2280
|
/**
|
|
2213
2281
|
* Apply a 4×4 affine transform to a solid (in place).
|
|
2214
2282
|
*
|
|
@@ -2219,7 +2287,7 @@ export class BrepKernel {
|
|
|
2219
2287
|
* Returns an error if the solid handle is invalid, the matrix doesn't
|
|
2220
2288
|
* have 16 elements, or the matrix is singular.
|
|
2221
2289
|
*/
|
|
2222
|
-
transformSolid(solid: number, matrix: Float64Array): void;
|
|
2290
|
+
transformSolid(solid: number, matrix: Float64Array | number[]): void;
|
|
2223
2291
|
/**
|
|
2224
2292
|
* Apply a 4×4 affine transform to a wire (in place).
|
|
2225
2293
|
*
|
|
@@ -2230,7 +2298,7 @@ export class BrepKernel {
|
|
|
2230
2298
|
* Returns an error if the wire handle is invalid, the matrix doesn't
|
|
2231
2299
|
* have 16 elements, or the matrix is singular.
|
|
2232
2300
|
*/
|
|
2233
|
-
transformWire(wire: number, matrix: Float64Array): void;
|
|
2301
|
+
transformWire(wire: number, matrix: Float64Array | number[]): void;
|
|
2234
2302
|
/**
|
|
2235
2303
|
* Unify adjacent faces that lie on the same geometric surface.
|
|
2236
2304
|
*
|
|
@@ -2299,7 +2367,7 @@ export class BrepKernel {
|
|
|
2299
2367
|
* Accepts an array of face handles from potentially different shells.
|
|
2300
2368
|
* Sews all faces together into a single solid.
|
|
2301
2369
|
*/
|
|
2302
|
-
weldShellsAndFaces(face_handles: Uint32Array, tolerance: number): number;
|
|
2370
|
+
weldShellsAndFaces(face_handles: Uint32Array | number[], tolerance: number): number;
|
|
2303
2371
|
/**
|
|
2304
2372
|
* Compute the total arc-length of a wire.
|
|
2305
2373
|
*/
|