nodi-modular 0.0.33 → 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
@@ -357,24 +357,31 @@ export interface Prune<T, U> {
357
357
  bypass: Connection[] | undefined;
358
358
  }
359
359
 
360
+ export interface ConnectedComponentNode {
361
+ sources: NodeId[];
362
+ destinations: NodeId[];
363
+ }
364
+
365
+ export interface ConnectedComponents<T, U> {
366
+ nodes: IndexMap<NodeId, ConnectedComponentNode<T, U>>;
367
+ }
368
+
360
369
  export type GraphVariant = "Root" | { SubGraph: SubGraphId };
361
370
 
371
+ export interface SubGraphIdSet {
372
+ subGraphId: SubGraphId;
373
+ instanceId: SubGraphInstanceId;
374
+ }
375
+
362
376
  /**
363
- * A sub graph is a graph that is a part of a larger graph
377
+ * Defines the dynamics of an IO parameter.
364
378
  */
365
- export interface SubGraph<T, U> {
366
- /**
367
- * The id of the sub graph
368
- */
369
- id: SubGraphId;
370
- /**
371
- * The graph of the sub graph
372
- */
373
- graph: Graph<T, U>;
374
- /**
375
- * The instances of the sub graph
376
- */
377
- instances: SubGraphInstanceId[];
379
+ export interface IOVariables {
380
+ minCount: number;
381
+ maxCount: number;
382
+ defaultCount: number;
383
+ offset: number;
384
+ editable: boolean;
378
385
  }
379
386
 
380
387
  /**
@@ -388,6 +395,14 @@ export interface IOParameter<T, U> {
388
395
  connections: U[];
389
396
  }
390
397
 
398
+ /**
399
+ * A set of node id and instance id
400
+ */
401
+ export interface GraphNodeSet {
402
+ subGraphIdSet: SubGraphIdSet | undefined;
403
+ nodeId: NodeId;
404
+ }
405
+
391
406
  /**
392
407
  * Graph structure
393
408
  */
@@ -402,41 +417,24 @@ export interface Graph<T, U> {
402
417
  sub_graphs?: IndexMap<SubGraphId, SubGraph<T, U>>;
403
418
  }
404
419
 
405
- export interface SubGraphIdSet {
406
- subGraphId: SubGraphId;
407
- instanceId: SubGraphInstanceId;
408
- }
409
-
410
- /**
411
- * Defines the dynamics of an IO parameter.
412
- */
413
- export interface IOVariables {
414
- minCount: number;
415
- maxCount: number;
416
- defaultCount: number;
417
- offset: number;
418
- editable: boolean;
419
- }
420
+ export type AccessTypes = "Item" | "List" | "Tree";
420
421
 
421
422
  /**
422
- * A set of node id and instance id
423
+ * A sub graph is a graph that is a part of a larger graph
423
424
  */
424
- export interface GraphNodeSet {
425
- subGraphIdSet: SubGraphIdSet | undefined;
426
- nodeId: NodeId;
427
- }
428
-
429
- export type AccessTypes = "Item" | "List" | "Tree";
430
-
431
- export interface Connection {
432
- source: NodeParameter<OutputId>;
433
- destination: NodeParameter<InputId>;
434
- }
435
-
436
- export interface NodeParameter<T> {
437
- nodeId: NodeId;
438
- parameterId: T;
439
- parameterIndex: number;
425
+ export interface SubGraph<T, U> {
426
+ /**
427
+ * The id of the sub graph
428
+ */
429
+ id: SubGraphId;
430
+ /**
431
+ * The graph of the sub graph
432
+ */
433
+ graph: Graph<T, U>;
434
+ /**
435
+ * The instances of the sub graph
436
+ */
437
+ instances: SubGraphInstanceId[];
440
438
  }
441
439
 
442
440
  export interface Node<T> {
@@ -454,13 +452,15 @@ export type OutputIOManager = IOManager<OutputId, InputId>;
454
452
 
455
453
  export type InputIOManager = IOManager<InputId, OutputId>;
456
454
 
457
- export interface ConnectedComponentNode {
458
- sources: NodeId[];
459
- destinations: NodeId[];
455
+ export interface Connection {
456
+ source: NodeParameter<OutputId>;
457
+ destination: NodeParameter<InputId>;
460
458
  }
461
459
 
462
- export interface ConnectedComponents<T, U> {
463
- nodes: IndexMap<NodeId, ConnectedComponentNode<T, U>>;
460
+ export interface NodeParameter<T> {
461
+ nodeId: NodeId;
462
+ parameterId: T;
463
+ parameterIndex: number;
464
464
  }
465
465
 
466
466
  export interface IOManager<T, U> {
@@ -468,10 +468,9 @@ export interface IOManager<T, U> {
468
468
  }
469
469
 
470
470
 
471
- export type NurbsCurve3D<T = number> = {
472
- control_points: Point4<T>[];
473
- knots: T[];
474
- degree: T;
471
+ export type LineCurve3D = {
472
+ a: Point3;
473
+ b: Point3;
475
474
  };
476
475
 
477
476
  /**
@@ -488,57 +487,93 @@ export interface PointCloudInterop {
488
487
  transform: Transform3<number>;
489
488
  }
490
489
 
491
- export type PolyCurve = CompoundCurve<number, U4>;
492
-
493
- export type NurbsCurve = NurbsCurve3D<number>;
494
-
495
490
  /**
496
- * Proxy for various curve types
491
+ * Plane representation with origin, normal, x axis, and y axis
497
492
  */
498
- 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 };
493
+ export interface Plane {
494
+ /**
495
+ * Origin coordinate of the plane
496
+ */
497
+ origin: Point3<number>;
498
+ /**
499
+ * Normal vector of the plane
500
+ */
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>;
510
+ }
499
511
 
500
512
  /**
501
513
  * Proxy for various surface types
502
514
  */
503
515
  export type SurfaceProxy = { variant: "Circular"; data: CircularSurface } | { variant: "Triangle"; data: TriangleSurface } | { variant: "Plane"; data: PlaneSurface } | { variant: "NURBS"; data: NurbsSurface } | { variant: "Trimmed"; data: TrimmedSurface };
504
516
 
505
-
506
- export type Triangle3D = {
507
- a: Point3;
508
- b: Point3;
509
- c: Point3;
510
- };
511
-
512
517
  /**
513
- * Interop struct for mesh data
518
+ * A rectangle curve in 3D space
514
519
  */
515
- export interface MeshInterop {
520
+ export interface RectangleCurve {
516
521
  /**
517
- * Vertices of the mesh
522
+ * The base plane of the rectangle
518
523
  */
519
- vertices: [number, number, number][];
524
+ plane: Plane;
520
525
  /**
521
- * Normals of the mesh
526
+ * The domain of the rectangle in the plane x axis
522
527
  */
523
- normals: [number, number, number][];
528
+ x: Domain;
524
529
  /**
525
- * UV coordinates of the mesh
530
+ * The domain of the rectangle in the plane y axis
526
531
  */
527
- uv?: [number, number][];
532
+ y: Domain;
533
+ }
534
+
535
+ /**
536
+ * An arc curve in 3D space
537
+ */
538
+ export interface ArcCurve {
528
539
  /**
529
- * Faces of the mesh
540
+ * The base plane of the arc
530
541
  */
531
- faces?: [number, number, number][];
542
+ plane: Plane;
532
543
  /**
533
- * Transform matrix of the mesh
544
+ * The start angle of the arc
534
545
  */
535
- transform?: Transform3<number>;
546
+ startAngle: number;
547
+ /**
548
+ * The end angle of the arc
549
+ */
550
+ endAngle: number;
551
+ /**
552
+ * The radius of the arc
553
+ */
554
+ radius: number;
536
555
  }
537
556
 
538
557
  /**
539
- * Interop proxy for various geometry types
558
+ * Geometry proxy for various geometry types
540
559
  */
541
- export type GeometryInterop = { variant: "Mesh"; data: MeshInterop } | { variant: "Curve"; data: CurveInterop } | { variant: "Point"; data: PointCloudInterop } | { variant: "Plane"; data: Plane } | { variant: "Group"; data: GeometryInterop[] };
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
+ };
542
577
 
543
578
  /**
544
579
  * Interop struct for curve data
@@ -555,31 +590,39 @@ export interface CurveInterop {
555
590
  }
556
591
 
557
592
  /**
558
- * Mesh representation with vertices, normals, uv, and index
593
+ * A circular surface
559
594
  */
560
- export interface Mesh {
595
+ export interface CircularSurface {
561
596
  /**
562
- * Vertices of the mesh
597
+ * The base plane of the circle
563
598
  */
564
- vertices: Point3<number>[];
599
+ plane: Plane;
565
600
  /**
566
- * Normals of the mesh
601
+ * The radius of the circle
567
602
  */
568
- normals: Vector3<number>[] | undefined;
603
+ radius: number;
604
+ }
605
+
606
+ /**
607
+ * A circle curve in 3D space
608
+ */
609
+ export interface CircleCurve {
569
610
  /**
570
- * UV coordinates of the mesh
611
+ * The base plane of the circle
571
612
  */
572
- uv: Vector2<number>[] | undefined;
613
+ plane: Plane;
573
614
  /**
574
- * Index of the mesh
615
+ * The radius of the circle
575
616
  */
576
- index: [number, number, number][];
617
+ radius: number;
577
618
  }
578
619
 
579
620
 
580
- export type LineCurve3D = {
581
- a: Point3;
582
- b: Point3;
621
+ export type PolylineCurve2D = {
622
+ points: Point2[];
623
+ };
624
+ export type PolylineCurve3D = {
625
+ points: Point3[];
583
626
  };
584
627
 
585
628
 
@@ -591,33 +634,6 @@ export type NurbsSurface3D<T = number> = {
591
634
  v_degree: T;
592
635
  };
593
636
 
594
- export interface Domain {
595
- min: number;
596
- max: number;
597
- }
598
-
599
- /**
600
- * Plane representation with origin, normal, x axis, and y axis
601
- */
602
- export interface Plane {
603
- /**
604
- * Origin coordinate of the plane
605
- */
606
- origin: Point3<number>;
607
- /**
608
- * Normal vector of the plane
609
- */
610
- normal: Vector3<number>;
611
- /**
612
- * X axis of the plane
613
- */
614
- xAxis: Vector3<number>;
615
- /**
616
- * Y axis of the plane
617
- */
618
- yAxis: Vector3<number>;
619
- }
620
-
621
637
  /**
622
638
  * An oriented box in 3D space
623
639
  */
@@ -632,53 +648,11 @@ export interface OrientedBox {
632
648
  bounds: BoundingBox3D;
633
649
  }
634
650
 
635
- /**
636
- * A geometry object with a transformation
637
- */
638
- export interface GeometryTransform {
639
- /**
640
- * The handle to the geometry object
641
- */
642
- geometry: Handle<GeometryProxy>;
643
- /**
644
- * Transformation matrix of the geometry
645
- */
646
- transform: Transform3<number>;
647
- }
648
-
649
- /**
650
- * Geometry proxy for various geometry types
651
- */
652
- 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 };
653
-
654
- /**
655
- * A surface defined by three points
656
- */
657
- export type TriangleSurface = Triangle3D;
658
-
659
651
  /**
660
652
  * A NURBS surface container
661
653
  */
662
654
  export type NurbsSurface = NurbsSurface3D<number>;
663
655
 
664
- /**
665
- * A rectangle curve in 3D space
666
- */
667
- export interface RectangleCurve {
668
- /**
669
- * The base plane of the rectangle
670
- */
671
- plane: Plane;
672
- /**
673
- * The domain of the rectangle in the plane x axis
674
- */
675
- x: Domain;
676
- /**
677
- * The domain of the rectangle in the plane y axis
678
- */
679
- y: Domain;
680
- }
681
-
682
656
  /**
683
657
  * A ellipse curve in 3D space
684
658
  */
@@ -697,101 +671,127 @@ export interface EllipseCurve {
697
671
  yRadius: number;
698
672
  }
699
673
 
674
+ export interface Domain {
675
+ min: number;
676
+ max: number;
677
+ }
678
+
700
679
  /**
701
- * An arc curve in 3D space
680
+ * A collection of geometry objects
702
681
  */
703
- export interface ArcCurve {
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
+ };
699
+
700
+
701
+ export type Triangle3D = {
702
+ a: Point3;
703
+ b: Point3;
704
+ c: Point3;
705
+ };
706
+
707
+ /**
708
+ * Interop struct for mesh data
709
+ */
710
+ export interface MeshInterop {
704
711
  /**
705
- * The base plane of the arc
712
+ * Vertices of the mesh
706
713
  */
707
- plane: Plane;
714
+ vertices: [number, number, number][];
708
715
  /**
709
- * The start angle of the arc
716
+ * Normals of the mesh
710
717
  */
711
- startAngle: number;
718
+ normals: [number, number, number][];
712
719
  /**
713
- * The end angle of the arc
720
+ * UV coordinates of the mesh
714
721
  */
715
- endAngle: number;
722
+ uv?: [number, number][];
716
723
  /**
717
- * The radius of the arc
724
+ * Faces of the mesh
718
725
  */
719
- radius: number;
726
+ faces?: [number, number, number][];
727
+ /**
728
+ * Transform matrix of the mesh
729
+ */
730
+ transform?: Transform3<number>;
720
731
  }
721
732
 
722
733
  /**
723
- * A surface defined by a plane and two domains in x and y directions
734
+ * Interop proxy for various geometry types
724
735
  */
725
- export interface PlaneSurface {
736
+ export type GeometryInterop = { variant: "Mesh"; data: MeshInterop } | { variant: "Curve"; data: CurveInterop } | { variant: "Point"; data: PointCloudInterop } | { variant: "Plane"; data: Plane } | { variant: "Group"; data: GeometryInterop[] };
737
+
738
+ /**
739
+ * Mesh representation with vertices, normals, uv, and index
740
+ */
741
+ export interface Mesh {
726
742
  /**
727
- * The base plane of the surface
743
+ * Vertices of the mesh
728
744
  */
729
- plane: Plane;
745
+ vertices: Point3<number>[];
730
746
  /**
731
- * The domain in x direction
747
+ * Normals of the mesh
732
748
  */
733
- x: Domain;
749
+ normals: Vector3<number>[] | undefined;
734
750
  /**
735
- * The domain in y direction
751
+ * UV coordinates of the mesh
736
752
  */
737
- y: Domain;
753
+ uv: Vector2<number>[] | undefined;
754
+ /**
755
+ * Index of the mesh
756
+ */
757
+ index: [number, number, number][];
738
758
  }
739
759
 
740
760
  /**
741
- * A circular surface
761
+ * A geometry object with a transformation
742
762
  */
743
- export interface CircularSurface {
763
+ export interface GeometryTransform {
744
764
  /**
745
- * The base plane of the circle
765
+ * The handle to the geometry object
746
766
  */
747
- plane: Plane;
767
+ geometry: Handle<GeometryProxy>;
748
768
  /**
749
- * The radius of the circle
769
+ * Transformation matrix of the geometry
750
770
  */
751
- radius: number;
771
+ transform: Transform3<number>;
752
772
  }
753
773
 
754
774
  /**
755
- * A circle curve in 3D space
775
+ * A surface defined by a plane and two domains in x and y directions
756
776
  */
757
- export interface CircleCurve {
777
+ export interface PlaneSurface {
758
778
  /**
759
- * The base plane of the circle
779
+ * The base plane of the surface
760
780
  */
761
781
  plane: Plane;
762
782
  /**
763
- * The radius of the circle
783
+ * The domain in x direction
764
784
  */
765
- radius: number;
785
+ x: Domain;
786
+ /**
787
+ * The domain in y direction
788
+ */
789
+ y: Domain;
766
790
  }
767
791
 
792
+ export type PolyCurve = CompoundCurve<number, U4>;
768
793
 
769
- export type PolylineCurve2D = {
770
- points: Point2[];
771
- };
772
- export type PolylineCurve3D = {
773
- points: Point3[];
774
- };
775
-
776
-
777
- export type BoundingBox3D = {
778
- min: Vector3;
779
- max: Vector3;
780
- };
781
-
782
- /**
783
- * A collection of geometry objects
784
- */
785
- export type Group = GeometryTransform[];
786
-
787
- /**
788
- * A face of a mesh with three vertices
789
- */
790
- export interface MeshTriangleFace {
791
- a: number;
792
- b: number;
793
- c: 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 closure901_externref_shim: (a: number, b: number, c: any) => void;
875
- readonly closure3815_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.closure901_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.closure3815_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_wrapper4059 = function(arg0, arg1, arg2) {
647
- const ret = makeMutClosure(arg0, arg1, 902, __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.33",
8
+ "version": "0.0.34",
9
9
  "license": "MIT",
10
10
  "repository": {
11
11
  "type": "git",