nodi-modular 0.0.28 → 0.0.30

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/index.d.ts CHANGED
@@ -6,13 +6,13 @@ export function do_nothing_just_tell_wasm_bindgen_to_generate_types(): void;
6
6
  */
7
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
8
 
9
+ export type NodeOutput = (Map<string, Item[]> | undefined)[];
10
+
9
11
  export interface GeometryTransformInterop {
10
12
  geometry: GeometryProxy;
11
13
  transform: TransformInterop;
12
14
  }
13
15
 
14
- export type NodeOutput = (Map<string, Item[]> | undefined)[];
15
-
16
16
  export type GeometryInteropVec = GeometryInterop[];
17
17
 
18
18
  export type NodeConnectionInteropVec = NodeConnectionInterop[];
@@ -23,6 +23,22 @@ export type NodeInteropVec = NodeInterop[];
23
23
 
24
24
  export type EdgeInteropVec = EdgeInterop[];
25
25
 
26
+ export interface IOInterop {
27
+ id: string;
28
+ name: string;
29
+ accessType: AccessTypes;
30
+ hint: TypeHint | undefined;
31
+ connections: string[];
32
+ }
33
+
34
+ export interface DataTreeInterop {
35
+ branches: IndexMap<string, string[]>;
36
+ }
37
+
38
+ export interface DataTreeFormatInterop {
39
+ outputs: IndexMap<string, string>;
40
+ }
41
+
26
42
  export interface GeometrySpreadsheet {
27
43
  points: Point3<number>[];
28
44
  curves: CurveProxy[];
@@ -30,12 +46,132 @@ export interface GeometrySpreadsheet {
30
46
  meshes: MeshInterop[];
31
47
  }
32
48
 
33
- export interface DataTreeInterop {
34
- branches: IndexMap<string, string[]>;
49
+ export interface GroupInteropHandle {
50
+ objects: GeometryInteropHandleProxy[];
35
51
  }
36
52
 
37
- export interface DataTreeFormatInterop {
38
- outputs: IndexMap<string, string>;
53
+ export interface NodeCreationSetting {
54
+ id: NodeId;
55
+ variant: string;
56
+ name?: string;
57
+ label?: string;
58
+ inputs?: number;
59
+ outputs?: number;
60
+ properties: NodePropertyInterop[];
61
+ enabled?: boolean;
62
+ visible?: boolean;
63
+ }
64
+
65
+ /**
66
+ * Interop struct for node property
67
+ */
68
+ export interface NodePropertyInterop {
69
+ /**
70
+ * Property name
71
+ */
72
+ name: string;
73
+ /**
74
+ * Property value
75
+ */
76
+ value: NodePropertyValue;
77
+ /**
78
+ * Whether the node has input connection and the property change is disabled
79
+ */
80
+ connected?: boolean;
81
+ /**
82
+ * Whether the property is disabled in node\' inspector
83
+ */
84
+ disabled?: boolean;
85
+ }
86
+
87
+ export interface NodeConnectionInterop {
88
+ outputNodeId: string;
89
+ outputIndex: number;
90
+ inputNodeId: string;
91
+ inputIndex: number;
92
+ inputConnectionIndex: number | undefined;
93
+ }
94
+
95
+ export interface IndicesInteropHandle {
96
+ count: number;
97
+ indices: number;
98
+ }
99
+
100
+
101
+ /// Manually added types due to limitations in the `wasm-bindgen` & `tsify` crates.
102
+ export type ID<T = any> = string;
103
+ export type NodeId = ID;
104
+ export type InputId = ID;
105
+ export type OutputId = ID;
106
+ export type SubGraphId = ID;
107
+ export type SubGraphInstanceId = ID;
108
+
109
+ export type IndexMap<K, V> = Map<K, V>;
110
+
111
+ export type U1 = 1;
112
+ export type U2 = 2;
113
+ export type U3 = 3;
114
+
115
+ /// Define vector & point types with FixedLengthArray
116
+ type BuildTuple<L extends number, T, R extends any[] = []> = R['length'] extends L ? R : BuildTuple<L, T, [T, ...R]>;
117
+ type FixedLengthArray<T, L extends number> = BuildTuple<L, T>;
118
+ export type OPoint<T, D extends number> = FixedLengthArray<T, D>;
119
+ export type OVector<T, D extends number> = FixedLengthArray<T, D>;
120
+ export type Point<T, D extends number> = OPoint<T, D>;
121
+ export type SVector<T, D extends number> = OVector<T, D>;
122
+ export type Point2<T = number> = Point<T, 2>;
123
+ export type Vector2<T = number> = SVector<T, 2>;
124
+ export type Point3<T = number> = Point<T, 3>;
125
+ export type Vector3<T = number> = SVector<T, 3>;
126
+ export type Point4<T = number> = Point<T, 4>;
127
+ export type Vector4<T = number> = SVector<T, 4>;
128
+ export type Transform3<T = number> = FixedLengthArray<T, 16>;
129
+ export type Matrix4<T = number> = FixedLengthArray<FixedLengthArray<T, 4>, 4>;
130
+
131
+
132
+ /**
133
+ * Geometry identifier
134
+ */
135
+ export interface GeometryIdentifier {
136
+ /**
137
+ * Parent node ID
138
+ */
139
+ graphNodeSet?: GraphNodeSet;
140
+ /**
141
+ * Output ID that the geometry is belonged to
142
+ */
143
+ outputId: OutputId;
144
+ /**
145
+ * Geometry ID
146
+ */
147
+ geometryId: ID<GeometryProxy>;
148
+ /**
149
+ * Transform matrix in interop format
150
+ */
151
+ transform: TransformInterop;
152
+ }
153
+
154
+ export type NodeSectionInterop = { type: "section"; content: NodeFolderInterop } | { type: "item"; content: NodeItemInterop };
155
+
156
+ export interface NodeItemInterop {
157
+ key: string;
158
+ name: string;
159
+ }
160
+
161
+ export type NodeFolderInterop = IndexMap<string, NodeSectionInterop>;
162
+
163
+ export interface NodeMapInterop {
164
+ folder: NodeFolderInterop;
165
+ }
166
+
167
+ /**
168
+ * Curve interop handle for wasm interop
169
+ * stride = 3 (x, y, z)
170
+ */
171
+ export interface CurveInteropHandle {
172
+ count: number;
173
+ vertices: number;
174
+ transform: TransformInterop | undefined;
39
175
  }
40
176
 
41
177
  export interface MeshInteropHandle {
@@ -46,6 +182,17 @@ export interface MeshInteropHandle {
46
182
  transform: TransformInterop | undefined;
47
183
  }
48
184
 
185
+ export interface EdgeInterop {
186
+ source: EdgeUnitInterop<OutputId>;
187
+ destination: EdgeUnitInterop<InputId>;
188
+ empty: boolean;
189
+ }
190
+
191
+ export interface EdgeUnitInterop<IO> {
192
+ node: NodeId;
193
+ io: IO;
194
+ }
195
+
49
196
  /**
50
197
  * Options for adaptive tessellation to create geometry interoperability
51
198
  */
@@ -102,29 +249,6 @@ export interface VectorDisplayHandle {
102
249
 
103
250
  export type DisplayProxyHandle = { variant: "Vector"; data: VectorDisplayHandle } | { variant: "PointList"; data: PointListDisplayHandle };
104
251
 
105
- export type NodeSectionInterop = { type: "section"; content: NodeFolderInterop } | { type: "item"; content: NodeItemInterop };
106
-
107
- export interface NodeItemInterop {
108
- key: string;
109
- name: string;
110
- }
111
-
112
- export type NodeFolderInterop = IndexMap<string, NodeSectionInterop>;
113
-
114
- export interface NodeMapInterop {
115
- folder: NodeFolderInterop;
116
- }
117
-
118
- /**
119
- * Curve interop handle for wasm interop
120
- * stride = 3 (x, y, z)
121
- */
122
- export interface CurveInteropHandle {
123
- count: number;
124
- vertices: number;
125
- transform: TransformInterop | undefined;
126
- }
127
-
128
252
  /**
129
253
  * Interop struct for transform
130
254
  * Represents a 4x4 matrix as a 16-element array
@@ -210,129 +334,9 @@ export interface EvaluationInterop {
210
334
  geometryIdentifiers: GeometryIdentifier[];
211
335
  }
212
336
 
213
- export interface GroupInteropHandle {
214
- objects: GeometryInteropHandleProxy[];
215
- }
216
-
217
- export interface NodeCreationSetting {
218
- id: NodeId;
219
- variant: string;
220
- name?: string;
221
- label?: string;
222
- inputs?: number;
223
- outputs?: number;
224
- properties: NodePropertyInterop[];
225
- enabled?: boolean;
226
- visible?: boolean;
227
- }
228
-
229
- /**
230
- * Interop struct for node property
231
- */
232
- export interface NodePropertyInterop {
233
- /**
234
- * Property name
235
- */
236
- name: string;
237
- /**
238
- * Property value
239
- */
240
- value: NodePropertyValue;
241
- /**
242
- * Whether the node has input connection and the property change is disabled
243
- */
244
- connected?: boolean;
245
- /**
246
- * Whether the property is disabled in node\' inspector
247
- */
248
- disabled?: boolean;
249
- }
250
-
251
- export interface NodeConnectionInterop {
252
- outputNodeId: string;
253
- outputIndex: number;
254
- inputNodeId: string;
255
- inputIndex: number;
256
- inputConnectionIndex: number | undefined;
257
- }
258
-
259
- export interface IndicesInteropHandle {
260
- count: number;
261
- indices: number;
262
- }
263
-
264
-
265
- /// Manually added types due to limitations in the `wasm-bindgen` & `tsify` crates.
266
- export type ID<T = any> = string;
267
- export type NodeId = ID;
268
- export type InputId = ID;
269
- export type OutputId = ID;
270
- export type SubGraphId = ID;
271
- export type SubGraphInstanceId = ID;
272
-
273
- export type IndexMap<K, V> = Map<K, V>;
274
-
275
- export type U1 = 1;
276
- export type U2 = 2;
277
- export type U3 = 3;
278
-
279
- /// Define vector & point types with FixedLengthArray
280
- type BuildTuple<L extends number, T, R extends any[] = []> = R['length'] extends L ? R : BuildTuple<L, T, [T, ...R]>;
281
- type FixedLengthArray<T, L extends number> = BuildTuple<L, T>;
282
- export type OPoint<T, D extends number> = FixedLengthArray<T, D>;
283
- export type OVector<T, D extends number> = FixedLengthArray<T, D>;
284
- export type Point<T, D extends number> = OPoint<T, D>;
285
- export type SVector<T, D extends number> = OVector<T, D>;
286
- export type Point2<T = number> = Point<T, 2>;
287
- export type Vector2<T = number> = SVector<T, 2>;
288
- export type Point3<T = number> = Point<T, 3>;
289
- export type Vector3<T = number> = SVector<T, 3>;
290
- export type Point4<T = number> = Point<T, 4>;
291
- export type Vector4<T = number> = SVector<T, 4>;
292
- export type Transform3<T = number> = FixedLengthArray<T, 16>;
293
- export type Matrix4<T = number> = FixedLengthArray<FixedLengthArray<T, 4>, 4>;
294
-
295
-
296
- export interface IOInterop {
297
- id: string;
298
- name: string;
299
- accessType: AccessTypes;
300
- hint: TypeHint | undefined;
301
- connections: string[];
302
- }
303
-
304
- export interface EdgeInterop {
305
- source: EdgeUnitInterop<OutputId>;
306
- destination: EdgeUnitInterop<InputId>;
307
- empty: boolean;
308
- }
309
-
310
- export interface EdgeUnitInterop<IO> {
311
- node: NodeId;
312
- io: IO;
313
- }
337
+ export type GraphMappingTypes = "None" | "Bezier" | "Linear" | "Sine";
314
338
 
315
- /**
316
- * Geometry identifier
317
- */
318
- export interface GeometryIdentifier {
319
- /**
320
- * Parent node ID
321
- */
322
- graphNodeSet?: GraphNodeSet;
323
- /**
324
- * Output ID that the geometry is belonged to
325
- */
326
- outputId: OutputId;
327
- /**
328
- * Geometry ID
329
- */
330
- geometryId: ID<GeometryProxy>;
331
- /**
332
- * Transform matrix in interop format
333
- */
334
- transform: TransformInterop;
335
- }
339
+ export type TypeHint = Internal;
336
340
 
337
341
  export interface NodePropertyCategoryValue {
338
342
  candidates: IndexMap<string, number>;
@@ -348,10 +352,25 @@ export interface NodePropertyRangeValue {
348
352
 
349
353
  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[] };
350
354
 
351
- export type TypeHint = Internal;
352
-
353
355
  export type AccessTypes = "Item" | "List" | "Tree";
354
356
 
357
+ export interface Node<T> {
358
+ id: NodeId;
359
+ name: string;
360
+ label: string | undefined;
361
+ input: InputIOManager;
362
+ output: OutputIOManager;
363
+ entity: T;
364
+ enabled: boolean;
365
+ visible: boolean;
366
+ }
367
+
368
+ export type OutputIOManager = IOManager<OutputId, InputId>;
369
+
370
+ export type InputIOManager = IOManager<InputId, OutputId>;
371
+
372
+ export type GraphVariant = "Root" | { SubGraph: SubGraphId };
373
+
355
374
  /**
356
375
  * Graph structure
357
376
  */
@@ -371,30 +390,42 @@ export interface Prune<T, U> {
371
390
  bypass: Connection[] | undefined;
372
391
  }
373
392
 
374
- export interface Node<T> {
375
- id: NodeId;
376
- name: string;
377
- label: string | undefined;
378
- input: InputIOManager;
379
- output: OutputIOManager;
380
- entity: T;
381
- enabled: boolean;
382
- visible: boolean;
393
+ export interface ConnectedComponentNode {
394
+ sources: NodeId[];
395
+ destinations: NodeId[];
383
396
  }
384
397
 
385
- export type OutputIOManager = IOManager<OutputId, InputId>;
386
-
387
- export type InputIOManager = IOManager<InputId, OutputId>;
398
+ export interface ConnectedComponents<T, U> {
399
+ nodes: IndexMap<NodeId, ConnectedComponentNode<T, U>>;
400
+ }
388
401
 
389
- export interface Connection {
390
- source: NodeParameter<OutputId>;
391
- destination: NodeParameter<InputId>;
402
+ /**
403
+ * A parameter for an input or output of a node.
404
+ */
405
+ export interface IOParameter<T, U> {
406
+ id: T;
407
+ name: string;
408
+ access_type: AccessTypes;
409
+ hint?: TypeHint;
410
+ connections: U[];
392
411
  }
393
412
 
394
- export interface NodeParameter<T> {
395
- nodeId: NodeId;
396
- parameterId: T;
397
- parameterIndex: number;
413
+ /**
414
+ * A sub graph is a graph that is a part of a larger graph
415
+ */
416
+ export interface SubGraph<T, U> {
417
+ /**
418
+ * The id of the sub graph
419
+ */
420
+ id: SubGraphId;
421
+ /**
422
+ * The graph of the sub graph
423
+ */
424
+ graph: Graph<T, U>;
425
+ /**
426
+ * The instances of the sub graph
427
+ */
428
+ instances: SubGraphInstanceId[];
398
429
  }
399
430
 
400
431
  export interface SubGraphIdSet {
@@ -402,15 +433,6 @@ export interface SubGraphIdSet {
402
433
  instanceId: SubGraphInstanceId;
403
434
  }
404
435
 
405
- export interface ConnectedComponentNode {
406
- sources: NodeId[];
407
- destinations: NodeId[];
408
- }
409
-
410
- export interface ConnectedComponents<T, U> {
411
- nodes: IndexMap<NodeId, ConnectedComponentNode<T, U>>;
412
- }
413
-
414
436
  /**
415
437
  * Defines the dynamics of an IO parameter.
416
438
  */
@@ -423,50 +445,78 @@ export interface IOVariables {
423
445
  }
424
446
 
425
447
  /**
426
- * A parameter for an input or output of a node.
448
+ * A set of node id and instance id
427
449
  */
428
- export interface IOParameter<T, U> {
429
- id: T;
430
- name: string;
431
- access_type: AccessTypes;
432
- hint?: TypeHint;
433
- connections: U[];
450
+ export interface GraphNodeSet {
451
+ subGraphIdSet: SubGraphIdSet | undefined;
452
+ nodeId: NodeId;
453
+ }
454
+
455
+ export interface Connection {
456
+ source: NodeParameter<OutputId>;
457
+ destination: NodeParameter<InputId>;
458
+ }
459
+
460
+ export interface NodeParameter<T> {
461
+ nodeId: NodeId;
462
+ parameterId: T;
463
+ parameterIndex: number;
434
464
  }
435
465
 
466
+ export interface IOManager<T, U> {
467
+ parameters: IOParameter<T, U>[];
468
+ }
469
+
470
+
471
+ export type NurbsSurface3D<T = number> = {
472
+ control_points: Point4<T>[][];
473
+ u_knots: T[];
474
+ v_knots: T[];
475
+ u_degree: T;
476
+ v_degree: T;
477
+ };
478
+
436
479
  /**
437
- * A set of node id and instance id
480
+ * An oriented box in 3D space
438
481
  */
439
- export interface GraphNodeSet {
440
- subGraphIdSet: SubGraphIdSet | undefined;
441
- nodeId: NodeId;
442
- }
443
-
444
- export interface IOManager<T, U> {
445
- parameters: IOParameter<T, U>[];
482
+ export interface OrientedBox {
483
+ /**
484
+ * The plane that the box is aligned to
485
+ */
486
+ plane: Plane;
487
+ /**
488
+ * The bounding box in the local coordinate system
489
+ */
490
+ bounds: BoundingBox3D;
446
491
  }
447
492
 
448
- export type GraphVariant = "Root" | { SubGraph: SubGraphId };
493
+ /**
494
+ * A NURBS surface container
495
+ */
496
+ export type NurbsSurface = NurbsSurface3D<number>;
449
497
 
450
498
  /**
451
- * A sub graph is a graph that is a part of a larger graph
499
+ * An arc curve in 3D space
452
500
  */
453
- export interface SubGraph<T, U> {
501
+ export interface ArcCurve {
454
502
  /**
455
- * The id of the sub graph
503
+ * The base plane of the arc
456
504
  */
457
- id: SubGraphId;
505
+ plane: Plane;
458
506
  /**
459
- * The graph of the sub graph
507
+ * The start angle of the arc
460
508
  */
461
- graph: Graph<T, U>;
509
+ startAngle: number;
462
510
  /**
463
- * The instances of the sub graph
511
+ * The end angle of the arc
464
512
  */
465
- instances: SubGraphInstanceId[];
513
+ endAngle: number;
514
+ /**
515
+ * The radius of the arc
516
+ */
517
+ radius: number;
466
518
  }
467
519
 
468
- export type GraphMappingTypes = "None" | "Bezier" | "Linear" | "Sine";
469
-
470
520
 
471
521
  export type NurbsCurve3D<T = number> = {
472
522
  control_points: Point4<T>[];
@@ -475,9 +525,9 @@ export type NurbsCurve3D<T = number> = {
475
525
  };
476
526
 
477
527
  /**
478
- * Interop proxy for various geometry types
528
+ * A collection of geometry objects
479
529
  */
480
- export type GeometryInterop = { variant: "Mesh"; data: MeshInterop } | { variant: "Curve"; data: CurveInterop } | { variant: "Point"; data: PointCloudInterop } | { variant: "Plane"; data: Plane } | { variant: "Group"; data: GeometryInterop[] };
530
+ export type Group = GeometryTransform[];
481
531
 
482
532
  /**
483
533
  * A geometry object with a transformation
@@ -497,35 +547,6 @@ export type PolyCurve = CompoundCurve<number, U4>;
497
547
 
498
548
  export type NurbsCurve = NurbsCurve3D<number>;
499
549
 
500
- /**
501
- * A collection of geometry objects
502
- */
503
- export type Group = GeometryTransform[];
504
-
505
- /**
506
- * A face of a mesh with three vertices
507
- */
508
- export interface MeshTriangleFace {
509
- a: number;
510
- b: number;
511
- c: number;
512
- }
513
-
514
- /**
515
- * Geometry proxy for various geometry types
516
- */
517
- 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 };
518
-
519
- /**
520
- * A surface defined by three points
521
- */
522
- export type TriangleSurface = Triangle3D;
523
-
524
- /**
525
- * Proxy for various curve types
526
- */
527
- 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 };
528
-
529
550
 
530
551
  export type PolylineCurve2D = {
531
552
  points: Point2[];
@@ -568,21 +589,26 @@ export interface MeshInterop {
568
589
  }
569
590
 
570
591
  /**
571
- * A ellipse curve in 3D space
592
+ * Interop proxy for various geometry types
572
593
  */
573
- export interface EllipseCurve {
594
+ export type GeometryInterop = { variant: "Mesh"; data: MeshInterop } | { variant: "Curve"; data: CurveInterop } | { variant: "Point"; data: PointCloudInterop } | { variant: "Plane"; data: Plane } | { variant: "Group"; data: GeometryInterop[] };
595
+
596
+ /**
597
+ * A rectangle curve in 3D space
598
+ */
599
+ export interface RectangleCurve {
574
600
  /**
575
- * The base plane of the ellipse
601
+ * The base plane of the rectangle
576
602
  */
577
603
  plane: Plane;
578
604
  /**
579
- * The x radius of the ellipse
605
+ * The domain of the rectangle in the plane x axis
580
606
  */
581
- xRadius: number;
607
+ x: Domain;
582
608
  /**
583
- * The y radius of the ellipse
609
+ * The domain of the rectangle in the plane y axis
584
610
  */
585
- yRadius: number;
611
+ y: Domain;
586
612
  }
587
613
 
588
614
  /**
@@ -600,54 +626,34 @@ export interface CircleCurve {
600
626
  }
601
627
 
602
628
  /**
603
- * An arc curve in 3D space
629
+ * A circular surface
604
630
  */
605
- export interface ArcCurve {
631
+ export interface CircularSurface {
606
632
  /**
607
- * The base plane of the arc
633
+ * The base plane of the circle
608
634
  */
609
635
  plane: Plane;
610
636
  /**
611
- * The start angle of the arc
612
- */
613
- startAngle: number;
614
- /**
615
- * The end angle of the arc
616
- */
617
- endAngle: number;
618
- /**
619
- * The radius of the arc
637
+ * The radius of the circle
620
638
  */
621
639
  radius: number;
622
640
  }
623
641
 
624
642
  /**
625
- * An oriented box in 3D space
643
+ * A surface defined by three points
626
644
  */
627
- export interface OrientedBox {
628
- /**
629
- * The plane that the box is aligned to
630
- */
631
- plane: Plane;
632
- /**
633
- * The bounding box in the local coordinate system
634
- */
635
- bounds: BoundingBox3D;
636
- }
645
+ export type TriangleSurface = Triangle3D;
637
646
 
638
647
  /**
639
- * A circular surface
648
+ * Proxy for various curve types
640
649
  */
641
- export interface CircularSurface {
642
- /**
643
- * The base plane of the circle
644
- */
645
- plane: Plane;
646
- /**
647
- * The radius of the circle
648
- */
649
- radius: number;
650
- }
650
+ 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 };
651
+
652
+
653
+ export type BoundingBox3D = {
654
+ min: Vector3;
655
+ max: Vector3;
656
+ };
651
657
 
652
658
  /**
653
659
  * Plane representation with origin, normal, x axis, and y axis
@@ -689,32 +695,63 @@ export interface PlaneSurface {
689
695
  y: Domain;
690
696
  }
691
697
 
698
+ /**
699
+ * A ellipse curve in 3D space
700
+ */
701
+ export interface EllipseCurve {
702
+ /**
703
+ * The base plane of the ellipse
704
+ */
705
+ plane: Plane;
706
+ /**
707
+ * The x radius of the ellipse
708
+ */
709
+ xRadius: number;
710
+ /**
711
+ * The y radius of the ellipse
712
+ */
713
+ yRadius: number;
714
+ }
692
715
 
693
- export type LineCurve3D = {
694
- a: Point3;
695
- b: Point3;
696
- };
697
-
698
-
699
- export type NurbsSurface3D<T = number> = {
700
- control_points: Point4<T>[][];
701
- u_knots: T[];
702
- v_knots: T[];
703
- u_degree: T;
704
- v_degree: T;
705
- };
706
-
707
-
708
- export type BoundingBox3D = {
709
- min: Vector3;
710
- max: Vector3;
711
- };
716
+ /**
717
+ * A face of a mesh with three vertices
718
+ */
719
+ export interface MeshTriangleFace {
720
+ a: number;
721
+ b: number;
722
+ c: number;
723
+ }
712
724
 
713
725
  export interface Domain {
714
726
  min: number;
715
727
  max: number;
716
728
  }
717
729
 
730
+ /**
731
+ * Interop struct for point cloud data
732
+ */
733
+ export interface PointCloudInterop {
734
+ /**
735
+ * Vertices of the point cloud
736
+ */
737
+ vertices: [number, number, number][];
738
+ /**
739
+ * Transform matrix of the point cloud
740
+ */
741
+ transform: Transform3<number>;
742
+ }
743
+
744
+ /**
745
+ * Proxy for various surface types
746
+ */
747
+ export type SurfaceProxy = { variant: "Circular"; data: CircularSurface } | { variant: "Triangle"; data: TriangleSurface } | { variant: "Plane"; data: PlaneSurface } | { variant: "NURBS"; data: NurbsSurface } | { variant: "Trimmed"; data: TrimmedSurface };
748
+
749
+
750
+ export type LineCurve3D = {
751
+ a: Point3;
752
+ b: Point3;
753
+ };
754
+
718
755
  /**
719
756
  * Interop struct for curve data
720
757
  */
@@ -752,46 +789,9 @@ export interface Mesh {
752
789
  }
753
790
 
754
791
  /**
755
- * A NURBS surface container
756
- */
757
- export type NurbsSurface = NurbsSurface3D<number>;
758
-
759
- /**
760
- * A rectangle curve in 3D space
761
- */
762
- export interface RectangleCurve {
763
- /**
764
- * The base plane of the rectangle
765
- */
766
- plane: Plane;
767
- /**
768
- * The domain of the rectangle in the plane x axis
769
- */
770
- x: Domain;
771
- /**
772
- * The domain of the rectangle in the plane y axis
773
- */
774
- y: Domain;
775
- }
776
-
777
- /**
778
- * Interop struct for point cloud data
779
- */
780
- export interface PointCloudInterop {
781
- /**
782
- * Vertices of the point cloud
783
- */
784
- vertices: [number, number, number][];
785
- /**
786
- * Transform matrix of the point cloud
787
- */
788
- transform: Transform3<number>;
789
- }
790
-
791
- /**
792
- * Proxy for various surface types
792
+ * Geometry proxy for various geometry types
793
793
  */
794
- export type SurfaceProxy = { variant: "Circular"; data: CircularSurface } | { variant: "Triangle"; data: TriangleSurface } | { variant: "Plane"; data: PlaneSurface } | { variant: "NURBS"; data: NurbsSurface } | { variant: "Trimmed"; data: TrimmedSurface };
794
+ 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 };
795
795
 
796
796
  /**
797
797
  * Modular structure with a graph handle
@@ -871,8 +871,8 @@ export interface InitOutput {
871
871
  readonly __externref_table_dealloc: (a: number) => void;
872
872
  readonly __externref_drop_slice: (a: number, b: number) => void;
873
873
  readonly __wbindgen_free: (a: number, b: number, c: number) => void;
874
- readonly closure874_externref_shim: (a: number, b: number, c: any) => void;
875
- readonly closure3561_externref_shim: (a: number, b: number, c: any, d: any) => void;
874
+ readonly closure885_externref_shim: (a: number, b: number, c: any) => void;
875
+ readonly closure3602_externref_shim: (a: number, b: number, c: any, d: any) => void;
876
876
  readonly __wbindgen_start: () => void;
877
877
  }
878
878
 
package/index.js CHANGED
@@ -225,11 +225,11 @@ export function do_nothing_just_tell_wasm_bindgen_to_generate_types() {
225
225
  }
226
226
 
227
227
  function __wbg_adapter_52(arg0, arg1, arg2) {
228
- wasm.closure874_externref_shim(arg0, arg1, arg2);
228
+ wasm.closure885_externref_shim(arg0, arg1, arg2);
229
229
  }
230
230
 
231
231
  function __wbg_adapter_129(arg0, arg1, arg2, arg3) {
232
- wasm.closure3561_externref_shim(arg0, arg1, arg2, arg3);
232
+ wasm.closure3602_externref_shim(arg0, arg1, arg2, arg3);
233
233
  }
234
234
 
235
235
  const ModularFinalization = (typeof FinalizationRegistry === 'undefined')
@@ -425,10 +425,10 @@ function __wbg_get_imports() {
425
425
  const ret = Object.entries(arg0);
426
426
  return ret;
427
427
  };
428
- imports.wbg.__wbg_getRandomValues_38097e921c2494c3 = function() { return handleError(function (arg0, arg1) {
428
+ imports.wbg.__wbg_getRandomValues_3c9c0d586e575a16 = function() { return handleError(function (arg0, arg1) {
429
429
  globalThis.crypto.getRandomValues(getArrayU8FromWasm0(arg0, arg1));
430
430
  }, arguments) };
431
- imports.wbg.__wbg_getRandomValues_3c9c0d586e575a16 = function() { return handleError(function (arg0, arg1) {
431
+ imports.wbg.__wbg_getRandomValues_e14bd3de0db61032 = function() { return handleError(function (arg0, arg1) {
432
432
  globalThis.crypto.getRandomValues(getArrayU8FromWasm0(arg0, arg1));
433
433
  }, arguments) };
434
434
  imports.wbg.__wbg_getTime_46267b1c24877e30 = function(arg0) {
@@ -643,8 +643,8 @@ function __wbg_get_imports() {
643
643
  const ret = false;
644
644
  return ret;
645
645
  };
646
- imports.wbg.__wbindgen_closure_wrapper3844 = function(arg0, arg1, arg2) {
647
- const ret = makeMutClosure(arg0, arg1, 875, __wbg_adapter_52);
646
+ imports.wbg.__wbindgen_closure_wrapper3885 = function(arg0, arg1, arg2) {
647
+ const ret = makeMutClosure(arg0, arg1, 886, __wbg_adapter_52);
648
648
  return ret;
649
649
  };
650
650
  imports.wbg.__wbindgen_debug_string = function(arg0, arg1) {
package/index_bg.wasm CHANGED
Binary file
package/package.json CHANGED
@@ -5,7 +5,7 @@
5
5
  "Masatatsu Nakamura <masatatsu.nakamura@gmail.com"
6
6
  ],
7
7
  "description": "Modular is a module project designed to import node graphs created in Nodi in JSON format, enabling the extraction of geometric data generated based on the node graph structure.",
8
- "version": "0.0.28",
8
+ "version": "0.0.30",
9
9
  "license": "MIT",
10
10
  "repository": {
11
11
  "type": "git",