@tscircuit/hypergraph 0.0.38 → 0.0.40

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.
Files changed (3) hide show
  1. package/dist/index.d.ts +152 -132
  2. package/dist/index.js +166 -145
  3. package/package.json +1 -1
package/dist/index.d.ts CHANGED
@@ -662,16 +662,16 @@ var viasByNet = {
662
662
  viaId: "79364d38-c966-4eff-aa4a-e3ff6cca6339",
663
663
  diameter: 0.6,
664
664
  position: {
665
- x: -0.8,
666
- y: -1.893395
665
+ x: -0.695585,
666
+ y: -1.475
667
667
  }
668
668
  },
669
669
  {
670
670
  viaId: "f1d52fd5-ddd2-4440-8772-da3d096b033f",
671
671
  diameter: 0.6,
672
672
  position: {
673
- x: -0.703066,
674
- y: 1.2
673
+ x: -0.428066,
674
+ y: 1.185303
675
675
  }
676
676
  }
677
677
  ],
@@ -680,24 +680,24 @@ var viasByNet = {
680
680
  viaId: "4e57cee8-0910-4c83-9ec1-1ed2c9d16dcc",
681
681
  diameter: 0.6,
682
682
  position: {
683
- x: 1.268717,
684
- y: -1.698536
683
+ x: 0.981466,
684
+ y: -1.472559
685
685
  }
686
686
  },
687
687
  {
688
688
  viaId: "a3797f13-73f9-48c3-a448-bea3980cdd65",
689
689
  diameter: 0.6,
690
690
  position: {
691
- x: -1.115754,
692
- y: -0.799377
691
+ x: -1.276,
692
+ y: -0.834191
693
693
  }
694
694
  },
695
695
  {
696
696
  viaId: "b0c56bb1-ea80-4154-9bb7-cb0fd760de8f",
697
697
  diameter: 0.6,
698
698
  position: {
699
- x: 0.397934,
700
- y: 1.458567
699
+ x: 0.685025,
700
+ y: 1.338478
701
701
  }
702
702
  }
703
703
  ],
@@ -706,8 +706,8 @@ var viasByNet = {
706
706
  viaId: "3719876b-17c8-4ee3-9cce-5b5c073d6614",
707
707
  diameter: 0.6,
708
708
  position: {
709
- x: 1.186721,
710
- y: 1.32508
709
+ x: 1.434987,
710
+ y: 1.330707
711
711
  }
712
712
  },
713
713
  {
@@ -722,8 +722,8 @@ var viasByNet = {
722
722
  viaId: "63afce65-b94e-47da-ae14-51ff0ee8eb39",
723
723
  diameter: 0.6,
724
724
  position: {
725
- x: 1.655408,
726
- y: -0.998198
725
+ x: 1.478363,
726
+ y: -0.910782
727
727
  }
728
728
  }
729
729
  ],
@@ -740,16 +740,16 @@ var viasByNet = {
740
740
  viaId: "548acbca-8b68-4186-a589-681ec44fba42",
741
741
  diameter: 0.6,
742
742
  position: {
743
- x: 0.222457,
744
- y: -1.866711
743
+ x: 0.251271,
744
+ y: -1.643783
745
745
  }
746
746
  },
747
747
  {
748
748
  viaId: "d6bf60bf-4b90-4967-a295-fc930b1f2549",
749
749
  diameter: 0.6,
750
750
  position: {
751
- x: -1.419706,
752
- y: 0.868747
751
+ x: -1.168748,
752
+ y: 1.067434
753
753
  }
754
754
  }
755
755
  ]
@@ -766,28 +766,28 @@ var routeSegments = [
766
766
  y: 0.582296
767
767
  },
768
768
  {
769
- x: 1.712721,
770
- y: 0.811183
769
+ x: 1.960987,
770
+ y: 1.059449
771
771
  },
772
772
  {
773
- x: 1.712721,
774
- y: 1.542957
773
+ x: 1.960987,
774
+ y: 1.548584
775
775
  },
776
776
  {
777
- x: 0.920111,
778
- y: 2.335567
777
+ x: 1.344093,
778
+ y: 2.165478
779
779
  },
780
780
  {
781
- x: 0.034666,
782
- y: 2.335566
781
+ x: 0.165478,
782
+ y: 2.165478
783
783
  },
784
784
  {
785
- x: -0.703066,
786
- y: 1.597834
785
+ x: -0.428066,
786
+ y: 1.571934
787
787
  },
788
788
  {
789
- x: -0.703066,
790
- y: 1.2
789
+ x: -0.428066,
790
+ y: 1.185303
791
791
  }
792
792
  ]
793
793
  },
@@ -798,32 +798,64 @@ var routeSegments = [
798
798
  layer: "bottom",
799
799
  segments: [
800
800
  {
801
- x: -0.8,
802
- y: -1.893395
801
+ x: -0.695585,
802
+ y: -1.475
803
+ },
804
+ {
805
+ x: -0.810394,
806
+ y: -1.360191
807
+ },
808
+ {
809
+ x: -1.493877,
810
+ y: -1.360191
811
+ },
812
+ {
813
+ x: -1.80445,
814
+ y: -1.049618
815
+ },
816
+ {
817
+ x: -1.80445,
818
+ y: 0.214427
819
+ },
820
+ {
821
+ x: -1.801,
822
+ y: 0.210977
803
823
  },
804
824
  {
805
- x: -1.706605,
806
- y: -1.893395
825
+ x: -1.801,
826
+ y: 0.217877
807
827
  },
808
828
  {
809
- x: -2.10103,
810
- y: -1.49897
829
+ x: -1.492877,
830
+ y: 0.526
811
831
  },
812
832
  {
813
- x: -2.10103,
814
- y: 1.002011
833
+ x: -1.057123,
834
+ y: 0.526
815
835
  },
816
836
  {
817
- x: -1.708294,
818
- y: 1.394747
837
+ x: -0.849428,
838
+ y: 0.318305
819
839
  },
820
840
  {
821
- x: -0.897813,
822
- y: 1.394747
841
+ x: -0.5,
842
+ y: 0.667733
823
843
  },
824
844
  {
825
- x: -0.703066,
826
- y: 1.2
845
+ x: -0.5,
846
+ y: 0.678735
847
+ },
848
+ {
849
+ x: -0.479066,
850
+ y: 0.699669
851
+ },
852
+ {
853
+ x: -0.479066,
854
+ y: 1.134303
855
+ },
856
+ {
857
+ x: -0.428066,
858
+ y: 1.185303
827
859
  }
828
860
  ]
829
861
  },
@@ -834,16 +866,16 @@ var routeSegments = [
834
866
  layer: "bottom",
835
867
  segments: [
836
868
  {
837
- x: 1.268717,
838
- y: -1.698536
869
+ x: 0.981466,
870
+ y: -1.472559
839
871
  },
840
872
  {
841
- x: 0.369558,
842
- y: -0.799377
873
+ x: 0.343098,
874
+ y: -0.834191
843
875
  },
844
876
  {
845
- x: -1.115754,
846
- y: -0.799377
877
+ x: -1.276,
878
+ y: -0.834191
847
879
  }
848
880
  ]
849
881
  },
@@ -854,8 +886,20 @@ var routeSegments = [
854
886
  layer: "bottom",
855
887
  segments: [
856
888
  {
857
- x: -1.115754,
858
- y: -0.799377
889
+ x: -1.276,
890
+ y: -0.834191
891
+ },
892
+ {
893
+ x: -1.156476,
894
+ y: -0.834191
895
+ },
896
+ {
897
+ x: -0.809571,
898
+ y: -0.487286
899
+ },
900
+ {
901
+ x: -0.803663,
902
+ y: -0.487286
859
903
  },
860
904
  {
861
905
  x: 0.397934,
@@ -863,7 +907,11 @@ var routeSegments = [
863
907
  },
864
908
  {
865
909
  x: 0.397934,
866
- y: 1.458567
910
+ y: 1.051387
911
+ },
912
+ {
913
+ x: 0.685025,
914
+ y: 1.338478
867
915
  }
868
916
  ]
869
917
  },
@@ -874,24 +922,20 @@ var routeSegments = [
874
922
  layer: "bottom",
875
923
  segments: [
876
924
  {
877
- x: 1.186721,
878
- y: 1.32508
879
- },
880
- {
881
- x: 0.907834,
882
- y: 1.046193
925
+ x: 1.434987,
926
+ y: 1.330707
883
927
  },
884
928
  {
885
- x: 0.907834,
886
- y: -0.261774
929
+ x: 0.957834,
930
+ y: 0.853554
887
931
  },
888
932
  {
889
- x: 1.644258,
890
- y: -0.998198
933
+ x: 0.957834,
934
+ y: -0.390253
891
935
  },
892
936
  {
893
- x: 1.655408,
894
- y: -0.998198
937
+ x: 1.478363,
938
+ y: -0.910782
895
939
  }
896
940
  ]
897
941
  },
@@ -902,31 +946,31 @@ var routeSegments = [
902
946
  layer: "bottom",
903
947
  segments: [
904
948
  {
905
- x: 1.186721,
906
- y: 1.32508
949
+ x: 1.434987,
950
+ y: 1.330707
907
951
  },
908
952
  {
909
- x: 1.186721,
910
- y: 1.484368
953
+ x: 1.434987,
954
+ y: 1.332393
911
955
  },
912
956
  {
913
- x: 0.636522,
914
- y: 2.034567
957
+ x: 0.902902,
958
+ y: 1.864478
915
959
  },
916
960
  {
917
- x: 0.159346,
918
- y: 2.034567
961
+ x: 0.467148,
962
+ y: 1.864478
919
963
  },
920
964
  {
921
- x: -0.178066,
922
- y: 1.697155
965
+ x: 0.096934,
966
+ y: 1.494264
923
967
  },
924
968
  {
925
- x: -0.178066,
926
- y: 0.981123
969
+ x: 0.096934,
970
+ y: 0.838989
927
971
  },
928
972
  {
929
- x: -1.159189,
973
+ x: -0.742055,
930
974
  y: 0
931
975
  },
932
976
  {
@@ -946,28 +990,24 @@ var routeSegments = [
946
990
  y: -0.164505
947
991
  },
948
992
  {
949
- x: 1.565592,
950
- y: -0.164505
951
- },
952
- {
953
- x: 2.181408,
954
- y: -0.780321
993
+ x: 2.004363,
994
+ y: -0.615839
955
995
  },
956
996
  {
957
- x: 2.181408,
958
- y: -1.600433
997
+ x: 2.004363,
998
+ y: -1.193539
959
999
  },
960
1000
  {
961
- x: 1.507305,
962
- y: -2.274536
1001
+ x: 1.197902,
1002
+ y: -2
963
1003
  },
964
1004
  {
965
- x: 0.630282,
966
- y: -2.274536
1005
+ x: 0.607488,
1006
+ y: -2
967
1007
  },
968
1008
  {
969
- x: 0.222457,
970
- y: -1.866711
1009
+ x: 0.251271,
1010
+ y: -1.643783
971
1011
  }
972
1012
  ]
973
1013
  },
@@ -978,61 +1018,37 @@ var routeSegments = [
978
1018
  layer: "bottom",
979
1019
  segments: [
980
1020
  {
981
- x: 0.222457,
982
- y: -1.866711
983
- },
984
- {
985
- x: 0.137528,
986
- y: -1.866711
987
- },
988
- {
989
- x: -0.329183,
990
- y: -1.4
991
- },
992
- {
993
- x: -0.361788,
994
- y: -1.367395
995
- },
996
- {
997
- x: -1.017877,
998
- y: -1.367395
999
- },
1000
- {
1001
- x: -1.237643,
1002
- y: -1.587161
1003
- },
1004
- {
1005
- x: -1.587161,
1006
- y: -1.587161
1021
+ x: 0.251271,
1022
+ y: -1.643783
1007
1023
  },
1008
1024
  {
1009
- x: -1.8,
1010
- y: -1.374322
1025
+ x: -0.105946,
1026
+ y: -2.001
1011
1027
  },
1012
1028
  {
1013
- x: -1.8,
1014
- y: -1.036995
1029
+ x: -1.278746,
1030
+ y: -2.001
1015
1031
  },
1016
1032
  {
1017
- x: -1.80003,
1018
- y: -1.036965
1033
+ x: -2.10545,
1034
+ y: -1.174296
1019
1035
  },
1020
1036
  {
1021
- x: -1.80003,
1022
- y: -0.6
1037
+ x: -2.10545,
1038
+ y: 0.339105
1023
1039
  },
1024
1040
  {
1025
- x: -1.80003,
1026
- y: 0.488423
1041
+ x: -1.377121,
1042
+ y: 1.067434
1027
1043
  },
1028
1044
  {
1029
- x: -1.419706,
1030
- y: 0.868747
1045
+ x: -1.168748,
1046
+ y: 1.067434
1031
1047
  }
1032
1048
  ]
1033
1049
  }
1034
1050
  ];
1035
- var viaTile = {
1051
+ var viaTile4Regions = {
1036
1052
  viasByNet: viasByNet,
1037
1053
  routeSegments: routeSegments
1038
1054
  };
@@ -1196,6 +1212,8 @@ type ConvexViaGraphFromXYConnectionsResult = JumperGraph & {
1196
1212
  * @param opts - Optional configuration
1197
1213
  */
1198
1214
  declare function createConvexViaGraphFromXYConnections(xyConnections: XYConnection[], viaTile?: ViaTile, opts?: {
1215
+ tileWidth?: number;
1216
+ tileHeight?: number;
1199
1217
  tileSize?: number;
1200
1218
  portPitch?: number;
1201
1219
  clearance?: number;
@@ -1259,6 +1277,8 @@ type Bounds = {
1259
1277
  declare function generateConvexViaTopologyRegions(opts: {
1260
1278
  viaTile: ViaTile;
1261
1279
  bounds: Bounds;
1280
+ tileWidth?: number;
1281
+ tileHeight?: number;
1262
1282
  tileSize?: number;
1263
1283
  portPitch?: number;
1264
1284
  clearance?: number;
@@ -1273,4 +1293,4 @@ declare function generateConvexViaTopologyRegions(opts: {
1273
1293
  };
1274
1294
  };
1275
1295
 
1276
- export { type Bounds$2 as Bounds, type BuildOpts, type Candidate, ConnectBuilder, type ConnectOpts, type Connection, type ConnectionId, type ConvexViaGraphFromXYConnectionsResult, type GScore, type GraphEdgeId, type HyperGraph, HyperGraphSolver, type JPort, type JRegion, JUMPER_GRAPH_SOLVER_DEFAULTS, type JumperGraph, JumperGraphSolver, type JumperGraphWithConnections, type NetworkId, type PortAssignment, PortBuilder, type PortData, type PortId, type PortSpread, type Region, RegionBuilder, type RegionData, type RegionId, type RegionPort, type RegionPortAssignment, type RegionRef, type RouteSegment, type SerializedConnection, type SerializedGraphPort, type SerializedGraphRegion, type SerializedHyperGraph, type SerializedRegionPortAssignment, type SharedBoundary, type SolvedRoute, Topology, TopologyError, VIA_GRAPH_SOLVER_DEFAULTS, type ValidateOpts, type ViaByNet, type ViaData, type ViaGraphFromXYConnectionsResult, ViaGraphSolver, type ViaGraphWithConnections, type ViaTile, type XYConnection, applyTransformToGraph, calculateGraphBounds, convertConnectionsToSerializedConnections, convertHyperGraphToSerializedHyperGraph, createConvexViaGraphFromXYConnections, createGraphWithConnectionsFromBaseGraph, createViaGraphFromXYConnections, createViaGraphWithConnections, generateConvexViaTopologyRegions, generateDefaultViaTopologyGrid, generateDefaultViaTopologyRegions, generateJumperGrid, generateJumperX4Grid, generateViaTopologyGrid, generateViaTopologyRegions, rotateGraph90Degrees, viaTile };
1296
+ export { type Bounds$2 as Bounds, type BuildOpts, type Candidate, ConnectBuilder, type ConnectOpts, type Connection, type ConnectionId, type ConvexViaGraphFromXYConnectionsResult, type GScore, type GraphEdgeId, type HyperGraph, HyperGraphSolver, type JPort, type JRegion, JUMPER_GRAPH_SOLVER_DEFAULTS, type JumperGraph, JumperGraphSolver, type JumperGraphWithConnections, type NetworkId, type PortAssignment, PortBuilder, type PortData, type PortId, type PortSpread, type Region, RegionBuilder, type RegionData, type RegionId, type RegionPort, type RegionPortAssignment, type RegionRef, type RouteSegment, type SerializedConnection, type SerializedGraphPort, type SerializedGraphRegion, type SerializedHyperGraph, type SerializedRegionPortAssignment, type SharedBoundary, type SolvedRoute, Topology, TopologyError, VIA_GRAPH_SOLVER_DEFAULTS, type ValidateOpts, type ViaByNet, type ViaData, type ViaGraphFromXYConnectionsResult, ViaGraphSolver, type ViaGraphWithConnections, type ViaTile, type XYConnection, applyTransformToGraph, calculateGraphBounds, convertConnectionsToSerializedConnections, convertHyperGraphToSerializedHyperGraph, createConvexViaGraphFromXYConnections, createGraphWithConnectionsFromBaseGraph, createViaGraphFromXYConnections, createViaGraphWithConnections, generateConvexViaTopologyRegions, generateDefaultViaTopologyGrid, generateDefaultViaTopologyRegions, generateJumperGrid, generateJumperX4Grid, generateViaTopologyGrid, generateViaTopologyRegions, rotateGraph90Degrees, viaTile4Regions as viaTile };
package/dist/index.js CHANGED
@@ -3763,8 +3763,8 @@ ${errors.map((e) => ` - ${e}`).join("\n")}`
3763
3763
  }
3764
3764
  };
3765
3765
 
3766
- // assets/ViaGraphSolver/via-tile.json
3767
- var via_tile_default = {
3766
+ // assets/ViaGraphSolver/via-tile-4-regions.json
3767
+ var via_tile_4_regions_default = {
3768
3768
  viasByNet: {
3769
3769
  Net6: [
3770
3770
  {
@@ -3779,16 +3779,16 @@ var via_tile_default = {
3779
3779
  viaId: "79364d38-c966-4eff-aa4a-e3ff6cca6339",
3780
3780
  diameter: 0.6,
3781
3781
  position: {
3782
- x: -0.8,
3783
- y: -1.893395
3782
+ x: -0.695585,
3783
+ y: -1.475
3784
3784
  }
3785
3785
  },
3786
3786
  {
3787
3787
  viaId: "f1d52fd5-ddd2-4440-8772-da3d096b033f",
3788
3788
  diameter: 0.6,
3789
3789
  position: {
3790
- x: -0.703066,
3791
- y: 1.2
3790
+ x: -0.428066,
3791
+ y: 1.185303
3792
3792
  }
3793
3793
  }
3794
3794
  ],
@@ -3797,24 +3797,24 @@ var via_tile_default = {
3797
3797
  viaId: "4e57cee8-0910-4c83-9ec1-1ed2c9d16dcc",
3798
3798
  diameter: 0.6,
3799
3799
  position: {
3800
- x: 1.268717,
3801
- y: -1.698536
3800
+ x: 0.981466,
3801
+ y: -1.472559
3802
3802
  }
3803
3803
  },
3804
3804
  {
3805
3805
  viaId: "a3797f13-73f9-48c3-a448-bea3980cdd65",
3806
3806
  diameter: 0.6,
3807
3807
  position: {
3808
- x: -1.115754,
3809
- y: -0.799377
3808
+ x: -1.276,
3809
+ y: -0.834191
3810
3810
  }
3811
3811
  },
3812
3812
  {
3813
3813
  viaId: "b0c56bb1-ea80-4154-9bb7-cb0fd760de8f",
3814
3814
  diameter: 0.6,
3815
3815
  position: {
3816
- x: 0.397934,
3817
- y: 1.458567
3816
+ x: 0.685025,
3817
+ y: 1.338478
3818
3818
  }
3819
3819
  }
3820
3820
  ],
@@ -3823,8 +3823,8 @@ var via_tile_default = {
3823
3823
  viaId: "3719876b-17c8-4ee3-9cce-5b5c073d6614",
3824
3824
  diameter: 0.6,
3825
3825
  position: {
3826
- x: 1.186721,
3827
- y: 1.32508
3826
+ x: 1.434987,
3827
+ y: 1.330707
3828
3828
  }
3829
3829
  },
3830
3830
  {
@@ -3839,8 +3839,8 @@ var via_tile_default = {
3839
3839
  viaId: "63afce65-b94e-47da-ae14-51ff0ee8eb39",
3840
3840
  diameter: 0.6,
3841
3841
  position: {
3842
- x: 1.655408,
3843
- y: -0.998198
3842
+ x: 1.478363,
3843
+ y: -0.910782
3844
3844
  }
3845
3845
  }
3846
3846
  ],
@@ -3857,16 +3857,16 @@ var via_tile_default = {
3857
3857
  viaId: "548acbca-8b68-4186-a589-681ec44fba42",
3858
3858
  diameter: 0.6,
3859
3859
  position: {
3860
- x: 0.222457,
3861
- y: -1.866711
3860
+ x: 0.251271,
3861
+ y: -1.643783
3862
3862
  }
3863
3863
  },
3864
3864
  {
3865
3865
  viaId: "d6bf60bf-4b90-4967-a295-fc930b1f2549",
3866
3866
  diameter: 0.6,
3867
3867
  position: {
3868
- x: -1.419706,
3869
- y: 0.868747
3868
+ x: -1.168748,
3869
+ y: 1.067434
3870
3870
  }
3871
3871
  }
3872
3872
  ]
@@ -3883,28 +3883,28 @@ var via_tile_default = {
3883
3883
  y: 0.582296
3884
3884
  },
3885
3885
  {
3886
- x: 1.712721,
3887
- y: 0.811183
3886
+ x: 1.960987,
3887
+ y: 1.059449
3888
3888
  },
3889
3889
  {
3890
- x: 1.712721,
3891
- y: 1.542957
3890
+ x: 1.960987,
3891
+ y: 1.548584
3892
3892
  },
3893
3893
  {
3894
- x: 0.920111,
3895
- y: 2.335567
3894
+ x: 1.344093,
3895
+ y: 2.165478
3896
3896
  },
3897
3897
  {
3898
- x: 0.034666,
3899
- y: 2.335566
3898
+ x: 0.165478,
3899
+ y: 2.165478
3900
3900
  },
3901
3901
  {
3902
- x: -0.703066,
3903
- y: 1.597834
3902
+ x: -0.428066,
3903
+ y: 1.571934
3904
3904
  },
3905
3905
  {
3906
- x: -0.703066,
3907
- y: 1.2
3906
+ x: -0.428066,
3907
+ y: 1.185303
3908
3908
  }
3909
3909
  ]
3910
3910
  },
@@ -3915,32 +3915,64 @@ var via_tile_default = {
3915
3915
  layer: "bottom",
3916
3916
  segments: [
3917
3917
  {
3918
- x: -0.8,
3919
- y: -1.893395
3918
+ x: -0.695585,
3919
+ y: -1.475
3920
+ },
3921
+ {
3922
+ x: -0.810394,
3923
+ y: -1.360191
3924
+ },
3925
+ {
3926
+ x: -1.493877,
3927
+ y: -1.360191
3928
+ },
3929
+ {
3930
+ x: -1.80445,
3931
+ y: -1.049618
3932
+ },
3933
+ {
3934
+ x: -1.80445,
3935
+ y: 0.214427
3936
+ },
3937
+ {
3938
+ x: -1.801,
3939
+ y: 0.210977
3940
+ },
3941
+ {
3942
+ x: -1.801,
3943
+ y: 0.217877
3944
+ },
3945
+ {
3946
+ x: -1.492877,
3947
+ y: 0.526
3920
3948
  },
3921
3949
  {
3922
- x: -1.706605,
3923
- y: -1.893395
3950
+ x: -1.057123,
3951
+ y: 0.526
3924
3952
  },
3925
3953
  {
3926
- x: -2.10103,
3927
- y: -1.49897
3954
+ x: -0.849428,
3955
+ y: 0.318305
3928
3956
  },
3929
3957
  {
3930
- x: -2.10103,
3931
- y: 1.002011
3958
+ x: -0.5,
3959
+ y: 0.667733
3932
3960
  },
3933
3961
  {
3934
- x: -1.708294,
3935
- y: 1.394747
3962
+ x: -0.5,
3963
+ y: 0.678735
3936
3964
  },
3937
3965
  {
3938
- x: -0.897813,
3939
- y: 1.394747
3966
+ x: -0.479066,
3967
+ y: 0.699669
3940
3968
  },
3941
3969
  {
3942
- x: -0.703066,
3943
- y: 1.2
3970
+ x: -0.479066,
3971
+ y: 1.134303
3972
+ },
3973
+ {
3974
+ x: -0.428066,
3975
+ y: 1.185303
3944
3976
  }
3945
3977
  ]
3946
3978
  },
@@ -3951,16 +3983,16 @@ var via_tile_default = {
3951
3983
  layer: "bottom",
3952
3984
  segments: [
3953
3985
  {
3954
- x: 1.268717,
3955
- y: -1.698536
3986
+ x: 0.981466,
3987
+ y: -1.472559
3956
3988
  },
3957
3989
  {
3958
- x: 0.369558,
3959
- y: -0.799377
3990
+ x: 0.343098,
3991
+ y: -0.834191
3960
3992
  },
3961
3993
  {
3962
- x: -1.115754,
3963
- y: -0.799377
3994
+ x: -1.276,
3995
+ y: -0.834191
3964
3996
  }
3965
3997
  ]
3966
3998
  },
@@ -3971,8 +4003,20 @@ var via_tile_default = {
3971
4003
  layer: "bottom",
3972
4004
  segments: [
3973
4005
  {
3974
- x: -1.115754,
3975
- y: -0.799377
4006
+ x: -1.276,
4007
+ y: -0.834191
4008
+ },
4009
+ {
4010
+ x: -1.156476,
4011
+ y: -0.834191
4012
+ },
4013
+ {
4014
+ x: -0.809571,
4015
+ y: -0.487286
4016
+ },
4017
+ {
4018
+ x: -0.803663,
4019
+ y: -0.487286
3976
4020
  },
3977
4021
  {
3978
4022
  x: 0.397934,
@@ -3980,7 +4024,11 @@ var via_tile_default = {
3980
4024
  },
3981
4025
  {
3982
4026
  x: 0.397934,
3983
- y: 1.458567
4027
+ y: 1.051387
4028
+ },
4029
+ {
4030
+ x: 0.685025,
4031
+ y: 1.338478
3984
4032
  }
3985
4033
  ]
3986
4034
  },
@@ -3991,24 +4039,20 @@ var via_tile_default = {
3991
4039
  layer: "bottom",
3992
4040
  segments: [
3993
4041
  {
3994
- x: 1.186721,
3995
- y: 1.32508
3996
- },
3997
- {
3998
- x: 0.907834,
3999
- y: 1.046193
4042
+ x: 1.434987,
4043
+ y: 1.330707
4000
4044
  },
4001
4045
  {
4002
- x: 0.907834,
4003
- y: -0.261774
4046
+ x: 0.957834,
4047
+ y: 0.853554
4004
4048
  },
4005
4049
  {
4006
- x: 1.644258,
4007
- y: -0.998198
4050
+ x: 0.957834,
4051
+ y: -0.390253
4008
4052
  },
4009
4053
  {
4010
- x: 1.655408,
4011
- y: -0.998198
4054
+ x: 1.478363,
4055
+ y: -0.910782
4012
4056
  }
4013
4057
  ]
4014
4058
  },
@@ -4019,31 +4063,31 @@ var via_tile_default = {
4019
4063
  layer: "bottom",
4020
4064
  segments: [
4021
4065
  {
4022
- x: 1.186721,
4023
- y: 1.32508
4066
+ x: 1.434987,
4067
+ y: 1.330707
4024
4068
  },
4025
4069
  {
4026
- x: 1.186721,
4027
- y: 1.484368
4070
+ x: 1.434987,
4071
+ y: 1.332393
4028
4072
  },
4029
4073
  {
4030
- x: 0.636522,
4031
- y: 2.034567
4074
+ x: 0.902902,
4075
+ y: 1.864478
4032
4076
  },
4033
4077
  {
4034
- x: 0.159346,
4035
- y: 2.034567
4078
+ x: 0.467148,
4079
+ y: 1.864478
4036
4080
  },
4037
4081
  {
4038
- x: -0.178066,
4039
- y: 1.697155
4082
+ x: 0.096934,
4083
+ y: 1.494264
4040
4084
  },
4041
4085
  {
4042
- x: -0.178066,
4043
- y: 0.981123
4086
+ x: 0.096934,
4087
+ y: 0.838989
4044
4088
  },
4045
4089
  {
4046
- x: -1.159189,
4090
+ x: -0.742055,
4047
4091
  y: 0
4048
4092
  },
4049
4093
  {
@@ -4063,28 +4107,24 @@ var via_tile_default = {
4063
4107
  y: -0.164505
4064
4108
  },
4065
4109
  {
4066
- x: 1.565592,
4067
- y: -0.164505
4068
- },
4069
- {
4070
- x: 2.181408,
4071
- y: -0.780321
4110
+ x: 2.004363,
4111
+ y: -0.615839
4072
4112
  },
4073
4113
  {
4074
- x: 2.181408,
4075
- y: -1.600433
4114
+ x: 2.004363,
4115
+ y: -1.193539
4076
4116
  },
4077
4117
  {
4078
- x: 1.507305,
4079
- y: -2.274536
4118
+ x: 1.197902,
4119
+ y: -2
4080
4120
  },
4081
4121
  {
4082
- x: 0.630282,
4083
- y: -2.274536
4122
+ x: 0.607488,
4123
+ y: -2
4084
4124
  },
4085
4125
  {
4086
- x: 0.222457,
4087
- y: -1.866711
4126
+ x: 0.251271,
4127
+ y: -1.643783
4088
4128
  }
4089
4129
  ]
4090
4130
  },
@@ -4095,56 +4135,32 @@ var via_tile_default = {
4095
4135
  layer: "bottom",
4096
4136
  segments: [
4097
4137
  {
4098
- x: 0.222457,
4099
- y: -1.866711
4100
- },
4101
- {
4102
- x: 0.137528,
4103
- y: -1.866711
4104
- },
4105
- {
4106
- x: -0.329183,
4107
- y: -1.4
4108
- },
4109
- {
4110
- x: -0.361788,
4111
- y: -1.367395
4138
+ x: 0.251271,
4139
+ y: -1.643783
4112
4140
  },
4113
4141
  {
4114
- x: -1.017877,
4115
- y: -1.367395
4142
+ x: -0.105946,
4143
+ y: -2.001
4116
4144
  },
4117
4145
  {
4118
- x: -1.237643,
4119
- y: -1.587161
4146
+ x: -1.278746,
4147
+ y: -2.001
4120
4148
  },
4121
4149
  {
4122
- x: -1.587161,
4123
- y: -1.587161
4150
+ x: -2.10545,
4151
+ y: -1.174296
4124
4152
  },
4125
4153
  {
4126
- x: -1.8,
4127
- y: -1.374322
4154
+ x: -2.10545,
4155
+ y: 0.339105
4128
4156
  },
4129
4157
  {
4130
- x: -1.8,
4131
- y: -1.036995
4158
+ x: -1.377121,
4159
+ y: 1.067434
4132
4160
  },
4133
4161
  {
4134
- x: -1.80003,
4135
- y: -1.036965
4136
- },
4137
- {
4138
- x: -1.80003,
4139
- y: -0.6
4140
- },
4141
- {
4142
- x: -1.80003,
4143
- y: 0.488423
4144
- },
4145
- {
4146
- x: -1.419706,
4147
- y: 0.868747
4162
+ x: -1.168748,
4163
+ y: 1.067434
4148
4164
  }
4149
4165
  ]
4150
4166
  }
@@ -5045,12 +5061,12 @@ function generateViaTopologyGrid(opts) {
5045
5061
 
5046
5062
  // lib/ViaGraphSolver/defaultTopology.ts
5047
5063
  function generateDefaultViaTopologyRegions(opts) {
5048
- return generateViaTopologyRegions(via_tile_default, opts);
5064
+ return generateViaTopologyRegions(via_tile_4_regions_default, opts);
5049
5065
  }
5050
5066
  function generateDefaultViaTopologyGrid(opts) {
5051
5067
  return generateViaTopologyGrid({
5052
5068
  ...opts,
5053
- viaTile: via_tile_default
5069
+ viaTile: via_tile_4_regions_default
5054
5070
  });
5055
5071
  }
5056
5072
 
@@ -14798,7 +14814,8 @@ function createPortsAlongEdge(edge, portPitch = 0.4) {
14798
14814
 
14799
14815
  // lib/ViaGraphSolver/via-graph-generator/generateConvexViaTopologyRegions.ts
14800
14816
  var DEFAULT_PORT_PITCH2 = 0.4;
14801
- var DEFAULT_TILE_SIZE2 = 5;
14817
+ var DEFAULT_TILE_WIDTH = 4.417;
14818
+ var DEFAULT_TILE_HEIGHT = 4.494;
14802
14819
  var DEFAULT_CLEARANCE = 0.1;
14803
14820
  function deduplicateConsecutivePoints(points, tolerance = 1e-3) {
14804
14821
  if (points.length <= 1) return points;
@@ -14955,7 +14972,8 @@ function translateRouteSegments2(routeSegments, dx, dy, prefix) {
14955
14972
  }));
14956
14973
  }
14957
14974
  function generateConvexViaTopologyRegions(opts) {
14958
- const tileSize = opts.tileSize ?? DEFAULT_TILE_SIZE2;
14975
+ const tileWidth = opts.tileWidth ?? opts.tileSize ?? DEFAULT_TILE_WIDTH;
14976
+ const tileHeight = opts.tileHeight ?? opts.tileSize ?? DEFAULT_TILE_HEIGHT;
14959
14977
  const portPitch = opts.portPitch ?? DEFAULT_PORT_PITCH2;
14960
14978
  const clearance = opts.clearance ?? DEFAULT_CLEARANCE;
14961
14979
  const concavityTolerance = opts.concavityTolerance ?? 0;
@@ -14963,22 +14981,23 @@ function generateConvexViaTopologyRegions(opts) {
14963
14981
  const { viasByNet, routeSegments } = inputViaTile;
14964
14982
  const width = bounds.maxX - bounds.minX;
14965
14983
  const height = bounds.maxY - bounds.minY;
14966
- const cols = Math.floor(width / tileSize);
14967
- const rows = Math.floor(height / tileSize);
14984
+ const cols = Math.floor(width / tileWidth);
14985
+ const rows = Math.floor(height / tileHeight);
14968
14986
  const allRegions = [];
14969
14987
  const allPorts = [];
14970
14988
  const viaTile = { viasByNet: {}, routeSegments: [] };
14971
14989
  const viaRegions = [];
14972
- const gridWidth = cols * tileSize;
14973
- const gridHeight = rows * tileSize;
14990
+ const gridWidth = cols * tileWidth;
14991
+ const gridHeight = rows * tileHeight;
14974
14992
  const gridMinX = bounds.minX + (width - gridWidth) / 2;
14975
14993
  const gridMinY = bounds.minY + (height - gridHeight) / 2;
14976
- const half = tileSize / 2;
14994
+ const halfWidth = tileWidth / 2;
14995
+ const halfHeight = tileHeight / 2;
14977
14996
  if (rows > 0 && cols > 0) {
14978
14997
  for (let row = 0; row < rows; row++) {
14979
14998
  for (let col = 0; col < cols; col++) {
14980
- const tileCenterX = gridMinX + col * tileSize + half;
14981
- const tileCenterY = gridMinY + row * tileSize + half;
14999
+ const tileCenterX = gridMinX + col * tileWidth + halfWidth;
15000
+ const tileCenterY = gridMinY + row * tileHeight + halfHeight;
14982
15001
  const prefix = `t${row}_${col}`;
14983
15002
  for (const [netName, vias] of Object.entries(viasByNet)) {
14984
15003
  if (vias.length === 0) continue;
@@ -15146,7 +15165,7 @@ function calculateBoundsFromConnections(xyConnections) {
15146
15165
  }
15147
15166
  return { minX, maxX, minY, maxY };
15148
15167
  }
15149
- function createConvexViaGraphFromXYConnections(xyConnections, viaTile = via_tile_default, opts) {
15168
+ function createConvexViaGraphFromXYConnections(xyConnections, viaTile = via_tile_4_regions_default, opts) {
15150
15169
  const bounds = calculateBoundsFromConnections(xyConnections);
15151
15170
  const {
15152
15171
  regions,
@@ -15156,6 +15175,8 @@ function createConvexViaGraphFromXYConnections(xyConnections, viaTile = via_tile
15156
15175
  } = generateConvexViaTopologyRegions({
15157
15176
  viaTile,
15158
15177
  bounds,
15178
+ tileWidth: opts?.tileWidth,
15179
+ tileHeight: opts?.tileHeight,
15159
15180
  tileSize: opts?.tileSize,
15160
15181
  portPitch: opts?.portPitch,
15161
15182
  clearance: opts?.clearance,
@@ -15241,7 +15262,7 @@ export {
15241
15262
  generateViaTopologyGrid,
15242
15263
  generateViaTopologyRegions,
15243
15264
  rotateGraph90Degrees,
15244
- via_tile_default as viaTile
15265
+ via_tile_4_regions_default as viaTile
15245
15266
  };
15246
15267
  /*! Bundled license information:
15247
15268
 
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@tscircuit/hypergraph",
3
3
  "main": "dist/index.js",
4
- "version": "0.0.38",
4
+ "version": "0.0.40",
5
5
  "type": "module",
6
6
  "scripts": {
7
7
  "start": "cosmos",