nodi-modular 0.0.36 → 0.0.37

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.
Files changed (4) hide show
  1. package/index.d.ts +403 -360
  2. package/index.js +172 -188
  3. package/index_bg.wasm +0 -0
  4. package/package.json +1 -1
package/index.d.ts CHANGED
@@ -1,11 +1,6 @@
1
1
  /* tslint:disable */
2
2
  /* eslint-disable */
3
3
  export function do_nothing_just_tell_wasm_bindgen_to_generate_types(): void;
4
- /**
5
- * Evaluation item interoperability type.
6
- */
7
- export type Item = { variant: "Bool"; data: boolean } | { variant: "String"; data: string } | { variant: "Number"; data: number } | { variant: "Domain"; data: Domain } | { variant: "Vector3"; data: Vector3<number> } | { variant: "Matrix4"; data: Matrix4<number> } | { variant: "Complex"; data: Complex<number> } | { variant: "Point3"; data: Point3<number> } | { variant: "Plane"; data: Plane } | { variant: "GeometryTransform"; data: GeometryTransformInterop } | { variant: "MeshFace"; data: MeshTriangleFace };
8
-
9
4
  export interface GeometryTransformInterop {
10
5
  geometry: GeometryProxy;
11
6
  transform: TransformInterop;
@@ -13,38 +8,38 @@ export interface GeometryTransformInterop {
13
8
 
14
9
  export type NodeOutput = (Map<string, Item[]> | undefined)[];
15
10
 
16
- export interface GroupInteropHandle {
17
- objects: GeometryInteropHandleProxy[];
18
- }
19
-
20
11
  /**
21
- * Interop struct for node property
12
+ * Evaluation item interoperability type.
22
13
  */
23
- export interface NodePropertyInterop {
24
- /**
25
- * Property name
26
- */
27
- name: string;
28
- /**
29
- * Property value
30
- */
31
- value: NodePropertyValue;
32
- /**
33
- * Whether the node has input connection and the property change is disabled
34
- */
35
- connected?: boolean;
36
- /**
37
- * Whether the property is disabled in node\' inspector
38
- */
39
- disabled?: boolean;
14
+ export type Item = { variant: "Bool"; data: boolean } | { variant: "String"; data: string } | { variant: "Number"; data: number } | { variant: "Domain"; data: Domain } | { variant: "Vector3"; data: Vector3<number> } | { variant: "Matrix4"; data: Matrix4<number> } | { variant: "Complex"; data: Complex<number> } | { variant: "Point3"; data: Point3<number> } | { variant: "Plane"; data: Plane } | { variant: "GeometryTransform"; data: GeometryTransformInterop } | { variant: "MeshFace"; data: MeshTriangleFace };
15
+
16
+ export interface GeometrySpreadsheet {
17
+ points: Point3<number>[];
18
+ curves: CurveProxy[];
19
+ surfaces: SurfaceProxy[];
20
+ meshes: MeshInterop[];
40
21
  }
41
22
 
42
- export interface IndicesInteropHandle {
43
- count: number;
44
- indices: number;
23
+ export interface EdgeInterop {
24
+ source: EdgeUnitInterop<OutputId>;
25
+ destination: EdgeUnitInterop<InputId>;
26
+ empty: boolean;
45
27
  }
46
28
 
47
- export type GeometryInteropHandleProxy = { variant: "Mesh"; data: MeshInteropHandle } | { variant: "Curve"; data: CurveInteropHandle } | { variant: "Group"; data: GroupInteropHandle };
29
+ export interface EdgeUnitInterop<IO> {
30
+ node: NodeId;
31
+ io: IO;
32
+ }
33
+
34
+ export type GeometryInteropVec = GeometryInterop[];
35
+
36
+ export type NodeConnectionInteropVec = NodeConnectionInterop[];
37
+
38
+ export type NodePropertyInteropVec = NodePropertyInterop[];
39
+
40
+ export type NodeInteropVec = NodeInterop[];
41
+
42
+ export type EdgeInteropVec = EdgeInterop[];
48
43
 
49
44
  export interface DataTreeInterop {
50
45
  branches: IndexMap<string, string[]>;
@@ -54,23 +49,35 @@ export interface DataTreeFormatInterop {
54
49
  outputs: IndexMap<string, string>;
55
50
  }
56
51
 
57
- export interface EdgeInterop {
58
- source: EdgeUnitInterop<OutputId>;
59
- destination: EdgeUnitInterop<InputId>;
60
- empty: boolean;
52
+ export type NodeSectionInterop = { type: "section"; content: NodeFolderInterop } | { type: "item"; content: NodeItemInterop };
53
+
54
+ export interface NodeItemInterop {
55
+ key: string;
56
+ name: string;
61
57
  }
62
58
 
63
- export interface EdgeUnitInterop<IO> {
64
- node: NodeId;
65
- io: IO;
59
+ export type NodeFolderInterop = IndexMap<string, NodeSectionInterop>;
60
+
61
+ export interface NodeMapInterop {
62
+ folder: NodeFolderInterop;
66
63
  }
67
64
 
68
- export interface MeshInteropHandle {
69
- count: number;
70
- vertices: number;
71
- normals: number;
72
- indices: IndicesInteropHandle | undefined;
73
- transform: TransformInterop | undefined;
65
+ /**
66
+ * Interop struct for evaluation results
67
+ */
68
+ export interface EvaluationInterop {
69
+ /**
70
+ * Processed nodes in the latest evaluation
71
+ */
72
+ processedNodes: GraphNodeSet[];
73
+ /**
74
+ * Geometry identifiers in the latest evaluation
75
+ */
76
+ geometryIdentifiers: GeometryIdentifier[];
77
+ }
78
+
79
+ export interface GroupInteropHandle {
80
+ objects: GeometryInteropHandleProxy[];
74
81
  }
75
82
 
76
83
  export interface NodeCreationSetting {
@@ -85,6 +92,28 @@ export interface NodeCreationSetting {
85
92
  visible?: boolean;
86
93
  }
87
94
 
95
+ /**
96
+ * Interop struct for node property
97
+ */
98
+ export interface NodePropertyInterop {
99
+ /**
100
+ * Property name
101
+ */
102
+ name: string;
103
+ /**
104
+ * Property value
105
+ */
106
+ value: NodePropertyValue;
107
+ /**
108
+ * Whether the node has input connection and the property change is disabled
109
+ */
110
+ connected?: boolean;
111
+ /**
112
+ * Whether the property is disabled in node\' inspector
113
+ */
114
+ disabled?: boolean;
115
+ }
116
+
88
117
 
89
118
  /// Manually added types due to limitations in the `wasm-bindgen` & `tsify` crates.
90
119
  export type ID<T = any> = string;
@@ -117,6 +146,36 @@ export type Transform3<T = number> = FixedLengthArray<T, 16>;
117
146
  export type Matrix4<T = number> = FixedLengthArray<FixedLengthArray<T, 4>, 4>;
118
147
 
119
148
 
149
+ /**
150
+ * Options for adaptive tessellation to create geometry interoperability
151
+ */
152
+ export interface AdaptiveTessellationOptions {
153
+ /**
154
+ * Whether to enable adaptive tessellation
155
+ */
156
+ enabled: boolean;
157
+ /**
158
+ * Tolerance for the normal vector: if the L2 norm of the normal vectors is below this value, the edge is considered flat
159
+ */
160
+ normTolerance: number;
161
+ /**
162
+ * Minimum number of divisions in u direction
163
+ */
164
+ minDivsU: number;
165
+ /**
166
+ * Minimum number of divisions in v direction
167
+ */
168
+ minDivsV: number;
169
+ /**
170
+ * Minimum depth for division
171
+ */
172
+ minDepth: number;
173
+ /**
174
+ * Maximum depth for division
175
+ */
176
+ maxDepth: number;
177
+ }
178
+
120
179
  /**
121
180
  * Interop struct for node
122
181
  */
@@ -190,6 +249,36 @@ export interface NodeConnectionInterop {
190
249
  inputConnectionIndex: number | undefined;
191
250
  }
192
251
 
252
+ export interface IOInterop {
253
+ id: string;
254
+ name: string;
255
+ accessType: AccessTypes;
256
+ hint: TypeHint | undefined;
257
+ connections: string[];
258
+ }
259
+
260
+ /**
261
+ * Geometry identifier
262
+ */
263
+ export interface GeometryIdentifier {
264
+ /**
265
+ * Parent node ID
266
+ */
267
+ graphNodeSet?: GraphNodeSet;
268
+ /**
269
+ * Output ID that the geometry is belonged to
270
+ */
271
+ outputId: OutputId;
272
+ /**
273
+ * Geometry ID
274
+ */
275
+ geometryId: ID<GeometryProxy>;
276
+ /**
277
+ * Transform matrix in interop format
278
+ */
279
+ transform: TransformInterop;
280
+ }
281
+
193
282
  export interface PointListHandleUnit {
194
283
  count: number;
195
284
  points: number;
@@ -214,190 +303,87 @@ export interface VectorDisplayHandle {
214
303
 
215
304
  export type DisplayProxyHandle = { variant: "Vector"; data: VectorDisplayHandle } | { variant: "PointList"; data: PointListDisplayHandle };
216
305
 
217
- export interface GeometrySpreadsheet {
218
- points: Point3<number>[];
219
- curves: CurveProxy[];
220
- surfaces: SurfaceProxy[];
221
- meshes: MeshInterop[];
306
+ export type GeometryInteropHandleProxy = { variant: "Mesh"; data: MeshInteropHandle } | { variant: "Curve"; data: CurveInteropHandle } | { variant: "Group"; data: GroupInteropHandle };
307
+
308
+ export interface SubGraphIdSet {
309
+ subGraphId: SubGraphId;
310
+ instanceId: SubGraphInstanceId;
222
311
  }
223
312
 
224
313
  /**
225
- * Options for adaptive tessellation to create geometry interoperability
314
+ * Defines the dynamics of an IO parameter.
226
315
  */
227
- export interface AdaptiveTessellationOptions {
228
- /**
229
- * Whether to enable adaptive tessellation
230
- */
231
- enabled: boolean;
232
- /**
233
- * Tolerance for the normal vector: if the L2 norm of the normal vectors is below this value, the edge is considered flat
234
- */
235
- normTolerance: number;
236
- /**
237
- * Minimum number of divisions in u direction
238
- */
239
- minDivsU: number;
240
- /**
241
- * Minimum number of divisions in v direction
242
- */
243
- minDivsV: number;
244
- /**
245
- * Minimum depth for division
246
- */
247
- minDepth: number;
248
- /**
249
- * Maximum depth for division
250
- */
251
- maxDepth: number;
316
+ export interface IOVariables {
317
+ minCount: number;
318
+ maxCount: number;
319
+ defaultCount: number;
320
+ offset: number;
321
+ editable: boolean;
252
322
  }
253
323
 
254
324
  /**
255
- * Interop struct for transform
256
- * Represents a 4x4 matrix as a 16-element array
325
+ * A set of node id and instance id
257
326
  */
258
- export type TransformInterop = number[];
259
-
260
- export type GeometryInteropVec = GeometryInterop[];
261
-
262
- export type NodeConnectionInteropVec = NodeConnectionInterop[];
327
+ export interface GraphNodeSet {
328
+ subGraphIdSet: SubGraphIdSet | undefined;
329
+ nodeId: NodeId;
330
+ }
263
331
 
264
- export type NodePropertyInteropVec = NodePropertyInterop[];
332
+ export type AccessTypes = "Item" | "List" | "Tree";
265
333
 
266
- export type NodeInteropVec = NodeInterop[];
334
+ /**
335
+ * A parameter for an input or output of a node.
336
+ */
337
+ export interface IOParameter<T, U> {
338
+ id: T;
339
+ name: string;
340
+ access_type: AccessTypes;
341
+ hint?: TypeHint;
342
+ connections: U[];
343
+ }
267
344
 
268
- export type EdgeInteropVec = EdgeInterop[];
345
+ export type TypeHint = Internal;
269
346
 
270
- export interface IOInterop {
271
- id: string;
272
- name: string;
273
- accessType: AccessTypes;
274
- hint: TypeHint | undefined;
275
- connections: string[];
347
+ export interface IOManager<T, U> {
348
+ parameters: IOParameter<T, U>[];
276
349
  }
277
350
 
278
- /**
279
- * Interop struct for evaluation results
280
- */
281
- export interface EvaluationInterop {
282
- /**
283
- * Processed nodes in the latest evaluation
284
- */
285
- processedNodes: GraphNodeSet[];
286
- /**
287
- * Geometry identifiers in the latest evaluation
288
- */
289
- geometryIdentifiers: GeometryIdentifier[];
290
- }
291
-
292
- /**
293
- * Curve interop handle for wasm interop
294
- * stride = 3 (x, y, z)
295
- */
296
- export interface CurveInteropHandle {
297
- count: number;
298
- vertices: number;
299
- transform: TransformInterop | undefined;
300
- }
301
-
302
- export type NodeSectionInterop = { type: "section"; content: NodeFolderInterop } | { type: "item"; content: NodeItemInterop };
351
+ export type GraphMappingTypes = "None" | "Bezier" | "Linear" | "Sine";
303
352
 
304
- export interface NodeItemInterop {
305
- key: string;
306
- name: string;
353
+ export interface Connection {
354
+ source: NodeParameter<OutputId>;
355
+ destination: NodeParameter<InputId>;
307
356
  }
308
357
 
309
- export type NodeFolderInterop = IndexMap<string, NodeSectionInterop>;
310
-
311
- export interface NodeMapInterop {
312
- folder: NodeFolderInterop;
358
+ export interface NodeParameter<T> {
359
+ nodeId: NodeId;
360
+ parameterId: T;
361
+ parameterIndex: number;
313
362
  }
314
363
 
315
364
  /**
316
- * Geometry identifier
365
+ * A sub graph is a graph that is a part of a larger graph
317
366
  */
318
- export interface GeometryIdentifier {
319
- /**
320
- * Parent node ID
321
- */
322
- graphNodeSet?: GraphNodeSet;
367
+ export interface SubGraph<T, U> {
323
368
  /**
324
- * Output ID that the geometry is belonged to
369
+ * The id of the sub graph
325
370
  */
326
- outputId: OutputId;
371
+ id: SubGraphId;
327
372
  /**
328
- * Geometry ID
373
+ * The graph of the sub graph
329
374
  */
330
- geometryId: ID<GeometryProxy>;
375
+ graph: Graph<T, U>;
331
376
  /**
332
- * Transform matrix in interop format
377
+ * The instances of the sub graph
333
378
  */
334
- transform: TransformInterop;
335
- }
336
-
337
- export interface SubGraphIdSet {
338
- subGraphId: SubGraphId;
339
- instanceId: SubGraphInstanceId;
340
- }
341
-
342
- export interface NodePropertyCategoryValue {
343
- candidates: IndexMap<string, number>;
344
- selected: number;
345
- }
346
-
347
- export interface NodePropertyRangeValue {
348
- value: number;
349
- min: number | undefined;
350
- max: number | undefined;
351
- step: number | undefined;
352
- }
353
-
354
- export type NodePropertyValue = { type: "Number"; content: number } | { type: "Range"; content: NodePropertyRangeValue } | { type: "Range2d"; content: [NodePropertyRangeValue, NodePropertyRangeValue] } | { type: "String"; content: string } | { type: "Bool"; content: boolean } | { type: "NumberVector"; content: number[] } | { type: "Category"; content: NodePropertyCategoryValue } | { type: "Vector2d"; content: [number, number] } | { type: "Vector3d"; content: [number, number, number] } | { type: "Point2d"; content: [number, number] } | { type: "Point3d"; content: [number, number, number] } | { type: "Points2d"; content: [number, number][] } | { type: "Buffer"; content: number[] };
355
-
356
- /**
357
- * Defines the dynamics of an IO parameter.
358
- */
359
- export interface IOVariables {
360
- minCount: number;
361
- maxCount: number;
362
- defaultCount: number;
363
- offset: number;
364
- editable: boolean;
365
- }
366
-
367
- /**
368
- * A set of node id and instance id
369
- */
370
- export interface GraphNodeSet {
371
- subGraphIdSet: SubGraphIdSet | undefined;
372
- nodeId: NodeId;
373
- }
374
-
375
- export type AccessTypes = "Item" | "List" | "Tree";
376
-
377
- export interface Connection {
378
- source: NodeParameter<OutputId>;
379
- destination: NodeParameter<InputId>;
380
- }
381
-
382
- export interface NodeParameter<T> {
383
- nodeId: NodeId;
384
- parameterId: T;
385
- parameterIndex: number;
386
- }
387
-
388
- export interface ConnectedComponentNode {
389
- sources: NodeId[];
390
- destinations: NodeId[];
379
+ instances: SubGraphInstanceId[];
391
380
  }
392
381
 
393
- export interface ConnectedComponents<T, U> {
394
- nodes: IndexMap<NodeId, ConnectedComponentNode<T, U>>;
382
+ export interface Prune<T, U> {
383
+ connectedComponents: ConnectedComponents<T, U>[];
384
+ bypass: Connection[] | undefined;
395
385
  }
396
386
 
397
- export type TypeHint = Internal;
398
-
399
- export type GraphMappingTypes = "None" | "Bezier" | "Linear" | "Sine";
400
-
401
387
  export interface Node<T> {
402
388
  id: NodeId;
403
389
  name: string;
@@ -413,23 +399,20 @@ export type OutputIOManager = IOManager<OutputId, InputId>;
413
399
 
414
400
  export type InputIOManager = IOManager<InputId, OutputId>;
415
401
 
416
- /**
417
- * A parameter for an input or output of a node.
418
- */
419
- export interface IOParameter<T, U> {
420
- id: T;
421
- name: string;
422
- access_type: AccessTypes;
423
- hint?: TypeHint;
424
- connections: U[];
402
+ export interface NodePropertyCategoryValue {
403
+ candidates: IndexMap<string, number>;
404
+ selected: number;
425
405
  }
426
406
 
427
- export type GraphVariant = "Root" | { SubGraph: SubGraphId };
428
-
429
- export interface IOManager<T, U> {
430
- parameters: IOParameter<T, U>[];
407
+ export interface NodePropertyRangeValue {
408
+ value: number;
409
+ min: number | undefined;
410
+ max: number | undefined;
411
+ step: number | undefined;
431
412
  }
432
413
 
414
+ export type NodePropertyValue = { type: "Number"; content: number } | { type: "Range"; content: NodePropertyRangeValue } | { type: "Range2d"; content: [NodePropertyRangeValue, NodePropertyRangeValue] } | { type: "String"; content: string } | { type: "Bool"; content: boolean } | { type: "NumberVector"; content: number[] } | { type: "Category"; content: NodePropertyCategoryValue } | { type: "Vector2d"; content: [number, number] } | { type: "Vector3d"; content: [number, number, number] } | { type: "Point2d"; content: [number, number] } | { type: "Point3d"; content: [number, number, number] } | { type: "Points2d"; content: [number, number][] } | { type: "Buffer"; content: number[] };
415
+
433
416
  /**
434
417
  * Graph structure
435
418
  */
@@ -444,29 +427,17 @@ export interface Graph<T, U> {
444
427
  sub_graphs?: IndexMap<SubGraphId, SubGraph<T, U>>;
445
428
  }
446
429
 
447
- /**
448
- * A sub graph is a graph that is a part of a larger graph
449
- */
450
- export interface SubGraph<T, U> {
451
- /**
452
- * The id of the sub graph
453
- */
454
- id: SubGraphId;
455
- /**
456
- * The graph of the sub graph
457
- */
458
- graph: Graph<T, U>;
459
- /**
460
- * The instances of the sub graph
461
- */
462
- instances: SubGraphInstanceId[];
430
+ export interface ConnectedComponentNode {
431
+ sources: NodeId[];
432
+ destinations: NodeId[];
463
433
  }
464
434
 
465
- export interface Prune<T, U> {
466
- connectedComponents: ConnectedComponents<T, U>[];
467
- bypass: Connection[] | undefined;
435
+ export interface ConnectedComponents<T, U> {
436
+ nodes: IndexMap<NodeId, ConnectedComponentNode<T, U>>;
468
437
  }
469
438
 
439
+ export type GraphVariant = "Root" | { SubGraph: SubGraphId };
440
+
470
441
 
471
442
  export type LineCurve3D = {
472
443
  a: Point3;
@@ -474,6 +445,13 @@ export type LineCurve3D = {
474
445
  };
475
446
 
476
447
 
448
+ export type NurbsCurve3D<T = number> = {
449
+ control_points: Point4<T>[];
450
+ knots: T[];
451
+ degree: T;
452
+ };
453
+
454
+
477
455
  export type PolylineCurve2D = {
478
456
  points: Point2[];
479
457
  };
@@ -500,6 +478,10 @@ export interface MeshInterop {
500
478
  * Normals of the mesh
501
479
  */
502
480
  normals: [number, number, number][];
481
+ /**
482
+ * Colors of the mesh
483
+ */
484
+ colors?: [number, number, number][];
503
485
  /**
504
486
  * UV coordinates of the mesh
505
487
  */
@@ -514,35 +496,27 @@ export interface MeshInterop {
514
496
  transform?: Transform3<number>;
515
497
  }
516
498
 
517
- /**
518
- * A collection of geometry objects
519
- */
520
- export type Group = GeometryTransform[];
499
+ export type NurbsCurve = NurbsCurve3D<number>;
521
500
 
522
- /**
523
- * Proxy for various surface types
524
- */
525
- export type SurfaceProxy = { variant: "Circular"; data: CircularSurface } | { variant: "Triangle"; data: TriangleSurface } | { variant: "Plane"; data: PlaneSurface } | { variant: "NURBS"; data: NurbsSurface } | { variant: "Trimmed"; data: TrimmedSurface };
501
+ export interface Domain {
502
+ min: number;
503
+ max: number;
504
+ }
526
505
 
527
506
  /**
528
- * A circular surface
507
+ * Interop struct for point cloud data
529
508
  */
530
- export interface CircularSurface {
509
+ export interface PointCloudInterop {
531
510
  /**
532
- * The base plane of the circle
511
+ * Vertices of the point cloud
533
512
  */
534
- plane: Plane;
513
+ vertices: [number, number, number][];
535
514
  /**
536
- * The radius of the circle
515
+ * Transform matrix of the point cloud
537
516
  */
538
- radius: number;
517
+ transform: Transform3<number>;
539
518
  }
540
519
 
541
- /**
542
- * Interop proxy for various geometry types
543
- */
544
- export type GeometryInterop = { variant: "Mesh"; data: MeshInterop } | { variant: "Curve"; data: CurveInterop } | { variant: "Point"; data: PointCloudInterop } | { variant: "Plane"; data: Plane } | { variant: "Group"; data: GeometryInterop[] };
545
-
546
520
  /**
547
521
  * Plane representation with origin, normal, x axis, and y axis
548
522
  */
@@ -565,6 +539,20 @@ export interface Plane {
565
539
  yAxis: Vector3<number>;
566
540
  }
567
541
 
542
+ /**
543
+ * A collection of geometry objects
544
+ */
545
+ export type Group = GeometryTransform[];
546
+
547
+ /**
548
+ * A face of a mesh with three vertices
549
+ */
550
+ export interface MeshTriangleFace {
551
+ a: number;
552
+ b: number;
553
+ c: number;
554
+ }
555
+
568
556
  /**
569
557
  * A geometry object with a transformation
570
558
  */
@@ -579,32 +567,8 @@ export interface GeometryTransform {
579
567
  transform: Transform3<number>;
580
568
  }
581
569
 
582
- /**
583
- * Interop struct for point cloud data
584
- */
585
- export interface PointCloudInterop {
586
- /**
587
- * Vertices of the point cloud
588
- */
589
- vertices: [number, number, number][];
590
- /**
591
- * Transform matrix of the point cloud
592
- */
593
- transform: Transform3<number>;
594
- }
595
-
596
- /**
597
- * Geometry proxy for various geometry types
598
- */
599
- export type GeometryProxy = { variant: "Curve"; data: CurveProxy } | { variant: "Surface"; data: SurfaceProxy } | { variant: "Brep"; data: Brep } | { variant: "Mesh"; data: Mesh } | { variant: "BBox"; data: OrientedBox } | { variant: "Group"; data: Group };
600
-
601
570
  export type PolyCurve = CompoundCurve<number, U4>;
602
571
 
603
- /**
604
- * Proxy for various curve types
605
- */
606
- export type CurveProxy = { variant: "Line"; data: LineCurve3D } | { variant: "Arc"; data: ArcCurve } | { variant: "Circle"; data: CircleCurve } | { variant: "Ellipse"; data: EllipseCurve } | { variant: "Rectangle"; data: RectangleCurve } | { variant: "Polyline"; data: PolylineCurve3D } | { variant: "NURBS"; data: NurbsCurve } | { variant: "Poly"; data: PolyCurve };
607
-
608
572
 
609
573
  export type NurbsSurface3D<T = number> = {
610
574
  control_points: Point4<T>[][];
@@ -614,6 +578,20 @@ export type NurbsSurface3D<T = number> = {
614
578
  v_degree: T;
615
579
  };
616
580
 
581
+ /**
582
+ * Interop struct for curve data
583
+ */
584
+ export interface CurveInterop {
585
+ /**
586
+ * Vertices of the curve
587
+ */
588
+ vertices: [number, number, number][];
589
+ /**
590
+ * Transform matrix of the curve
591
+ */
592
+ transform: Transform3<number> | undefined;
593
+ }
594
+
617
595
  /**
618
596
  * An oriented box in 3D space
619
597
  */
@@ -629,50 +607,91 @@ export interface OrientedBox {
629
607
  }
630
608
 
631
609
  /**
632
- * A NURBS surface container
633
- */
634
- export type NurbsSurface = NurbsSurface3D<number>;
635
-
636
- /**
637
- * A rectangle curve in 3D space
610
+ * Mesh representation with vertices, normals, uv, and index
638
611
  */
639
- export interface RectangleCurve {
612
+ export interface Mesh {
640
613
  /**
641
- * The base plane of the rectangle
614
+ * Vertices of the mesh
642
615
  */
643
- plane: Plane;
616
+ vertices: Point3<number>[];
644
617
  /**
645
- * The domain of the rectangle in the plane x axis
618
+ * Normals of the mesh
646
619
  */
647
- x: Domain;
620
+ normals: Vector3<number>[] | undefined;
648
621
  /**
649
- * The domain of the rectangle in the plane y axis
622
+ * UV coordinates of the mesh
650
623
  */
651
- y: Domain;
624
+ uv: Vector2<number>[] | undefined;
625
+ /**
626
+ * Colors of the mesh
627
+ */
628
+ colors: Vector3<number>[] | undefined;
629
+ /**
630
+ * Index of the mesh
631
+ */
632
+ index: [number, number, number][];
652
633
  }
653
634
 
654
635
  /**
655
- * A ellipse curve in 3D space
636
+ * A surface defined by three points
656
637
  */
657
- export interface EllipseCurve {
638
+ export type TriangleSurface = Triangle3D;
639
+
640
+ /**
641
+ * A NURBS surface container
642
+ */
643
+ export type NurbsSurface = NurbsSurface3D<number>;
644
+
645
+ export interface MeshInteropHandle {
646
+ count: number;
647
+ vertices: number;
648
+ normals: number;
649
+ indices: IndicesInteropHandle | undefined;
650
+ transform: TransformInterop | undefined;
651
+ }
652
+
653
+ export interface IndicesInteropHandle {
654
+ count: number;
655
+ indices: number;
656
+ }
657
+
658
+ /**
659
+ * Curve interop handle for wasm interop
660
+ * stride = 3 (x, y, z)
661
+ */
662
+ export interface CurveInteropHandle {
663
+ count: number;
664
+ vertices: number;
665
+ transform: TransformInterop | undefined;
666
+ }
667
+
668
+ /**
669
+ * Interop proxy for various geometry types
670
+ */
671
+ export type GeometryInterop = { variant: "Mesh"; data: MeshInterop } | { variant: "Curve"; data: CurveInterop } | { variant: "Point"; data: PointCloudInterop } | { variant: "Plane"; data: Plane } | { variant: "Group"; data: GeometryInterop[] };
672
+
673
+ /**
674
+ * A surface defined by a plane and two domains in x and y directions
675
+ */
676
+ export interface PlaneSurface {
658
677
  /**
659
- * The base plane of the ellipse
678
+ * The base plane of the surface
660
679
  */
661
680
  plane: Plane;
662
681
  /**
663
- * The x radius of the ellipse
682
+ * The domain in x direction
664
683
  */
665
- xRadius: number;
684
+ x: Domain;
666
685
  /**
667
- * The y radius of the ellipse
686
+ * The domain in y direction
668
687
  */
669
- yRadius: number;
688
+ y: Domain;
670
689
  }
671
690
 
672
691
  /**
673
- * A circle curve in 3D space
692
+ * A circular surface
674
693
  */
675
- export interface CircleCurve {
694
+ export interface CircularSurface {
676
695
  /**
677
696
  * The base plane of the circle
678
697
  */
@@ -684,119 +703,143 @@ export interface CircleCurve {
684
703
  }
685
704
 
686
705
  /**
687
- * An arc curve in 3D space
706
+ * A surface defined by a base surface and trimming curves
707
+ *
708
+ * The trimming curves are defined in the parameter space (2D) of the base surface.
709
+ * - exterior: Optional outer boundary curve in parameter space
710
+ * - interiors: Interior holes in parameter space
688
711
  */
689
- export interface ArcCurve {
712
+ export interface TrimmedSurface {
713
+ baseSurface: SurfaceProxy;
714
+ exterior: CompoundCurve2D<number> | undefined;
715
+ interiors: CompoundCurve2D<number>[];
716
+ }
717
+
718
+ /**
719
+ * A surface defined by a plane and two domains in x and y directions
720
+ */
721
+ export interface TorusSurface {
690
722
  /**
691
- * The base plane of the arc
723
+ * The base plane of the surface
692
724
  */
693
725
  plane: Plane;
694
726
  /**
695
- * The start angle of the arc
727
+ * The major radius of the torus
696
728
  */
697
- startAngle: number;
729
+ majorRadius: number;
698
730
  /**
699
- * The end angle of the arc
731
+ * The minor radius of the torus
700
732
  */
701
- endAngle: number;
733
+ minorRadius: number;
702
734
  /**
703
- * The radius of the arc
735
+ * The domain in u direction
704
736
  */
705
- radius: number;
737
+ uDomain: Domain;
738
+ /**
739
+ * The domain in v direction
740
+ */
741
+ vDomain: Domain;
706
742
  }
707
743
 
708
-
709
- export type BoundingBox3D = {
710
- min: Vector3;
711
- max: Vector3;
712
- };
713
-
714
- export interface Domain {
715
- min: number;
716
- max: number;
744
+ /**
745
+ * A circle curve in 3D space
746
+ */
747
+ export interface CircleCurve {
748
+ /**
749
+ * The base plane of the circle
750
+ */
751
+ plane: Plane;
752
+ /**
753
+ * The radius of the circle
754
+ */
755
+ radius: number;
717
756
  }
718
757
 
719
758
  /**
720
- * A face of a mesh with three vertices
759
+ * Interop struct for transform
760
+ * Represents a 4x4 matrix as a 16-element array
721
761
  */
722
- export interface MeshTriangleFace {
723
- a: number;
724
- b: number;
725
- c: number;
726
- }
762
+ export type TransformInterop = number[];
727
763
 
764
+ /**
765
+ * Geometry proxy for various geometry types
766
+ */
767
+ export type GeometryProxy = { variant: "Curve"; data: CurveProxy } | { variant: "Surface"; data: SurfaceProxy } | { variant: "Brep"; data: Brep } | { variant: "Mesh"; data: Mesh } | { variant: "BBox"; data: OrientedBox } | { variant: "Group"; data: Group };
728
768
 
729
- export type NurbsCurve3D<T = number> = {
730
- control_points: Point4<T>[];
731
- knots: T[];
732
- degree: T;
733
- };
769
+ /**
770
+ * Proxy for various surface types
771
+ */
772
+ export type SurfaceProxy = { variant: "Circular"; data: CircularSurface } | { variant: "Triangle"; data: TriangleSurface } | { variant: "Plane"; data: PlaneSurface } | { variant: "Torus"; data: TorusSurface } | { variant: "NURBS"; data: NurbsSurface } | { variant: "Trimmed"; data: TrimmedSurface };
734
773
 
735
774
  /**
736
- * Interop struct for curve data
775
+ * A rectangle curve in 3D space
737
776
  */
738
- export interface CurveInterop {
777
+ export interface RectangleCurve {
739
778
  /**
740
- * Vertices of the curve
779
+ * The base plane of the rectangle
741
780
  */
742
- vertices: [number, number, number][];
781
+ plane: Plane;
743
782
  /**
744
- * Transform matrix of the curve
783
+ * The domain of the rectangle in the plane x axis
745
784
  */
746
- transform: Transform3<number> | undefined;
785
+ x: Domain;
786
+ /**
787
+ * The domain of the rectangle in the plane y axis
788
+ */
789
+ y: Domain;
747
790
  }
748
791
 
749
792
  /**
750
- * Mesh representation with vertices, normals, uv, and index
793
+ * A ellipse curve in 3D space
751
794
  */
752
- export interface Mesh {
753
- /**
754
- * Vertices of the mesh
755
- */
756
- vertices: Point3<number>[];
757
- /**
758
- * Normals of the mesh
759
- */
760
- normals: Vector3<number>[] | undefined;
795
+ export interface EllipseCurve {
761
796
  /**
762
- * UV coordinates of the mesh
797
+ * The base plane of the ellipse
763
798
  */
764
- uv: Vector2<number>[] | undefined;
799
+ plane: Plane;
765
800
  /**
766
- * Colors of the mesh
801
+ * The x radius of the ellipse
767
802
  */
768
- colors: Vector3<number>[] | undefined;
803
+ xRadius: number;
769
804
  /**
770
- * Index of the mesh
805
+ * The y radius of the ellipse
771
806
  */
772
- index: [number, number, number][];
807
+ yRadius: number;
773
808
  }
774
809
 
775
810
  /**
776
- * A surface defined by three points
811
+ * Proxy for various curve types
777
812
  */
778
- export type TriangleSurface = Triangle3D;
813
+ export type CurveProxy = { variant: "Line"; data: LineCurve3D } | { variant: "Arc"; data: ArcCurve } | { variant: "Circle"; data: CircleCurve } | { variant: "Ellipse"; data: EllipseCurve } | { variant: "Rectangle"; data: RectangleCurve } | { variant: "Polyline"; data: PolylineCurve3D } | { variant: "NURBS"; data: NurbsCurve } | { variant: "Poly"; data: PolyCurve };
814
+
815
+
816
+ export type BoundingBox3D = {
817
+ min: Vector3;
818
+ max: Vector3;
819
+ };
779
820
 
780
821
  /**
781
- * A surface defined by a plane and two domains in x and y directions
822
+ * An arc curve in 3D space
782
823
  */
783
- export interface PlaneSurface {
824
+ export interface ArcCurve {
784
825
  /**
785
- * The base plane of the surface
826
+ * The base plane of the arc
786
827
  */
787
828
  plane: Plane;
788
829
  /**
789
- * The domain in x direction
830
+ * The start angle of the arc
790
831
  */
791
- x: Domain;
832
+ startAngle: number;
792
833
  /**
793
- * The domain in y direction
834
+ * The end angle of the arc
794
835
  */
795
- y: Domain;
836
+ endAngle: number;
837
+ /**
838
+ * The radius of the arc
839
+ */
840
+ radius: number;
796
841
  }
797
842
 
798
- export type NurbsCurve = NurbsCurve3D<number>;
799
-
800
843
  /**
801
844
  * Modular structure with a graph handle
802
845
  */
@@ -867,17 +910,17 @@ export interface InitOutput {
867
910
  readonly modular_findGeometryInteropById: (a: number, b: any) => any;
868
911
  readonly modular_updateTessellationOptions: (a: number, b: number) => void;
869
912
  readonly do_nothing_just_tell_wasm_bindgen_to_generate_types: () => void;
913
+ readonly wasm_bindgen__convert__closures_____invoke__hffd4dd448f07753e: (a: number, b: number, c: any) => void;
914
+ readonly wasm_bindgen__closure__destroy__h1033e34e643c979e: (a: number, b: number) => void;
915
+ readonly wasm_bindgen__convert__closures_____invoke__h963e2c009efa9d83: (a: number, b: number, c: any, d: any) => void;
870
916
  readonly __wbindgen_malloc: (a: number, b: number) => number;
871
917
  readonly __wbindgen_realloc: (a: number, b: number, c: number, d: number) => number;
872
918
  readonly __wbindgen_exn_store: (a: number) => void;
873
919
  readonly __externref_table_alloc: () => number;
874
- readonly __wbindgen_export_4: WebAssembly.Table;
875
- readonly __wbindgen_export_5: WebAssembly.Table;
920
+ readonly __wbindgen_externrefs: WebAssembly.Table;
876
921
  readonly __externref_table_dealloc: (a: number) => void;
877
922
  readonly __externref_drop_slice: (a: number, b: number) => void;
878
923
  readonly __wbindgen_free: (a: number, b: number, c: number) => void;
879
- readonly closure964_externref_shim: (a: number, b: number, c: any) => void;
880
- readonly closure3977_externref_shim: (a: number, b: number, c: any, d: any) => void;
881
924
  readonly __wbindgen_start: () => void;
882
925
  }
883
926