nodi-modular 0.0.32 → 0.0.33

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;
@@ -355,13 +357,24 @@ export interface Prune<T, U> {
355
357
  bypass: Connection[] | undefined;
356
358
  }
357
359
 
358
- export interface ConnectedComponentNode {
359
- sources: NodeId[];
360
- destinations: NodeId[];
361
- }
360
+ export type GraphVariant = "Root" | { SubGraph: SubGraphId };
362
361
 
363
- export interface ConnectedComponents<T, U> {
364
- nodes: IndexMap<NodeId, ConnectedComponentNode<T, U>>;
362
+ /**
363
+ * A sub graph is a graph that is a part of a larger graph
364
+ */
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[];
365
378
  }
366
379
 
367
380
  /**
@@ -375,56 +388,18 @@ export interface IOParameter<T, U> {
375
388
  connections: U[];
376
389
  }
377
390
 
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
-
412
391
  /**
413
- * A sub graph is a graph that is a part of a larger graph
392
+ * Graph structure
414
393
  */
415
- export interface SubGraph<T, U> {
416
- /**
417
- * The id of the sub graph
418
- */
419
- id: SubGraphId;
394
+ export interface Graph<T, U> {
420
395
  /**
421
- * The graph of the sub graph
396
+ * Nodes in the graph
422
397
  */
423
- graph: Graph<T, U>;
398
+ nodes: IndexMap<NodeId, Node<T, U>>;
424
399
  /**
425
- * The instances of the sub graph
400
+ * nested graphs
426
401
  */
427
- instances: SubGraphInstanceId[];
402
+ sub_graphs?: IndexMap<SubGraphId, SubGraph<T, U>>;
428
403
  }
429
404
 
430
405
  export interface SubGraphIdSet {
@@ -451,94 +426,54 @@ export interface GraphNodeSet {
451
426
  nodeId: NodeId;
452
427
  }
453
428
 
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>>;
429
+ export type AccessTypes = "Item" | "List" | "Tree";
430
+
431
+ export interface Connection {
432
+ source: NodeParameter<OutputId>;
433
+ destination: NodeParameter<InputId>;
466
434
  }
467
435
 
468
- export type AccessTypes = "Item" | "List" | "Tree";
436
+ export interface NodeParameter<T> {
437
+ nodeId: NodeId;
438
+ parameterId: T;
439
+ parameterIndex: number;
440
+ }
469
441
 
470
- export interface Domain {
471
- min: number;
472
- max: number;
442
+ export interface Node<T> {
443
+ id: NodeId;
444
+ name: string;
445
+ label: string | undefined;
446
+ input: InputIOManager;
447
+ output: OutputIOManager;
448
+ entity: T;
449
+ enabled: boolean;
450
+ visible: boolean;
473
451
  }
474
452
 
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;
453
+ export type OutputIOManager = IOManager<OutputId, InputId>;
454
+
455
+ export type InputIOManager = IOManager<InputId, OutputId>;
456
+
457
+ export interface ConnectedComponentNode {
458
+ sources: NodeId[];
459
+ destinations: NodeId[];
487
460
  }
488
461
 
489
- /**
490
- * A face of a mesh with three vertices
491
- */
492
- export interface MeshTriangleFace {
493
- a: number;
494
- b: number;
495
- c: number;
462
+ export interface ConnectedComponents<T, U> {
463
+ nodes: IndexMap<NodeId, ConnectedComponentNode<T, U>>;
496
464
  }
497
465
 
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;
466
+ export interface IOManager<T, U> {
467
+ parameters: IOParameter<T, U>[];
510
468
  }
511
469
 
512
470
 
513
- export type PolylineCurve2D = {
514
- points: Point2[];
515
- };
516
- export type PolylineCurve3D = {
517
- points: Point3[];
471
+ export type NurbsCurve3D<T = number> = {
472
+ control_points: Point4<T>[];
473
+ knots: T[];
474
+ degree: T;
518
475
  };
519
476
 
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
477
  /**
543
478
  * Interop struct for point cloud data
544
479
  */
@@ -553,59 +488,19 @@ export interface PointCloudInterop {
553
488
  transform: Transform3<number>;
554
489
  }
555
490
 
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
491
  export type PolyCurve = CompoundCurve<number, U4>;
567
492
 
493
+ export type NurbsCurve = NurbsCurve3D<number>;
494
+
568
495
  /**
569
496
  * Proxy for various curve types
570
497
  */
571
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 };
572
499
 
573
-
574
- export type NurbsSurface3D<T = number> = {
575
- control_points: Point4<T>[][];
576
- u_knots: T[];
577
- v_knots: T[];
578
- u_degree: T;
579
- v_degree: T;
580
- };
581
-
582
- /**
583
- * A NURBS surface container
584
- */
585
- export type NurbsSurface = NurbsSurface3D<number>;
586
-
587
500
  /**
588
- * A ellipse curve in 3D space
589
- */
590
- export interface EllipseCurve {
591
- /**
592
- * The base plane of the ellipse
593
- */
594
- plane: Plane;
595
- /**
596
- * The x radius of the ellipse
597
- */
598
- xRadius: number;
599
- /**
600
- * The y radius of the ellipse
601
- */
602
- yRadius: number;
603
- }
604
-
605
- /**
606
- * A surface defined by three points
501
+ * Proxy for various surface types
607
502
  */
608
- export type TriangleSurface = Triangle3D;
503
+ export type SurfaceProxy = { variant: "Circular"; data: CircularSurface } | { variant: "Triangle"; data: TriangleSurface } | { variant: "Plane"; data: PlaneSurface } | { variant: "NURBS"; data: NurbsSurface } | { variant: "Trimmed"; data: TrimmedSurface };
609
504
 
610
505
 
611
506
  export type Triangle3D = {
@@ -640,6 +535,11 @@ export interface MeshInterop {
640
535
  transform?: Transform3<number>;
641
536
  }
642
537
 
538
+ /**
539
+ * Interop proxy for various geometry types
540
+ */
541
+ export type GeometryInterop = { variant: "Mesh"; data: MeshInterop } | { variant: "Curve"; data: CurveInterop } | { variant: "Point"; data: PointCloudInterop } | { variant: "Plane"; data: Plane } | { variant: "Group"; data: GeometryInterop[] };
542
+
643
543
  /**
644
544
  * Interop struct for curve data
645
545
  */
@@ -676,24 +576,6 @@ export interface Mesh {
676
576
  index: [number, number, number][];
677
577
  }
678
578
 
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
579
 
698
580
  export type LineCurve3D = {
699
581
  a: Point3;
@@ -701,12 +583,19 @@ export type LineCurve3D = {
701
583
  };
702
584
 
703
585
 
704
- export type NurbsCurve3D<T = number> = {
705
- control_points: Point4<T>[];
706
- knots: T[];
707
- degree: T;
586
+ export type NurbsSurface3D<T = number> = {
587
+ control_points: Point4<T>[][];
588
+ u_knots: T[];
589
+ v_knots: T[];
590
+ u_degree: T;
591
+ v_degree: T;
708
592
  };
709
593
 
594
+ export interface Domain {
595
+ min: number;
596
+ max: number;
597
+ }
598
+
710
599
  /**
711
600
  * Plane representation with origin, normal, x axis, and y axis
712
601
  */
@@ -729,6 +618,20 @@ export interface Plane {
729
618
  yAxis: Vector3<number>;
730
619
  }
731
620
 
621
+ /**
622
+ * An oriented box in 3D space
623
+ */
624
+ export interface OrientedBox {
625
+ /**
626
+ * The plane that the box is aligned to
627
+ */
628
+ plane: Plane;
629
+ /**
630
+ * The bounding box in the local coordinate system
631
+ */
632
+ bounds: BoundingBox3D;
633
+ }
634
+
732
635
  /**
733
636
  * A geometry object with a transformation
734
637
  */
@@ -744,9 +647,77 @@ export interface GeometryTransform {
744
647
  }
745
648
 
746
649
  /**
747
- * Proxy for various surface types
650
+ * Geometry proxy for various geometry types
748
651
  */
749
- export type SurfaceProxy = { variant: "Circular"; data: CircularSurface } | { variant: "Triangle"; data: TriangleSurface } | { variant: "Plane"; data: PlaneSurface } | { variant: "NURBS"; data: NurbsSurface } | { variant: "Trimmed"; data: TrimmedSurface };
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
+ /**
660
+ * A NURBS surface container
661
+ */
662
+ export type NurbsSurface = NurbsSurface3D<number>;
663
+
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
+ /**
683
+ * A ellipse curve in 3D space
684
+ */
685
+ export interface EllipseCurve {
686
+ /**
687
+ * The base plane of the ellipse
688
+ */
689
+ plane: Plane;
690
+ /**
691
+ * The x radius of the ellipse
692
+ */
693
+ xRadius: number;
694
+ /**
695
+ * The y radius of the ellipse
696
+ */
697
+ yRadius: number;
698
+ }
699
+
700
+ /**
701
+ * An arc curve in 3D space
702
+ */
703
+ export interface ArcCurve {
704
+ /**
705
+ * The base plane of the arc
706
+ */
707
+ plane: Plane;
708
+ /**
709
+ * The start angle of the arc
710
+ */
711
+ startAngle: number;
712
+ /**
713
+ * The end angle of the arc
714
+ */
715
+ endAngle: number;
716
+ /**
717
+ * The radius of the arc
718
+ */
719
+ radius: number;
720
+ }
750
721
 
751
722
  /**
752
723
  * A surface defined by a plane and two domains in x and y directions
@@ -766,18 +737,19 @@ export interface PlaneSurface {
766
737
  y: Domain;
767
738
  }
768
739
 
769
- export type NurbsCurve = NurbsCurve3D<number>;
770
-
771
-
772
- export type BoundingBox3D = {
773
- min: Vector3;
774
- max: Vector3;
775
- };
776
-
777
740
  /**
778
- * A collection of geometry objects
741
+ * A circular surface
779
742
  */
780
- export type Group = GeometryTransform[];
743
+ export interface CircularSurface {
744
+ /**
745
+ * The base plane of the circle
746
+ */
747
+ plane: Plane;
748
+ /**
749
+ * The radius of the circle
750
+ */
751
+ radius: number;
752
+ }
781
753
 
782
754
  /**
783
755
  * A circle curve in 3D space
@@ -793,6 +765,34 @@ export interface CircleCurve {
793
765
  radius: number;
794
766
  }
795
767
 
768
+
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
+ }
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 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 closure901_externref_shim: (a: number, b: number, c: any) => void;
875
+ readonly closure3815_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.closure901_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.closure3815_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_wrapper4059 = function(arg0, arg1, arg2) {
647
+ const ret = makeMutClosure(arg0, arg1, 902, __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.33",
9
9
  "license": "MIT",
10
10
  "repository": {
11
11
  "type": "git",