nodi-modular 0.0.30 → 0.0.32

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