nodi-modular 0.0.21 → 0.0.22

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
@@ -372,11 +372,6 @@ export interface GraphNodeSet {
372
372
  nodeId: NodeId;
373
373
  }
374
374
 
375
- export interface Prune<T, U> {
376
- connectedComponents: ConnectedComponents<T, U>[];
377
- bypass: Connection[] | undefined;
378
- }
379
-
380
375
  export interface ConnectedComponentNode {
381
376
  sources: NodeId[];
382
377
  destinations: NodeId[];
@@ -397,6 +392,20 @@ export interface IOParameter<T, U> {
397
392
  connections: U[];
398
393
  }
399
394
 
395
+ /**
396
+ * Graph structure
397
+ */
398
+ export interface Graph<T, U> {
399
+ /**
400
+ * Nodes in the graph
401
+ */
402
+ nodes: IndexMap<NodeId, Node<T, U>>;
403
+ /**
404
+ * nested graphs
405
+ */
406
+ sub_graphs?: IndexMap<SubGraphId, SubGraph<T, U>>;
407
+ }
408
+
400
409
  export interface IOManager<T, U> {
401
410
  parameters: IOParameter<T, U>[];
402
411
  }
@@ -447,31 +456,130 @@ export interface NodeParameter<T> {
447
456
 
448
457
  export type GraphVariant = "Root" | { SubGraph: SubGraphId };
449
458
 
459
+ export interface Prune<T, U> {
460
+ connectedComponents: ConnectedComponents<T, U>[];
461
+ bypass: Connection[] | undefined;
462
+ }
463
+
464
+ export type TypeHint = Internal;
465
+
466
+ export type AccessTypes = "Item" | "List" | "Tree";
467
+
468
+ export type GraphMappingTypes = "None" | "Bezier" | "Linear" | "Sine";
469
+
470
+
471
+ export type LineCurve3D = {
472
+ a: Point3;
473
+ b: Point3;
474
+ };
475
+
476
+
477
+ export type NurbsCurve3D<T = number> = {
478
+ control_points: Point4<T>[];
479
+ knots: T[];
480
+ degree: T;
481
+ };
482
+
483
+
484
+ export type NurbsSurface3D<T = number> = {
485
+ control_points: Point4<T>[][];
486
+ u_knots: T[];
487
+ v_knots: T[];
488
+ u_degree: T;
489
+ v_degree: T;
490
+ };
491
+
492
+
493
+ export type BoundingBox3D = {
494
+ min: Vector3;
495
+ max: Vector3;
496
+ };
497
+
450
498
  /**
451
- * Graph structure
499
+ * Interop struct for curve data
452
500
  */
453
- export interface Graph<T, U> {
501
+ export interface CurveInterop {
454
502
  /**
455
- * Nodes in the graph
503
+ * Vertices of the curve
456
504
  */
457
- nodes: IndexMap<NodeId, Node<T, U>>;
505
+ vertices: [number, number, number][];
458
506
  /**
459
- * nested graphs
507
+ * Transform matrix of the curve
460
508
  */
461
- sub_graphs?: IndexMap<SubGraphId, SubGraph<T, U>>;
509
+ transform: Transform3<number> | undefined;
462
510
  }
463
511
 
464
- export type TypeHint = Internal;
512
+ /**
513
+ * A collection of geometry objects
514
+ */
515
+ export type Group = GeometryTransform[];
465
516
 
466
- export type AccessTypes = "Item" | "List" | "Tree";
517
+ /**
518
+ * Mesh representation with vertices, normals, uv, and index
519
+ */
520
+ export interface Mesh {
521
+ /**
522
+ * Vertices of the mesh
523
+ */
524
+ vertices: Point3<number>[];
525
+ /**
526
+ * Normals of the mesh
527
+ */
528
+ normals: Vector3<number>[] | undefined;
529
+ /**
530
+ * UV coordinates of the mesh
531
+ */
532
+ uv: Vector2<number>[] | undefined;
533
+ /**
534
+ * Index of the mesh
535
+ */
536
+ index: [number, number, number][];
537
+ }
467
538
 
468
- export type GraphMappingTypes = "None" | "Bezier" | "Linear" | "Sine";
539
+ /**
540
+ * A face of a mesh with three vertices
541
+ */
542
+ export interface MeshTriangleFace {
543
+ a: number;
544
+ b: number;
545
+ c: number;
546
+ }
469
547
 
470
- export interface Domain {
471
- min: number;
472
- max: number;
548
+ /**
549
+ * A NURBS surface container
550
+ */
551
+ export type NurbsSurface = NurbsSurface3D<number>;
552
+
553
+ /**
554
+ * A rectangle curve in 3D space
555
+ */
556
+ export interface RectangleCurve {
557
+ /**
558
+ * The base plane of the rectangle
559
+ */
560
+ plane: Plane;
561
+ /**
562
+ * The domain of the rectangle in the plane x axis
563
+ */
564
+ x: Domain;
565
+ /**
566
+ * The domain of the rectangle in the plane y axis
567
+ */
568
+ y: Domain;
473
569
  }
474
570
 
571
+ export type NurbsCurve = NurbsCurve3D<number>;
572
+
573
+ /**
574
+ * A surface defined by three points
575
+ */
576
+ export type TriangleSurface = Triangle3D;
577
+
578
+ /**
579
+ * Proxy for various curve types
580
+ */
581
+ 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 };
582
+
475
583
 
476
584
  export type PolylineCurve2D = {
477
585
  points: Point2[];
@@ -622,42 +730,35 @@ export interface OrientedBox {
622
730
  }
623
731
 
624
732
  /**
625
- * A collection of geometry objects
626
- */
627
- export type Group = GeometryTransform[];
628
-
629
- /**
630
- * A face of a mesh with three vertices
733
+ * Interop proxy for various geometry types
631
734
  */
632
- export interface MeshTriangleFace {
633
- a: number;
634
- b: number;
635
- c: number;
636
- }
735
+ export type GeometryInterop = { variant: "Mesh"; data: MeshInterop } | { variant: "Curve"; data: CurveInterop } | { variant: "Point"; data: PointCloudInterop } | { variant: "Plane"; data: Plane } | { variant: "Group"; data: GeometryInterop[] };
637
736
 
638
737
  /**
639
- * A circular surface
738
+ * A geometry object with a transformation
640
739
  */
641
- export interface CircularSurface {
740
+ export interface GeometryTransform {
642
741
  /**
643
- * The base plane of the circle
742
+ * The handle to the geometry object
644
743
  */
645
- plane: Plane;
744
+ geometry: Handle<GeometryProxy>;
646
745
  /**
647
- * The radius of the circle
746
+ * Transformation matrix of the geometry
648
747
  */
649
- radius: number;
748
+ transform: Transform3<number>;
650
749
  }
651
750
 
652
751
  /**
653
- * A surface defined by three points
752
+ * Geometry proxy for various geometry types
654
753
  */
655
- export type TriangleSurface = Triangle3D;
754
+ 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 };
656
755
 
657
- /**
658
- * Proxy for various curve types
659
- */
660
- 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 };
756
+ export type PolyCurve = CompoundCurve<number, U4>;
757
+
758
+ export interface Domain {
759
+ min: number;
760
+ max: number;
761
+ }
661
762
 
662
763
  /**
663
764
  * Interop struct for point cloud data
@@ -678,121 +779,20 @@ export interface PointCloudInterop {
678
779
  */
679
780
  export type SurfaceProxy = { variant: "Circular"; data: CircularSurface } | { variant: "Triangle"; data: TriangleSurface } | { variant: "Plane"; data: PlaneSurface } | { variant: "NURBS"; data: NurbsSurface } | { variant: "Trimmed"; data: TrimmedSurface };
680
781
 
681
-
682
- export type LineCurve3D = {
683
- a: Point3;
684
- b: Point3;
685
- };
686
-
687
-
688
- export type NurbsCurve3D<T = number> = {
689
- control_points: Point4<T>[];
690
- knots: T[];
691
- degree: T;
692
- };
693
-
694
-
695
- export type NurbsSurface3D<T = number> = {
696
- control_points: Point4<T>[][];
697
- u_knots: T[];
698
- v_knots: T[];
699
- u_degree: T;
700
- v_degree: T;
701
- };
702
-
703
-
704
- export type BoundingBox3D = {
705
- min: Vector3;
706
- max: Vector3;
707
- };
708
-
709
- /**
710
- * Interop proxy for various geometry types
711
- */
712
- export type GeometryInterop = { variant: "Mesh"; data: MeshInterop } | { variant: "Curve"; data: CurveInterop } | { variant: "Point"; data: PointCloudInterop } | { variant: "Plane"; data: Plane } | { variant: "Group"; data: GeometryInterop[] };
713
-
714
- /**
715
- * Interop struct for curve data
716
- */
717
- export interface CurveInterop {
718
- /**
719
- * Vertices of the curve
720
- */
721
- vertices: [number, number, number][];
722
- /**
723
- * Transform matrix of the curve
724
- */
725
- transform: Transform3<number> | undefined;
726
- }
727
-
728
782
  /**
729
- * Mesh representation with vertices, normals, uv, and index
730
- */
731
- export interface Mesh {
732
- /**
733
- * Vertices of the mesh
734
- */
735
- vertices: Point3<number>[];
736
- /**
737
- * Normals of the mesh
738
- */
739
- normals: Vector3<number>[] | undefined;
740
- /**
741
- * UV coordinates of the mesh
742
- */
743
- uv: Vector2<number>[] | undefined;
744
- /**
745
- * Index of the mesh
746
- */
747
- index: [number, number, number][];
748
- }
749
-
750
- /**
751
- * A NURBS surface container
752
- */
753
- export type NurbsSurface = NurbsSurface3D<number>;
754
-
755
- /**
756
- * A rectangle curve in 3D space
783
+ * A circular surface
757
784
  */
758
- export interface RectangleCurve {
785
+ export interface CircularSurface {
759
786
  /**
760
- * The base plane of the rectangle
787
+ * The base plane of the circle
761
788
  */
762
789
  plane: Plane;
763
790
  /**
764
- * The domain of the rectangle in the plane x axis
765
- */
766
- x: Domain;
767
- /**
768
- * The domain of the rectangle in the plane y axis
769
- */
770
- y: Domain;
771
- }
772
-
773
- export type NurbsCurve = NurbsCurve3D<number>;
774
-
775
- /**
776
- * A geometry object with a transformation
777
- */
778
- export interface GeometryTransform {
779
- /**
780
- * The handle to the geometry object
781
- */
782
- geometry: Handle<GeometryProxy>;
783
- /**
784
- * Transformation matrix of the geometry
791
+ * The radius of the circle
785
792
  */
786
- transform: Transform3<number>;
793
+ radius: number;
787
794
  }
788
795
 
789
- /**
790
- * Geometry proxy for various geometry types
791
- */
792
- 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 };
793
-
794
- export type PolyCurve = CompoundCurve<number, U4>;
795
-
796
796
  /**
797
797
  * Modular structure with a graph handle
798
798
  */
@@ -871,7 +871,7 @@ 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 closure861_externref_shim: (a: number, b: number, c: any) => void;
874
+ readonly closure862_externref_shim: (a: number, b: number, c: any) => void;
875
875
  readonly closure3520_externref_shim: (a: number, b: number, c: any, d: any) => void;
876
876
  readonly __wbindgen_start: () => void;
877
877
  }
package/index.js CHANGED
@@ -225,7 +225,7 @@ 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.closure861_externref_shim(arg0, arg1, arg2);
228
+ wasm.closure862_externref_shim(arg0, arg1, arg2);
229
229
  }
230
230
 
231
231
  function __wbg_adapter_129(arg0, arg1, arg2, arg3) {
@@ -643,8 +643,8 @@ function __wbg_get_imports() {
643
643
  const ret = false;
644
644
  return ret;
645
645
  };
646
- imports.wbg.__wbindgen_closure_wrapper3621 = function(arg0, arg1, arg2) {
647
- const ret = makeMutClosure(arg0, arg1, 862, __wbg_adapter_52);
646
+ imports.wbg.__wbindgen_closure_wrapper3617 = function(arg0, arg1, arg2) {
647
+ const ret = makeMutClosure(arg0, arg1, 863, __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.21",
8
+ "version": "0.0.22",
9
9
  "license": "MIT",
10
10
  "repository": {
11
11
  "type": "git",