nodi-modular 0.0.32 → 0.0.34

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,18 +1,18 @@
1
1
  /* tslint:disable */
2
2
  /* eslint-disable */
3
3
  export function do_nothing_just_tell_wasm_bindgen_to_generate_types(): void;
4
- export interface GeometryTransformInterop {
5
- geometry: GeometryProxy;
6
- transform: TransformInterop;
7
- }
8
-
9
- export type NodeOutput = (Map<string, Item[]> | undefined)[];
10
-
11
4
  /**
12
5
  * Evaluation item interoperability type.
13
6
  */
14
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 };
15
8
 
9
+ export type NodeOutput = (Map<string, Item[]> | undefined)[];
10
+
11
+ export interface GeometryTransformInterop {
12
+ geometry: GeometryProxy;
13
+ transform: TransformInterop;
14
+ }
15
+
16
16
  export interface GeometrySpreadsheet {
17
17
  points: Point3<number>[];
18
18
  curves: CurveProxy[];
@@ -334,6 +334,8 @@ export interface CurveInteropHandle {
334
334
  transform: TransformInterop | undefined;
335
335
  }
336
336
 
337
+ export type GraphMappingTypes = "None" | "Bezier" | "Linear" | "Sine";
338
+
337
339
  export interface NodePropertyCategoryValue {
338
340
  candidates: IndexMap<string, number>;
339
341
  selected: number;
@@ -364,6 +366,24 @@ export interface ConnectedComponents<T, U> {
364
366
  nodes: IndexMap<NodeId, ConnectedComponentNode<T, U>>;
365
367
  }
366
368
 
369
+ export type GraphVariant = "Root" | { SubGraph: SubGraphId };
370
+
371
+ export interface SubGraphIdSet {
372
+ subGraphId: SubGraphId;
373
+ instanceId: SubGraphInstanceId;
374
+ }
375
+
376
+ /**
377
+ * Defines the dynamics of an IO parameter.
378
+ */
379
+ export interface IOVariables {
380
+ minCount: number;
381
+ maxCount: number;
382
+ defaultCount: number;
383
+ offset: number;
384
+ editable: boolean;
385
+ }
386
+
367
387
  /**
368
388
  * A parameter for an input or output of a node.
369
389
  */
@@ -375,39 +395,29 @@ export interface IOParameter<T, U> {
375
395
  connections: U[];
376
396
  }
377
397
 
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> {
398
+ /**
399
+ * A set of node id and instance id
400
+ */
401
+ export interface GraphNodeSet {
402
+ subGraphIdSet: SubGraphIdSet | undefined;
386
403
  nodeId: NodeId;
387
- parameterId: T;
388
- parameterIndex: number;
389
- }
390
-
391
- export interface IOManager<T, U> {
392
- parameters: IOParameter<T, U>[];
393
404
  }
394
405
 
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;
406
+ /**
407
+ * Graph structure
408
+ */
409
+ export interface Graph<T, U> {
410
+ /**
411
+ * Nodes in the graph
412
+ */
413
+ nodes: IndexMap<NodeId, Node<T, U>>;
414
+ /**
415
+ * nested graphs
416
+ */
417
+ sub_graphs?: IndexMap<SubGraphId, SubGraph<T, U>>;
404
418
  }
405
419
 
406
- export type OutputIOManager = IOManager<OutputId, InputId>;
407
-
408
- export type InputIOManager = IOManager<InputId, OutputId>;
409
-
410
- export type GraphVariant = "Root" | { SubGraph: SubGraphId };
420
+ export type AccessTypes = "Item" | "List" | "Tree";
411
421
 
412
422
  /**
413
423
  * A sub graph is a graph that is a part of a larger graph
@@ -427,96 +437,101 @@ export interface SubGraph<T, U> {
427
437
  instances: SubGraphInstanceId[];
428
438
  }
429
439
 
430
- export interface SubGraphIdSet {
431
- subGraphId: SubGraphId;
432
- instanceId: SubGraphInstanceId;
440
+ export interface Node<T> {
441
+ id: NodeId;
442
+ name: string;
443
+ label: string | undefined;
444
+ input: InputIOManager;
445
+ output: OutputIOManager;
446
+ entity: T;
447
+ enabled: boolean;
448
+ visible: boolean;
433
449
  }
434
450
 
435
- /**
436
- * Defines the dynamics of an IO parameter.
437
- */
438
- export interface IOVariables {
439
- minCount: number;
440
- maxCount: number;
441
- defaultCount: number;
442
- offset: number;
443
- editable: boolean;
451
+ export type OutputIOManager = IOManager<OutputId, InputId>;
452
+
453
+ export type InputIOManager = IOManager<InputId, OutputId>;
454
+
455
+ export interface Connection {
456
+ source: NodeParameter<OutputId>;
457
+ destination: NodeParameter<InputId>;
444
458
  }
445
459
 
446
- /**
447
- * A set of node id and instance id
448
- */
449
- export interface GraphNodeSet {
450
- subGraphIdSet: SubGraphIdSet | undefined;
460
+ export interface NodeParameter<T> {
451
461
  nodeId: NodeId;
462
+ parameterId: T;
463
+ parameterIndex: number;
464
+ }
465
+
466
+ export interface IOManager<T, U> {
467
+ parameters: IOParameter<T, U>[];
452
468
  }
453
469
 
470
+
471
+ export type LineCurve3D = {
472
+ a: Point3;
473
+ b: Point3;
474
+ };
475
+
454
476
  /**
455
- * Graph structure
477
+ * Interop struct for point cloud data
456
478
  */
457
- export interface Graph<T, U> {
479
+ export interface PointCloudInterop {
458
480
  /**
459
- * Nodes in the graph
481
+ * Vertices of the point cloud
460
482
  */
461
- nodes: IndexMap<NodeId, Node<T, U>>;
483
+ vertices: [number, number, number][];
462
484
  /**
463
- * nested graphs
485
+ * Transform matrix of the point cloud
464
486
  */
465
- sub_graphs?: IndexMap<SubGraphId, SubGraph<T, U>>;
466
- }
467
-
468
- export type AccessTypes = "Item" | "List" | "Tree";
469
-
470
- export interface Domain {
471
- min: number;
472
- max: number;
487
+ transform: Transform3<number>;
473
488
  }
474
489
 
475
490
  /**
476
- * An oriented box in 3D space
491
+ * Plane representation with origin, normal, x axis, and y axis
477
492
  */
478
- export interface OrientedBox {
493
+ export interface Plane {
479
494
  /**
480
- * The plane that the box is aligned to
495
+ * Origin coordinate of the plane
481
496
  */
482
- plane: Plane;
497
+ origin: Point3<number>;
483
498
  /**
484
- * The bounding box in the local coordinate system
499
+ * Normal vector of the plane
485
500
  */
486
- bounds: BoundingBox3D;
501
+ normal: Vector3<number>;
502
+ /**
503
+ * X axis of the plane
504
+ */
505
+ xAxis: Vector3<number>;
506
+ /**
507
+ * Y axis of the plane
508
+ */
509
+ yAxis: Vector3<number>;
487
510
  }
488
511
 
489
512
  /**
490
- * A face of a mesh with three vertices
513
+ * Proxy for various surface types
491
514
  */
492
- export interface MeshTriangleFace {
493
- a: number;
494
- b: number;
495
- c: number;
496
- }
515
+ export type SurfaceProxy = { variant: "Circular"; data: CircularSurface } | { variant: "Triangle"; data: TriangleSurface } | { variant: "Plane"; data: PlaneSurface } | { variant: "NURBS"; data: NurbsSurface } | { variant: "Trimmed"; data: TrimmedSurface };
497
516
 
498
517
  /**
499
- * A circular surface
518
+ * A rectangle curve in 3D space
500
519
  */
501
- export interface CircularSurface {
520
+ export interface RectangleCurve {
502
521
  /**
503
- * The base plane of the circle
522
+ * The base plane of the rectangle
504
523
  */
505
524
  plane: Plane;
506
525
  /**
507
- * The radius of the circle
526
+ * The domain of the rectangle in the plane x axis
508
527
  */
509
- radius: number;
528
+ x: Domain;
529
+ /**
530
+ * The domain of the rectangle in the plane y axis
531
+ */
532
+ y: Domain;
510
533
  }
511
534
 
512
-
513
- export type PolylineCurve2D = {
514
- points: Point2[];
515
- };
516
- export type PolylineCurve3D = {
517
- points: Point3[];
518
- };
519
-
520
535
  /**
521
536
  * An arc curve in 3D space
522
537
  */
@@ -540,35 +555,75 @@ export interface ArcCurve {
540
555
  }
541
556
 
542
557
  /**
543
- * Interop struct for point cloud data
558
+ * Geometry proxy for various geometry types
544
559
  */
545
- export interface PointCloudInterop {
560
+ 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 };
561
+
562
+ /**
563
+ * Proxy for various curve types
564
+ */
565
+ 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 };
566
+
567
+ /**
568
+ * A surface defined by three points
569
+ */
570
+ export type TriangleSurface = Triangle3D;
571
+
572
+
573
+ export type BoundingBox3D = {
574
+ min: Vector3;
575
+ max: Vector3;
576
+ };
577
+
578
+ /**
579
+ * Interop struct for curve data
580
+ */
581
+ export interface CurveInterop {
546
582
  /**
547
- * Vertices of the point cloud
583
+ * Vertices of the curve
548
584
  */
549
585
  vertices: [number, number, number][];
550
586
  /**
551
- * Transform matrix of the point cloud
587
+ * Transform matrix of the curve
552
588
  */
553
- transform: Transform3<number>;
589
+ transform: Transform3<number> | undefined;
554
590
  }
555
591
 
556
592
  /**
557
- * Interop proxy for various geometry types
593
+ * A circular surface
558
594
  */
559
- export type GeometryInterop = { variant: "Mesh"; data: MeshInterop } | { variant: "Curve"; data: CurveInterop } | { variant: "Point"; data: PointCloudInterop } | { variant: "Plane"; data: Plane } | { variant: "Group"; data: GeometryInterop[] };
595
+ export interface CircularSurface {
596
+ /**
597
+ * The base plane of the circle
598
+ */
599
+ plane: Plane;
600
+ /**
601
+ * The radius of the circle
602
+ */
603
+ radius: number;
604
+ }
560
605
 
561
606
  /**
562
- * Geometry proxy for various geometry types
607
+ * A circle curve in 3D space
563
608
  */
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 };
609
+ export interface CircleCurve {
610
+ /**
611
+ * The base plane of the circle
612
+ */
613
+ plane: Plane;
614
+ /**
615
+ * The radius of the circle
616
+ */
617
+ radius: number;
618
+ }
565
619
 
566
- export type PolyCurve = CompoundCurve<number, U4>;
567
620
 
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 };
621
+ export type PolylineCurve2D = {
622
+ points: Point2[];
623
+ };
624
+ export type PolylineCurve3D = {
625
+ points: Point3[];
626
+ };
572
627
 
573
628
 
574
629
  export type NurbsSurface3D<T = number> = {
@@ -579,6 +634,20 @@ export type NurbsSurface3D<T = number> = {
579
634
  v_degree: T;
580
635
  };
581
636
 
637
+ /**
638
+ * An oriented box in 3D space
639
+ */
640
+ export interface OrientedBox {
641
+ /**
642
+ * The plane that the box is aligned to
643
+ */
644
+ plane: Plane;
645
+ /**
646
+ * The bounding box in the local coordinate system
647
+ */
648
+ bounds: BoundingBox3D;
649
+ }
650
+
582
651
  /**
583
652
  * A NURBS surface container
584
653
  */
@@ -602,10 +671,31 @@ export interface EllipseCurve {
602
671
  yRadius: number;
603
672
  }
604
673
 
674
+ export interface Domain {
675
+ min: number;
676
+ max: number;
677
+ }
678
+
605
679
  /**
606
- * A surface defined by three points
680
+ * A collection of geometry objects
607
681
  */
608
- export type TriangleSurface = Triangle3D;
682
+ export type Group = GeometryTransform[];
683
+
684
+ /**
685
+ * A face of a mesh with three vertices
686
+ */
687
+ export interface MeshTriangleFace {
688
+ a: number;
689
+ b: number;
690
+ c: number;
691
+ }
692
+
693
+
694
+ export type NurbsCurve3D<T = number> = {
695
+ control_points: Point4<T>[];
696
+ knots: T[];
697
+ degree: T;
698
+ };
609
699
 
610
700
 
611
701
  export type Triangle3D = {
@@ -641,18 +731,9 @@ export interface MeshInterop {
641
731
  }
642
732
 
643
733
  /**
644
- * Interop struct for curve data
734
+ * Interop proxy for various geometry types
645
735
  */
646
- export interface CurveInterop {
647
- /**
648
- * Vertices of the curve
649
- */
650
- vertices: [number, number, number][];
651
- /**
652
- * Transform matrix of the curve
653
- */
654
- transform: Transform3<number> | undefined;
655
- }
736
+ export type GeometryInterop = { variant: "Mesh"; data: MeshInterop } | { variant: "Curve"; data: CurveInterop } | { variant: "Point"; data: PointCloudInterop } | { variant: "Plane"; data: Plane } | { variant: "Group"; data: GeometryInterop[] };
656
737
 
657
738
  /**
658
739
  * Mesh representation with vertices, normals, uv, and index
@@ -676,59 +757,6 @@ export interface Mesh {
676
757
  index: [number, number, number][];
677
758
  }
678
759
 
679
- /**
680
- * A rectangle curve in 3D space
681
- */
682
- export interface RectangleCurve {
683
- /**
684
- * The base plane of the rectangle
685
- */
686
- plane: Plane;
687
- /**
688
- * The domain of the rectangle in the plane x axis
689
- */
690
- x: Domain;
691
- /**
692
- * The domain of the rectangle in the plane y axis
693
- */
694
- y: Domain;
695
- }
696
-
697
-
698
- export type LineCurve3D = {
699
- a: Point3;
700
- b: Point3;
701
- };
702
-
703
-
704
- export type NurbsCurve3D<T = number> = {
705
- control_points: Point4<T>[];
706
- knots: T[];
707
- degree: T;
708
- };
709
-
710
- /**
711
- * Plane representation with origin, normal, x axis, and y axis
712
- */
713
- export interface Plane {
714
- /**
715
- * Origin coordinate of the plane
716
- */
717
- origin: Point3<number>;
718
- /**
719
- * Normal vector of the plane
720
- */
721
- normal: Vector3<number>;
722
- /**
723
- * X axis of the plane
724
- */
725
- xAxis: Vector3<number>;
726
- /**
727
- * Y axis of the plane
728
- */
729
- yAxis: Vector3<number>;
730
- }
731
-
732
760
  /**
733
761
  * A geometry object with a transformation
734
762
  */
@@ -743,11 +771,6 @@ export interface GeometryTransform {
743
771
  transform: Transform3<number>;
744
772
  }
745
773
 
746
- /**
747
- * Proxy for various surface types
748
- */
749
- export type SurfaceProxy = { variant: "Circular"; data: CircularSurface } | { variant: "Triangle"; data: TriangleSurface } | { variant: "Plane"; data: PlaneSurface } | { variant: "NURBS"; data: NurbsSurface } | { variant: "Trimmed"; data: TrimmedSurface };
750
-
751
774
  /**
752
775
  * A surface defined by a plane and two domains in x and y directions
753
776
  */
@@ -766,32 +789,9 @@ export interface PlaneSurface {
766
789
  y: Domain;
767
790
  }
768
791
 
769
- export type NurbsCurve = NurbsCurve3D<number>;
770
-
771
-
772
- export type BoundingBox3D = {
773
- min: Vector3;
774
- max: Vector3;
775
- };
776
-
777
- /**
778
- * A collection of geometry objects
779
- */
780
- export type Group = GeometryTransform[];
792
+ export type PolyCurve = CompoundCurve<number, U4>;
781
793
 
782
- /**
783
- * A circle curve in 3D space
784
- */
785
- export interface CircleCurve {
786
- /**
787
- * The base plane of the circle
788
- */
789
- plane: Plane;
790
- /**
791
- * The radius of the circle
792
- */
793
- radius: number;
794
- }
794
+ export type NurbsCurve = NurbsCurve3D<number>;
795
795
 
796
796
  /**
797
797
  * Modular structure with a graph handle
@@ -871,8 +871,8 @@ export interface InitOutput {
871
871
  readonly __externref_table_dealloc: (a: number) => void;
872
872
  readonly __externref_drop_slice: (a: number, b: number) => void;
873
873
  readonly __wbindgen_free: (a: number, b: number, c: number) => void;
874
- readonly closure896_externref_shim: (a: number, b: number, c: any) => void;
875
- readonly closure3794_externref_shim: (a: number, b: number, c: any, d: any) => void;
874
+ readonly closure902_externref_shim: (a: number, b: number, c: any) => void;
875
+ readonly closure3818_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.closure896_externref_shim(arg0, arg1, arg2);
228
+ wasm.closure902_externref_shim(arg0, arg1, arg2);
229
229
  }
230
230
 
231
231
  function __wbg_adapter_129(arg0, arg1, arg2, arg3) {
232
- wasm.closure3794_externref_shim(arg0, arg1, arg2, arg3);
232
+ wasm.closure3818_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_wrapper4036 = function(arg0, arg1, arg2) {
647
- const ret = makeMutClosure(arg0, arg1, 897, __wbg_adapter_52);
646
+ imports.wbg.__wbindgen_closure_wrapper4056 = function(arg0, arg1, arg2) {
647
+ const ret = makeMutClosure(arg0, arg1, 903, __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.32",
8
+ "version": "0.0.34",
9
9
  "license": "MIT",
10
10
  "repository": {
11
11
  "type": "git",