nodi-modular 0.0.30 → 0.0.31

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
@@ -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 type NodeOutput = (Map<string, Item[]> | undefined)[];
10
5
 
11
6
  export interface GeometryTransformInterop {
@@ -13,31 +8,10 @@ export interface GeometryTransformInterop {
13
8
  transform: TransformInterop;
14
9
  }
15
10
 
16
- export type GeometryInteropVec = GeometryInterop[];
17
-
18
- export type NodeConnectionInteropVec = NodeConnectionInterop[];
19
-
20
- export type NodePropertyInteropVec = NodePropertyInterop[];
21
-
22
- export type NodeInteropVec = NodeInterop[];
23
-
24
- export type EdgeInteropVec = EdgeInterop[];
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
- }
11
+ /**
12
+ * Evaluation item interoperability type.
13
+ */
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 };
41
15
 
42
16
  export interface GeometrySpreadsheet {
43
17
  points: Point3<number>[];
@@ -46,141 +20,21 @@ export interface GeometrySpreadsheet {
46
20
  meshes: MeshInterop[];
47
21
  }
48
22
 
49
- export interface GroupInteropHandle {
50
- objects: GeometryInteropHandleProxy[];
51
- }
52
-
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
23
  /**
133
- * Geometry identifier
24
+ * Interop struct for evaluation results
134
25
  */
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;
26
+ export interface EvaluationInterop {
144
27
  /**
145
- * Geometry ID
28
+ * Processed nodes in the latest evaluation
146
29
  */
147
- geometryId: ID<GeometryProxy>;
30
+ processedNodes: GraphNodeSet[];
148
31
  /**
149
- * Transform matrix in interop format
32
+ * Geometry identifiers in the latest evaluation
150
33
  */
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;
34
+ geometryIdentifiers: GeometryIdentifier[];
175
35
  }
176
36
 
177
- export interface MeshInteropHandle {
178
- count: number;
179
- vertices: number;
180
- normals: number;
181
- indices: IndicesInteropHandle | undefined;
182
- transform: TransformInterop | undefined;
183
- }
37
+ export type GeometryInteropHandleProxy = { variant: "Mesh"; data: MeshInteropHandle } | { variant: "Curve"; data: CurveInteropHandle } | { variant: "Group"; data: GroupInteropHandle };
184
38
 
185
39
  export interface EdgeInterop {
186
40
  source: EdgeUnitInterop<OutputId>;
@@ -193,6 +47,22 @@ export interface EdgeUnitInterop<IO> {
193
47
  io: IO;
194
48
  }
195
49
 
50
+ export interface GroupInteropHandle {
51
+ objects: GeometryInteropHandleProxy[];
52
+ }
53
+
54
+ export interface NodeCreationSetting {
55
+ id: NodeId;
56
+ variant: string;
57
+ name?: string;
58
+ label?: string;
59
+ inputs?: number;
60
+ outputs?: number;
61
+ properties: NodePropertyInterop[];
62
+ enabled?: boolean;
63
+ visible?: boolean;
64
+ }
65
+
196
66
  /**
197
67
  * Options for adaptive tessellation to create geometry interoperability
198
68
  */
@@ -223,37 +93,36 @@ export interface AdaptiveTessellationOptions {
223
93
  maxDepth: number;
224
94
  }
225
95
 
226
- export type GeometryInteropHandleProxy = { variant: "Mesh"; data: MeshInteropHandle } | { variant: "Curve"; data: CurveInteropHandle } | { variant: "Group"; data: GroupInteropHandle };
227
-
228
- export interface PointListHandleUnit {
229
- count: number;
230
- points: number;
96
+ export interface NodeConnectionInterop {
97
+ outputNodeId: string;
98
+ outputIndex: number;
99
+ inputNodeId: string;
100
+ inputIndex: number;
101
+ inputConnectionIndex: number | undefined;
231
102
  }
232
103
 
233
- /**
234
- * Point display handle for wasm interop
235
- */
236
- export interface PointListDisplayHandle {
237
- list: PointListHandleUnit[];
238
- pointSize: number;
104
+ export interface IndicesInteropHandle {
105
+ count: number;
106
+ indices: number;
239
107
  }
240
108
 
241
109
  /**
242
- * Vector display handle for wasm interop
243
- * stride = 6 (3 for point, 3 for vector)
110
+ * Curve interop handle for wasm interop
111
+ * stride = 3 (x, y, z)
244
112
  */
245
- export interface VectorDisplayHandle {
113
+ export interface CurveInteropHandle {
246
114
  count: number;
247
115
  vertices: number;
116
+ transform: TransformInterop | undefined;
248
117
  }
249
118
 
250
- export type DisplayProxyHandle = { variant: "Vector"; data: VectorDisplayHandle } | { variant: "PointList"; data: PointListDisplayHandle };
251
-
252
- /**
253
- * Interop struct for transform
254
- * Represents a 4x4 matrix as a 16-element array
255
- */
256
- export type TransformInterop = number[];
119
+ export interface IOInterop {
120
+ id: string;
121
+ name: string;
122
+ accessType: AccessTypes;
123
+ hint: TypeHint | undefined;
124
+ connections: string[];
125
+ }
257
126
 
258
127
  /**
259
128
  * Interop struct for node
@@ -320,96 +189,169 @@ export interface NodeMetaInterop {
320
189
  hasGeometry: boolean;
321
190
  }
322
191
 
323
- /**
324
- * Interop struct for evaluation results
325
- */
326
- export interface EvaluationInterop {
327
- /**
328
- * Processed nodes in the latest evaluation
329
- */
330
- processedNodes: GraphNodeSet[];
331
- /**
332
- * Geometry identifiers in the latest evaluation
333
- */
334
- geometryIdentifiers: GeometryIdentifier[];
192
+ export interface MeshInteropHandle {
193
+ count: number;
194
+ vertices: number;
195
+ normals: number;
196
+ indices: IndicesInteropHandle | undefined;
197
+ transform: TransformInterop | undefined;
335
198
  }
336
199
 
337
- export type GraphMappingTypes = "None" | "Bezier" | "Linear" | "Sine";
338
-
339
- export type TypeHint = Internal;
340
-
341
- export interface NodePropertyCategoryValue {
342
- candidates: IndexMap<string, number>;
343
- selected: number;
200
+ export interface PointListHandleUnit {
201
+ count: number;
202
+ points: number;
344
203
  }
345
204
 
346
- export interface NodePropertyRangeValue {
347
- value: number;
348
- min: number | undefined;
349
- max: number | undefined;
350
- step: number | undefined;
205
+ /**
206
+ * Point display handle for wasm interop
207
+ */
208
+ export interface PointListDisplayHandle {
209
+ list: PointListHandleUnit[];
210
+ pointSize: number;
351
211
  }
352
212
 
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[] };
213
+ /**
214
+ * Vector display handle for wasm interop
215
+ * stride = 6 (3 for point, 3 for vector)
216
+ */
217
+ export interface VectorDisplayHandle {
218
+ count: number;
219
+ vertices: number;
220
+ }
354
221
 
355
- export type AccessTypes = "Item" | "List" | "Tree";
222
+ export type DisplayProxyHandle = { variant: "Vector"; data: VectorDisplayHandle } | { variant: "PointList"; data: PointListDisplayHandle };
356
223
 
357
- export interface Node<T> {
358
- id: NodeId;
224
+ export type NodeSectionInterop = { type: "section"; content: NodeFolderInterop } | { type: "item"; content: NodeItemInterop };
225
+
226
+ export interface NodeItemInterop {
227
+ key: string;
359
228
  name: string;
360
- label: string | undefined;
361
- input: InputIOManager;
362
- output: OutputIOManager;
363
- entity: T;
364
- enabled: boolean;
365
- visible: boolean;
366
229
  }
367
230
 
368
- export type OutputIOManager = IOManager<OutputId, InputId>;
231
+ export type NodeFolderInterop = IndexMap<string, NodeSectionInterop>;
369
232
 
370
- export type InputIOManager = IOManager<InputId, OutputId>;
233
+ export interface NodeMapInterop {
234
+ folder: NodeFolderInterop;
235
+ }
236
+
237
+
238
+ /// Manually added types due to limitations in the `wasm-bindgen` & `tsify` crates.
239
+ export type ID<T = any> = string;
240
+ export type NodeId = ID;
241
+ export type InputId = ID;
242
+ export type OutputId = ID;
243
+ export type SubGraphId = ID;
244
+ export type SubGraphInstanceId = ID;
245
+
246
+ export type IndexMap<K, V> = Map<K, V>;
247
+
248
+ export type U1 = 1;
249
+ export type U2 = 2;
250
+ export type U3 = 3;
251
+
252
+ /// Define vector & point types with FixedLengthArray
253
+ type BuildTuple<L extends number, T, R extends any[] = []> = R['length'] extends L ? R : BuildTuple<L, T, [T, ...R]>;
254
+ type FixedLengthArray<T, L extends number> = BuildTuple<L, T>;
255
+ export type OPoint<T, D extends number> = FixedLengthArray<T, D>;
256
+ export type OVector<T, D extends number> = FixedLengthArray<T, D>;
257
+ export type Point<T, D extends number> = OPoint<T, D>;
258
+ export type SVector<T, D extends number> = OVector<T, D>;
259
+ export type Point2<T = number> = Point<T, 2>;
260
+ export type Vector2<T = number> = SVector<T, 2>;
261
+ export type Point3<T = number> = Point<T, 3>;
262
+ export type Vector3<T = number> = SVector<T, 3>;
263
+ export type Point4<T = number> = Point<T, 4>;
264
+ export type Vector4<T = number> = SVector<T, 4>;
265
+ export type Transform3<T = number> = FixedLengthArray<T, 16>;
266
+ export type Matrix4<T = number> = FixedLengthArray<FixedLengthArray<T, 4>, 4>;
371
267
 
372
- export type GraphVariant = "Root" | { SubGraph: SubGraphId };
373
268
 
374
269
  /**
375
- * Graph structure
270
+ * Geometry identifier
376
271
  */
377
- export interface Graph<T, U> {
272
+ export interface GeometryIdentifier {
378
273
  /**
379
- * Nodes in the graph
274
+ * Parent node ID
380
275
  */
381
- nodes: IndexMap<NodeId, Node<T, U>>;
276
+ graphNodeSet?: GraphNodeSet;
382
277
  /**
383
- * nested graphs
278
+ * Output ID that the geometry is belonged to
384
279
  */
385
- sub_graphs?: IndexMap<SubGraphId, SubGraph<T, U>>;
280
+ outputId: OutputId;
281
+ /**
282
+ * Geometry ID
283
+ */
284
+ geometryId: ID<GeometryProxy>;
285
+ /**
286
+ * Transform matrix in interop format
287
+ */
288
+ transform: TransformInterop;
386
289
  }
387
290
 
388
- export interface Prune<T, U> {
389
- connectedComponents: ConnectedComponents<T, U>[];
390
- bypass: Connection[] | undefined;
391
- }
291
+ export type GeometryInteropVec = GeometryInterop[];
392
292
 
393
- export interface ConnectedComponentNode {
394
- sources: NodeId[];
395
- destinations: NodeId[];
293
+ export type NodeConnectionInteropVec = NodeConnectionInterop[];
294
+
295
+ export type NodePropertyInteropVec = NodePropertyInterop[];
296
+
297
+ export type NodeInteropVec = NodeInterop[];
298
+
299
+ export type EdgeInteropVec = EdgeInterop[];
300
+
301
+ export interface DataTreeInterop {
302
+ branches: IndexMap<string, string[]>;
396
303
  }
397
304
 
398
- export interface ConnectedComponents<T, U> {
399
- nodes: IndexMap<NodeId, ConnectedComponentNode<T, U>>;
305
+ export interface DataTreeFormatInterop {
306
+ outputs: IndexMap<string, string>;
400
307
  }
401
308
 
402
309
  /**
403
- * A parameter for an input or output of a node.
310
+ * Interop struct for node property
404
311
  */
405
- export interface IOParameter<T, U> {
406
- id: T;
312
+ export interface NodePropertyInterop {
313
+ /**
314
+ * Property name
315
+ */
407
316
  name: string;
408
- access_type: AccessTypes;
409
- hint?: TypeHint;
410
- connections: U[];
317
+ /**
318
+ * Property value
319
+ */
320
+ value: NodePropertyValue;
321
+ /**
322
+ * Whether the node has input connection and the property change is disabled
323
+ */
324
+ connected?: boolean;
325
+ /**
326
+ * Whether the property is disabled in node\' inspector
327
+ */
328
+ disabled?: boolean;
411
329
  }
412
330
 
331
+ /**
332
+ * Interop struct for transform
333
+ * Represents a 4x4 matrix as a 16-element array
334
+ */
335
+ export type TransformInterop = number[];
336
+
337
+ export interface NodePropertyCategoryValue {
338
+ candidates: IndexMap<string, number>;
339
+ selected: number;
340
+ }
341
+
342
+ export interface NodePropertyRangeValue {
343
+ value: number;
344
+ min: number | undefined;
345
+ max: number | undefined;
346
+ step: number | undefined;
347
+ }
348
+
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[] };
350
+
351
+ export type TypeHint = Internal;
352
+
353
+ export type GraphMappingTypes = "None" | "Bezier" | "Linear" | "Sine";
354
+
413
355
  /**
414
356
  * A sub graph is a graph that is a part of a larger graph
415
357
  */
@@ -428,6 +370,47 @@ export interface SubGraph<T, U> {
428
370
  instances: SubGraphInstanceId[];
429
371
  }
430
372
 
373
+ export interface Prune<T, U> {
374
+ connectedComponents: ConnectedComponents<T, U>[];
375
+ bypass: Connection[] | undefined;
376
+ }
377
+
378
+ export type GraphVariant = "Root" | { SubGraph: SubGraphId };
379
+
380
+ /**
381
+ * A parameter for an input or output of a node.
382
+ */
383
+ export interface IOParameter<T, U> {
384
+ id: T;
385
+ name: string;
386
+ access_type: AccessTypes;
387
+ hint?: TypeHint;
388
+ connections: U[];
389
+ }
390
+
391
+ /**
392
+ * Graph structure
393
+ */
394
+ export interface Graph<T, U> {
395
+ /**
396
+ * Nodes in the graph
397
+ */
398
+ nodes: IndexMap<NodeId, Node<T, U>>;
399
+ /**
400
+ * nested graphs
401
+ */
402
+ sub_graphs?: IndexMap<SubGraphId, SubGraph<T, U>>;
403
+ }
404
+
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
+
431
414
  export interface SubGraphIdSet {
432
415
  subGraphId: SubGraphId;
433
416
  instanceId: SubGraphInstanceId;
@@ -452,6 +435,27 @@ export interface GraphNodeSet {
452
435
  nodeId: NodeId;
453
436
  }
454
437
 
438
+ export type AccessTypes = "Item" | "List" | "Tree";
439
+
440
+ export interface IOManager<T, U> {
441
+ parameters: IOParameter<T, U>[];
442
+ }
443
+
444
+ export interface Node<T> {
445
+ id: NodeId;
446
+ name: string;
447
+ label: string | undefined;
448
+ input: InputIOManager;
449
+ output: OutputIOManager;
450
+ entity: T;
451
+ enabled: boolean;
452
+ visible: boolean;
453
+ }
454
+
455
+ export type OutputIOManager = IOManager<OutputId, InputId>;
456
+
457
+ export type InputIOManager = IOManager<InputId, OutputId>;
458
+
455
459
  export interface Connection {
456
460
  source: NodeParameter<OutputId>;
457
461
  destination: NodeParameter<InputId>;
@@ -463,8 +467,102 @@ export interface NodeParameter<T> {
463
467
  parameterIndex: number;
464
468
  }
465
469
 
466
- export interface IOManager<T, U> {
467
- parameters: IOParameter<T, U>[];
470
+
471
+ export type PolylineCurve2D = {
472
+ points: Point2[];
473
+ };
474
+ export type PolylineCurve3D = {
475
+ points: Point3[];
476
+ };
477
+
478
+ /**
479
+ * An oriented box in 3D space
480
+ */
481
+ export interface OrientedBox {
482
+ /**
483
+ * The plane that the box is aligned to
484
+ */
485
+ plane: Plane;
486
+ /**
487
+ * The bounding box in the local coordinate system
488
+ */
489
+ bounds: BoundingBox3D;
490
+ }
491
+
492
+ /**
493
+ * A collection of geometry objects
494
+ */
495
+ export type Group = GeometryTransform[];
496
+
497
+ /**
498
+ * A face of a mesh with three vertices
499
+ */
500
+ export interface MeshTriangleFace {
501
+ a: number;
502
+ b: number;
503
+ c: number;
504
+ }
505
+
506
+ /**
507
+ * An arc curve in 3D space
508
+ */
509
+ export interface ArcCurve {
510
+ /**
511
+ * The base plane of the arc
512
+ */
513
+ plane: Plane;
514
+ /**
515
+ * The start angle of the arc
516
+ */
517
+ startAngle: number;
518
+ /**
519
+ * The end angle of the arc
520
+ */
521
+ endAngle: number;
522
+ /**
523
+ * The radius of the arc
524
+ */
525
+ radius: number;
526
+ }
527
+
528
+ /**
529
+ * Interop struct for point cloud data
530
+ */
531
+ export interface PointCloudInterop {
532
+ /**
533
+ * Vertices of the point cloud
534
+ */
535
+ vertices: [number, number, number][];
536
+ /**
537
+ * Transform matrix of the point cloud
538
+ */
539
+ transform: Transform3<number>;
540
+ }
541
+
542
+ /**
543
+ * Geometry proxy for various geometry types
544
+ */
545
+ 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 };
546
+
547
+ export type PolyCurve = CompoundCurve<number, U4>;
548
+
549
+ /**
550
+ * Proxy for various curve types
551
+ */
552
+ 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 };
553
+
554
+ /**
555
+ * A circle curve in 3D space
556
+ */
557
+ export interface CircleCurve {
558
+ /**
559
+ * The base plane of the circle
560
+ */
561
+ plane: Plane;
562
+ /**
563
+ * The radius of the circle
564
+ */
565
+ radius: number;
468
566
  }
469
567
 
470
568
 
@@ -477,82 +575,51 @@ export type NurbsSurface3D<T = number> = {
477
575
  };
478
576
 
479
577
  /**
480
- * An oriented box in 3D space
481
- */
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;
491
- }
492
-
493
- /**
494
- * A NURBS surface container
578
+ * A surface defined by three points
495
579
  */
496
- export type NurbsSurface = NurbsSurface3D<number>;
580
+ export type TriangleSurface = Triangle3D;
497
581
 
498
582
  /**
499
- * An arc curve in 3D space
583
+ * A surface defined by a plane and two domains in x and y directions
500
584
  */
501
- export interface ArcCurve {
585
+ export interface PlaneSurface {
502
586
  /**
503
- * The base plane of the arc
587
+ * The base plane of the surface
504
588
  */
505
589
  plane: Plane;
506
590
  /**
507
- * The start angle of the arc
508
- */
509
- startAngle: number;
510
- /**
511
- * The end angle of the arc
591
+ * The domain in x direction
512
592
  */
513
- endAngle: number;
593
+ x: Domain;
514
594
  /**
515
- * The radius of the arc
595
+ * The domain in y direction
516
596
  */
517
- radius: number;
597
+ y: Domain;
518
598
  }
519
599
 
520
-
521
- export type NurbsCurve3D<T = number> = {
522
- control_points: Point4<T>[];
523
- knots: T[];
524
- degree: T;
525
- };
526
-
527
600
  /**
528
- * A collection of geometry objects
601
+ * A NURBS surface container
529
602
  */
530
- export type Group = GeometryTransform[];
603
+ export type NurbsSurface = NurbsSurface3D<number>;
531
604
 
532
605
  /**
533
- * A geometry object with a transformation
606
+ * A circular surface
534
607
  */
535
- export interface GeometryTransform {
608
+ export interface CircularSurface {
536
609
  /**
537
- * The handle to the geometry object
610
+ * The base plane of the circle
538
611
  */
539
- geometry: Handle<GeometryProxy>;
612
+ plane: Plane;
540
613
  /**
541
- * Transformation matrix of the geometry
614
+ * The radius of the circle
542
615
  */
543
- transform: Transform3<number>;
616
+ radius: number;
544
617
  }
545
618
 
546
- export type PolyCurve = CompoundCurve<number, U4>;
547
-
548
- export type NurbsCurve = NurbsCurve3D<number>;
549
-
550
619
 
551
- export type PolylineCurve2D = {
552
- points: Point2[];
553
- };
554
- export type PolylineCurve3D = {
555
- points: Point3[];
620
+ export type BoundingBox3D = {
621
+ min: Vector3;
622
+ max: Vector3;
556
623
  };
557
624
 
558
625
 
@@ -589,72 +656,64 @@ export interface MeshInterop {
589
656
  }
590
657
 
591
658
  /**
592
- * Interop proxy for various geometry types
593
- */
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
659
+ * Mesh representation with vertices, normals, uv, and index
598
660
  */
599
- export interface RectangleCurve {
600
- /**
601
- * The base plane of the rectangle
602
- */
603
- plane: Plane;
661
+ export interface Mesh {
604
662
  /**
605
- * The domain of the rectangle in the plane x axis
663
+ * Vertices of the mesh
606
664
  */
607
- x: Domain;
665
+ vertices: Point3<number>[];
608
666
  /**
609
- * The domain of the rectangle in the plane y axis
667
+ * Normals of the mesh
610
668
  */
611
- y: Domain;
612
- }
613
-
614
- /**
615
- * A circle curve in 3D space
616
- */
617
- export interface CircleCurve {
669
+ normals: Vector3<number>[] | undefined;
618
670
  /**
619
- * The base plane of the circle
671
+ * UV coordinates of the mesh
620
672
  */
621
- plane: Plane;
673
+ uv: Vector2<number>[] | undefined;
622
674
  /**
623
- * The radius of the circle
675
+ * Index of the mesh
624
676
  */
625
- radius: number;
677
+ index: [number, number, number][];
626
678
  }
627
679
 
628
680
  /**
629
- * A circular surface
681
+ * Interop struct for curve data
630
682
  */
631
- export interface CircularSurface {
683
+ export interface CurveInterop {
632
684
  /**
633
- * The base plane of the circle
685
+ * Vertices of the curve
634
686
  */
635
- plane: Plane;
687
+ vertices: [number, number, number][];
636
688
  /**
637
- * The radius of the circle
689
+ * Transform matrix of the curve
638
690
  */
639
- radius: number;
691
+ transform: Transform3<number> | undefined;
640
692
  }
641
693
 
642
- /**
643
- * A surface defined by three points
644
- */
645
- export type TriangleSurface = Triangle3D;
646
694
 
647
- /**
648
- * Proxy for various curve types
649
- */
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 };
695
+ export type LineCurve3D = {
696
+ a: Point3;
697
+ b: Point3;
698
+ };
651
699
 
652
700
 
653
- export type BoundingBox3D = {
654
- min: Vector3;
655
- max: Vector3;
701
+ export type NurbsCurve3D<T = number> = {
702
+ control_points: Point4<T>[];
703
+ knots: T[];
704
+ degree: T;
656
705
  };
657
706
 
707
+ export interface Domain {
708
+ min: number;
709
+ max: number;
710
+ }
711
+
712
+ /**
713
+ * Interop proxy for various geometry types
714
+ */
715
+ export type GeometryInterop = { variant: "Mesh"; data: MeshInterop } | { variant: "Curve"; data: CurveInterop } | { variant: "Point"; data: PointCloudInterop } | { variant: "Plane"; data: Plane } | { variant: "Group"; data: GeometryInterop[] };
716
+
658
717
  /**
659
718
  * Plane representation with origin, normal, x axis, and y axis
660
719
  */
@@ -678,65 +737,15 @@ export interface Plane {
678
737
  }
679
738
 
680
739
  /**
681
- * A surface defined by a plane and two domains in x and y directions
682
- */
683
- export interface PlaneSurface {
684
- /**
685
- * The base plane of the surface
686
- */
687
- plane: Plane;
688
- /**
689
- * The domain in x direction
690
- */
691
- x: Domain;
692
- /**
693
- * The domain in y direction
694
- */
695
- y: Domain;
696
- }
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
- }
715
-
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
- }
724
-
725
- export interface Domain {
726
- min: number;
727
- max: number;
728
- }
729
-
730
- /**
731
- * Interop struct for point cloud data
740
+ * A geometry object with a transformation
732
741
  */
733
- export interface PointCloudInterop {
742
+ export interface GeometryTransform {
734
743
  /**
735
- * Vertices of the point cloud
744
+ * The handle to the geometry object
736
745
  */
737
- vertices: [number, number, number][];
746
+ geometry: Handle<GeometryProxy>;
738
747
  /**
739
- * Transform matrix of the point cloud
748
+ * Transformation matrix of the geometry
740
749
  */
741
750
  transform: Transform3<number>;
742
751
  }
@@ -746,53 +755,44 @@ export interface PointCloudInterop {
746
755
  */
747
756
  export type SurfaceProxy = { variant: "Circular"; data: CircularSurface } | { variant: "Triangle"; data: TriangleSurface } | { variant: "Plane"; data: PlaneSurface } | { variant: "NURBS"; data: NurbsSurface } | { variant: "Trimmed"; data: TrimmedSurface };
748
757
 
749
-
750
- export type LineCurve3D = {
751
- a: Point3;
752
- b: Point3;
753
- };
754
-
755
758
  /**
756
- * Interop struct for curve data
759
+ * A rectangle curve in 3D space
757
760
  */
758
- export interface CurveInterop {
761
+ export interface RectangleCurve {
759
762
  /**
760
- * Vertices of the curve
763
+ * The base plane of the rectangle
761
764
  */
762
- vertices: [number, number, number][];
765
+ plane: Plane;
763
766
  /**
764
- * Transform matrix of the curve
767
+ * The domain of the rectangle in the plane x axis
765
768
  */
766
- transform: Transform3<number> | undefined;
769
+ x: Domain;
770
+ /**
771
+ * The domain of the rectangle in the plane y axis
772
+ */
773
+ y: Domain;
767
774
  }
768
775
 
776
+ export type NurbsCurve = NurbsCurve3D<number>;
777
+
769
778
  /**
770
- * Mesh representation with vertices, normals, uv, and index
779
+ * A ellipse curve in 3D space
771
780
  */
772
- export interface Mesh {
773
- /**
774
- * Vertices of the mesh
775
- */
776
- vertices: Point3<number>[];
781
+ export interface EllipseCurve {
777
782
  /**
778
- * Normals of the mesh
783
+ * The base plane of the ellipse
779
784
  */
780
- normals: Vector3<number>[] | undefined;
785
+ plane: Plane;
781
786
  /**
782
- * UV coordinates of the mesh
787
+ * The x radius of the ellipse
783
788
  */
784
- uv: Vector2<number>[] | undefined;
789
+ xRadius: number;
785
790
  /**
786
- * Index of the mesh
791
+ * The y radius of the ellipse
787
792
  */
788
- index: [number, number, number][];
793
+ yRadius: number;
789
794
  }
790
795
 
791
- /**
792
- * Geometry proxy for various geometry types
793
- */
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
-
796
796
  /**
797
797
  * Modular structure with a graph handle
798
798
  */
@@ -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 closure885_externref_shim: (a: number, b: number, c: any) => void;
875
- readonly closure3602_externref_shim: (a: number, b: number, c: any, d: any) => void;
874
+ readonly closure893_externref_shim: (a: number, b: number, c: any) => void;
875
+ readonly closure3806_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.closure885_externref_shim(arg0, arg1, arg2);
228
+ wasm.closure893_externref_shim(arg0, arg1, arg2);
229
229
  }
230
230
 
231
231
  function __wbg_adapter_129(arg0, arg1, arg2, arg3) {
232
- wasm.closure3602_externref_shim(arg0, arg1, arg2, arg3);
232
+ wasm.closure3806_externref_shim(arg0, arg1, arg2, arg3);
233
233
  }
234
234
 
235
235
  const ModularFinalization = (typeof FinalizationRegistry === 'undefined')
@@ -643,8 +643,8 @@ function __wbg_get_imports() {
643
643
  const ret = false;
644
644
  return ret;
645
645
  };
646
- imports.wbg.__wbindgen_closure_wrapper3885 = function(arg0, arg1, arg2) {
647
- const ret = makeMutClosure(arg0, arg1, 886, __wbg_adapter_52);
646
+ imports.wbg.__wbindgen_closure_wrapper4049 = function(arg0, arg1, arg2) {
647
+ const ret = makeMutClosure(arg0, arg1, 894, __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.30",
8
+ "version": "0.0.31",
9
9
  "license": "MIT",
10
10
  "repository": {
11
11
  "type": "git",