nodi-modular 0.0.11 → 0.0.13

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,90 +6,23 @@ export interface GeometryTransformInterop {
6
6
  transform: TransformInterop;
7
7
  }
8
8
 
9
+ export type NodeOutput = (Map<string, Item[]> | undefined)[];
10
+
9
11
  /**
10
12
  * Evaluation item interoperability type.
11
13
  */
12
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 };
13
15
 
14
- export type NodeOutput = (Map<string, Item[]> | undefined)[];
15
-
16
- export interface GroupInteropHandle {
17
- objects: GeometryInteropHandleProxy[];
18
- }
19
-
20
- export type GeometryInteropVec = GeometryInterop[];
21
-
22
- export type NodeConnectionInteropVec = NodeConnectionInterop[];
23
-
24
- export type NodePropertyInteropVec = NodePropertyInterop[];
25
-
26
- export type NodeInteropVec = NodeInterop[];
27
-
28
- export type EdgeInteropVec = EdgeInterop[];
29
-
30
- /**
31
- * Interop struct for node
32
- */
33
- export interface NodeInterop {
34
- /**
35
- * Node variant
36
- */
16
+ export interface NodeCreationSetting {
17
+ id: NodeId;
37
18
  variant: string;
38
- /**
39
- * Node identifier
40
- */
41
- id: string;
42
- name: string;
43
- label: string | undefined;
44
- description: string;
45
- /**
46
- * Input parameters
47
- */
48
- inputs: IOInterop[];
49
- /**
50
- * Input variables
51
- */
52
- inputVariables: IOVariables | undefined;
53
- /**
54
- * Output parameters
55
- */
56
- outputs: IOInterop[];
57
- /**
58
- * Output variables
59
- */
60
- outputVariables: IOVariables | undefined;
61
- /**
62
- * Node properties
63
- */
19
+ name?: string;
20
+ label?: string;
21
+ inputs?: number;
22
+ outputs?: number;
64
23
  properties: NodePropertyInterop[];
65
- enabled: boolean;
66
- visible: boolean;
67
- meta: NodeMetaInterop;
68
- }
69
-
70
- export interface NodeEntityInterop {
71
- variant: string;
72
- id: string;
73
- name: string;
74
- label: string | undefined;
75
- inputs: string[];
76
- outputs: string[];
77
- enabled: boolean;
78
- visible: boolean;
79
- }
80
-
81
- /**
82
- * Interop struct for node meta
83
- */
84
- export interface NodeMetaInterop {
85
- /**
86
- * Error message
87
- */
88
- error: string | undefined;
89
- /**
90
- * Node\' output has geometry or not
91
- */
92
- hasGeometry: boolean;
24
+ enabled?: boolean;
25
+ visible?: boolean;
93
26
  }
94
27
 
95
28
  export interface NodeConnectionInterop {
@@ -105,6 +38,16 @@ export interface IndicesInteropHandle {
105
38
  indices: number;
106
39
  }
107
40
 
41
+ export type GeometryInteropVec = GeometryInterop[];
42
+
43
+ export type NodeConnectionInteropVec = NodeConnectionInterop[];
44
+
45
+ export type NodePropertyInteropVec = NodePropertyInterop[];
46
+
47
+ export type NodeInteropVec = NodeInterop[];
48
+
49
+ export type EdgeInteropVec = EdgeInterop[];
50
+
108
51
  /**
109
52
  * Geometry identifier
110
53
  */
@@ -127,24 +70,15 @@ export interface GeometryIdentifier {
127
70
  transform: TransformInterop;
128
71
  }
129
72
 
130
- export interface MeshInteropHandle {
131
- count: number;
132
- vertices: number;
133
- normals: number;
134
- indices: IndicesInteropHandle | undefined;
135
- transform: TransformInterop | undefined;
73
+ export interface GeometrySpreadsheet {
74
+ points: Point3<number>[];
75
+ curves: CurveProxy[];
76
+ surfaces: SurfaceProxy[];
77
+ meshes: MeshInterop[];
136
78
  }
137
79
 
138
- export interface NodeCreationSetting {
139
- id: NodeId;
140
- variant: string;
141
- name?: string;
142
- label?: string;
143
- inputs?: number;
144
- outputs?: number;
145
- properties: NodePropertyInterop[];
146
- enabled?: boolean;
147
- visible?: boolean;
80
+ export interface GroupInteropHandle {
81
+ objects: GeometryInteropHandleProxy[];
148
82
  }
149
83
 
150
84
  /**
@@ -169,30 +103,6 @@ export interface NodePropertyInterop {
169
103
  disabled?: boolean;
170
104
  }
171
105
 
172
- export type NodeSectionInterop = { type: "section"; content: NodeFolderInterop } | { type: "item"; content: NodeItemInterop };
173
-
174
- export interface NodeItemInterop {
175
- key: string;
176
- name: string;
177
- }
178
-
179
- export type NodeFolderInterop = IndexMap<string, NodeSectionInterop>;
180
-
181
- export interface NodeMapInterop {
182
- folder: NodeFolderInterop;
183
- }
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
-
196
106
 
197
107
  /// Manually added types due to limitations in the `wasm-bindgen` & `tsify` crates.
198
108
  export type ID<T = any> = string;
@@ -255,18 +165,46 @@ export interface AdaptiveTessellationOptions {
255
165
  maxDepth: number;
256
166
  }
257
167
 
168
+ export type NodeSectionInterop = { type: "section"; content: NodeFolderInterop } | { type: "item"; content: NodeItemInterop };
169
+
170
+ export interface NodeItemInterop {
171
+ key: string;
172
+ name: string;
173
+ }
174
+
175
+ export type NodeFolderInterop = IndexMap<string, NodeSectionInterop>;
176
+
177
+ export interface NodeMapInterop {
178
+ folder: NodeFolderInterop;
179
+ }
180
+
258
181
  /**
259
- * Interop struct for evaluation results
182
+ * Curve interop handle for wasm interop
183
+ * stride = 3 (x, y, z)
260
184
  */
261
- export interface EvaluationInterop {
262
- /**
263
- * Processed nodes in the latest evaluation
264
- */
265
- processedNodes: GraphNodeSet[];
266
- /**
267
- * Geometry identifiers in the latest evaluation
268
- */
269
- geometryIdentifiers: GeometryIdentifier[];
185
+ export interface CurveInteropHandle {
186
+ count: number;
187
+ vertices: number;
188
+ transform: TransformInterop | undefined;
189
+ }
190
+
191
+ export interface IOInterop {
192
+ id: string;
193
+ name: string;
194
+ accessType: AccessTypes;
195
+ hint: TypeHint | undefined;
196
+ connections: string[];
197
+ }
198
+
199
+ export interface EdgeInterop {
200
+ source: EdgeUnitInterop<OutputId>;
201
+ destination: EdgeUnitInterop<InputId>;
202
+ empty: boolean;
203
+ }
204
+
205
+ export interface EdgeUnitInterop<IO> {
206
+ node: NodeId;
207
+ io: IO;
270
208
  }
271
209
 
272
210
  export interface PointListHandleUnit {
@@ -293,76 +231,107 @@ export interface VectorDisplayHandle {
293
231
 
294
232
  export type DisplayProxyHandle = { variant: "Vector"; data: VectorDisplayHandle } | { variant: "PointList"; data: PointListDisplayHandle };
295
233
 
296
- export type GeometryInteropHandleProxy = { variant: "Mesh"; data: MeshInteropHandle } | { variant: "Curve"; data: CurveInteropHandle } | { variant: "Group"; data: GroupInteropHandle };
297
-
298
- export interface GeometrySpreadsheet {
299
- points: Point3<number>[];
300
- curves: CurveProxy[];
301
- surfaces: SurfaceProxy[];
302
- meshes: MeshInterop[];
234
+ /**
235
+ * Interop struct for node
236
+ */
237
+ export interface NodeInterop {
238
+ /**
239
+ * Node variant
240
+ */
241
+ variant: string;
242
+ /**
243
+ * Node identifier
244
+ */
245
+ id: string;
246
+ name: string;
247
+ label: string | undefined;
248
+ description: string;
249
+ /**
250
+ * Input parameters
251
+ */
252
+ inputs: IOInterop[];
253
+ /**
254
+ * Input variables
255
+ */
256
+ inputVariables: IOVariables | undefined;
257
+ /**
258
+ * Output parameters
259
+ */
260
+ outputs: IOInterop[];
261
+ /**
262
+ * Output variables
263
+ */
264
+ outputVariables: IOVariables | undefined;
265
+ /**
266
+ * Node properties
267
+ */
268
+ properties: NodePropertyInterop[];
269
+ enabled: boolean;
270
+ visible: boolean;
271
+ meta: NodeMetaInterop;
303
272
  }
304
273
 
305
- export interface IOInterop {
274
+ export interface NodeEntityInterop {
275
+ variant: string;
306
276
  id: string;
307
277
  name: string;
308
- accessType: AccessTypes;
309
- hint: TypeHint | undefined;
310
- connections: string[];
278
+ label: string | undefined;
279
+ inputs: string[];
280
+ outputs: string[];
281
+ enabled: boolean;
282
+ visible: boolean;
311
283
  }
312
284
 
313
285
  /**
314
- * Interop struct for transform
315
- * Represents a 4x4 matrix as a 16-element array
286
+ * Interop struct for node meta
316
287
  */
317
- export type TransformInterop = number[];
318
-
319
- export interface DataTreeInterop {
320
- branches: IndexMap<string, string[]>;
288
+ export interface NodeMetaInterop {
289
+ /**
290
+ * Error message
291
+ */
292
+ error: string | undefined;
293
+ /**
294
+ * Node\' output has geometry or not
295
+ */
296
+ hasGeometry: boolean;
321
297
  }
322
298
 
323
- export interface DataTreeFormatInterop {
324
- outputs: IndexMap<string, string>;
325
- }
299
+ export type GeometryInteropHandleProxy = { variant: "Mesh"; data: MeshInteropHandle } | { variant: "Curve"; data: CurveInteropHandle } | { variant: "Group"; data: GroupInteropHandle };
326
300
 
327
301
  /**
328
- * Curve interop handle for wasm interop
329
- * stride = 3 (x, y, z)
302
+ * Interop struct for evaluation results
330
303
  */
331
- export interface CurveInteropHandle {
304
+ export interface EvaluationInterop {
305
+ /**
306
+ * Processed nodes in the latest evaluation
307
+ */
308
+ processedNodes: GraphNodeSet[];
309
+ /**
310
+ * Geometry identifiers in the latest evaluation
311
+ */
312
+ geometryIdentifiers: GeometryIdentifier[];
313
+ }
314
+
315
+ export interface MeshInteropHandle {
332
316
  count: number;
333
317
  vertices: number;
318
+ normals: number;
319
+ indices: IndicesInteropHandle | undefined;
334
320
  transform: TransformInterop | undefined;
335
321
  }
336
322
 
337
- export interface SubGraphIdSet {
338
- subGraphId: SubGraphId;
339
- instanceId: SubGraphInstanceId;
340
- }
341
-
342
323
  /**
343
- * Defines the dynamics of an IO parameter.
324
+ * Interop struct for transform
325
+ * Represents a 4x4 matrix as a 16-element array
344
326
  */
345
- export interface IOVariables {
346
- minCount: number;
347
- maxCount: number;
348
- defaultCount: number;
349
- offset: number;
350
- editable: boolean;
351
- }
327
+ export type TransformInterop = number[];
352
328
 
353
- /**
354
- * A set of node id and instance id
355
- */
356
- export interface GraphNodeSet {
357
- subGraphIdSet: SubGraphIdSet | undefined;
358
- nodeId: NodeId;
329
+ export interface DataTreeInterop {
330
+ branches: IndexMap<string, string[]>;
359
331
  }
360
332
 
361
- export type AccessTypes = "Item" | "List" | "Tree";
362
-
363
- export interface Prune<T, U> {
364
- connectedComponents: ConnectedComponents<T, U>[];
365
- bypass: Connection[] | undefined;
333
+ export interface DataTreeFormatInterop {
334
+ outputs: IndexMap<string, string>;
366
335
  }
367
336
 
368
337
  export interface NodePropertyCategoryValue {
@@ -379,6 +348,37 @@ export interface NodePropertyRangeValue {
379
348
 
380
349
  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[] };
381
350
 
351
+ export type TypeHint = Internal;
352
+
353
+ export type AccessTypes = "Item" | "List" | "Tree";
354
+
355
+ export type GraphVariant = "Root" | { SubGraph: SubGraphId };
356
+
357
+ /**
358
+ * Graph structure
359
+ */
360
+ export interface Graph<T, U> {
361
+ /**
362
+ * Nodes in the graph
363
+ */
364
+ nodes: IndexMap<NodeId, Node<T, U>>;
365
+ /**
366
+ * nested graphs
367
+ */
368
+ sub_graphs?: IndexMap<SubGraphId, SubGraph<T, U>>;
369
+ }
370
+
371
+ export interface Prune<T, U> {
372
+ connectedComponents: ConnectedComponents<T, U>[];
373
+ bypass: Connection[] | undefined;
374
+ }
375
+
376
+ export type GraphMappingTypes = "None" | "Bezier" | "Linear" | "Sine";
377
+
378
+ export interface IOManager<T, U> {
379
+ parameters: IOParameter<T, U>[];
380
+ }
381
+
382
382
  export interface Connection {
383
383
  source: NodeParameter<OutputId>;
384
384
  destination: NodeParameter<InputId>;
@@ -390,6 +390,24 @@ export interface NodeParameter<T> {
390
390
  parameterIndex: number;
391
391
  }
392
392
 
393
+ /**
394
+ * A sub graph is a graph that is a part of a larger graph
395
+ */
396
+ export interface SubGraph<T, U> {
397
+ /**
398
+ * The id of the sub graph
399
+ */
400
+ id: SubGraphId;
401
+ /**
402
+ * The graph of the sub graph
403
+ */
404
+ graph: Graph<T, U>;
405
+ /**
406
+ * The instances of the sub graph
407
+ */
408
+ instances: SubGraphInstanceId[];
409
+ }
410
+
393
411
  export interface ConnectedComponentNode {
394
412
  sources: NodeId[];
395
413
  destinations: NodeId[];
@@ -410,38 +428,28 @@ export interface IOParameter<T, U> {
410
428
  connections: U[];
411
429
  }
412
430
 
431
+ export interface SubGraphIdSet {
432
+ subGraphId: SubGraphId;
433
+ instanceId: SubGraphInstanceId;
434
+ }
435
+
413
436
  /**
414
- * Graph structure
437
+ * Defines the dynamics of an IO parameter.
415
438
  */
416
- export interface Graph<T, U> {
417
- /**
418
- * Nodes in the graph
419
- */
420
- nodes: IndexMap<NodeId, Node<T, U>>;
421
- /**
422
- * nested graphs
423
- */
424
- sub_graphs?: IndexMap<SubGraphId, SubGraph<T, U>>;
439
+ export interface IOVariables {
440
+ minCount: number;
441
+ maxCount: number;
442
+ defaultCount: number;
443
+ offset: number;
444
+ editable: boolean;
425
445
  }
426
446
 
427
- export type GraphMappingTypes = "None" | "Bezier" | "Linear" | "Sine";
428
-
429
447
  /**
430
- * A sub graph is a graph that is a part of a larger graph
448
+ * A set of node id and instance id
431
449
  */
432
- export interface SubGraph<T, U> {
433
- /**
434
- * The id of the sub graph
435
- */
436
- id: SubGraphId;
437
- /**
438
- * The graph of the sub graph
439
- */
440
- graph: Graph<T, U>;
441
- /**
442
- * The instances of the sub graph
443
- */
444
- instances: SubGraphInstanceId[];
450
+ export interface GraphNodeSet {
451
+ subGraphIdSet: SubGraphIdSet | undefined;
452
+ nodeId: NodeId;
445
453
  }
446
454
 
447
455
  export interface Node<T> {
@@ -459,50 +467,87 @@ export type OutputIOManager = IOManager<OutputId, InputId>;
459
467
 
460
468
  export type InputIOManager = IOManager<InputId, OutputId>;
461
469
 
462
- export type TypeHint = Internal;
463
470
 
464
- export type GraphVariant = "Root" | { SubGraph: SubGraphId };
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
+ };
465
478
 
466
- export interface IOManager<T, U> {
467
- parameters: IOParameter<T, U>[];
479
+
480
+ export type BoundingBox3D = {
481
+ min: Vector3;
482
+ max: Vector3;
483
+ };
484
+
485
+
486
+ export type Triangle3D = {
487
+ a: Point3;
488
+ b: Point3;
489
+ c: Point3;
490
+ };
491
+
492
+ /**
493
+ * A NURBS surface container
494
+ */
495
+ export type NurbsSurface = NurbsSurface3D<number>;
496
+
497
+ /**
498
+ * A ellipse curve in 3D space
499
+ */
500
+ export interface EllipseCurve {
501
+ /**
502
+ * The base plane of the ellipse
503
+ */
504
+ plane: Plane;
505
+ /**
506
+ * The x radius of the ellipse
507
+ */
508
+ xRadius: number;
509
+ /**
510
+ * The y radius of the ellipse
511
+ */
512
+ yRadius: number;
468
513
  }
469
514
 
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
- };
515
+ /**
516
+ * A circle curve in 3D space
517
+ */
518
+ export interface CircleCurve {
519
+ /**
520
+ * The base plane of the circle
521
+ */
522
+ plane: Plane;
523
+ /**
524
+ * The radius of the circle
525
+ */
526
+ radius: number;
527
+ }
478
528
 
479
529
  /**
480
- * Plane representation with origin, normal, x axis, and y axis
530
+ * An arc curve in 3D space
481
531
  */
482
- export interface Plane {
532
+ export interface ArcCurve {
483
533
  /**
484
- * Origin coordinate of the plane
534
+ * The base plane of the arc
485
535
  */
486
- origin: Point3<number>;
536
+ plane: Plane;
487
537
  /**
488
- * Normal vector of the plane
538
+ * The start angle of the arc
489
539
  */
490
- normal: Vector3<number>;
540
+ startAngle: number;
491
541
  /**
492
- * X axis of the plane
542
+ * The end angle of the arc
493
543
  */
494
- xAxis: Vector3<number>;
544
+ endAngle: number;
495
545
  /**
496
- * Y axis of the plane
546
+ * The radius of the arc
497
547
  */
498
- yAxis: Vector3<number>;
548
+ radius: number;
499
549
  }
500
550
 
501
- /**
502
- * A NURBS surface
503
- */
504
- export type NurbsSurface = NurbsSurface3D<number>;
505
-
506
551
 
507
552
  export type LineCurve3D = {
508
553
  a: Point3;
@@ -518,40 +563,46 @@ export type PolylineCurve3D = {
518
563
  };
519
564
 
520
565
  /**
521
- * A face of a mesh with three vertices
566
+ * A collection of geometry objects
522
567
  */
523
- export interface MeshTriangleFace {
524
- a: number;
525
- b: number;
526
- c: number;
527
- }
568
+ export type Group = GeometryTransform[];
528
569
 
529
570
  /**
530
- * An arc curve in 3D space
571
+ * A surface defined by three points
531
572
  */
532
- export interface ArcCurve {
573
+ export type TriangleSurface = Triangle3D;
574
+
575
+ /**
576
+ * A surface defined by a plane and two domains in x and y directions
577
+ */
578
+ export interface PlaneSurface {
533
579
  /**
534
- * The base plane of the arc
580
+ * The base plane of the surface
535
581
  */
536
582
  plane: Plane;
537
583
  /**
538
- * The start angle of the arc
539
- */
540
- startAngle: number;
541
- /**
542
- * The end angle of the arc
584
+ * The domain in x direction
543
585
  */
544
- endAngle: number;
586
+ x: Domain;
545
587
  /**
546
- * The radius of the arc
588
+ * The domain in y direction
547
589
  */
548
- radius: number;
590
+ y: Domain;
549
591
  }
550
592
 
551
593
  /**
552
- * A collection of geometry objects
594
+ * Proxy for various curve types
553
595
  */
554
- export type Group = GeometryTransform[];
596
+ 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 };
597
+
598
+ /**
599
+ * A face of a mesh with three vertices
600
+ */
601
+ export interface MeshTriangleFace {
602
+ a: number;
603
+ b: number;
604
+ c: number;
605
+ }
555
606
 
556
607
  /**
557
608
  * A geometry object with a transformation
@@ -567,50 +618,29 @@ export interface GeometryTransform {
567
618
  transform: Transform3<number>;
568
619
  }
569
620
 
570
-
571
- export type BoundingBox3D = {
572
- min: Vector3;
573
- max: Vector3;
574
- };
575
-
576
-
577
- export type Triangle3D = {
578
- a: Point3;
579
- b: Point3;
580
- c: Point3;
581
- };
621
+ /**
622
+ * Geometry proxy for various geometry types
623
+ */
624
+ 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 };
582
625
 
583
626
  /**
584
- * A ellipse curve in 3D space
627
+ * Interop struct for point cloud data
585
628
  */
586
- export interface EllipseCurve {
587
- /**
588
- * The base plane of the ellipse
589
- */
590
- plane: Plane;
629
+ export interface PointCloudInterop {
591
630
  /**
592
- * The x radius of the ellipse
631
+ * Vertices of the point cloud
593
632
  */
594
- xRadius: number;
633
+ vertices: [number, number, number][];
595
634
  /**
596
- * The y radius of the ellipse
635
+ * Transform matrix of the point cloud
597
636
  */
598
- yRadius: number;
637
+ transform: Transform3<number>;
599
638
  }
600
639
 
601
640
  /**
602
- * A circle curve in 3D space
641
+ * Proxy for various surface types
603
642
  */
604
- export interface CircleCurve {
605
- /**
606
- * The base plane of the circle
607
- */
608
- plane: Plane;
609
- /**
610
- * The radius of the circle
611
- */
612
- radius: number;
613
- }
643
+ export type SurfaceProxy = { variant: "Circular"; data: CircularSurface } | { variant: "Triangle"; data: TriangleSurface } | { variant: "Plane"; data: PlaneSurface } | { variant: "NURBS"; data: NurbsSurface } | { variant: "Trimmed"; data: TrimmedSurface };
614
644
 
615
645
 
616
646
  export type NurbsCurve3D<T = number> = {
@@ -619,6 +649,11 @@ export type NurbsCurve3D<T = number> = {
619
649
  degree: T;
620
650
  };
621
651
 
652
+ export interface Domain {
653
+ min: number;
654
+ max: number;
655
+ }
656
+
622
657
  /**
623
658
  * Interop struct for mesh data
624
659
  */
@@ -645,6 +680,25 @@ export interface MeshInterop {
645
680
  transform?: Transform3<number>;
646
681
  }
647
682
 
683
+ /**
684
+ * Interop proxy for various geometry types
685
+ */
686
+ export type GeometryInterop = { variant: "Mesh"; data: MeshInterop } | { variant: "Curve"; data: CurveInterop } | { variant: "Point"; data: PointCloudInterop } | { variant: "Plane"; data: Plane } | { variant: "Group"; data: GeometryInterop[] };
687
+
688
+ /**
689
+ * Interop struct for curve data
690
+ */
691
+ export interface CurveInterop {
692
+ /**
693
+ * Vertices of the curve
694
+ */
695
+ vertices: [number, number, number][];
696
+ /**
697
+ * Transform matrix of the curve
698
+ */
699
+ transform: Transform3<number> | undefined;
700
+ }
701
+
648
702
  /**
649
703
  * An oriented box in 3D space
650
704
  */
@@ -679,82 +733,6 @@ export interface RectangleCurve {
679
733
 
680
734
  export type NurbsCurve = NurbsCurve3D<number>;
681
735
 
682
- export interface Domain {
683
- min: number;
684
- max: number;
685
- }
686
-
687
- /**
688
- * Interop struct for point cloud data
689
- */
690
- export interface PointCloudInterop {
691
- /**
692
- * Vertices of the point cloud
693
- */
694
- vertices: [number, number, number][];
695
- /**
696
- * Transform matrix of the point cloud
697
- */
698
- transform: Transform3<number>;
699
- }
700
-
701
- /**
702
- * Geometry proxy for various geometry types
703
- */
704
- 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 };
705
-
706
- /**
707
- * A surface defined by three points
708
- */
709
- export type TriangleSurface = Triangle3D;
710
-
711
- /**
712
- * A surface defined by a plane and two domains in x and y directions
713
- */
714
- export interface PlaneSurface {
715
- /**
716
- * The base plane of the surface
717
- */
718
- plane: Plane;
719
- /**
720
- * The domain in x direction
721
- */
722
- x: Domain;
723
- /**
724
- * The domain in y direction
725
- */
726
- y: Domain;
727
- }
728
-
729
- /**
730
- * Proxy for various curve types
731
- */
732
- 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 };
733
-
734
- /**
735
- * Proxy for various surface types
736
- */
737
- export type SurfaceProxy = { variant: "Circular"; data: CircularSurface } | { variant: "Triangle"; data: TriangleSurface } | { variant: "Plane"; data: PlaneSurface } | { variant: "NURBS"; data: NurbsSurface } | { variant: "Trimmed"; data: TrimmedSurface };
738
-
739
- /**
740
- * Interop proxy for various geometry types
741
- */
742
- export type GeometryInterop = { variant: "Mesh"; data: MeshInterop } | { variant: "Curve"; data: CurveInterop } | { variant: "Point"; data: PointCloudInterop } | { variant: "Plane"; data: Plane } | { variant: "Group"; data: GeometryInterop[] };
743
-
744
- /**
745
- * Interop struct for curve data
746
- */
747
- export interface CurveInterop {
748
- /**
749
- * Vertices of the curve
750
- */
751
- vertices: [number, number, number][];
752
- /**
753
- * Transform matrix of the curve
754
- */
755
- transform: Transform3<number> | undefined;
756
- }
757
-
758
736
  /**
759
737
  * Mesh representation with vertices, normals, uv, and index
760
738
  */
@@ -791,6 +769,28 @@ export interface CircularSurface {
791
769
  radius: number;
792
770
  }
793
771
 
772
+ /**
773
+ * Plane representation with origin, normal, x axis, and y axis
774
+ */
775
+ export interface Plane {
776
+ /**
777
+ * Origin coordinate of the plane
778
+ */
779
+ origin: Point3<number>;
780
+ /**
781
+ * Normal vector of the plane
782
+ */
783
+ normal: Vector3<number>;
784
+ /**
785
+ * X axis of the plane
786
+ */
787
+ xAxis: Vector3<number>;
788
+ /**
789
+ * Y axis of the plane
790
+ */
791
+ yAxis: Vector3<number>;
792
+ }
793
+
794
794
  /**
795
795
  * Modular structure with a graph handle
796
796
  */
@@ -869,8 +869,8 @@ export interface InitOutput {
869
869
  readonly __externref_table_dealloc: (a: number) => void;
870
870
  readonly __externref_drop_slice: (a: number, b: number) => void;
871
871
  readonly __wbindgen_free: (a: number, b: number, c: number) => void;
872
- readonly closure786_externref_shim: (a: number, b: number, c: any) => void;
873
- readonly closure3448_externref_shim: (a: number, b: number, c: any, d: any) => void;
872
+ readonly closure821_externref_shim: (a: number, b: number, c: any) => void;
873
+ readonly closure3503_externref_shim: (a: number, b: number, c: any, d: any) => void;
874
874
  readonly __wbindgen_start: () => void;
875
875
  }
876
876
 
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.closure786_externref_shim(arg0, arg1, arg2);
228
+ wasm.closure821_externref_shim(arg0, arg1, arg2);
229
229
  }
230
230
 
231
231
  function __wbg_adapter_145(arg0, arg1, arg2, arg3) {
232
- wasm.closure3448_externref_shim(arg0, arg1, arg2, arg3);
232
+ wasm.closure3503_externref_shim(arg0, arg1, arg2, arg3);
233
233
  }
234
234
 
235
235
  const ModularFinalization = (typeof FinalizationRegistry === 'undefined')
@@ -685,8 +685,8 @@ function __wbg_get_imports() {
685
685
  const ret = false;
686
686
  return ret;
687
687
  };
688
- imports.wbg.__wbindgen_closure_wrapper3424 = function(arg0, arg1, arg2) {
689
- const ret = makeMutClosure(arg0, arg1, 787, __wbg_adapter_52);
688
+ imports.wbg.__wbindgen_closure_wrapper3458 = function(arg0, arg1, arg2) {
689
+ const ret = makeMutClosure(arg0, arg1, 822, __wbg_adapter_52);
690
690
  return ret;
691
691
  };
692
692
  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.11",
8
+ "version": "0.0.13",
9
9
  "license": "MIT",
10
10
  "repository": {
11
11
  "type": "git",