API
Geometry Construction
Classes and functions for construction and manipulation of geometric objects.
Component definition
Component
Bases: ComponentBase, DKCell
Canvas where you add polygons, instances and ports.
- stores settings that you use to build the component
- stores info that you want to use
- can return ports by type (optical, electrical ...)
- can return netlist for circuit simulation
- can write to GDS, OASIS
- can show in KLayout, matplotlib or 3D
Properties
info: dictionary that includes derived properties, simulation_settings, settings (test_protocol, docs, ...)
Source code in gdsfactory/component.py
650 651 652 653 654 655 656 657 658 659 660 661 662 663 664 665 666 667 668 669 670 671 672 673 674 675 676 677 678 679 680 681 682 683 684 685 686 687 688 689 690 691 692 693 694 695 696 697 698 699 700 701 702 703 704 705 706 707 708 709 710 711 712 713 714 715 716 717 718 719 720 721 722 723 724 725 726 727 728 729 730 731 732 733 734 735 736 737 738 739 740 741 742 743 744 745 746 747 748 749 750 751 752 753 754 755 756 757 758 759 760 761 762 763 764 765 766 767 768 769 770 771 772 773 774 775 776 777 778 779 780 781 782 783 784 785 786 787 788 789 790 791 792 793 794 795 796 797 798 799 800 801 802 803 804 805 806 807 808 809 810 811 812 813 814 815 816 817 818 819 820 821 822 823 824 825 826 827 828 829 830 831 832 833 834 835 836 837 838 839 840 841 842 843 844 845 846 847 848 849 850 851 852 853 854 855 856 857 858 859 860 861 862 863 864 865 866 867 868 869 870 871 872 873 874 875 876 877 878 879 880 881 882 883 884 885 886 887 888 889 890 891 892 893 894 895 896 897 898 899 900 901 902 903 904 905 906 907 908 909 910 911 912 913 914 915 916 917 918 919 920 921 922 923 924 925 926 927 928 929 930 931 932 933 934 935 936 937 938 939 940 941 942 943 944 945 946 947 948 949 950 951 952 953 954 955 956 957 958 959 960 961 962 963 964 965 966 967 968 969 970 971 972 973 974 975 976 977 978 979 980 981 982 983 984 985 986 987 988 989 990 991 992 993 994 995 996 997 998 999 1000 1001 1002 1003 1004 1005 1006 1007 1008 1009 1010 1011 1012 1013 1014 1015 1016 1017 1018 1019 1020 1021 1022 1023 1024 1025 1026 1027 1028 1029 1030 1031 1032 1033 1034 1035 1036 1037 1038 1039 1040 1041 1042 1043 1044 1045 1046 1047 1048 1049 1050 1051 1052 1053 1054 1055 1056 1057 1058 1059 1060 1061 1062 1063 1064 1065 1066 1067 1068 1069 1070 1071 1072 1073 1074 1075 1076 1077 1078 1079 1080 1081 1082 1083 1084 1085 1086 1087 1088 1089 1090 1091 1092 1093 1094 1095 1096 1097 1098 1099 1100 1101 1102 1103 1104 1105 1106 1107 1108 1109 1110 1111 1112 1113 1114 1115 1116 1117 1118 1119 1120 1121 1122 1123 1124 1125 1126 1127 1128 1129 1130 1131 1132 1133 1134 1135 1136 1137 1138 1139 1140 1141 1142 1143 1144 1145 1146 1147 1148 1149 1150 1151 1152 1153 1154 1155 1156 1157 1158 1159 1160 1161 1162 1163 1164 1165 1166 1167 1168 1169 1170 1171 1172 1173 1174 1175 1176 1177 1178 1179 1180 1181 1182 1183 1184 1185 1186 1187 1188 1189 1190 1191 1192 1193 1194 1195 1196 1197 1198 1199 1200 1201 1202 1203 1204 1205 1206 1207 1208 1209 1210 1211 1212 1213 1214 1215 1216 1217 1218 1219 1220 1221 1222 1223 1224 1225 1226 1227 1228 1229 1230 1231 1232 1233 1234 1235 1236 1237 1238 1239 1240 1241 1242 1243 1244 1245 1246 1247 1248 1249 1250 1251 1252 1253 1254 1255 1256 1257 1258 1259 1260 1261 1262 1263 1264 1265 1266 1267 1268 1269 1270 1271 1272 1273 1274 1275 1276 1277 1278 1279 1280 1281 1282 1283 1284 1285 1286 1287 1288 1289 1290 1291 1292 1293 1294 1295 1296 1297 1298 1299 1300 1301 1302 1303 1304 1305 1306 1307 1308 1309 1310 1311 1312 1313 1314 1315 1316 1317 1318 1319 1320 1321 1322 1323 1324 1325 1326 1327 1328 1329 1330 1331 1332 1333 1334 1335 1336 1337 1338 1339 1340 1341 1342 1343 1344 1345 1346 1347 1348 1349 1350 1351 1352 1353 1354 1355 1356 1357 1358 1359 1360 1361 1362 1363 1364 1365 1366 1367 1368 1369 1370 1371 1372 1373 1374 1375 1376 1377 1378 1379 1380 1381 1382 1383 1384 1385 1386 1387 1388 1389 1390 1391 1392 1393 1394 1395 1396 1397 1398 1399 1400 1401 1402 1403 1404 1405 1406 1407 1408 1409 1410 1411 1412 1413 1414 1415 1416 1417 1418 1419 1420 1421 1422 1423 1424 1425 1426 1427 1428 1429 1430 1431 1432 1433 1434 1435 1436 1437 1438 1439 1440 1441 1442 1443 1444 1445 1446 1447 1448 1449 1450 1451 1452 1453 1454 1455 1456 1457 1458 1459 1460 1461 1462 1463 1464 1465 1466 1467 1468 1469 1470 1471 1472 1473 1474 1475 1476 1477 1478 1479 1480 1481 1482 1483 1484 1485 1486 1487 1488 1489 1490 1491 1492 1493 1494 1495 1496 1497 1498 1499 1500 1501 1502 1503 1504 1505 1506 1507 1508 1509 1510 1511 1512 1513 1514 1515 1516 1517 1518 1519 1520 1521 1522 1523 1524 1525 1526 1527 1528 1529 1530 1531 1532 1533 1534 1535 1536 1537 1538 1539 1540 1541 1542 1543 1544 1545 1546 1547 1548 1549 1550 1551 1552 1553 1554 1555 1556 1557 1558 1559 1560 1561 1562 1563 1564 1565 1566 1567 1568 1569 1570 1571 1572 1573 1574 1575 1576 1577 1578 1579 1580 1581 1582 1583 1584 1585 1586 1587 1588 1589 1590 1591 1592 1593 1594 1595 1596 1597 1598 1599 1600 1601 1602 | |
__lshift__
__lshift__(cell: ProtoTKCell[Any]) -> ComponentReference
Convenience function for adding instances/references to a Component.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
cell
|
ProtoTKCell[Any]
|
The cell to be added as an instance |
required |
Source code in gdsfactory/component.py
796 797 798 799 800 801 802 | |
absorb
absorb(reference: ComponentReference) -> Self
Absorbs polygons from ComponentReference into Component.
Destroys the reference in the process but keeping the polygon geometry.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
reference
|
ComponentReference
|
Instance to be absorbed into the Component. |
required |
Source code in gdsfactory/component.py
747 748 749 750 751 752 753 754 755 756 757 758 759 760 761 762 763 | |
add_polygon
add_polygon(
points: _PolygonPoints, layer: LayerSpec
) -> kdb.Shape | None
Adds a Polygon to the Component and returns a klayout Shape.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
points
|
_PolygonPoints
|
Coordinates of the vertices of the Polygon. |
required |
layer
|
LayerSpec
|
layer spec to add polygon on. |
required |
Source code in gdsfactory/component.py
1299 1300 1301 1302 1303 1304 1305 1306 1307 1308 1309 1310 1311 1312 1313 1314 1315 1316 1317 | |
add_ref
add_ref(
component: ProtoTKCell[Any],
name: str | None = None,
columns: int = 1,
rows: int = 1,
column_pitch: float = 0.0,
row_pitch: float = 0.0,
) -> ComponentReference
Adds a component instance reference to a Component.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
component
|
ProtoTKCell[Any]
|
The referenced component. |
required |
name
|
str | None
|
Name of the reference. |
None
|
columns
|
int
|
Number of columns in the array. |
1
|
rows
|
int
|
Number of rows in the array. |
1
|
column_pitch
|
float
|
column pitch. |
0.0
|
row_pitch
|
float
|
row pitch. |
0.0
|
Source code in gdsfactory/component.py
804 805 806 807 808 809 810 811 812 813 814 815 816 817 818 819 820 821 822 823 824 825 826 827 828 829 830 831 832 833 834 835 836 837 838 839 840 841 842 843 844 845 846 847 848 | |
area
area(layer: LayerSpec) -> float
Returns the area of the Component in um2.
Source code in gdsfactory/component.py
929 930 931 932 933 934 935 936 | |
copy_layers
copy_layers(
layer_map: dict[LayerSpec, LayerSpec],
recursive: bool = False,
) -> Self
Remaps a list of layers and returns the same Component.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
layer_map
|
dict[LayerSpec, LayerSpec]
|
dictionary of layers to copy. |
required |
recursive
|
bool
|
if True, remaps layers recursively. |
False
|
Source code in gdsfactory/component.py
1021 1022 1023 1024 1025 1026 1027 1028 1029 1030 1031 1032 1033 1034 1035 1036 1037 1038 1039 1040 1041 1042 1043 1044 1045 1046 1047 1048 1049 1050 1051 1052 1053 1054 1055 1056 1057 1058 1059 1060 | |
dup
dup(new_name: str | None = None) -> Self
Copy the full cell.
Overrides kfactory's dup() to fix pin port mapping during copy. kfactory builds port_mapping from ephemeral Port wrappers, but pin ports are BasePort objects — the id() values never match.
Source code in gdsfactory/component.py
666 667 668 669 670 671 672 673 674 675 676 677 678 679 680 681 682 683 684 685 686 687 688 689 690 691 | |
extract
extract(
layers: LayerSpecs, recursive: bool = True
) -> Component
Extracts a list of layers and adds them to a new Component.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
layers
|
LayerSpecs
|
list of layers to extract. |
required |
recursive
|
bool
|
if True, extracts layers recursively and returns a flattened Component. |
True
|
Source code in gdsfactory/component.py
1006 1007 1008 1009 1010 1011 1012 1013 1014 1015 1016 1017 1018 1019 | |
fill
fill(
fill_cell: ComponentSpec,
fill_layers: Iterable[tuple[LayerSpec, float]] = [],
fill_regions: Iterable[tuple[Region, float]] = [],
exclude_layers: Iterable[tuple[LayerSpec, float]] = [],
exclude_regions: Iterable[tuple[Region, float]] = [],
n_threads: int | None = None,
tile_size: tuple[float, float] | None = None,
row_step: DVector | None = None,
col_step: DVector | None = None,
x_space: float = 0.0,
y_space: float = 0.0,
tile_border: tuple[float, float] = (20, 20),
multi: bool = False,
) -> None
Fill a [KCell][kfactory.kcell.KCell].
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
fill_cell
|
ComponentSpec
|
The cell used as a cell to fill the regions. |
required |
fill_layers
|
Iterable[tuple[LayerSpec, float]]
|
Tuples of layer and keepout in um. |
[]
|
fill_regions
|
Iterable[tuple[Region, float]]
|
Specific regions to fill. Also tuples like the layers. |
[]
|
exclude_layers
|
Iterable[tuple[LayerSpec, float]]
|
Layers to ignore. Tuples like the fill layers |
[]
|
exclude_regions
|
Iterable[tuple[Region, float]]
|
Specific regions to ignore. Tuples like the fill layers. |
[]
|
n_threads
|
int | None
|
Max number of threads used. Defaults to number of cores of the machine. |
None
|
tile_size
|
tuple[float, float] | None
|
Size of the tiles in um. |
None
|
row_step
|
DVector | None
|
DVector for steping to the next instance position in the row. x-coordinate must be >= 0. |
None
|
col_step
|
DVector | None
|
DVector for steping to the next instance position in the column. y-coordinate must be >= 0. |
None
|
x_space
|
float
|
Spacing between the fill cell bounding boxes in x-direction. |
0.0
|
y_space
|
float
|
Spacing between the fill cell bounding boxes in y-direction. |
0.0
|
tile_border
|
tuple[float, float]
|
The tile border to consider for excludes |
(20, 20)
|
multi
|
bool
|
Use the region_fill_multi strategy instead of single fill. |
False
|
Source code in gdsfactory/component.py
1535 1536 1537 1538 1539 1540 1541 1542 1543 1544 1545 1546 1547 1548 1549 1550 1551 1552 1553 1554 1555 1556 1557 1558 1559 1560 1561 1562 1563 1564 1565 1566 1567 1568 1569 1570 1571 1572 1573 1574 1575 1576 1577 1578 1579 1580 1581 1582 1583 1584 1585 1586 1587 1588 1589 1590 1591 1592 1593 1594 1595 1596 1597 1598 1599 1600 1601 1602 | |
fix_spacing
fix_spacing(
layer: LayerSpec,
min_space: float = 0.2,
size_bias: float = 0.0,
) -> None
Fixes layer spacing in the Component.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
layer
|
LayerSpec
|
layer to fix spacing on. |
required |
min_space
|
float
|
minimum space in um. |
0.2
|
size_bias
|
float
|
optional geometry bias applied after spacing fix (um). |
0.0
|
Source code in gdsfactory/component.py
1197 1198 1199 1200 1201 1202 1203 1204 1205 1206 1207 1208 1209 1210 1211 1212 1213 1214 1215 1216 1217 1218 1219 1220 1221 1222 1223 | |
fix_width
fix_width(
layer: LayerSpec,
min_width: float = 0.2,
n_threads: int | None = None,
tile_size: tuple[float, float] | None = None,
overlap: int = 1,
smooth: int | None = None,
flatten: bool = True,
) -> None
Fixes layer min width in the Component.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
layer
|
LayerSpec
|
layer to fix width on. |
required |
min_width
|
float
|
minimum width in um. |
0.2
|
n_threads
|
int | None
|
number of threads to use for processing. |
None
|
tile_size
|
tuple[float, float] | None
|
size of the tiles to use for processing. |
None
|
overlap
|
int
|
overlap between tiles. |
1
|
smooth
|
int | None
|
smooth the polygons by this amount in um. |
None
|
flatten
|
bool
|
if True, flattens the Component before fixing width. |
True
|
Source code in gdsfactory/component.py
1225 1226 1227 1228 1229 1230 1231 1232 1233 1234 1235 1236 1237 1238 1239 1240 1241 1242 1243 1244 1245 1246 1247 1248 1249 1250 1251 1252 1253 1254 1255 1256 1257 1258 1259 1260 1261 1262 1263 1264 | |
get_boxes
get_boxes(
layer: LayerSpec, recursive: bool = True
) -> list[kf.kdb.DBox]
Returns a list of boxes.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
layer
|
LayerSpec
|
layer to get boxes from. |
required |
recursive
|
bool
|
if True, gets boxes recursively. |
True
|
Source code in gdsfactory/component.py
876 877 878 879 880 881 882 883 884 885 886 887 888 889 890 891 892 893 894 895 896 897 898 899 900 | |
get_labels
get_labels(
layer: LayerSpec, recursive: bool = True
) -> list[kf.kdb.DText]
Returns a list of labels from the Component.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
layer
|
LayerSpec
|
layer to get labels from. |
required |
recursive
|
bool
|
if True, gets labels recursively. |
True
|
Source code in gdsfactory/component.py
902 903 904 905 906 907 908 909 910 911 912 913 914 915 916 917 918 919 920 921 922 923 924 925 926 927 | |
get_paths
get_paths(
layer: LayerSpec, recursive: bool = True
) -> list[kf.kdb.DPath]
Returns a list of paths.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
layer
|
LayerSpec
|
layer to get paths from. |
required |
recursive
|
bool
|
if True, gets paths recursively. |
True
|
Source code in gdsfactory/component.py
850 851 852 853 854 855 856 857 858 859 860 861 862 863 864 865 866 867 868 869 870 871 872 873 874 | |
get_polygons
get_polygons(
merge: bool = False,
by: Literal["index", "name", "tuple"] = "index",
layers: LayerSpecs | None = None,
smooth: float | None = None,
) -> dict[
tuple[int, int] | str | int, list[kf.kdb.Polygon]
]
Returns a dict of Polygons per layer.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
merge
|
bool
|
if True, merges the polygons. |
False
|
by
|
Literal['index', 'name', 'tuple']
|
the format of the resulting keys in the dictionary ('index', 'name', 'tuple') |
'index'
|
layers
|
LayerSpecs | None
|
list of layers to get polygons from. Defaults to all layers. |
None
|
smooth
|
float | None
|
if True, smooths the polygons. |
None
|
Source code in gdsfactory/component.py
938 939 940 941 942 943 944 945 946 947 948 949 950 951 952 953 954 955 956 957 958 | |
get_polygons_points
get_polygons_points(
merge: bool = False,
scale: float | None = None,
by: Literal["index", "name", "tuple"] = "index",
layers: LayerSpecs | None = None,
) -> dict[
int | str | tuple[int, int],
list[npt.NDArray[np.floating[Any]]],
]
Returns a dict with list of points per layer.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
merge
|
bool
|
if True, merges the polygons. |
False
|
scale
|
float | None
|
if True, scales the points. |
None
|
by
|
Literal['index', 'name', 'tuple']
|
the format of the resulting keys in the dictionary ('index', 'name', 'tuple') |
'index'
|
layers
|
LayerSpecs | None
|
list of layers to get polygons from. Defaults to all layers. |
None
|
Source code in gdsfactory/component.py
984 985 986 987 988 989 990 991 992 993 994 995 996 997 998 999 1000 1001 1002 1003 1004 | |
get_region
get_region(
layer: LayerSpec,
merge: bool = False,
smooth: float | None = None,
) -> kdb.Region
Returns a Region of the Component.
Note that all operations that you do with the Region will be done in the database units.
Where for most processes 1 dbu = 1 nm.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
layer
|
LayerSpec
|
layer to get region from. |
required |
merge
|
bool
|
if True, merges the region. |
False
|
smooth
|
float | None
|
if True, smooths the region by the specified amount (in um). |
None
|
Source code in gdsfactory/component.py
960 961 962 963 964 965 966 967 968 969 970 971 972 973 974 975 976 977 978 979 980 981 982 | |
offset
offset(
layer: LayerSpec,
distance: float,
flatten: bool = False,
corner_mode: int | CornerMode = 2,
) -> None
Offsets a Component layer by a distance in um.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
layer
|
LayerSpec
|
layer to offset the Component on. |
required |
distance
|
float
|
distance to offset the Component in um. |
required |
flatten
|
bool
|
if True, flattens the Component before offsetting. |
False
|
corner_mode
|
int | CornerMode
|
determines behavior around corners |
2
|
Source code in gdsfactory/component.py
1266 1267 1268 1269 1270 1271 1272 1273 1274 1275 1276 1277 1278 1279 1280 1281 1282 1283 1284 1285 1286 1287 1288 1289 1290 1291 1292 1293 1294 1295 1296 1297 | |
over_under
over_under(
layer: LayerSpec,
distance: float = 0.001,
remove_old_layer: bool = True,
corner_mode: int | CornerMode = 2,
) -> None
Returns a Component over-under on a layer in the Component.
For big components use tiled version.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
layer
|
LayerSpec
|
layer to perform over-under on. |
required |
distance
|
float
|
distance to perform over-under in um. |
0.001
|
remove_old_layer
|
bool
|
if True, removes the old layer. |
True
|
corner_mode
|
int | CornerMode
|
determines behavior around corners |
2
|
Source code in gdsfactory/component.py
1162 1163 1164 1165 1166 1167 1168 1169 1170 1171 1172 1173 1174 1175 1176 1177 1178 1179 1180 1181 1182 1183 1184 1185 1186 1187 1188 1189 1190 1191 1192 1193 1194 1195 | |
plot
plot(
lyrdb: Path | str | None = None,
display_type: Literal["image", "widget"] | None = None,
*,
show_labels: bool = True,
show_ruler: bool = True,
pixel_buffer_options: PixelBufferOptions | None = None,
return_fig: Literal[True] = True,
ax: Axes | None = None
) -> Figure
plot(
lyrdb: Path | str | None = None,
display_type: Literal["image", "widget"] | None = None,
*,
show_labels: bool = True,
show_ruler: bool = True,
pixel_buffer_options: PixelBufferOptions | None = None,
return_fig: Literal[False] = False,
ax: Axes | None = None
) -> None
plot(
lyrdb: Path | str | None = None,
display_type: Literal["image", "widget"] | None = None,
*,
show_labels: bool = True,
show_ruler: bool = True,
pixel_buffer_options: PixelBufferOptions | None = None,
return_fig: bool = False,
ax: Axes | None = None
) -> Figure | None
Plots the Component using klayout.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
lyrdb
|
Path | str | None
|
path to layer properties file. |
None
|
display_type
|
Literal['image', 'widget'] | None
|
if "image", displays the image. |
None
|
show_labels
|
bool
|
if True, shows labels. |
True
|
show_ruler
|
bool
|
if True, shows ruler. |
True
|
pixel_buffer_options
|
PixelBufferOptions | None
|
options for KLayout's get_pixels_with_options. If None, uses default values (width=800, height=600, linewidth=0, oversampling=0, resolution=0). |
None
|
return_fig
|
bool
|
if True, returns the figure. |
False
|
ax
|
Axes | None
|
Optional matplotlib Axes to plot on. If None, creates a new figure and axes. When specified, fig_size and dpi are determined by the provided axes' figure. |
None
|
Source code in gdsfactory/component.py
1345 1346 1347 1348 1349 1350 1351 1352 1353 1354 1355 1356 1357 1358 1359 1360 1361 1362 1363 1364 1365 1366 1367 1368 1369 1370 1371 1372 1373 1374 1375 1376 1377 1378 1379 1380 1381 1382 1383 1384 1385 1386 1387 1388 1389 1390 1391 1392 1393 1394 1395 1396 1397 1398 1399 1400 1401 1402 1403 1404 1405 1406 1407 1408 1409 1410 1411 1412 1413 1414 1415 1416 1417 1418 1419 1420 1421 1422 1423 1424 1425 1426 1427 1428 1429 1430 1431 1432 | |
plot_netlist
plot_netlist(
recursive: bool = False,
with_labels: bool = True,
font_weight: str = "normal",
**kwargs: Any
) -> nx.Graph
Plots a netlist graph with networkx.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
recursive
|
bool
|
if True, returns a recursive netlist. |
False
|
with_labels
|
bool
|
add label to each node. |
True
|
font_weight
|
str
|
normal, bold. |
'normal'
|
kwargs
|
Any
|
keyword arguments to get_netlist. |
{}
|
Other Parameters:
| Name | Type | Description |
|---|---|---|
tolerance |
tolerance in grid_factor to consider two ports connected. |
|
exclude_port_types |
optional list of port types to exclude from netlisting. |
|
get_instance_name |
function to get instance name. |
|
allow_multiple |
False to raise an error if more than two ports share the same connection. if True, will return key: [value] pairs with [value] a list of all connected instances. |
Source code in gdsfactory/component.py
1434 1435 1436 1437 1438 1439 1440 1441 1442 1443 1444 1445 1446 1447 1448 1449 1450 1451 1452 1453 1454 1455 1456 1457 1458 1459 1460 1461 1462 1463 1464 1465 1466 1467 1468 1469 1470 1471 1472 1473 1474 1475 1476 1477 1478 1479 1480 1481 1482 1483 1484 1485 1486 1487 1488 1489 1490 1491 1492 1493 1494 1495 1496 1497 1498 1499 1500 1501 | |
plot_netlist_graphviz
plot_netlist_graphviz(
recursive: bool = False,
interactive: bool = False,
splines: str = "ortho",
) -> None
Plots a netlist graph with graphviz.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
recursive
|
bool
|
if True, returns a recursive netlist. |
False
|
interactive
|
bool
|
if True, opens the graph in a browser. |
False
|
splines
|
str
|
ortho, spline, polyline, line, curved. |
'ortho'
|
Source code in gdsfactory/component.py
1503 1504 1505 1506 1507 1508 1509 1510 1511 1512 1513 1514 1515 1516 1517 1518 | |
remap_layers
remap_layers(
layer_map: dict[LayerSpec, LayerSpec],
recursive: bool = False,
) -> Self
Remaps a list of layers and returns the same Component.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
layer_map
|
dict[LayerSpec, LayerSpec]
|
dictionary of layers to remap. |
required |
recursive
|
bool
|
if True, remaps layers recursively. |
False
|
Source code in gdsfactory/component.py
1107 1108 1109 1110 1111 1112 1113 1114 1115 1116 1117 1118 1119 1120 1121 1122 1123 1124 1125 1126 1127 1128 1129 1130 1131 1132 1133 1134 | |
remove_layers
remove_layers(
layers: LayerSpecs, recursive: bool = True
) -> Self
Removes a list of layers and returns the same Component.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
layers
|
LayerSpecs
|
list of layers to remove. |
required |
recursive
|
bool
|
if True, removes layers recursively and temporarily unlocks components. |
True
|
Source code in gdsfactory/component.py
1062 1063 1064 1065 1066 1067 1068 1069 1070 1071 1072 1073 1074 1075 1076 1077 1078 1079 1080 1081 1082 1083 1084 1085 1086 1087 1088 1089 1090 1091 1092 1093 1094 1095 1096 1097 1098 1099 1100 1101 1102 1103 1104 1105 | |
to_3d
to_3d(
layer_views: LayerViews | None = None,
layer_stack: LayerStack | None = None,
exclude_layers: Sequence[Layer] | None = None,
) -> Scene
Return Component 3D trimesh Scene.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
component
|
to extrude in 3D. |
required | |
layer_views
|
LayerViews | None
|
layer colors from Klayout Layer Properties file. Defaults to active PDK.layer_views. |
None
|
layer_stack
|
LayerStack | None
|
contains thickness and zmin for each layer. Defaults to active PDK.layer_stack. |
None
|
exclude_layers
|
Sequence[Layer] | None
|
layers to exclude. |
None
|
Source code in gdsfactory/component.py
1136 1137 1138 1139 1140 1141 1142 1143 1144 1145 1146 1147 1148 1149 1150 1151 1152 1153 1154 1155 1156 1157 1158 1159 1160 | |
to_graphviz
to_graphviz(recursive: bool = False) -> Digraph
Returns a netlist graph with graphviz.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
recursive
|
bool
|
if True, returns a recursive netlist. |
False
|
Source code in gdsfactory/component.py
1520 1521 1522 1523 1524 1525 1526 1527 1528 1529 1530 1531 1532 1533 | |
trim
trim(
left: float,
bottom: float,
right: float,
top: float,
flatten: bool = False,
) -> None
Trims the Component to a bounding box.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
left
|
float
|
left coordinate of the bounding box. |
required |
bottom
|
float
|
bottom coordinate of the bounding box. |
required |
right
|
float
|
right coordinate of the bounding box. |
required |
top
|
float
|
top coordinate of the bounding box. |
required |
flatten
|
bool
|
if True, flattens the Component. |
False
|
Source code in gdsfactory/component.py
765 766 767 768 769 770 771 772 773 774 775 776 777 778 779 780 781 782 783 784 785 786 787 788 789 790 791 792 793 794 | |
write
write(
filename: str | Path,
save_options: SaveLayoutOptions | None = None,
convert_external_cells: bool = False,
set_meta_data: bool = True,
autoformat_from_file_extension: bool = True,
deduplicate_cell_names: bool = True,
) -> None
Write component to GDS, fixing pin metadata for kfactory compat.
Source code in gdsfactory/component.py
693 694 695 696 697 698 699 700 701 702 703 704 705 706 707 708 709 710 711 712 713 714 715 716 717 718 719 720 721 722 723 724 725 | |
ComponentAllAngle
Bases: ComponentBase, VKCell
Source code in gdsfactory/component.py
1605 1606 1607 1608 1609 1610 1611 1612 1613 1614 1615 1616 1617 1618 1619 1620 1621 1622 1623 1624 1625 1626 1627 1628 1629 1630 1631 1632 1633 1634 1635 1636 1637 1638 1639 1640 1641 1642 1643 1644 1645 1646 1647 1648 1649 1650 1651 1652 1653 1654 1655 | |
add_polygon
add_polygon(
points: _PolygonPoints, layer: LayerSpec
) -> kdb.Shape | None
Adds a Polygon to the Component and returns a klayout Shape.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
points
|
_PolygonPoints
|
Coordinates of the vertices of the Polygon. |
required |
layer
|
LayerSpec
|
layer spec to add polygon on. |
required |
Source code in gdsfactory/component.py
1632 1633 1634 1635 1636 1637 1638 1639 1640 1641 1642 1643 1644 1645 1646 1647 1648 1649 | |
dup
dup(new_name: str | None = None) -> ComponentAllAngle
Copy the full cell.
Source code in gdsfactory/component.py
1615 1616 1617 1618 1619 1620 1621 1622 1623 1624 1625 1626 1627 1628 1629 1630 | |
get_polygons
get_polygons(layer: LayerSpec) -> list[kf.kdb.DPolygon]
Returns a list of polygons from the Component.
Source code in gdsfactory/component.py
1651 1652 1653 1654 1655 | |
plot
plot(**kwargs: Any) -> None
Plots the Component using klayout.
Source code in gdsfactory/component.py
1606 1607 1608 1609 1610 1611 1612 1613 | |
ComponentReference
module-attribute
ComponentReference: TypeAlias = DInstance
import_gds
import_gds
import_gds(
gdspath: str | Path,
cellname: str | None = None,
post_process: PostProcesses | None = None,
rename_duplicated_cells: bool = False,
skip_new_cells: bool = False,
) -> Component
Reads a GDS file and returns a Component.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
gdspath
|
str | Path
|
path to GDS file. |
required |
cellname
|
str | None
|
name of the cell to return. Defaults to top cell. |
None
|
post_process
|
PostProcesses | None
|
function to run after reading the GDS file. |
None
|
rename_duplicated_cells
|
bool
|
if True, rename duplicated cells. By default appends $n to the cell name. |
False
|
skip_new_cells
|
bool
|
if True, skip new cells that conflict with existing ones. |
False
|
Source code in gdsfactory/read/import_gds.py
16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 | |
import_gds_multiple_top_cells
import_gds_multiple_top_cells(
gdspath: str | Path,
cellnames: list[str] | None = None,
post_process: PostProcesses | None = None,
rename_duplicated_cells: bool = False,
skip_new_cells: bool = False,
) -> dict[str, Component]
Reads a GDS file and returns a dictionary of its top cells as Components.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
gdspath
|
str | Path
|
path to GDS file. |
required |
cellnames
|
list[str] | None
|
list of names of the cells to return. Defaults to all top cells. |
None
|
post_process
|
PostProcesses | None
|
list of post-processing functions to apply to each cell. |
None
|
rename_duplicated_cells
|
bool
|
if True, renames duplicated cells instead of raising an error. |
False
|
skip_new_cells
|
bool
|
if True, skips new cells instead of raising an error. |
False
|
Returns:
| Type | Description |
|---|---|
dict[str, Component]
|
dict of cellname to Component. |
Raises:
| Type | Description |
|---|---|
ValueError
|
if any of the provided cellnames are not found among the top cells. |
Source code in gdsfactory/read/import_gds.py
132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 | |
import_gds_with_conflicts
import_gds_with_conflicts(
gdspath: str | Path, cellname: str | None = None
) -> Component
Reads a GDS file and returns a Component.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
gdspath
|
str | Path
|
path to GDS file. |
required |
cellname
|
str | None
|
name of the cell to return. Defaults to top cell. |
None
|
Modes
AddToCell: Add content to existing cell. Content of new cells is simply added to existing cells with the same name. OverwriteCell: The old cell is overwritten entirely (including child cells which are not used otherwise) RenameCell: The new cell will be renamed to become unique SkipNewCell: The new cell is skipped entirely (including child cells which are not used otherwise)
Source code in gdsfactory/read/import_gds.py
113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 | |
from_yaml
Returns Component from YAML syntax.
name: myComponent settings: length: 3
info
description: just a demo polarization: TE ...
instances
mzi: component: mzi_phase_shifter settings: delta_length: ${settings.length} length_x: 50
pads: component: pad_array settings: n: 2 port_names: - e4
placements
mzi: x: 0 pads: y: 200 x: mzi,cc
ports: o1: mzi,o1 o2: mzi,o2
routes
electrical: links: mzi,etop_e1: pads,e4_0 mzi,etop_e2: pads,e4_1
settings:
layer: [31, 0]
width: 10
radius: 10
cell_from_yaml
cell_from_yaml(
yaml_str: str | Path | IO[Any] | dict[str, Any],
routing_strategies: RoutingStrategies | None = None,
label_instance_function: LabelInstanceFunction = add_instance_label,
name: str | None = None,
) -> Callable[[], Component]
Returns Component factory from YAML string or file.
YAML includes instances, placements, routes, ports and connections.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
yaml_str
|
str | Path | IO[Any] | dict[str, Any]
|
YAML string or file. |
required |
routing_strategies
|
RoutingStrategies | None
|
for each route. |
None
|
label_instance_function
|
LabelInstanceFunction
|
to label each instance. |
add_instance_label
|
name
|
str | None
|
Optional name. |
None
|
kwargs
|
function settings for creating YAML PCells. |
required | |
valid variables
|
|
required | |
name
|
str | None
|
Optional Component name |
None
|
settings
|
Optional variables |
required | |
pdk
|
overrides |
required | |
info
|
Optional component info description: just a demo polarization: TE ... |
required | |
instances
|
name: component: (ComponentSpec) settings (Optional) length: 10 ... |
required | |
placements
|
x: float, str | None str can be instanceName,portName y: float, str | None rotation: float | None mirror: bool, float | None float is x mirror axis port: str | None port anchor |
required | |
connections
|
Optional
|
between instances |
required |
ports
|
Optional
|
ports to expose |
required |
routes
|
Optional
|
bundles of routes routeName: library: optical links: instance1,port1: instance2,port2 |
required |
settings
|
length_mmi: 5 |
required | |
instances
|
mmi_bot: component: mmi1x2 settings: width_mmi: 4.5 length_mmi: 10 mmi_top: component: mmi1x2 settings: width_mmi: 4.5 length_mmi: ${settings.length_mmi} |
required | |
placements
|
mmi_top: port: o1 x: 0 y: 0 mmi_bot: port: o1 x: mmi_top,o2 y: mmi_top,o2 dx: 30 dy: -30 |
required | |
routes
|
optical: library: optical links: mmi_top,o3: mmi_bot,o1 |
required |
Source code in gdsfactory/read/from_yaml.py
618 619 620 621 622 623 624 625 626 627 628 629 630 631 632 633 634 635 636 637 638 639 640 641 642 643 644 645 646 647 648 649 650 651 652 653 654 655 656 657 658 659 660 661 662 663 664 665 666 667 668 669 670 671 672 673 674 675 676 677 678 679 680 681 682 683 684 685 686 687 688 689 690 691 692 693 694 695 696 697 698 699 700 701 702 703 704 705 | |
from_yaml
from_yaml(
yaml_str: str | Path | IO[Any] | dict[str, Any],
routing_strategies: RoutingStrategies | None = None,
label_instance_function: LabelInstanceFunction = add_instance_label,
name: str | None = None,
) -> Component
Returns Component from YAML string or file.
YAML includes instances, placements, routes, ports and connections.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
yaml_str
|
str | Path | IO[Any] | dict[str, Any]
|
YAML string or file. |
required |
routing_strategies
|
RoutingStrategies | None
|
for each route. |
None
|
label_instance_function
|
LabelInstanceFunction
|
to label each instance. |
add_instance_label
|
name
|
str | None
|
Optional name. |
None
|
valid variables
|
|
required | |
name
|
str | None
|
Optional Component name |
None
|
settings
|
Optional variables |
required | |
pdk
|
overrides |
required | |
info
|
Optional component info description: just a demo polarization: TE ... |
required | |
instances
|
name: component: (ComponentSpec) settings (Optional) length: 10 ... |
required | |
placements
|
x: float, str | None str can be instanceName,portName y: float, str | None rotation: float | None mirror: bool, float | None float is x mirror axis port: str | None port anchor |
required | |
connections
|
Optional
|
between instances |
required |
ports
|
Optional
|
ports to expose |
required |
routes
|
Optional
|
bundles of routes routeName: library: optical links: instance1,port1: instance2,port2 |
required |
settings
|
length_mmi: 5 |
required | |
instances
|
mmi_bot: component: mmi1x2 settings: width_mmi: 4.5 length_mmi: 10 mmi_top: component: mmi1x2 settings: width_mmi: 4.5 length_mmi: ${settings.length_mmi} |
required | |
placements
|
mmi_top: port: o1 x: 0 y: 0 mmi_bot: port: o1 x: mmi_top,o2 y: mmi_top,o2 dx: 30 dy: -30 |
required | |
routes
|
optical: library: optical links: mmi_top,o3: mmi_bot,o1 |
required |
Source code in gdsfactory/read/from_yaml.py
708 709 710 711 712 713 714 715 716 717 718 719 720 721 722 723 724 725 726 727 728 729 730 731 732 733 734 735 736 737 738 739 740 741 742 743 744 745 746 747 748 749 750 751 752 753 754 755 756 757 758 759 760 761 762 763 764 765 766 767 768 769 770 771 772 773 774 775 776 777 778 779 780 781 782 783 784 785 786 787 788 789 790 791 792 793 794 795 796 797 798 799 800 801 | |
make_connection
make_connection(
instance_src_name: str,
port_src_name: str,
instance_dst_name: str,
port_dst_name: str,
instances: dict[str, InstanceOrVInstance],
src_ia: int | None = None,
src_ib: int | None = None,
dst_ia: int | None = None,
dst_ib: int | None = None,
) -> None
Connect instance_src_name,port to instance_dst_name,port.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
instance_src_name
|
str
|
source instance name. |
required |
port_src_name
|
str
|
from instance_src_name. |
required |
instance_dst_name
|
str
|
destination instance name. |
required |
port_dst_name
|
str
|
from instance_dst_name. |
required |
instances
|
dict[str, InstanceOrVInstance]
|
dict of instances. |
required |
src_ia
|
int | None
|
the a-index of the source instance, if it is an arrayed instance |
None
|
src_ib
|
int | None
|
the b-index of the source instance, if it is an arrayed instance |
None
|
dst_ia
|
int | None
|
the a-index of the destination instance, if it is an arrayed instance |
None
|
dst_ib
|
int | None
|
the b-index of the destination instance, if it is an arrayed instance |
None
|
Source code in gdsfactory/read/from_yaml.py
516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 | |
place
place(
placements_conf: dict[
str, dict[str, int | float | str]
],
connections_by_transformed_inst: dict[
str, dict[str, str]
],
instances: dict[str, InstanceOrVInstance],
encountered_insts: list[str],
instance_name: str | None = None,
all_remaining_insts: list[str] | None = None,
) -> None
Place instance_name based on placements_conf config.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
placements_conf
|
dict[str, dict[str, int | float | str]]
|
Dict of instance_name to placement (x, y, rotation ...). |
required |
connections_by_transformed_inst
|
dict[str, dict[str, str]]
|
Dict of connection attributes. keyed by the name of the instance which should be transformed. |
required |
instances
|
dict[str, InstanceOrVInstance]
|
Dict of references. |
required |
encountered_insts
|
list[str]
|
list of encountered_instances. |
required |
instance_name
|
str | None
|
instance_name to place. |
None
|
all_remaining_insts
|
list[str] | None
|
list of all the remaining instances to place instances pop from this instance as they are placed. |
None
|
Source code in gdsfactory/read/from_yaml.py
277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 | |
transform_connections_dict
transform_connections_dict(
connections_conf: dict[str, str],
) -> dict[str, dict[str, str | int | None]]
Returns Dict with source_instance_name key and connection properties.
Source code in gdsfactory/read/from_yaml.py
484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 | |
from_np
Read component from a numpy.ndarray.
compute_area_signed
compute_area_signed(pr: NDArray[floating[Any]]) -> float
Return the signed area enclosed by a ring using the linear time.
algorithm at http://www.cgafaq.info/wiki/Polygon_Area. A value >= 0 indicates a counter-clockwise oriented ring.
Source code in gdsfactory/read/from_np.py
16 17 18 19 20 21 22 23 24 25 26 27 28 | |
from_image
from_image(
image_path: PathType, **kwargs: Any
) -> Component
Returns Component from a png image.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
image_path
|
PathType
|
png file path. |
required |
kwargs
|
Any
|
for from_np. |
{}
|
Other Parameters:
| Name | Type | Description |
|---|---|---|
nm_per_pixel |
scale_factor. |
|
layer |
layer tuple to output gds. |
|
threshold |
value along which to find contours in the array. |
Source code in gdsfactory/read/from_np.py
71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 | |
from_np
from_np(
ndarray: NDArray[floating[Any]],
nm_per_pixel: int = 20,
layer: tuple[int, int] = (1, 0),
threshold: float = 0.99,
invert: bool = True,
) -> Component
Returns Component from a np.ndarray.
Extracts contours skimage.measure.find_contours using threshold.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
ndarray
|
NDArray[floating[Any]]
|
2D ndarray representing the device layout. |
required |
nm_per_pixel
|
int
|
scale_factor. |
20
|
layer
|
tuple[int, int]
|
layer tuple to output gds. |
(1, 0)
|
threshold
|
float
|
value along which to find contours in the array. |
0.99
|
invert
|
bool
|
invert the mask. |
True
|
Source code in gdsfactory/read/from_np.py
31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 | |
Cell decorators
cell
cell(
_func: ComponentFunc[ComponentParams],
) -> ComponentFunc[ComponentParams]
cell(
*,
set_settings: bool = True,
set_name: bool = True,
check_ports: bool = True,
check_instances: CheckInstances | None = None,
snap_ports: bool = True,
add_port_layers: bool = True,
cache: Cache[int, Any] | dict[int, Any] | None = None,
basename: str | None = None,
drop_params: list[str] | None = None,
register_factory: bool = True,
overwrite_existing: bool | None = None,
layout_cache: bool | None = None,
info: dict[str, MetaData] | None = None,
post_process: (
Iterable[Callable[[Component], None]] | None
) = None,
debug_names: bool | None = None,
tags: list[str] | None = None,
with_module_name: bool = False,
lvs_equivalent_ports: list[list[str]] | None = None,
schematic_function: Callable[ComponentParams, Schematic]
) -> Callable[
[ComponentFunc[ComponentParams]],
ComponentFunc[ComponentParams],
]
cell(
*,
set_settings: bool = True,
set_name: bool = True,
check_ports: bool = True,
check_instances: CheckInstances | None = None,
snap_ports: bool = True,
add_port_layers: bool = True,
cache: Cache[int, Any] | dict[int, Any] | None = None,
basename: str | None = None,
drop_params: list[str] | None = None,
register_factory: bool = True,
overwrite_existing: bool | None = None,
layout_cache: bool | None = None,
info: dict[str, MetaData] | None = None,
post_process: (
Iterable[Callable[[Component], None]] | None
) = None,
debug_names: bool | None = None,
tags: list[str] | None = None,
with_module_name: bool = False,
lvs_equivalent_ports: list[list[str]] | None = None,
schematic_function: None = None
) -> Callable[
[ComponentFunc[ComponentParams]],
ComponentFunc[ComponentParams],
]
cell(
_func: ComponentFunc[ComponentParams] | None = None,
/,
*,
set_settings: bool = True,
set_name: bool = True,
check_ports: bool = True,
check_instances: CheckInstances | None = None,
snap_ports: bool = True,
add_port_layers: bool = True,
cache: Cache[int, Any] | dict[int, Any] | None = None,
basename: str | None = None,
drop_params: list[str] | None = None,
register_factory: bool = True,
overwrite_existing: bool | None = None,
layout_cache: bool | None = None,
info: dict[str, MetaData] | None = None,
post_process: (
Iterable[Callable[[Component], None]] | None
) = None,
debug_names: bool | None = None,
tags: list[str] | None = None,
with_module_name: bool = False,
lvs_equivalent_ports: list[list[str]] | None = None,
ports: PortsDefinition | None = None,
schematic_function: (
Callable[ComponentParams, Schematic] | None
) = None,
) -> (
ComponentFunc[ComponentParams]
| Callable[
[ComponentFunc[ComponentParams]],
ComponentFunc[ComponentParams],
]
)
Decorator to convert a function into a Component.
Source code in gdsfactory/_cell.py
94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 | |
vcell
vcell(
_func: ComponentAllAngleFunc[ComponentParams],
) -> ComponentAllAngleFunc[ComponentParams]
vcell(
*,
set_settings: bool = True,
set_name: bool = True,
check_ports: bool = True,
basename: str | None = None,
drop_params: tuple[str, ...] = ("self", "cls"),
register_factory: bool = True,
ports: PortsDefinition | None = None,
lvs_equivalent_ports: list[list[str]] | None = None,
tags: list[str] | None = None,
with_module_name: bool = False
) -> Callable[
[ComponentAllAngleFunc[ComponentParams]],
ComponentAllAngleFunc[ComponentParams],
]
vcell(
_func: (
ComponentAllAngleFunc[ComponentParams] | None
) = None,
/,
*,
set_settings: bool = True,
set_name: bool = True,
add_port_layers: bool = True,
cache: Cache[int, Any] | dict[int, Any] | None = None,
basename: str | None = None,
drop_params: tuple[str, ...] = ("self", "cls"),
register_factory: bool = True,
check_ports: bool = True,
ports: PortsDefinition | None = None,
lvs_equivalent_ports: list[list[str]] | None = None,
tags: list[str] | None = None,
with_module_name: bool = False,
) -> (
ComponentAllAngleFunc[ComponentParams]
| Callable[
[ComponentAllAngleFunc[ComponentParams]],
ComponentAllAngleFunc[ComponentParams],
]
)
Source code in gdsfactory/_cell.py
209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 | |
Paths
Path
Bases: UMGeometricObject
You can extrude a Path with a CrossSection to create a Component.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
path
|
NDArray[floating[Any]] | Path | list[tuple[float, float]] | None
|
array-like[N][2], Path, or list of Paths. |
None
|
Source code in gdsfactory/path.py
96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 593 594 595 596 597 598 599 600 601 602 603 604 605 606 607 608 609 610 611 612 613 614 615 616 617 618 619 620 621 622 623 624 625 626 627 628 629 630 631 632 633 634 635 636 637 638 639 640 641 642 643 644 645 646 647 648 649 650 651 652 653 654 655 656 657 658 659 660 661 662 663 664 | |
__add__
__add__(path: NDArray[floating[Any]] | Path) -> Path
Returns new path concatenating current and new path.
Source code in gdsfactory/path.py
173 174 175 176 | |
__eq__
__eq__(other: object) -> bool
Check if two Path instances are equal.
Source code in gdsfactory/path.py
451 452 453 454 455 456 457 458 459 | |
__hash__
__hash__() -> int
Computes a hash of the Path.
Source code in gdsfactory/path.py
447 448 449 | |
__iadd__
__iadd__(
path_or_points: NDArray[floating[Any]] | Path,
) -> Path
Adds points to current path.
Source code in gdsfactory/path.py
169 170 171 | |
__init__
__init__(
path: (
NDArray[floating[Any]]
| Path
| list[tuple[float, float]]
| None
) = None,
start_angle: float | None = None,
end_angle: float | None = None,
) -> None
Initializes a Path.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
path
|
NDArray[floating[Any]] | Path | list[tuple[float, float]] | None
|
array-like[N][2], Path, or list of Paths. |
None
|
start_angle
|
float | None
|
optional angle in degrees at the start of the path. Overrides the angle inferred from the points. |
None
|
end_angle
|
float | None
|
optional angle in degrees at the end of the path. Overrides the angle inferred from the points. |
None
|
Source code in gdsfactory/path.py
104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 | |
__len__
__len__() -> int
Returns path points.
Source code in gdsfactory/path.py
165 166 167 | |
__repr__
__repr__() -> str
Returns path points.
Source code in gdsfactory/path.py
157 158 159 160 161 162 163 | |
append
append(
path: (
NDArray[floating[Any]]
| Path
| list[Path]
| list[tuple[float, float]]
),
) -> Path
Attach Path to the end of this Path.
The input path automatically rotates and translates such that it continues smoothly from the previous segment.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
path
|
NDArray[floating[Any]] | Path | list[Path] | list[tuple[float, float]]
|
Path, array-like[N][2], or list of Paths. The input path that will be appended. |
required |
Source code in gdsfactory/path.py
239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 | |
bbox_np
bbox_np() -> npt.NDArray[np.float64]
Returns the bounding box of the Path as a numpy array.
Source code in gdsfactory/path.py
229 230 231 232 233 234 235 236 237 | |
centerpoint_offset_curve
centerpoint_offset_curve(
points: NDArray[floating[Any]],
offset_distance: (
float | Sequence[float] | NDArray[floating[Any]]
),
start_angle: float | None = None,
end_angle: float | None = None,
) -> npt.NDArray[np.floating[Any]]
Creates a offset curve computing the centerpoint offset of x and y points.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
points
|
NDArray[floating[Any]]
|
array-like[N][2] The points to be offset. |
required |
offset_distance
|
float | Sequence[float] | NDArray[floating[Any]]
|
array-like[N] The distance to offset the points. |
required |
start_angle
|
float | None
|
float or None The angle at the start of the path. |
None
|
end_angle
|
float | None
|
float or None The angle at the end of the path. |
None
|
Source code in gdsfactory/path.py
343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 | |
copy
copy() -> Path
Returns a copy of the Path.
Source code in gdsfactory/path.py
637 638 639 640 641 642 643 644 | |
curvature
curvature() -> tuple[
npt.NDArray[np.floating[Any]],
npt.NDArray[np.floating[Any]],
]
Calculates Path curvature.
The curvature is numerically computed so areas where the curvature jumps instantaneously (such as between an arc and a straight segment) will be slightly interpolated, and sudden changes in point density along the curve can cause discontinuities.
Returns:
| Name | Type | Description |
|---|---|---|
s |
NDArray[floating[Any]]
|
array-like[N] The arc-length of the Path |
K |
NDArray[floating[Any]]
|
array-like[N] The curvature of the Path |
Source code in gdsfactory/path.py
409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 | |
extrude
extrude(
cross_section: CrossSectionSpec | None = None,
layer: LayerSpec | None = None,
width: float | None = None,
simplify: float | None = None,
all_angle: Literal[False] = False,
register_cross_section: bool = False,
) -> Component
extrude(
cross_section: CrossSectionSpec | None = None,
layer: LayerSpec | None = None,
width: float | None = None,
simplify: float | None = None,
all_angle: Literal[True] = True,
register_cross_section: bool = False,
) -> ComponentAllAngle
extrude(
cross_section: CrossSectionSpec | None = None,
layer: LayerSpec | None = None,
width: float | None = None,
simplify: float | None = None,
all_angle: bool = True,
register_cross_section: bool = False,
) -> AnyComponent
extrude(
cross_section: CrossSectionSpec | None = None,
layer: LayerSpec | None = None,
width: float | None = None,
simplify: float | None = None,
all_angle: bool = False,
register_cross_section: bool = False,
) -> AnyComponent
Returns Component by extruding a Path with a CrossSection.
A path can be extruded using any CrossSection returning a Component The CrossSection defines the layer numbers, widths and offsets.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
cross_section
|
CrossSectionSpec | None
|
to extrude. |
None
|
layer
|
LayerSpec | None
|
optional layer. |
None
|
width
|
float | None
|
optional width in um. |
None
|
simplify
|
float | None
|
Tolerance value for the simplification algorithm. All points that can be removed without changing the resulting polygon by more than the value listed here will be removed. |
None
|
all_angle
|
bool
|
if True, the bend is drawn with a single euler curve. |
False
|
register_cross_section
|
bool
|
if True, the cross_section factory is registered in the active PDK. |
False
|
Example
import gdsfactory as gf
p = gf.path.euler(radius=10)
c = p.extrude(layer=(1, 0), width=0.5)
c.plot()
Source code in gdsfactory/path.py
552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 593 594 | |
extrude_transition
extrude_transition(
transition: Transition | TransitionAsymmetric,
all_angle: Literal[False] = False,
) -> Component
extrude_transition(
transition: Transition | TransitionAsymmetric,
all_angle: Literal[True] = True,
) -> ComponentAllAngle
extrude_transition(
transition: Transition | TransitionAsymmetric,
all_angle: bool = True,
) -> AnyComponent
extrude_transition(
transition: Transition | TransitionAsymmetric,
all_angle: bool = False,
) -> AnyComponent
Extrudes a path along a transition.
Allows different transition methods for the upper and lower edges.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
transition
|
Transition | TransitionAsymmetric
|
Transition or TransitionAsymmetric object describing the cross-sections and default transition types. |
required |
all_angle
|
bool
|
if True, returns a ComponentAllAngle. |
False
|
Returns:
| Name | Type | Description |
|---|---|---|
AnyComponent |
AnyComponent
|
The extruded component with the specified transition methods for each edge. |
Source code in gdsfactory/path.py
617 618 619 620 621 622 623 624 625 626 627 628 629 630 631 632 633 634 635 | |
hash_geometry
hash_geometry(precision: float = 0.0001) -> int
Computes an SHA1 hash of the points in the Path and the start_angle and end_angle.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
precision
|
float
|
Rounding precision for the the objects in the Component. For instance, a precision of 1e-2 will round a point at (0.124, 1.748) to (0.12, 1.75) |
0.0001
|
Returns:
| Type | Description |
|---|---|
int
|
str Hash result in the form of an SHA1 hex digest string. |
int
|
hash( hash(First layer information: [layer1, datatype1]), hash(Polygon 1 on layer 1 points: [(x1,y1),(x2,y2),(x3,y3)] ), hash(Polygon 2 on layer 1 points: [(x1,y1),(x2,y2),(x3,y3),(x4,y4)] ), hash(Polygon 3 on layer 1 points: [(x1,y1),(x2,y2),(x3,y3)] ), hash(Second layer information: [layer2, datatype2]), hash(Polygon 1 on layer 2 points: [(x1,y1),(x2,y2),(x3,y3),(x4,y4)] ), hash(Polygon 2 on layer 2 points: [(x1,y1),(x2,y2),(x3,y3)] ), |
int
|
) |
Source code in gdsfactory/path.py
461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 | |
length
length() -> float
Return cumulative length.
Source code in gdsfactory/path.py
401 402 403 404 405 406 407 | |
mirror
mirror(
p1: tuple[float, float] = (0, 1),
p2: tuple[float, float] = (0, 0),
) -> Path
Mirrors the Path across the line formed between the two specified points.
points may be input as either single points [1,2]
or array-like[N][2], and will return in kind.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
p1
|
tuple[float, float]
|
First point of the line. |
(0, 1)
|
p2
|
tuple[float, float]
|
Second point of the line. |
(0, 0)
|
Source code in gdsfactory/path.py
646 647 648 649 650 651 652 653 654 655 656 657 658 659 660 661 662 663 664 | |
offset
offset(
offset: float | Callable[[float], float] = 0,
) -> Path
Offsets Path so that it follows the Path centerline plus an offset.
The offset can either be a fixed value, or a function of the form my_offset(t) where t goes from 0->1
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
offset
|
float | Callable[[float], float]
|
int or float, callable. Magnitude of the offset |
0
|
Source code in gdsfactory/path.py
295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 | |
plot
plot() -> None
Plot path in matplotlib.
Example
import gdsfactory as gf
p = gf.path.euler(radius=10)
p.plot()
Source code in gdsfactory/path.py
501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 | |
straight
straight(length: float = 10.0, npoints: int = 2) -> Path
Returns a straight path.
For transitions you should increase have at least 100 points
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
length
|
float
|
of straight. |
10.0
|
npoints
|
int
|
number of points. |
2
|
Source code in gdsfactory/path.py
2253 2254 2255 2256 2257 2258 2259 2260 2261 2262 2263 2264 2265 2266 2267 2268 2269 2270 2271 | |
euler
euler(
radius: float = 10,
angle: float = 90,
p: float = 0.5,
use_eff: bool = False,
npoints: int | None = None,
angular_step: float | None = None,
) -> Path
Returns an euler bend that adiabatically transitions from straight to curved.
radius is the minimum radius of curvature of the bend.
However, if use_eff is set to True, radius corresponds to the effective
radius of curvature (making the curve a drop-in replacement for an arc).
If p < 1.0, will create a "partial euler" curve as described in Vogelbacher et. al.
https://dx.doi.org/10.1364/oe.27.031394
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
radius
|
float
|
minimum radius of curvature. |
10
|
angle
|
float
|
total angle of the curve. |
90
|
p
|
float
|
Proportion of the curve that is an Euler curve. |
0.5
|
use_eff
|
bool
|
If False: |
False
|
npoints
|
int | None
|
Number of points used per 360 degrees. |
None
|
angular_step
|
float | None
|
If provided, determines the angular step (in degrees) between points. This overrides npoints calculation. |
None
|
Example
import gdsfactory as gf
p = gf.path.euler(radius=10, angle=45, p=1, use_eff=True, npoints=720)
p.plot()
Source code in gdsfactory/path.py
1865 1866 1867 1868 1869 1870 1871 1872 1873 1874 1875 1876 1877 1878 1879 1880 1881 1882 1883 1884 1885 1886 1887 1888 1889 1890 1891 1892 1893 1894 1895 1896 1897 1898 1899 1900 1901 1902 1903 1904 1905 1906 1907 1908 1909 1910 1911 1912 1913 1914 1915 1916 1917 1918 1919 1920 1921 1922 1923 1924 1925 1926 1927 1928 1929 1930 1931 1932 1933 1934 1935 1936 1937 1938 1939 1940 1941 1942 1943 1944 1945 1946 1947 1948 1949 1950 1951 1952 1953 1954 1955 1956 1957 1958 1959 1960 1961 1962 1963 1964 1965 1966 1967 1968 1969 1970 1971 1972 1973 1974 1975 1976 1977 1978 1979 1980 1981 1982 1983 1984 1985 1986 1987 1988 1989 1990 1991 1992 1993 1994 1995 1996 1997 1998 1999 2000 2001 2002 2003 2004 2005 2006 2007 2008 2009 2010 2011 2012 2013 2014 2015 2016 2017 2018 2019 2020 2021 2022 2023 2024 2025 2026 2027 2028 2029 2030 2031 2032 2033 2034 2035 2036 2037 2038 2039 | |
arc
arc(
radius: float | None = 10.0,
angle: float = 90,
npoints: int | None = None,
start_angle: float = -90,
angular_step: float | None = None,
) -> Path
Returns a radial arc.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
radius
|
float | None
|
minimum radius of curvature. |
10.0
|
angle
|
float
|
total angle of the curve. |
90
|
npoints
|
int | None
|
Number of points used per 360 degrees. Defaults to pdk.bend_points_distance. |
None
|
start_angle
|
float
|
initial angle of the curve for drawing, default -90 degrees. |
-90
|
angular_step
|
float | None
|
If provided, determines the angular step (in degrees) between points. This overrides npoints calculation. |
None
|
Example
import gdsfactory as gf
p = gf.path.arc(radius=10, angle=45)
p.plot()
Source code in gdsfactory/path.py
1760 1761 1762 1763 1764 1765 1766 1767 1768 1769 1770 1771 1772 1773 1774 1775 1776 1777 1778 1779 1780 1781 1782 1783 1784 1785 1786 1787 1788 1789 1790 1791 1792 1793 1794 1795 1796 1797 1798 1799 1800 1801 1802 1803 1804 1805 1806 1807 1808 1809 1810 1811 1812 1813 1814 1815 1816 1817 1818 | |
spiral_archimedean
spiral_archimedean(
min_bend_radius: float,
separation: float,
number_of_loops: float,
npoints: int,
) -> Path
Returns an Archimedean spiral.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
min_bend_radius
|
float
|
Inner radius of the spiral. |
required |
separation
|
float
|
Half the radial separation between loops in um. The
current formula is retained for compatibility with existing
layouts, so adjacent turns are separated by |
required |
number_of_loops
|
float
|
number of loops. |
required |
npoints
|
int
|
number of Points. |
required |
Example
import gdsfactory as gf
p = gf.path.spiral_archimedean(min_bend_radius=5, separation=2, number_of_loops=3, npoints=200)
p.plot()
Source code in gdsfactory/path.py
2274 2275 2276 2277 2278 2279 2280 2281 2282 2283 2284 2285 2286 2287 2288 2289 2290 2291 2292 2293 2294 2295 2296 2297 2298 2299 | |
smooth
smooth(
points: NDArray[floating[Any]] | Path,
radius: float = 4.0,
bend: PathFactory = euler,
**kwargs: Any
) -> Path
Returns a smooth Path from a series of waypoints.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
points
|
NDArray[floating[Any]] | Path
|
array-like[N][2] List of waypoints for the path to follow. |
required |
radius
|
float
|
radius of curvature, passed to |
4.0
|
bend
|
PathFactory
|
bend function that returns a path that round corners. |
euler
|
kwargs
|
Any
|
Extra keyword arguments that will be passed to |
{}
|
Example
import gdsfactory as gf
p = gf.path.smooth(([0, 0], [0, 10], [10, 10]))
p.plot()
Source code in gdsfactory/path.py
2332 2333 2334 2335 2336 2337 2338 2339 2340 2341 2342 2343 2344 2345 2346 2347 2348 2349 2350 2351 2352 2353 2354 2355 2356 2357 2358 2359 2360 2361 2362 2363 2364 2365 2366 2367 2368 2369 2370 2371 2372 2373 2374 2375 2376 2377 2378 2379 2380 2381 2382 2383 2384 2385 2386 2387 2388 2389 2390 2391 2392 2393 2394 2395 2396 2397 2398 2399 2400 2401 2402 2403 2404 2405 2406 2407 2408 | |
Cross-section functions
CrossSection
Bases: BaseModel
Waveguide information to extrude a path.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
sections
|
tuple of Sections(width, offset, layer, ports). |
required | |
components_along_path
|
tuple of ComponentAlongPaths. |
required | |
radius
|
default bend radius for routing (um). |
required | |
radius_min
|
minimum acceptable bend radius. |
required | |
bbox_layers
|
layer to add as bounding box. |
required | |
bbox_offsets
|
offset to add to the bounding box. ┌────────────────────────────────────────────────────────────┐ │ │ │ │ │ boox_layer │ │ │ │ ┌──────────────────────────────────────┐ │ │ │ ▲ │bbox_offset│ │ │ │ ├──────────►│ │ │ cladding_offset │ │ │ │ │ │ │ │ │ ├─────────────────────────▲──┴─────────┤ │ │ │ │ │ │ |
required |
Source code in gdsfactory/cross_section/base.py
180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 | |
hash
property
hash: str
Returns a hash of the cross_section.
__getitem__
__getitem__(key: str) -> Section
Returns the section with the given name.
Source code in gdsfactory/cross_section/base.py
268 269 270 271 272 273 | |
add_bbox
add_bbox(
component: AnyComponentT,
top: float | None = None,
bottom: float | None = None,
right: float | None = None,
left: float | None = None,
) -> typings.AnyComponentT
Add bounding box layers to a component.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
component
|
AnyComponentT
|
to add layers. |
required |
top
|
float | None
|
top padding. |
None
|
bottom
|
float | None
|
bottom padding. |
None
|
right
|
float | None
|
right padding. |
None
|
left
|
float | None
|
left padding. |
None
|
Source code in gdsfactory/cross_section/base.py
344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 | |
append_sections
append_sections(sections: Sections) -> Self
Append sections to the cross_section.
Source code in gdsfactory/cross_section/base.py
263 264 265 266 | |
copy
copy(
width: float | None = None,
layer: LayerSpec | None = None,
width_function: WidthFunction | None = None,
offset_function: OffsetFunction | None = None,
sections: Sections | None = None,
**kwargs: Any
) -> CrossSection
Returns copy of the cross_section with new parameters.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
width
|
float | None
|
of the section (um). Defaults to current width. |
None
|
layer
|
LayerSpec | None
|
layer spec. Defaults to current layer. |
None
|
width_function
|
WidthFunction | None
|
parameterized function from 0 to 1. |
None
|
offset_function
|
OffsetFunction | None
|
parameterized function from 0 to 1. |
None
|
sections
|
Sections | None
|
a tuple of Sections, to replace the original sections |
None
|
kwargs
|
Any
|
additional parameters to update. |
{}
|
Other Parameters:
| Name | Type | Description |
|---|---|---|
sections |
Sections | None
|
tuple of Sections(width, offset, layer, ports). |
components_along_path |
tuple of ComponentAlongPaths. |
|
radius |
route bend radius (um). |
|
bbox_layers |
layer to add as bounding box. |
|
bbox_offsets |
offset to add to the bounding box. |
|
_name |
name of the cross_section. |
Source code in gdsfactory/cross_section/base.py
280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 | |
get_xmin_xmax
get_xmin_xmax() -> tuple[float, float]
Returns the min and max extent of the cross_section across all sections.
Source code in gdsfactory/cross_section/base.py
381 382 383 384 385 386 387 388 389 390 391 392 393 | |
mirror
mirror() -> CrossSection
Returns a mirrored copy of the cross_section.
Source code in gdsfactory/cross_section/base.py
339 340 341 342 | |
Transition
Bases: BaseModel
Waveguide information to extrude a path between two CrossSection.
cladding_layers follow path shape
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
cross_section1
|
input cross_section. |
required | |
cross_section2
|
output cross_section. |
required | |
width_type
|
'sine', 'linear', 'parabolic' or Callable. Sets the type of width transition used if widths are different between the two input CrossSections. |
required | |
offset_type
|
'sine', 'linear', 'parabolic' or Callable. Sets the type of offset transition used if offsets are different between the two input CrossSections. |
required |
Source code in gdsfactory/cross_section/base.py
399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 | |
Section
Bases: BaseModel
CrossSection to extrude a path with a waveguide.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
width
|
of the section (um). When |
required | |
offset
|
center offset (um). When |
required | |
insets
|
distance (um) in x to inset section relative to end of the Path (i.e. (start inset, stop_inset)). |
required | |
layer
|
layer spec. If None does not draw the main section. |
required | |
port_names
|
Optional port names. |
required | |
port_types
|
optical, electrical, ... |
required | |
name
|
Optional Section name. |
required | |
hidden
|
hide layer. |
required | |
simplify
|
Optional Tolerance value for the simplification algorithm. All points that can be removed without changing the resulting. polygon by more than the value listed here will be removed. |
required | |
skip_transition
|
if True, this section is excluded from cross-section transitions (will not be tapered between two CrossSections). |
required | |
width_function
|
parameterized function from 0 to 1. |
required | |
offset_function
|
parameterized function from 0 to 1. 0 │ ┌───────┐ │ │ │ │ layer │ │◄─────►│ │ │ │ │ width │ │ └───────┘ | │ | ◄────────────► +offset |
required |
Source code in gdsfactory/cross_section/base.py
70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 | |
cross_section
cross_section(
width: float | WidthFunction = 0.5,
offset: float | OffsetFunction = 0,
layer: LayerSpec = "WG",
sections: Sections | None = None,
port_names: IOPorts = ("o1", "o2"),
port_types: IOPorts = ("optical", "optical"),
bbox_layers: LayerSpecs | None = None,
bbox_offsets: Floats | None = None,
cladding_layers: LayerSpecs | None = None,
cladding_offsets: float | Floats | None = None,
cladding_simplify: float | Floats | None = None,
cladding_centers: float | Floats | None = None,
radius: float | None = 10.0,
radius_min: float | None = 7.0,
main_section_name: str = "_default",
) -> CrossSection
Return CrossSection.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
width
|
float | WidthFunction
|
main Section width (um) or parameterized function from 0 to 1. |
0.5
|
offset
|
float | OffsetFunction
|
main Section center offset (um) or parameterized function from 0 to 1. |
0
|
layer
|
LayerSpec
|
main section layer. |
'WG'
|
sections
|
Sections | None
|
list of Sections(width, offset, layer, ports). |
None
|
port_names
|
IOPorts
|
for input and output ('o1', 'o2'). |
('o1', 'o2')
|
port_types
|
IOPorts
|
for input and output: electrical, optical, vertical_te ... |
('optical', 'optical')
|
bbox_layers
|
LayerSpecs | None
|
list of layers bounding boxes to extrude. |
None
|
bbox_offsets
|
Floats | None
|
list of offset from bounding box edge. |
None
|
cladding_layers
|
LayerSpecs | None
|
list of layers to extrude. |
None
|
cladding_offsets
|
float | Floats | None
|
offset from main Section edge. Single float is broadcast to all cladding layers. |
None
|
cladding_simplify
|
float | Floats | None
|
Optional Tolerance value for the simplification algorithm. All points that can be removed without changing the resulting. polygon by more than the value listed here will be removed. Single float is broadcast to all cladding layers. |
None
|
cladding_centers
|
float | Floats | None
|
center offset for each cladding layer. Defaults to 0. Single float is broadcast to all cladding layers. |
None
|
radius
|
float | None
|
routing bend radius (um). |
10.0
|
radius_min
|
float | None
|
min acceptable bend radius. |
7.0
|
main_section_name
|
str
|
name of the main section. Defaults to _default |
'_default'
|
Example
import gdsfactory as gf
xs = gf.cross_section.cross_section(width=0.5, offset=0, layer='WG')
p = gf.path.arc(radius=10, angle=45)
c = p.extrude(xs)
c.plot()
┌────────────────────────────────────────────────────────────┐
│ │
│ │
│ boox_layer │
│ │
│ ┌──────────────────────────────────────┐ │
│ │ ▲ │bbox_offset│
│ │ │ ├──────────►│
│ │ cladding_offset │ │ │
│ │ │ │ │
│ ├─────────────────────────▲──┴─────────┤ │
│ │ │ │ │
─ ─┤ │ core width │ │ ├─ ─ center
│ │ │ │ │
│ ├─────────────────────────▼────────────┤ │
│ │ │ │
│ │ │ │
│ │ │ │
│ │ │ │
│ └──────────────────────────────────────┘ │
│ │
│ │
│ │
└────────────────────────────────────────────────────────────┘
Source code in gdsfactory/cross_section/utils.py
61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 | |
strip
strip(
width: float = 0.5,
layer: LayerSpec = "WG",
radius: float = 10.0,
radius_min: float = 3.5,
**kwargs: Any
) -> CrossSection
Return Strip cross_section.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
width
|
main Section width (um). |
required | |
layer
|
main section layer. |
required | |
radius
|
routing bend radius (um). |
required | |
radius_min
|
min acceptable bend radius. |
required | |
kwargs
|
cross_section settings. |
required |
Source code in gdsfactory/cross_section/presets.py
26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 | |
strip_no_ports
strip_no_ports(
width: float = 0.5,
layer: LayerSpec = "WG",
radius: float = 10.0,
radius_min: float = 5,
port_names: IOPorts = ("", ""),
**kwargs: Any
) -> CrossSection
Return Strip cross_section without ports.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
width
|
float
|
main Section width (um). |
0.5
|
layer
|
LayerSpec
|
main section layer. |
'WG'
|
radius
|
float
|
routing bend radius (um). |
10.0
|
radius_min
|
float
|
min acceptable bend radius. |
5
|
port_names
|
IOPorts
|
for input and output ('o1', 'o2'). |
('', '')
|
kwargs
|
Any
|
cross_section settings. |
{}
|
Source code in gdsfactory/cross_section/presets.py
52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 | |
slot
slot(
width: float = 0.5,
layer: LayerSpec = "WG_ABSTRACT",
slot_width: float = 0.04,
rail_layer: LayerSpec = "WG",
sections: Sections | None = None,
**kwargs: Any
) -> CrossSection
Return CrossSection Slot (with an etched region in the center).
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
width
|
float
|
main Section width (um) or function parameterized from 0 to 1. the width at t==0 is the width at the beginning of the Path. the width at t==1 is the width at the end. |
0.5
|
layer
|
LayerSpec
|
main section layer. |
'WG_ABSTRACT'
|
slot_width
|
float
|
in um. |
0.04
|
rail_layer
|
LayerSpec
|
rail layer. |
'WG'
|
sections
|
Sections | None
|
list of Sections(width, offset, layer, ports). |
None
|
kwargs
|
Any
|
other cross section parameters. |
{}
|
Example
import gdsfactory as gf
xs = gf.cross_section.slot(width=0.5, slot_width=0.05, layer='WG')
p = gf.path.arc(radius=10, angle=45)
c = p.extrude(xs)
c.plot()
Source code in gdsfactory/cross_section/presets.py
229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 | |
rib
rib(
width: float = 0.5,
layer: LayerSpec = "WG",
radius: float = radius_rib,
radius_min: float | None = 7,
cladding_layers: LayerSpecs = ("SLAB90",),
cladding_offsets: Floats = (3,),
cladding_simplify: Floats = (50 * nm,),
**kwargs: Any
) -> CrossSection
Return Rib cross_section.
Source code in gdsfactory/cross_section/presets.py
81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 | |
rib_bbox
rib_bbox(
width: float = 0.5,
layer: LayerSpec = "WG",
radius: float = radius_rib,
radius_min: float | None = None,
bbox_layers: LayerSpecs = ("SLAB90",),
bbox_offsets: Floats = (3,),
**kwargs: Any
) -> CrossSection
Return Rib cross_section.
Source code in gdsfactory/cross_section/presets.py
105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 | |
rib2
rib2(
width: float = 0.5,
layer: LayerSpec = "WG",
layer_slab: LayerSpec = "SLAB90",
radius: float = radius_rib,
radius_min: float | None = None,
width_slab: float = 6,
**kwargs: Any
) -> CrossSection
Return Rib cross_section.
Source code in gdsfactory/cross_section/presets.py
127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 | |
rib_with_trenches
rib_with_trenches(
width: float = 0.5,
width_trench: float = 2.0,
slab_offset: float | None = 0.3,
width_slab: float | None = None,
simplify_slab: float | None = None,
layer: LayerSpec = "WG",
layer_trench: LayerSpec = "DEEP_ETCH",
wg_marking_layer: LayerSpec = "WG_ABSTRACT",
sections: Sections | None = None,
**kwargs: Any
) -> CrossSection
Return CrossSection of rib waveguide defined by trenches.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
width
|
float
|
main Section width (um) or function parameterized from 0 to 1. the width at t==0 is the width at the beginning of the Path. the width at t==1 is the width at the end. |
0.5
|
width_trench
|
float
|
in um. |
2.0
|
slab_offset
|
float | None
|
from the edge of the trench to the edge of the slab. |
0.3
|
width_slab
|
float | None
|
in um. |
None
|
simplify_slab
|
float | None
|
Optional Tolerance value for the simplification algorithm. All points that can be removed without changing the resulting polygon by more than the value listed here will be removed. |
None
|
layer
|
LayerSpec
|
slab layer. |
'WG'
|
layer_trench
|
LayerSpec
|
layer to etch trenches. |
'DEEP_ETCH'
|
wg_marking_layer
|
LayerSpec
|
layer to draw over the actual waveguide. This can be useful for booleans, routing, placement ... |
'WG_ABSTRACT'
|
sections
|
Sections | None
|
list of Sections(width, offset, layer, ports). |
None
|
kwargs
|
Any
|
cross_section settings.
┌────────┐ ┌────────┐ │ │ │ │layer_trench └────────┘ └────────┘ ┌─────────────────────────────────────────┐ │ layer │ │ │ └─────────────────────────────────────────┘ ◄─────────► width ┌─────┐ ┌────────┐ ┌───────┐ │ │ │ │ │ │ │ └─────────┘ └────────┘ │ │ ◄---------► ◄-------► │ └─────────────────────────────────────────┘ slab_offset width_trench ──────► | ◄────────────────────────────────────────► width_slab |
{}
|
Example
import gdsfactory as gf
xs = gf.cross_section.rib_with_trenches(width=0.5)
p = gf.path.arc(radius=10, angle=45)
c = p.extrude(xs)
c.plot()
Source code in gdsfactory/cross_section/presets.py
294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 | |
nitride
nitride(
width: float = 1.0,
layer: LayerSpec = "WGN",
radius: float = radius_nitride,
radius_min: float | None = None,
**kwargs: Any
) -> CrossSection
Return Strip cross_section.
Source code in gdsfactory/cross_section/presets.py
151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 | |
strip_rib_tip
strip_rib_tip(
width: float = 0.5,
width_tip: float = 0.2,
layer: LayerSpec = "WG",
layer_slab: LayerSpec = "SLAB90",
radius: float = 10.0,
radius_min: float | None = 5,
**kwargs: Any
) -> CrossSection
Return Rib tip cross_section.
Source code in gdsfactory/cross_section/presets.py
169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 | |
strip_nitride_tip
strip_nitride_tip(
width: float = 1.0,
layer: LayerSpec = "WGN",
layer_silicon: LayerSpec = "WG",
width_tip_nitride: float = 0.2,
width_tip_silicon: float = 0.1,
radius: float = radius_nitride,
radius_min: float | None = None,
**kwargs: Any
) -> CrossSection
Return the end of the nitride tip.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
width
|
float
|
main Section width (um). |
1.0
|
layer
|
LayerSpec
|
main section layer. |
'WGN'
|
layer_silicon
|
LayerSpec
|
silicon layer. |
'WG'
|
width_tip_nitride
|
float
|
in um. |
0.2
|
width_tip_silicon
|
float
|
in um. |
0.1
|
radius
|
float
|
routing bend radius (um). |
radius_nitride
|
radius_min
|
float | None
|
min acceptable bend radius. |
None
|
kwargs
|
Any
|
cross_section settings. |
{}
|
Source code in gdsfactory/cross_section/presets.py
191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 | |
l_with_trenches
l_with_trenches(
width: float = 0.5,
width_trench: float = 2.0,
width_slab: float = 7.0,
layer: LayerSpec = "WG",
layer_slab: LayerSpec = "WG",
layer_trench: LayerSpec = "DEEP_ETCH",
mirror: bool = False,
sections: Sections | None = None,
**kwargs: Any
) -> CrossSection
Return CrossSection of l waveguide defined by trenches.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
width
|
float
|
main Section width (um) or function parameterized from 0 to 1. the width at t==0 is the width at the beginning of the Path. the width at t==1 is the width at the end. |
0.5
|
width_trench
|
float
|
in um. |
2.0
|
width_slab
|
float
|
in um. |
7.0
|
layer
|
LayerSpec
|
ridge layer. None adds only ridge. |
'WG'
|
layer_slab
|
LayerSpec
|
slab layer. |
'WG'
|
layer_trench
|
LayerSpec
|
layer to etch trenches. |
'DEEP_ETCH'
|
mirror
|
bool
|
this cross section is not symmetric and you can switch orientation. |
False
|
sections
|
Sections | None
|
list of Sections(width, offset, layer, ports). |
None
|
kwargs
|
Any
|
cross_section settings. x = 0 | | |
{}
|
_________________________
<-------> |
width_trench
<-------->
width
|
<------------------------>
width_slab
Example
import gdsfactory as gf
xs = gf.cross_section.l_with_trenches(width=0.5)
p = gf.path.arc(radius=10, angle=45)
c = p.extrude(xs)
c.plot()
Source code in gdsfactory/cross_section/presets.py
392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 | |
metal1
metal1(
width: float = 10,
layer: LayerSpec = "M1",
radius: float | None = None,
port_names: IOPorts = port_names_electrical,
port_types: IOPorts = port_types_electrical,
**kwargs: Any
) -> CrossSection
Return Metal Strip cross_section.
Source code in gdsfactory/cross_section/presets.py
470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 | |
metal2
metal2(
width: float = 10,
layer: LayerSpec = "M2",
radius: float | None = None,
port_names: IOPorts = port_names_electrical,
port_types: IOPorts = port_types_electrical,
**kwargs: Any
) -> CrossSection
Return Metal Strip cross_section.
Source code in gdsfactory/cross_section/presets.py
491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 | |
metal3
metal3(
width: float = 10,
layer: LayerSpec = "M3",
radius: float | None = None,
port_names: IOPorts = port_names_electrical,
port_types: IOPorts = port_types_electrical,
**kwargs: Any
) -> CrossSection
Return Metal Strip cross_section.
Source code in gdsfactory/cross_section/presets.py
512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 | |
metal_routing
metal_routing(
width: float = 10,
layer: LayerSpec = "M3",
radius: float | None = None,
port_names: IOPorts = port_names_electrical,
port_types: IOPorts = port_types_electrical,
**kwargs: Any
) -> CrossSection
Return Metal Strip cross_section.
Source code in gdsfactory/cross_section/presets.py
598 599 600 601 602 603 604 605 606 607 608 609 610 611 612 613 614 615 616 617 | |
gs
gs(
trace_width: float = 140,
layer: LayerSpec = "M3",
gap: float = 120,
layer_port: LayerSpec = "M3_ABSTRACT",
radius: float | None = None,
**kwargs: Any
) -> CrossSection
Return Ground-Signal-Ground cross_section.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
trace_width
|
float
|
in um. |
140
|
layer
|
LayerSpec
|
metal layer. |
'M3'
|
gap
|
float
|
between metal lines in um. |
120
|
layer_port
|
LayerSpec
|
port layer. |
'M3_ABSTRACT'
|
radius
|
float | None
|
bend radius. Optional, defaults to 2*width+gap. |
None
|
kwargs
|
Any
|
cross_section settings. (ignored) |
{}
|
Source code in gdsfactory/cross_section/presets.py
533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 | |
gsg
gsg(
trace_width: float = 140,
layer: LayerSpec = "M3",
gap: float = 100,
radius: float | None = None,
) -> CrossSection
Return Ground-Signal-Ground cross_section.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
trace_width
|
float
|
in um. |
140
|
layer
|
LayerSpec
|
metal layer. |
'M3'
|
gap
|
float
|
between metal lines in um. |
100
|
layer_port
|
port layer. |
required | |
radius
|
float | None
|
bend radius. Optional, defaults to 3width+2gap. |
None
|
Source code in gdsfactory/cross_section/presets.py
567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 593 594 595 | |
heater_metal
heater_metal(
width: float = 2.5,
layer: LayerSpec = "HEATER",
radius: float | None = None,
port_names: IOPorts = port_names_electrical,
port_types: IOPorts = port_types_electrical,
**kwargs: Any
) -> CrossSection
Return Metal Strip cross_section.
Source code in gdsfactory/cross_section/presets.py
620 621 622 623 624 625 626 627 628 629 630 631 632 633 634 635 636 637 638 | |
npp
npp(
width: float = 0.5,
layer: LayerSpec = "NPP",
radius: float | None = None,
port_names: IOPorts = port_names_electrical,
port_types: IOPorts = port_types_electrical,
**kwargs: Any
) -> CrossSection
Return Doped NPP cross_section.
Source code in gdsfactory/cross_section/presets.py
641 642 643 644 645 646 647 648 649 650 651 652 653 654 655 656 657 658 | |
pin
pin(
width: float = 0.5,
layer: LayerSpec = "WG",
layer_slab: LayerSpec = "SLAB90",
layers_via_stack1: LayerSpecs = ("PPP",),
layers_via_stack2: LayerSpecs = ("NPP",),
bbox_offsets_via_stack1: tuple[float, ...] = (0, -0.2),
bbox_offsets_via_stack2: tuple[float, ...] = (0, -0.2),
via_stack_width: float = 9.0,
via_stack_gap: float = 0.55,
slab_gap: float = -0.2,
layer_via: LayerSpec | None = None,
via_width: float = 1,
via_offsets: tuple[float, ...] | None = None,
sections: Sections | None = None,
**kwargs: Any
) -> CrossSection
Rib PIN doped cross_section.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
width
|
float
|
ridge width. |
0.5
|
layer
|
LayerSpec
|
ridge layer. |
'WG'
|
layer_slab
|
LayerSpec
|
slab layer. |
'SLAB90'
|
layers_via_stack1
|
LayerSpecs
|
list of bot layer. |
('PPP',)
|
layers_via_stack2
|
LayerSpecs
|
list of top layer. |
('NPP',)
|
bbox_offsets_via_stack1
|
tuple[float, ...]
|
for bot. |
(0, -0.2)
|
bbox_offsets_via_stack2
|
tuple[float, ...]
|
for top. |
(0, -0.2)
|
via_stack_width
|
float
|
in um. |
9.0
|
via_stack_gap
|
float
|
offset from via_stack to ridge edge. |
0.55
|
slab_gap
|
float
|
extra slab gap (negative: via_stack goes beyond slab). |
-0.2
|
layer_via
|
LayerSpec | None
|
for via. |
None
|
via_width
|
float
|
in um. |
1
|
via_offsets
|
tuple[float, ...] | None
|
in um. |
None
|
sections
|
Sections | None
|
cross_section sections. |
None
|
kwargs
|
Any
|
cross_section settings. |
{}
|
https://doi.org/10.1364/OE.26.029983
layer
|<----width--->|
_______________ via_stack_gap slab_gap
| |<----------->| <-->
___ ____________________| |__________________________|___
| | | | | |
| | P++ | undoped silicon | N++ | |
|___|_________|_______________________________________|____________|___|
<----------->
via_stack_width
<---------------------------------------------------------------------->
slab_width
Example
import gdsfactory as gf
xs = gf.cross_section.pin(width=0.5, via_stack_gap=1, via_stack_width=1)
p = gf.path.arc(radius=10, angle=45)
c = p.extrude(xs)
c.plot()
Source code in gdsfactory/cross_section/pn_junction.py
20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 | |
pn
pn(
width: float = 0.5,
layer: LayerSpec = "WG",
layer_slab: LayerSpec = "SLAB90",
gap_low_doping: float = 0.0,
gap_medium_doping: float = 0.5,
gap_high_doping: float = 1.0,
offset_low_doping: float = 0.0,
width_doping: float = 8.0,
width_slab: float = 7.0,
layer_p: LayerSpec | None = "P",
layer_pp: LayerSpec | None = "PP",
layer_ppp: LayerSpec | None = "PPP",
layer_n: LayerSpec | None = "N",
layer_np: LayerSpec | None = "NP",
layer_npp: LayerSpec | None = "NPP",
layer_via: LayerSpec | None = None,
width_via: float = 1.0,
layer_metal: LayerSpec | None = None,
width_metal: float = 1.0,
port_names: tuple[str, str] = ("o1", "o2"),
sections: Sections | None = None,
cladding_layers: LayerSpecs | None = None,
cladding_offsets: Floats | None = None,
cladding_simplify: Floats | None = None,
slab_inset: float | None = None,
**kwargs: Any
) -> CrossSection
Rib PN doped cross_section.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
width
|
float
|
width of the ridge in um. |
0.5
|
layer
|
LayerSpec
|
ridge layer. |
'WG'
|
layer_slab
|
LayerSpec
|
slab layer. |
'SLAB90'
|
gap_low_doping
|
float
|
from waveguide center to low doping. Only used for PIN. |
0.0
|
gap_medium_doping
|
float
|
from waveguide center to medium doping. None removes it. |
0.5
|
gap_high_doping
|
float
|
from center to high doping. None removes it. |
1.0
|
offset_low_doping
|
float
|
from center to junction center. |
0.0
|
width_doping
|
float
|
in um. |
8.0
|
width_slab
|
float
|
in um. |
7.0
|
layer_p
|
LayerSpec | None
|
p doping layer. |
'P'
|
layer_pp
|
LayerSpec | None
|
p+ doping layer. |
'PP'
|
layer_ppp
|
LayerSpec | None
|
p++ doping layer. |
'PPP'
|
layer_n
|
LayerSpec | None
|
n doping layer. |
'N'
|
layer_np
|
LayerSpec | None
|
n+ doping layer. |
'NP'
|
layer_npp
|
LayerSpec | None
|
n++ doping layer. |
'NPP'
|
layer_via
|
LayerSpec | None
|
via layer. |
None
|
width_via
|
float
|
via width in um. |
1.0
|
layer_metal
|
LayerSpec | None
|
metal layer. |
None
|
width_metal
|
float
|
metal width in um. |
1.0
|
port_names
|
tuple[str, str]
|
input and output port names. |
('o1', 'o2')
|
sections
|
Sections | None
|
optional list of sections. |
None
|
cladding_layers
|
LayerSpecs | None
|
optional list of cladding layers. |
None
|
cladding_offsets
|
Floats | None
|
optional list of cladding offsets. |
None
|
cladding_simplify
|
Floats | None
|
Optional Tolerance value for the simplification algorithm. All points that can be removed without changing the resulting polygon by more than the value listed here will be removed. |
None
|
slab_inset
|
float | None
|
slab inset in um. |
None
|
kwargs
|
Any
|
cross_section settings.
|
{}
|
Example
import gdsfactory as gf
xs = gf.cross_section.pn(width=0.5, gap_low_doping=0, width_doping=2.)
p = gf.path.arc(radius=10, angle=45)
c = p.extrude(xs)
c.plot()
Source code in gdsfactory/cross_section/pn_junction.py
128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 | |
pn_with_trenches
pn_with_trenches(
width: float = 0.5,
layer: LayerSpec = "WG",
layer_trench: LayerSpec = "DEEP_ETCH",
gap_low_doping: float = 0.0,
gap_medium_doping: float | None = 0.5,
gap_high_doping: float | None = 1.0,
offset_low_doping: float = 0.0,
width_doping: float = 8.0,
slab_offset: float | None = 0.3,
width_slab: float | None = None,
width_trench: float = 2.0,
layer_p: LayerSpec | None = "P",
layer_pp: LayerSpec | None = "PP",
layer_ppp: LayerSpec | None = "PPP",
layer_n: LayerSpec | None = "N",
layer_np: LayerSpec | None = "NP",
layer_npp: LayerSpec | None = "NPP",
layer_via: LayerSpec | None = None,
width_via: float = 1.0,
layer_metal: LayerSpec | None = None,
width_metal: float = 1.0,
port_names: IOPorts = ("o1", "o2"),
cladding_layers: (
Layers | None
) = cladding_layers_optical,
cladding_offsets: (
Floats | None
) = cladding_offsets_optical,
cladding_simplify: (
Floats | None
) = cladding_simplify_optical,
wg_marking_layer: LayerSpec | None = None,
sections: Sections | None = None,
**kwargs: Any
) -> CrossSection
Rib PN doped cross_section.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
width
|
float
|
width of the ridge in um. |
0.5
|
layer
|
LayerSpec
|
ridge layer. None adds only ridge. |
'WG'
|
layer_trench
|
LayerSpec
|
layer to etch trenches. |
'DEEP_ETCH'
|
gap_low_doping
|
float
|
from waveguide center to low doping. Only used for PIN. |
0.0
|
gap_medium_doping
|
float | None
|
from waveguide center to medium doping. None removes it. |
0.5
|
gap_high_doping
|
float | None
|
from center to high doping. None removes it. |
1.0
|
offset_low_doping
|
float
|
from center to junction center. |
0.0
|
width_doping
|
float
|
in um. |
8.0
|
slab_offset
|
float | None
|
from the edge of the trench to the edge of the slab. |
0.3
|
width_slab
|
float | None
|
in um. |
None
|
width_trench
|
float
|
in um. |
2.0
|
layer_p
|
LayerSpec | None
|
p doping layer. |
'P'
|
layer_pp
|
LayerSpec | None
|
p+ doping layer. |
'PP'
|
layer_ppp
|
LayerSpec | None
|
p++ doping layer. |
'PPP'
|
layer_n
|
LayerSpec | None
|
n doping layer. |
'N'
|
layer_np
|
LayerSpec | None
|
n+ doping layer. |
'NP'
|
layer_npp
|
LayerSpec | None
|
n++ doping layer. |
'NPP'
|
layer_via
|
LayerSpec | None
|
via layer. |
None
|
width_via
|
float
|
via width in um. |
1.0
|
layer_metal
|
LayerSpec | None
|
metal layer. |
None
|
width_metal
|
float
|
metal width in um. |
1.0
|
port_names
|
IOPorts
|
input and output port names. |
('o1', 'o2')
|
cladding_layers
|
Layers | None
|
optional list of cladding layers. |
cladding_layers_optical
|
cladding_offsets
|
Floats | None
|
optional list of cladding offsets. |
cladding_offsets_optical
|
cladding_simplify
|
Floats | None
|
Optional Tolerance value for the simplification algorithm. All points that can be removed without changing the resulting. polygon by more than the value listed here will be removed. |
cladding_simplify_optical
|
wg_marking_layer
|
LayerSpec | None
|
layer to draw over the actual waveguide. |
None
|
sections
|
Sections | None
|
optional list of sections. |
None
|
kwargs
|
Any
|
cross_section settings. |
{}
|
offset_low_doping
<------>
| |
wg junction
center center slab_offset
| | <------>
_____ ______________|_______ ______ ________
| | | | | | |
|________| | |_________| |
P | | N |
width_p | width_n |
<-------------------------------->|<--------------------->|
<-------> | | N+ |
width_trench | | width_n |
| |<------------->|
|<------------->|
gap_medium_doping
<------------------------------------------------------------>
width_slab
Example
import gdsfactory as gf
xs = gf.cross_section.pn_with_trenches(width=0.5, gap_low_doping=0, width_doping=2.)
p = gf.path.arc(radius=10, angle=45)
c = p.extrude(xs)
c.plot()
Source code in gdsfactory/cross_section/pn_junction.py
314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 | |
pn_with_trenches_asymmetric
pn_with_trenches_asymmetric(
width: float = 0.5,
layer: LayerSpec = "WG",
layer_trench: LayerSpec = "DEEP_ETCH",
gap_low_doping: float | tuple[float, float] = (
0.0,
0.0,
),
gap_medium_doping: (
float | tuple[float, float] | None
) = (0.5, 0.2),
gap_high_doping: float | tuple[float, float] | None = (
1.0,
0.8,
),
width_doping: float = 8.0,
slab_offset: float | None = 0.3,
width_slab: float | None = None,
width_trench: float = 2.0,
layer_p: LayerSpec | None = "P",
layer_pp: LayerSpec | None = "PP",
layer_ppp: LayerSpec | None = "PPP",
layer_n: LayerSpec | None = "N",
layer_np: LayerSpec | None = "NP",
layer_npp: LayerSpec | None = "NPP",
layer_via: LayerSpec | None = None,
width_via: float = 1.0,
layer_metal: LayerSpec | None = None,
width_metal: float = 1.0,
port_names: tuple[str, str] = ("o1", "o2"),
cladding_layers: (
Layers | None
) = cladding_layers_optical,
cladding_offsets: (
Floats | None
) = cladding_offsets_optical,
wg_marking_layer: LayerSpec | None = None,
sections: Sections | None = None,
**kwargs: Any
) -> CrossSection
Rib PN doped cross_section with asymmetric dimensions left and right.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
width
|
float
|
width of the ridge in um. |
0.5
|
layer
|
LayerSpec
|
ridge layer. None adds only ridge. |
'WG'
|
layer_trench
|
LayerSpec
|
layer to etch trenches. |
'DEEP_ETCH'
|
gap_low_doping
|
float | tuple[float, float]
|
from waveguide center to low doping. Only used for PIN. If a list, it considers the first element is [p_side, n_side]. If a number, it assumes the same for both sides. |
(0.0, 0.0)
|
gap_medium_doping
|
float | tuple[float, float] | None
|
from waveguide center to medium doping. None removes it. If a list, it considers the first element is [p_side, n_side]. If a number, it assumes the same for both sides. |
(0.5, 0.2)
|
gap_high_doping
|
float | tuple[float, float] | None
|
from center to high doping. None removes it. If a list, it considers the first element is [p_side, n_side]. If a number, it assumes the same for both sides. |
(1.0, 0.8)
|
width_doping
|
float
|
in um. |
8.0
|
slab_offset
|
float | None
|
from the edge of the trench to the edge of the slab. |
0.3
|
width_slab
|
float | None
|
in um. |
None
|
width_trench
|
float
|
in um. |
2.0
|
layer_p
|
LayerSpec | None
|
p doping layer. |
'P'
|
layer_pp
|
LayerSpec | None
|
p+ doping layer. |
'PP'
|
layer_ppp
|
LayerSpec | None
|
p++ doping layer. |
'PPP'
|
layer_n
|
LayerSpec | None
|
n doping layer. |
'N'
|
layer_np
|
LayerSpec | None
|
n+ doping layer. |
'NP'
|
layer_npp
|
LayerSpec | None
|
n++ doping layer. |
'NPP'
|
layer_via
|
LayerSpec | None
|
via layer. |
None
|
width_via
|
float
|
via width in um. |
1.0
|
layer_metal
|
LayerSpec | None
|
metal layer. |
None
|
width_metal
|
float
|
metal width in um. |
1.0
|
port_names
|
tuple[str, str]
|
input and output port names. |
('o1', 'o2')
|
cladding_layers
|
Layers | None
|
optional list of cladding layers. |
cladding_layers_optical
|
cladding_offsets
|
Floats | None
|
optional list of cladding offsets. |
cladding_offsets_optical
|
wg_marking_layer
|
LayerSpec | None
|
layer to draw over the actual waveguide. |
None
|
sections
|
Sections | None
|
optional list of sections. |
None
|
kwargs
|
Any
|
cross_section settings. |
{}
|
gap_low_doping[1]
<------>
| |
wg junction
center center slab_offset
| | <------>
_____ ______________|_______ ______ ________
| | | | | | |
|________| | |_________| |
P | | N |
width_p | width_n |
<-------------------------------->|<--------------------->|
<-------> | | N+ |
width_trench | | width_n |
| |<------------->|
|<------------->|
gap_medium_doping[1]
<------------------------------------------------------------>
width_slab
Example
import gdsfactory as gf
xs = gf.cross_section.pn_with_trenches_assymmetric(width=0.5, gap_low_doping=0, width_doping=2.)
p = gf.path.arc(radius=10, angle=45)
c = p.extrude(xs)
c.plot()
Source code in gdsfactory/cross_section/pn_junction.py
532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 593 594 595 596 597 598 599 600 601 602 603 604 605 606 607 608 609 610 611 612 613 614 615 616 617 618 619 620 621 622 623 624 625 626 627 628 629 630 631 632 633 634 635 636 637 638 639 640 641 642 643 644 645 646 647 648 649 650 651 652 653 654 655 656 657 658 659 660 661 662 663 664 665 666 667 668 669 670 671 672 673 674 675 676 677 678 679 680 681 682 683 684 685 686 687 688 689 690 691 692 693 694 695 696 697 698 699 700 701 702 703 704 705 706 707 708 709 710 711 712 713 714 715 716 717 718 719 720 721 722 723 724 725 726 727 728 729 730 731 732 733 734 735 736 737 738 739 740 741 742 743 744 745 746 747 748 749 750 751 752 753 754 755 756 757 758 759 760 761 762 763 764 765 766 767 768 769 770 771 | |
l_wg_doped_with_trenches
l_wg_doped_with_trenches(
width: float = 0.5,
layer: LayerSpec = "WG",
layer_trench: LayerSpec = "DEEP_ETCH",
gap_low_doping: float = 0.0,
gap_medium_doping: float | None = 0.5,
gap_high_doping: float | None = 1.0,
width_doping: float = 8.0,
slab_offset: float | None = 0.3,
width_slab: float | None = None,
width_trench: float = 2.0,
layer_low: LayerSpec = "P",
layer_mid: LayerSpec = "PP",
layer_high: LayerSpec = "PPP",
layer_via: LayerSpec | None = None,
width_via: float = 1.0,
layer_metal: LayerSpec | None = None,
width_metal: float = 1.0,
port_names: tuple[str, str] = ("o1", "o2"),
cladding_layers: (
Layers | None
) = cladding_layers_optical,
cladding_offsets: (
Floats | None
) = cladding_offsets_optical,
wg_marking_layer: LayerSpec | None = None,
sections: Sections | None = None,
**kwargs: Any
) -> CrossSection
L waveguide PN doped cross_section.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
width
|
float
|
width of the ridge in um. |
0.5
|
layer
|
LayerSpec
|
ridge layer. None adds only ridge. |
'WG'
|
layer_trench
|
LayerSpec
|
layer to etch trenches. |
'DEEP_ETCH'
|
gap_low_doping
|
float
|
from waveguide outer edge to low doping. Only used for PIN. |
0.0
|
gap_medium_doping
|
float | None
|
from waveguide edge to medium doping. None removes it. |
0.5
|
gap_high_doping
|
float | None
|
from edge to high doping. None removes it. |
1.0
|
width_doping
|
float
|
in um. |
8.0
|
slab_offset
|
float | None
|
from the edge of the trench to the edge of the slab. |
0.3
|
width_slab
|
float | None
|
in um. |
None
|
width_trench
|
float
|
in um. |
2.0
|
layer_low
|
LayerSpec
|
low doping layer. |
'P'
|
layer_mid
|
LayerSpec
|
mid doping layer. |
'PP'
|
layer_high
|
LayerSpec
|
high doping layer. |
'PPP'
|
layer_via
|
LayerSpec | None
|
via layer. |
None
|
width_via
|
float
|
via width in um. |
1.0
|
layer_metal
|
LayerSpec | None
|
metal layer. |
None
|
width_metal
|
float
|
metal width in um. |
1.0
|
port_names
|
tuple[str, str]
|
input and output port names. |
('o1', 'o2')
|
cladding_layers
|
Layers | None
|
optional list of cladding layers. |
cladding_layers_optical
|
cladding_offsets
|
Floats | None
|
optional list of cladding offsets. |
cladding_offsets_optical
|
wg_marking_layer
|
LayerSpec | None
|
layer to mark where the actual guiding section is. |
None
|
sections
|
Sections | None
|
optional list of sections. |
None
|
kwargs
|
Any
|
cross_section settings. |
{}
|
gap_low_doping
<------>
|
wg
edge
|
_____ _______ ______
| | |
|_____________________| |
|
|
<------------>
width
<---------------------> |
width_trench | |
| |
|<----------------->|
gap_medium_doping
|<--------------------------->|
gap_high_doping
<------------------------------------------->
width_slab
Example
import gdsfactory as gf
xs = gf.cross_section.pn_with_trenches(width=0.5, gap_low_doping=0, width_doping=2.)
p = gf.path.arc(radius=10, angle=45)
c = p.extrude(xs)
c.plot()
Source code in gdsfactory/cross_section/pn_junction.py
774 775 776 777 778 779 780 781 782 783 784 785 786 787 788 789 790 791 792 793 794 795 796 797 798 799 800 801 802 803 804 805 806 807 808 809 810 811 812 813 814 815 816 817 818 819 820 821 822 823 824 825 826 827 828 829 830 831 832 833 834 835 836 837 838 839 840 841 842 843 844 845 846 847 848 849 850 851 852 853 854 855 856 857 858 859 860 861 862 863 864 865 866 867 868 869 870 871 872 873 874 875 876 877 878 879 880 881 882 883 884 885 886 887 888 889 890 891 892 893 894 895 896 897 898 899 900 901 902 903 904 905 906 907 908 909 910 911 912 913 914 915 916 917 918 919 920 921 922 923 924 925 926 927 928 929 930 931 932 933 934 935 936 937 938 939 940 941 942 943 944 945 946 947 948 949 950 951 952 | |
strip_heater_metal_undercut
strip_heater_metal_undercut(
width: float = 0.5,
layer: LayerSpec = "WG",
heater_width: float = 2.5,
trench_width: float = 6.5,
trench_gap: float = 2.0,
layer_heater: LayerSpec = "HEATER",
layer_trench: LayerSpec = "DEEPTRENCH",
sections: Sections | None = None,
**kwargs: Any
) -> CrossSection
Returns strip cross_section with top metal and undercut trenches on both.
sides.
dimensions from https://doi.org/10.1364/OE.18.020298
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
width
|
float
|
waveguide width. |
0.5
|
layer
|
LayerSpec
|
waveguide layer. |
'WG'
|
heater_width
|
float
|
of metal heater. |
2.5
|
trench_width
|
float
|
in um. |
6.5
|
trench_gap
|
float
|
from waveguide edge to trench edge. |
2.0
|
layer_heater
|
LayerSpec
|
heater layer. |
'HEATER'
|
layer_trench
|
LayerSpec
|
tench layer. |
'DEEPTRENCH'
|
sections
|
Sections | None
|
cross_section sections. |
None
|
kwargs
|
Any
|
cross_section settings. |<-------heater_width--------->| | | | layer_heater | |______|
|
{}
|
Example
import gdsfactory as gf
xs = gf.cross_section.strip_heater_metal_undercut(width=0.5, heater_width=2, trench_width=4, trench_gap=4)
p = gf.path.arc(radius=10, angle=45)
c = p.extrude(xs)
c.plot()
Source code in gdsfactory/cross_section/heater.py
19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 | |
strip_heater_metal
strip_heater_metal(
width: float = 0.5,
layer: LayerSpec = "WG",
heater_width: float = 2.5,
layer_heater: LayerSpec = "HEATER",
sections: Sections | None = None,
insets: tuple[float, float] | None = None,
**kwargs: Any
) -> CrossSection
Returns strip cross_section with top heater metal.
dimensions from https://doi.org/10.1364/OE.18.020298
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
width
|
float
|
waveguide width (um). |
0.5
|
layer
|
LayerSpec
|
waveguide layer. |
'WG'
|
heater_width
|
float
|
of metal heater. |
2.5
|
layer_heater
|
LayerSpec
|
for the metal. |
'HEATER'
|
sections
|
Sections | None
|
cross_section sections. |
None
|
insets
|
tuple[float, float] | None
|
for the heater. |
None
|
kwargs
|
Any
|
cross_section settings. |
{}
|
Example
import gdsfactory as gf
xs = gf.cross_section.strip_heater_metal(width=0.5, heater_width=2)
p = gf.path.arc(radius=10, angle=45)
c = p.extrude(xs)
c.plot()
Source code in gdsfactory/cross_section/heater.py
95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 | |
strip_heater_doped
strip_heater_doped(
width: float = 0.5,
layer: LayerSpec = "WG",
heater_width: float = 2.0,
heater_gap: float = 0.8,
layers_heater: LayerSpecs = ("WG", "NPP"),
bbox_offsets_heater: tuple[float, ...] = (0, 0.1),
sections: Sections | None = None,
**kwargs: Any
) -> CrossSection
Returns strip cross_section with N++ doped heaters on both sides.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
width
|
float
|
in um. |
0.5
|
layer
|
LayerSpec
|
waveguide spec. |
'WG'
|
heater_width
|
float
|
in um. |
2.0
|
heater_gap
|
float
|
in um. |
0.8
|
layers_heater
|
LayerSpecs
|
for doped heater. |
('WG', 'NPP')
|
bbox_offsets_heater
|
tuple[float, ...]
|
for each layers_heater. |
(0, 0.1)
|
sections
|
Sections | None
|
cross_section sections. |
None
|
kwargs
|
Any
|
cross_section settings.
__ __ __ | | | undoped Si | | | |layerheater| | intrinsic region |<----------->| layer_heater | |_| |____| |__| <------------> heater_gap heater_width |
{}
|
Example
import gdsfactory as gf
xs = gf.cross_section.strip_heater_doped(width=0.5, heater_width=2, heater_gap=0.5)
p = gf.path.arc(radius=10, angle=45)
c = p.extrude(xs)
c.plot()
Source code in gdsfactory/cross_section/heater.py
147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 | |
rib_heater_doped
rib_heater_doped(
width: float = 0.5,
layer: LayerSpec = "WG",
heater_width: float = 2.0,
heater_gap: float = 0.8,
layer_heater: LayerSpec = "NPP",
layer_slab: LayerSpec = "SLAB90",
slab_gap: float = 0.2,
with_top_heater: bool = True,
with_bot_heater: bool = True,
sections: Sections | None = None,
**kwargs: Any
) -> CrossSection
Returns rib cross_section with N++ doped heaters on both sides.
dimensions from https://doi.org/10.1364/OE.27.010456
|<------width------>|
____________________ heater_gap slab_gap
| |<----------->| <-->
___ _______________________| |__________________________|___
| | | undoped Si | | |
| |layer_heater| intrinsic region |layer_heater| |
|___|____________|____________________________________________|____________|___|
<---------->
heater_width
<------------------------------------------------------------------------------>
slab_width
Example
import gdsfactory as gf
xs = gf.cross_section.rib_heater_doped(width=0.5, heater_width=2, heater_gap=0.5, layer_heater='NPP')
p = gf.path.arc(radius=10, angle=45)
c = p.extrude(xs)
c.plot()
Source code in gdsfactory/cross_section/heater.py
223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 | |
rib_heater_doped_via_stack
rib_heater_doped_via_stack(
width: float = 0.5,
layer: LayerSpec = "WG",
heater_width: float = 1.0,
heater_gap: float = 0.8,
layer_slab: LayerSpec = "SLAB90",
layer_heater: LayerSpec = "NPP",
via_stack_width: float = 2.0,
via_stack_gap: float = 0.8,
layers_via_stack: LayerSpecs = ("NPP", "VIAC"),
bbox_offsets_via_stack: tuple[float, ...] = (0, -0.2),
slab_gap: float = 0.2,
slab_offset: float = 0,
with_top_heater: bool = True,
with_bot_heater: bool = True,
sections: Sections | None = None,
**kwargs: Any
) -> CrossSection
Returns rib cross_section with N++ doped heaters on both sides.
dimensions from https://doi.org/10.1364/OE.27.010456
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
width
|
float
|
in um. |
0.5
|
layer
|
LayerSpec
|
for main waveguide section. |
'WG'
|
heater_width
|
float
|
in um. |
1.0
|
heater_gap
|
float
|
in um. |
0.8
|
layer_slab
|
LayerSpec
|
for pedestal. |
'SLAB90'
|
layer_heater
|
LayerSpec
|
for doped heater. |
'NPP'
|
via_stack_width
|
float
|
for the contact. |
2.0
|
via_stack_gap
|
float
|
in um. |
0.8
|
layers_via_stack
|
LayerSpecs
|
for the contact. |
('NPP', 'VIAC')
|
bbox_offsets_via_stack
|
tuple[float, ...]
|
for the contact. |
(0, -0.2)
|
slab_gap
|
float
|
from heater edge. |
0.2
|
slab_offset
|
float
|
over the center of the slab. |
0
|
with_top_heater
|
bool
|
adds top/left heater. |
True
|
with_bot_heater
|
bool
|
adds bottom/right heater. |
True
|
sections
|
Sections | None
|
list of sections to add to the cross_section. |
None
|
kwargs
|
Any
|
cross_section settings. |
{}
|
|<----width------>|
slab_gap __________________ via_stack_gap via_stack width
<--> | |<------------>|<--------------->
| | heater_gap |
| |<---------->|
___ _______________________| |___________________________ ____
| | | undoped Si | | |
| |layer_heater| intrinsic region |layer_heater | |
|___|____________|_________________________________________|______________|____|
<------------>
heater_width
<------------------------------------------------------------------------------>
slab_width
Example
import gdsfactory as gf
xs = gf.cross_section.rib_heater_doped_via_stack(width=0.5, heater_width=2, heater_gap=0.5, layer_heater='NPP')
p = gf.path.arc(radius=10, angle=45)
c = p.extrude(xs)
c.plot()
Source code in gdsfactory/cross_section/heater.py
308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 | |
pn_ge_detector_si_contacts
pn_ge_detector_si_contacts(
width_si: float = 6.0,
layer_si: LayerSpec = "WG",
width_ge: float = 3.0,
layer_ge: LayerSpec = "GE",
gap_low_doping: float = 0.6,
gap_medium_doping: float = 0.9,
gap_high_doping: float = 1.1,
width_doping: float = 8.0,
layer_p: LayerSpec = "P",
layer_pp: LayerSpec = "PP",
layer_ppp: LayerSpec = "PPP",
layer_n: LayerSpec = "N",
layer_np: LayerSpec = "NP",
layer_npp: LayerSpec = "NPP",
layer_via: LayerSpec | None = None,
width_via: float = 1.0,
layer_metal: LayerSpec | None = None,
port_names: tuple[str, str] = ("o1", "o2"),
cladding_layers: (
Layers | None
) = cladding_layers_optical,
cladding_offsets: (
Floats | None
) = cladding_offsets_optical,
cladding_simplify: Floats | None = None,
**kwargs: Any
) -> CrossSection
Linear Ge detector cross section based on a lateral p(i)n junction.
It has silicon contacts (no contact on the Ge). The contacts need to be created in the component generating function (they can't be created here).
See Chen et al., "High-Responsivity Low-Voltage 28-Gb/s Ge p-i-n Photodetector With Silicon Contacts", Journal of Lightwave Technology 33(4), 2015.
Notice it is possible to have dopings going beyond the ridge waveguide. This is fine, and it is to account for the presence of the contacts. Such contacts can be subwavelength or not.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
width_si
|
float
|
width of the full etch si in um. |
6.0
|
layer_si
|
LayerSpec
|
si ridge layer. |
'WG'
|
width_ge
|
float
|
width of the ge in um. |
3.0
|
layer_ge
|
LayerSpec
|
ge layer. |
'GE'
|
gap_low_doping
|
float
|
from waveguide center to low doping. |
0.6
|
gap_medium_doping
|
float
|
from waveguide center to medium doping. None removes it. |
0.9
|
gap_high_doping
|
float
|
from center to high doping. None removes it. |
1.1
|
width_doping
|
float
|
distance from waveguide center to doping edge in um. |
8.0
|
layer_p
|
LayerSpec
|
p doping layer. |
'P'
|
layer_pp
|
LayerSpec
|
p+ doping layer. |
'PP'
|
layer_ppp
|
LayerSpec
|
p++ doping layer. |
'PPP'
|
layer_n
|
LayerSpec
|
n doping layer. |
'N'
|
layer_np
|
LayerSpec
|
n+ doping layer. |
'NP'
|
layer_npp
|
LayerSpec
|
n++ doping layer. |
'NPP'
|
layer_via
|
LayerSpec | None
|
via layer. |
None
|
width_via
|
float
|
via width in um. |
1.0
|
layer_metal
|
LayerSpec | None
|
metal layer. |
None
|
port_names
|
tuple[str, str]
|
for input and output ('o1', 'o2'). |
('o1', 'o2')
|
cladding_layers
|
Layers | None
|
list of layers to extrude. |
cladding_layers_optical
|
cladding_offsets
|
Floats | None
|
list of offset from main Section edge. |
cladding_offsets_optical
|
cladding_simplify
|
Floats | None
|
Optional Tolerance value for the simplification algorithm. All points that can be removed without changing the resulting. polygon by more than the value listed here will be removed. |
None
|
kwargs
|
Any
|
cross_section settings.
|
{}
|
Example
import gdsfactory as gf
xs = gf.cross_section.pn()
p = gf.path.straight()
c = p.extrude(xs)
c.plot()
Source code in gdsfactory/cross_section/pn_junction.py
955 956 957 958 959 960 961 962 963 964 965 966 967 968 969 970 971 972 973 974 975 976 977 978 979 980 981 982 983 984 985 986 987 988 989 990 991 992 993 994 995 996 997 998 999 1000 1001 1002 1003 1004 1005 1006 1007 1008 1009 1010 1011 1012 1013 1014 1015 1016 1017 1018 1019 1020 1021 1022 1023 1024 1025 1026 1027 1028 1029 1030 1031 1032 1033 1034 1035 1036 1037 1038 1039 1040 1041 1042 1043 1044 1045 1046 1047 1048 1049 1050 1051 1052 1053 1054 1055 1056 1057 1058 1059 1060 1061 1062 1063 1064 1065 1066 1067 1068 1069 1070 1071 1072 1073 1074 1075 1076 1077 1078 1079 1080 1081 1082 1083 1084 1085 1086 1087 1088 1089 1090 1091 1092 1093 1094 1095 1096 1097 1098 1099 1100 1101 1102 1103 1104 1105 1106 1107 1108 1109 1110 1111 1112 1113 1114 1115 1116 1117 1118 1119 1120 1121 | |
CrossSectionFactory
CrossSectionFactory = Callable[..., 'CrossSection']
CrossSectionSpec
CrossSectionSpec = (
CrossSection
| str
| dict[str, Any]
| CrossSectionFactory
| SymmetricalCrossSection
| DCrossSection
)
Transitions
transition
transition(
cross_section1: CrossSectionSpec,
cross_section2: CrossSectionSpec,
width_type: (
WidthTypes | Callable[[float, float, float], float]
) = "sine",
offset_type: (
WidthTypes | Callable[[float, float, float], float]
) = "sine",
) -> Transition
Returns a smoothly-transitioning between two CrossSections.
Only cross-sectional elements that have the name (as in X.add(..., name = 'wg') )
parameter specified in both input CrosSections will be created.
Port names will be cloned from the input CrossSections in reverse.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
cross_section1
|
CrossSectionSpec
|
First CrossSection. |
required |
cross_section2
|
CrossSectionSpec
|
Second CrossSection. |
required |
width_type
|
WidthTypes | Callable[[float, float, float], float]
|
'sine', 'parabolic', 'linear' or Callable. type of width transition used if any widths are different between the two input CrossSections. |
'sine'
|
offset_type
|
WidthTypes | Callable[[float, float, float], float]
|
'sine', 'parabolic', 'linear' or Callable. type of width transition used if any widths are different between the two input CrossSections. |
'sine'
|
Source code in gdsfactory/path.py
805 806 807 808 809 810 811 812 813 814 815 816 817 818 819 820 821 822 823 824 825 826 827 828 829 830 831 832 833 834 835 836 837 838 839 840 841 842 843 844 845 846 847 | |
Boolean
boolean
boolean
boolean(
A: ComponentOrReference,
B: ComponentOrReference,
operation: Literal[
"or", "|", "not", "-", "^", "xor", "&", "and", "A-B"
],
layer: LayerSpec,
layer1: LayerSpec | None = None,
layer2: LayerSpec | None = None,
) -> Component
Performs boolean operations between 2 Component or Instance objects.
The operation parameter specifies the type of boolean operation to perform.
Supported operations include {'not', 'and', 'or', 'xor', '-', '&', '|', '^'}:
'|'is equivalent to'or''-'is equivalent to'not''&'is equivalent to'and''^'is equivalent to'xor'
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
A
|
ComponentOrReference
|
Component(/Reference) or list of Component(/References). |
required |
B
|
ComponentOrReference
|
Component(/Reference) or list of Component(/References). |
required |
operation
|
Literal['or', '|', 'not', '-', '^', 'xor', '&', 'and', 'A-B']
|
{'not', 'and', 'or', 'xor', '-', '&', '|', '^'}. |
required |
layer
|
LayerSpec
|
Specific layer to put polygon geometry on. |
required |
layer1
|
LayerSpec | None
|
Specific layer to get polygons. |
None
|
layer2
|
LayerSpec | None
|
Specific layer to get polygons. |
None
|
Component with polygon(s) of the boolean operations between
| Type | Description |
|---|---|
Component
|
the 2 input Components performed. |
Example
import gdsfactory as gf
c = gf.Component()
c1 = c << gf.components.circle(radius=10)
c2 = c << gf.components.circle(radius=9)
c2.movex(5)
c = gf.boolean(c1, c2, operation="xor")
c.plot()
Source code in gdsfactory/boolean.py
13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 | |
Decorators
cell
cell(
_func: ComponentFunc[ComponentParams],
) -> ComponentFunc[ComponentParams]
cell(
*,
set_settings: bool = True,
set_name: bool = True,
check_ports: bool = True,
check_instances: CheckInstances | None = None,
snap_ports: bool = True,
add_port_layers: bool = True,
cache: Cache[int, Any] | dict[int, Any] | None = None,
basename: str | None = None,
drop_params: list[str] | None = None,
register_factory: bool = True,
overwrite_existing: bool | None = None,
layout_cache: bool | None = None,
info: dict[str, MetaData] | None = None,
post_process: (
Iterable[Callable[[Component], None]] | None
) = None,
debug_names: bool | None = None,
tags: list[str] | None = None,
with_module_name: bool = False,
lvs_equivalent_ports: list[list[str]] | None = None,
schematic_function: Callable[ComponentParams, Schematic]
) -> Callable[
[ComponentFunc[ComponentParams]],
ComponentFunc[ComponentParams],
]
cell(
*,
set_settings: bool = True,
set_name: bool = True,
check_ports: bool = True,
check_instances: CheckInstances | None = None,
snap_ports: bool = True,
add_port_layers: bool = True,
cache: Cache[int, Any] | dict[int, Any] | None = None,
basename: str | None = None,
drop_params: list[str] | None = None,
register_factory: bool = True,
overwrite_existing: bool | None = None,
layout_cache: bool | None = None,
info: dict[str, MetaData] | None = None,
post_process: (
Iterable[Callable[[Component], None]] | None
) = None,
debug_names: bool | None = None,
tags: list[str] | None = None,
with_module_name: bool = False,
lvs_equivalent_ports: list[list[str]] | None = None,
schematic_function: None = None
) -> Callable[
[ComponentFunc[ComponentParams]],
ComponentFunc[ComponentParams],
]
cell(
_func: ComponentFunc[ComponentParams] | None = None,
/,
*,
set_settings: bool = True,
set_name: bool = True,
check_ports: bool = True,
check_instances: CheckInstances | None = None,
snap_ports: bool = True,
add_port_layers: bool = True,
cache: Cache[int, Any] | dict[int, Any] | None = None,
basename: str | None = None,
drop_params: list[str] | None = None,
register_factory: bool = True,
overwrite_existing: bool | None = None,
layout_cache: bool | None = None,
info: dict[str, MetaData] | None = None,
post_process: (
Iterable[Callable[[Component], None]] | None
) = None,
debug_names: bool | None = None,
tags: list[str] | None = None,
with_module_name: bool = False,
lvs_equivalent_ports: list[list[str]] | None = None,
ports: PortsDefinition | None = None,
schematic_function: (
Callable[ComponentParams, Schematic] | None
) = None,
) -> (
ComponentFunc[ComponentParams]
| Callable[
[ComponentFunc[ComponentParams]],
ComponentFunc[ComponentParams],
]
)
Decorator to convert a function into a Component.
Source code in gdsfactory/_cell.py
94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 | |
Typings
Anchor
Anchor = Literal[
"ce",
"cw",
"nc",
"ne",
"nw",
"sc",
"se",
"sw",
"center",
"cc",
]
ComponentSpec
ComponentSpec = (
str
| ComponentFactory
| dict[str, Any]
| DKCell
| partial[Component]
)
Layer
Layer = tuple[int, int]
LayerSpec
LayerSpec = Layer | str | int | LayerEnum
LayerSpecs
LayerSpecs = Sequence[LayerSpec]
MaterialSpec
MaterialSpec = (
str
| float
| tuple[float, float]
| Callable[..., Any]
| NDArray[float64]
)
PathType
PathType = str | Path
Step
Bases: TypedDict
Manhattan Step.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
x
|
set the absolute x coordinate of the next waypoint. |
required | |
y
|
set the absolute y coordinate of the next waypoint. |
required | |
dx
|
relative x-displacement from the current position. |
required | |
dy
|
relative y-displacement from the current position. |
required |
You can combine absolute and relative in a single step, e.g. {"x": 100, "dy": 20} sets x to 100 and shifts y by 20 from the current position.
Source code in gdsfactory/typings.py
59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 | |
MultiCrossSectionAngleSpec
MultiCrossSectionAngleSpec = Sequence[
tuple[CrossSectionSpec, tuple[int, ...]]
]
Technology
AbstractLayer
Bases: BaseModel
Generic design layer.
Attributes:
| Name | Type | Description |
|---|---|---|
sizings_xoffsets |
Sequence[int]
|
sequence of xoffset sizings to apply to this Logical or Derived layer. |
sizings_yoffsets |
Sequence[int]
|
sequence of yoffset sizings to apply to this Logical or Derived layer. |
sizings_modes |
Sequence[int]
|
sequence of sizing modes to apply to this Logical or Derived layer. |
Source code in gdsfactory/technology/layer_stack.py
22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 | |
__add__
__add__(other: AbstractLayer) -> DerivedLayer
Represents boolean OR (+) operation between two derived layers.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
other
|
AbstractLayer
|
Another Layer object to perform OR operation. |
required |
Returns:
| Type | Description |
|---|---|
DerivedLayer
|
A new DerivedLayer with the AND operation logged. |
Source code in gdsfactory/technology/layer_stack.py
68 69 70 71 72 73 74 75 76 77 | |
__and__
__and__(other: AbstractLayer) -> DerivedLayer
Represents boolean AND (&) operation between two layers.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
other
|
AbstractLayer
|
Another Layer object to perform AND operation. |
required |
Returns:
| Type | Description |
|---|---|
DerivedLayer
|
A new DerivedLayer with the AND operation logged. |
Source code in gdsfactory/technology/layer_stack.py
45 46 47 48 49 50 51 52 53 54 | |
__or__
__or__(other: AbstractLayer) -> DerivedLayer
Represents boolean OR (|) operation between two layers.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
other
|
AbstractLayer
|
Another Layer object to perform OR operation. |
required |
Returns:
| Type | Description |
|---|---|
DerivedLayer
|
A new DerivedLayer with the OR operation logged. |
Source code in gdsfactory/technology/layer_stack.py
57 58 59 60 61 62 63 64 65 66 | |
__sub__
__sub__(other: AbstractLayer) -> DerivedLayer
Represents boolean NOT (-) operation on a derived layer.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
other
|
AbstractLayer
|
Another Layer object to perform NOT operation. |
required |
Returns:
| Type | Description |
|---|---|
DerivedLayer
|
A new DerivedLayer with the NOT operation logged. |
Source code in gdsfactory/technology/layer_stack.py
92 93 94 95 96 97 98 99 100 101 | |
__xor__
__xor__(other: AbstractLayer) -> DerivedLayer
Represents boolean XOR (^) operation between two derived layers.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
other
|
AbstractLayer
|
Another Layer object to perform XOR operation. |
required |
Returns:
| Type | Description |
|---|---|
DerivedLayer
|
A new DerivedLayer with the XOR operation logged. |
Source code in gdsfactory/technology/layer_stack.py
80 81 82 83 84 85 86 87 88 89 | |
sized
sized(
xoffset: int | tuple[int, ...],
yoffset: int | tuple[int, ...] | None = None,
mode: int | tuple[int, ...] | None = None,
) -> T
Accumulates a list of sizing operations for the layer by the provided offset (in dbu).
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
xoffset
|
int | tuple
|
number of dbu units to buffer by. Can be a tuple for sequential sizing operations. |
required |
yoffset
|
int | tuple
|
number of dbu units to buffer by in the y-direction. If not specified, uses xfactor. Can be a tuple for sequential sizing operations. |
None
|
mode
|
int | tuple
|
mode of the sizing operation(s). Can be a tuple for sequential sizing operations. |
None
|
Source code in gdsfactory/technology/layer_stack.py
103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 | |
DerivedLayer
Bases: AbstractLayer
Physical "derived layer", resulting from a combination of GDS design layers. Can be used by renderers and simulators.
Overloads operators for simpler expressions.
Attributes:
| Name | Type | Description |
|---|---|---|
input_layer1 |
primary layer comprising the derived layer. Can be a GDS design layer (kf.kcell.LayerEnum , tuple[int, int]), or another derived layer. |
|
input_layer2 |
secondary layer comprising the derived layer. Can be a GDS design layer (kf.kcell.LayerEnum , tuple[int, int]), or another derived layer. |
|
operation |
Literal['and', '&', 'or', '|', 'xor', '^', 'not', '-']
|
operation to perform between layer1 and layer2. One of "and", "or", "xor", or "not" or associated symbols. |
Source code in gdsfactory/technology/layer_stack.py
227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 | |
__eq__
__eq__(other: object) -> bool
Check if two DerivedLayer instances are equal.
Source code in gdsfactory/technology/layer_stack.py
252 253 254 255 256 257 258 259 260 | |
__hash__
__hash__() -> int
Generates a hash value for a LogicalLayer instance.
This method allows LogicalLayer instances to be used in hash-based data structures such as sets and dictionaries.
Returns:
| Name | Type | Description |
|---|---|---|
int |
int
|
The hash value of the layer attribute. |
Source code in gdsfactory/technology/layer_stack.py
242 243 244 245 246 247 248 249 250 | |
__repr__
__repr__() -> str
Print text representation.
Source code in gdsfactory/technology/layer_stack.py
312 313 314 | |
get_shapes
get_shapes(component: Component) -> kf.kdb.Region
Return the shapes of the component argument corresponding to this layer.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
component
|
Component
|
Component from which to extract shapes on this layer. |
required |
Returns:
| Type | Description |
|---|---|
Region
|
kf.kdb.Region: A region of polygons on this layer. |
Source code in gdsfactory/technology/layer_stack.py
285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 | |
LayerLevel
Bases: BaseModel
Level for 3D LayerStack.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
name
|
str |
required | |
layer
|
LogicalLayer or DerivedLayer. DerivedLayers can be composed of operations consisting of multiple other GDSLayers or other DerivedLayers. |
required | |
derived_layer
|
if the layer is derived, LogicalLayer to assign to the derived layer. |
required | |
thickness
|
layer thickness in um. |
required | |
thickness_tolerance
|
layer thickness tolerance in um. |
required | |
width_tolerance
|
layer width tolerance in um. |
required | |
zmin
|
height position where material starts in um. |
required | |
zmin_tolerance
|
layer height tolerance in um. |
required | |
sidewall_angle
|
in degrees with respect to normal. |
required | |
sidewall_angle_tolerance
|
in degrees. |
required | |
width_to_z
|
if sidewall_angle, reference z-position (0 --> zmin, 1 --> zmin + thickness, 0.5 in the middle). |
required | |
bias
|
shrink/grow of the level compared to the mask |
required | |
z_to_bias
|
most generic way to specify an extrusion. Two tuples of the same length specifying the shrink/grow (float) to apply between zmin (0) and zmin + thickness (1) I.e. [[z1, z2, ..., zN], [bias1, bias2, ..., biasN]] Defaults no buffering [[0, 1], [0, 0]]. NOTE: A dict might be more expressive. |
required | |
mesh_order
|
lower mesh order (e.g. 1) will have priority over higher mesh order (e.g. 2) in the regions where materials overlap. |
required | |
material
|
used in the klayout script |
required | |
info
|
all other rendering and simulation metadata should go here. |
required |
Source code in gdsfactory/technology/layer_stack.py
322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 | |
bounds
property
bounds: tuple[float, float]
Calculates and returns the bounds of the layer level in the z-direction.
Returns:
| Name | Type | Description |
|---|---|---|
tuple |
tuple[float, float]
|
A tuple containing the minimum and maximum z-values of the layer level. |
LayerMap
Bases: LayerEnum
You will need to create a new LayerMap with your specific foundry layers.
Source code in gdsfactory/technology/layer_map.py
7 8 9 10 | |
LayerStack
Bases: BaseModel
For simulation and 3D rendering. Captures design intent of the chip layers after fabrication.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
layers
|
dict of layer_levels. |
required |
Source code in gdsfactory/technology/layer_stack.py
397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 593 594 595 596 597 598 599 600 601 602 603 604 605 606 607 608 609 610 611 612 613 614 615 616 617 618 619 620 621 622 623 624 625 626 627 628 629 630 631 632 633 634 635 636 637 638 639 640 641 642 643 644 645 646 647 648 649 650 651 652 653 654 655 656 657 658 659 | |
__getitem__
__getitem__(key: str) -> LayerLevel
Access layer stack elements.
Source code in gdsfactory/technology/layer_stack.py
509 510 511 512 513 514 515 | |
__init__
__init__(**data: Any) -> None
Add LayerLevels automatically for subclassed LayerStacks.
Source code in gdsfactory/technology/layer_stack.py
415 416 417 418 419 420 421 422 | |
filtered
filtered(layers: list[str]) -> LayerStack
Returns filtered layerstack, given layer specs.
Source code in gdsfactory/technology/layer_stack.py
639 640 641 642 643 | |
get_component_with_derived_layers
get_component_with_derived_layers(
component: Component, **kwargs: Any
) -> Component
Returns component with derived layers.
Source code in gdsfactory/technology/layer_stack.py
451 452 453 454 455 456 457 | |
get_klayout_3d_script
get_klayout_3d_script(
layer_views: LayerViews | None = None,
dbu: float | None = 0.001,
) -> str
Returns script for 2.5D view in KLayout.
You can include this information in your tech.lyt
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
layer_views
|
LayerViews | None
|
optional layer_views. |
None
|
dbu
|
float | None
|
Optional database unit. Defaults to 1nm. |
0.001
|
Source code in gdsfactory/technology/layer_stack.py
517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 593 594 595 596 597 598 599 600 601 602 603 604 605 606 607 608 609 610 611 612 613 614 615 616 617 618 619 620 621 622 623 624 625 626 627 628 629 630 631 632 633 634 635 636 637 | |
get_layer_to_info
get_layer_to_info() -> dict[BroadLayer, dict[str, Any]]
Returns layer tuple to info dict.
Source code in gdsfactory/technology/layer_stack.py
481 482 483 | |
get_layer_to_layername
get_layer_to_layername() -> dict[BroadLayer, list[str]]
Returns layer tuple to layername.
Source code in gdsfactory/technology/layer_stack.py
485 486 487 488 489 490 491 | |
get_layer_to_material
get_layer_to_material() -> dict[BroadLayer, str | None]
Returns layer tuple to material name.
Source code in gdsfactory/technology/layer_stack.py
465 466 467 468 469 470 471 | |
get_layer_to_mesh_order
get_layer_to_mesh_order() -> dict[BroadLayer, int]
Returns layer tuple to mesh order.
Source code in gdsfactory/technology/layer_stack.py
493 494 495 496 497 498 499 500 501 502 503 504 | |
get_layer_to_sidewall_angle
get_layer_to_sidewall_angle() -> dict[BroadLayer, float]
Returns layer tuple to material name.
Source code in gdsfactory/technology/layer_stack.py
473 474 475 476 477 478 479 | |
get_layer_to_thickness
get_layer_to_thickness() -> dict[BroadLayer, float]
Returns layer tuple to thickness (um).
Source code in gdsfactory/technology/layer_stack.py
439 440 441 442 443 444 445 446 447 448 449 | |
get_layer_to_zmin
get_layer_to_zmin() -> dict[BroadLayer, float]
Returns layer tuple to z min position (um).
Source code in gdsfactory/technology/layer_stack.py
459 460 461 462 463 | |
invert_zaxis
invert_zaxis() -> LayerStack
Flips the zmin values about the origin.
Source code in gdsfactory/technology/layer_stack.py
653 654 655 656 657 658 659 | |
model_copy
model_copy(
*,
update: Mapping[str, Any] | None = None,
deep: bool = False
) -> LayerStack
Returns a copy of the LayerStack.
Source code in gdsfactory/technology/layer_stack.py
409 410 411 412 413 | |
z_offset
z_offset(dz: float) -> LayerStack
Translates the z-coordinates of the layerstack.
Source code in gdsfactory/technology/layer_stack.py
645 646 647 648 649 650 651 | |
LayerView
Bases: BaseModel
KLayout layer properties.
Docstrings adapted from KLayout documentation: https://www.klayout.de/lyp_format.html
Attributes:
| Name | Type | Description |
|---|---|---|
name |
str | None
|
Layer name. |
info |
str | None
|
Extra info to include in the LayerView. |
layer |
Layer | None
|
GDSII layer. |
layer_in_name |
bool
|
Whether to display the name as 'name layer/datatype' rather than just the layer. |
width |
int | None
|
This is the line width of the frame in pixels (or empty for the default which is 1). |
line_style |
str | LineStyle | None
|
This is the number of the line style used to draw the shape boundaries. An empty string is "solid line". The values are "Ix" for one of the built-in styles where "I0" is "solid", "I1" is "dotted" etc. |
hatch_pattern |
str | HatchPattern | None
|
This is the number of the dither pattern used to fill the shapes. The values are "Ix" for one of the built-in pattern where "I0" is "solid" and "I1" is "clear". |
fill_color |
Color | None
|
Display color of the layer fill. |
frame_color |
Color | None
|
Display color of the layer frame. Accepts Pydantic Color types. See: https://docs.pydantic.dev/usage/types/#color-type for more info. |
fill_brightness |
int
|
Brightness of the fill. |
frame_brightness |
int
|
Brightness of the frame. |
animation |
int
|
This is a value indicating the animation mode. 0 is "none", 1 is "scrolling", 2 is "blinking" and 3 is "inverse blinking". (Only applies to KLayout layer properties) |
xfill |
bool
|
Whether boxes are drawn with a diagonal cross. (Only applies to KLayout layer properties) |
marked |
bool
|
Whether the entry is marked (drawn with small crosses). (Only applies to KLayout layer properties) |
transparent |
bool
|
Whether the entry is transparent. |
visible |
bool
|
Whether the entry is visible. |
valid |
bool
|
Whether the entry is valid. Invalid layers are drawn but you can't select shapes on those layers. (Only applies to KLayout layer properties) |
group_members |
dict[str, LayerView]
|
Add a list of group members to the LayerView. |
Source code in gdsfactory/technology/layer_views.py
374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 593 594 595 596 597 598 599 600 601 602 603 604 605 606 607 608 609 610 611 612 613 614 615 616 617 618 619 620 621 622 623 624 625 626 627 628 629 630 631 632 633 634 635 636 637 638 639 640 641 642 643 644 645 646 647 648 649 650 651 652 653 654 655 656 657 658 659 660 661 662 663 664 665 666 667 668 669 670 671 672 673 674 675 676 677 678 679 680 681 682 683 684 685 686 687 688 689 690 691 692 693 694 695 696 697 698 699 700 701 702 703 704 705 706 707 708 709 710 711 712 713 714 715 716 717 718 719 720 721 722 723 724 725 726 727 728 729 730 731 732 733 734 735 736 737 738 739 740 741 742 743 744 745 746 747 748 749 750 751 752 753 754 755 756 757 758 759 760 761 762 763 764 765 766 767 768 769 770 771 772 773 774 775 776 777 778 779 780 781 782 783 784 | |
__init__
__init__(
gds_layer: int | None = None,
gds_datatype: int | None = None,
color: ColorType | None = None,
brightness: int | None = None,
**data: Any
) -> None
Initialize LayerView object.
Source code in gdsfactory/technology/layer_views.py
427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 | |
__repr__
__repr__() -> str
Returns a formatted view of properties and their values.
Source code in gdsfactory/technology/layer_views.py
515 516 517 | |
__str__
__str__() -> str
Returns a formatted view of properties and their values.
Source code in gdsfactory/technology/layer_views.py
509 510 511 512 513 | |
dict
dict(
*,
include: IncEx | None = None,
exclude: IncEx | None = None,
by_alias: bool = False,
exclude_unset: bool = False,
exclude_defaults: bool = False,
exclude_none: bool = False,
simplify: bool = True
) -> dict[str, Any]
Generate a dictionary representation of the model, optionally specifying which fields to include or exclude.
Specify "simplify" to consolidate fill and frame color/brightness if they are the same.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
mode
|
The mode in which |
required | |
include
|
IncEx | None
|
A list of fields to include in the output. |
None
|
exclude
|
IncEx | None
|
A list of fields to exclude from the output. |
None
|
by_alias
|
bool
|
Whether to use the field's alias in the dictionary key if defined. |
False
|
exclude_unset
|
bool
|
Whether to exclude fields that are unset or None from the output. |
False
|
exclude_defaults
|
bool
|
Whether to exclude fields that are set to their default value from the output. |
False
|
exclude_none
|
bool
|
Whether to exclude fields that have a value of |
False
|
simplify
|
bool
|
Whether to consolidate fill and frame color/brightness if they are the same. |
True
|
Returns:
| Type | Description |
|---|---|
dict[str, Any]
|
A dictionary representation of the model. |
Source code in gdsfactory/technology/layer_views.py
458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 | |
from_xml_element
classmethod
from_xml_element(
element: Element, layer_pattern: str | Pattern[str]
) -> LayerView | None
Read properties from .lyp XML and generate LayerViews from them.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
element
|
Element
|
XML Element to iterate over. |
required |
layer_pattern
|
str | Pattern[str]
|
Regex pattern to match layers with. |
required |
Source code in gdsfactory/technology/layer_views.py
715 716 717 718 719 720 721 722 723 724 725 726 727 728 729 730 731 732 733 734 735 736 737 738 739 740 741 742 743 744 745 746 747 748 749 750 751 752 753 754 755 756 757 758 759 760 761 762 763 764 765 766 767 768 769 770 771 772 773 774 775 776 777 778 779 780 781 782 783 784 | |
to_klayout_xml
to_klayout_xml(
custom_hatch_patterns: dict[str, HatchPattern],
custom_line_styles: dict[str, LineStyle],
) -> ET.Element
Return an XML representation of the LayerView.
Source code in gdsfactory/technology/layer_views.py
644 645 646 647 648 649 650 651 652 653 654 655 656 657 658 659 660 661 662 663 664 665 | |
LayerViews
Bases: BaseModel
A container for layer properties for KLayout layer property (.lyp) files.
Attributes:
| Name | Type | Description |
|---|---|---|
layer_views |
dict[str, LayerView]
|
Dictionary of LayerViews describing how to display gds layers. |
custom_dither_patterns |
dict[str, HatchPattern]
|
Custom dither patterns. |
custom_line_styles |
dict[str, LineStyle]
|
Custom line styles. |
layers |
type[LayerEnum] | None
|
Specify a layer_map to get the layer tuple based on the name of the LayerView, rather than the 'layer' argument. |
Source code in gdsfactory/technology/layer_views.py
790 791 792 793 794 795 796 797 798 799 800 801 802 803 804 805 806 807 808 809 810 811 812 813 814 815 816 817 818 819 820 821 822 823 824 825 826 827 828 829 830 831 832 833 834 835 836 837 838 839 840 841 842 843 844 845 846 847 848 849 850 851 852 853 854 855 856 857 858 859 860 861 862 863 864 865 866 867 868 869 870 871 872 873 874 875 876 877 878 879 880 881 882 883 884 885 886 887 888 889 890 891 892 893 894 895 896 897 898 899 900 901 902 903 904 905 906 907 908 909 910 911 912 913 914 915 916 917 918 919 920 921 922 923 924 925 926 927 928 929 930 931 932 933 934 935 936 937 938 939 940 941 942 943 944 945 946 947 948 949 950 951 952 953 954 955 956 957 958 959 960 961 962 963 964 965 966 967 968 969 970 971 972 973 974 975 976 977 978 979 980 981 982 983 984 985 986 987 988 989 990 991 992 993 994 995 996 997 998 999 1000 1001 1002 1003 1004 1005 1006 1007 1008 1009 1010 1011 1012 1013 1014 1015 1016 1017 1018 1019 1020 1021 1022 1023 1024 1025 1026 1027 1028 1029 1030 1031 1032 1033 1034 1035 1036 1037 1038 1039 1040 1041 1042 1043 1044 1045 1046 1047 1048 1049 1050 1051 1052 1053 1054 1055 1056 1057 1058 1059 1060 1061 1062 1063 1064 1065 1066 1067 1068 1069 1070 1071 1072 1073 1074 1075 1076 1077 1078 1079 1080 1081 1082 1083 1084 1085 1086 1087 1088 1089 1090 1091 1092 1093 1094 1095 1096 1097 1098 1099 1100 1101 1102 1103 1104 1105 1106 1107 1108 1109 1110 1111 1112 1113 1114 1115 1116 1117 1118 1119 1120 1121 1122 1123 1124 1125 1126 1127 1128 1129 1130 1131 1132 1133 1134 1135 1136 1137 1138 1139 1140 1141 1142 1143 1144 1145 1146 1147 1148 1149 1150 1151 1152 1153 1154 1155 1156 1157 1158 1159 1160 1161 1162 1163 1164 1165 1166 1167 1168 1169 1170 1171 1172 1173 1174 1175 1176 1177 1178 1179 1180 1181 1182 1183 1184 1185 1186 1187 1188 1189 1190 1191 1192 1193 1194 1195 1196 1197 1198 1199 1200 1201 1202 1203 1204 1205 1206 1207 1208 1209 1210 1211 1212 1213 1214 1215 1216 1217 1218 1219 1220 1221 1222 1223 1224 1225 1226 1227 1228 1229 1230 1231 1232 1233 1234 1235 1236 1237 1238 1239 1240 1241 1242 1243 1244 1245 1246 1247 1248 1249 1250 1251 1252 1253 1254 1255 1256 1257 1258 1259 1260 1261 1262 1263 1264 1265 1266 1267 1268 1269 1270 1271 1272 1273 1274 1275 1276 1277 1278 1279 1280 1281 1282 1283 1284 1285 1286 1287 | |
__getitem__
__getitem__(val: str) -> LayerView
Allows accessing to the layer names like ls['gold2'].
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
val
|
str
|
Layer name to access within the LayerViews. |
required |
Returns:
| Type | Description |
|---|---|
LayerView
|
self.layers[val]: LayerView in the LayerViews. |
Source code in gdsfactory/technology/layer_views.py
961 962 963 964 965 966 967 968 969 970 971 972 973 974 975 976 | |
__init__
__init__(
filepath: PathLike | None = None,
layers: type[LayerEnum] | None = None,
**data: Any
) -> None
Initialize LayerViews object.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
filepath
|
PathLike | None
|
can be YAML or LYP. |
None
|
layers
|
type[LayerEnum] | None
|
Optional layermap. |
None
|
data
|
Any
|
Additional data to add to the LayerViews object. |
{}
|
Source code in gdsfactory/technology/layer_views.py
807 808 809 810 811 812 813 814 815 816 817 818 819 820 821 822 823 824 825 826 827 828 829 830 831 832 833 834 835 836 837 838 839 840 841 842 843 844 845 846 847 848 849 850 851 852 853 854 855 856 857 858 859 860 861 862 863 864 865 866 867 868 869 870 871 872 873 874 875 876 877 878 | |
__str__
__str__() -> str
Prints the number of LayerView objects in the LayerViews object.
Source code in gdsfactory/technology/layer_views.py
941 942 943 944 945 946 947 948 949 | |
add_layer_view
add_layer_view(
name: str,
layer_view: LayerView | None = None,
**kwargs: Any
) -> None
Adds a layer to LayerViews.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
name
|
str
|
Name of the LayerView. |
required |
layer_view
|
LayerView | None
|
LayerView to add. |
None
|
kwargs
|
Any
|
Additional arguments to pass to LayerView. |
{}
|
Source code in gdsfactory/technology/layer_views.py
880 881 882 883 884 885 886 887 888 889 890 891 892 893 894 895 896 897 898 899 900 901 902 903 904 905 906 907 908 909 910 911 912 913 914 915 916 917 918 919 920 921 922 | |
clear
clear() -> None
Deletes all layers in the LayerViews.
Source code in gdsfactory/technology/layer_views.py
1004 1005 1006 | |
from_lyp
staticmethod
from_lyp(
filepath: str | Path,
layer_pattern: str | Pattern[str] | None = None,
) -> LayerViews
Write all layer properties to a KLayout .lyp file.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
filepath
|
str | Path
|
to write the .lyp file to (appends .lyp extension if not present). |
required |
layer_pattern
|
str | Pattern[str] | None
|
Regex pattern to match layers with. Defaults to r'(\d+|*)/(\d+|*)'. |
None
|
Source code in gdsfactory/technology/layer_views.py
1095 1096 1097 1098 1099 1100 1101 1102 1103 1104 1105 1106 1107 1108 1109 1110 1111 1112 1113 1114 1115 1116 1117 1118 1119 1120 1121 1122 1123 1124 1125 1126 1127 1128 1129 1130 1131 1132 1133 1134 1135 1136 1137 1138 1139 1140 1141 1142 1143 1144 1145 1146 1147 1148 1149 1150 1151 1152 1153 1154 1155 1156 1157 1158 1159 1160 1161 1162 1163 1164 1165 1166 1167 1168 1169 1170 1171 1172 1173 1174 1175 1176 1177 1178 1179 1180 1181 1182 1183 1184 1185 1186 1187 1188 1189 1190 1191 1192 1193 1194 1195 1196 1197 1198 1199 1200 1201 1202 | |
from_yaml
staticmethod
from_yaml(layer_file: str | Path) -> LayerViews
Import layer properties from two yaml files.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
layer_file
|
str | Path
|
Name of the file to read LayerViews, CustomDitherPatterns, and CustomLineStyles from. |
required |
Source code in gdsfactory/technology/layer_views.py
1245 1246 1247 1248 1249 1250 1251 1252 1253 1254 1255 1256 1257 1258 1259 1260 1261 1262 1263 1264 1265 1266 1267 1268 1269 1270 1271 1272 1273 1274 1275 1276 1277 1278 1279 1280 1281 1282 1283 1284 1285 1286 1287 | |
get
get(name: str) -> LayerView
Returns Layer from name.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
name
|
str
|
Name of layer. |
required |
Source code in gdsfactory/technology/layer_views.py
951 952 953 954 955 956 957 958 959 | |
get_from_tuple
get_from_tuple(layer_tuple: tuple[int, int]) -> LayerView
Returns LayerView from layer tuple.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
layer_tuple
|
tuple[int, int]
|
Tuple of (gds_layer, gds_datatype). |
required |
Returns:
| Type | Description |
|---|---|
LayerView
|
LayerView. |
Source code in gdsfactory/technology/layer_views.py
978 979 980 981 982 983 984 985 986 987 988 989 990 991 992 993 994 | |
get_layer_tuples
get_layer_tuples() -> set[Layer]
Returns a tuple for each layer.
Source code in gdsfactory/technology/layer_views.py
996 997 998 999 1000 1001 1002 | |
get_layer_view_groups
get_layer_view_groups() -> dict[str, LayerView]
Return the LayerViews that contain other LayerViews.
Source code in gdsfactory/technology/layer_views.py
937 938 939 | |
get_layer_views
get_layer_views(
exclude_groups: bool = False,
) -> dict[str, LayerView]
Return all LayerViews.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
exclude_groups
|
bool
|
Whether to exclude LayerViews that contain other LayerViews. |
False
|
Source code in gdsfactory/technology/layer_views.py
924 925 926 927 928 929 930 931 932 933 934 935 | |
preview_layerset
preview_layerset(
size: float = 100.0, spacing: float = 100.0
) -> Component
Generates a Component with all the layers.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
size
|
float
|
square size in um. |
100.0
|
spacing
|
float
|
spacing between each square in um. |
100.0
|
Source code in gdsfactory/technology/layer_views.py
1008 1009 1010 1011 1012 1013 1014 1015 1016 1017 1018 1019 1020 1021 1022 1023 1024 1025 1026 1027 1028 1029 1030 1031 1032 1033 1034 1035 1036 1037 1038 1039 1040 1041 1042 1043 1044 1045 1046 1047 1048 1049 1050 1051 1052 1053 1054 1055 1056 1057 1058 | |
to_lyp
to_lyp(
filepath: str | Path, overwrite: bool = True
) -> pathlib.Path
Write all layer properties to a KLayout .lyp file.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
filepath
|
str | Path
|
to write the .lyp file to (appends .lyp extension if not present). |
required |
overwrite
|
bool
|
Whether to overwrite an existing file located at the filepath. |
True
|
Source code in gdsfactory/technology/layer_views.py
1060 1061 1062 1063 1064 1065 1066 1067 1068 1069 1070 1071 1072 1073 1074 1075 1076 1077 1078 1079 1080 1081 1082 1083 1084 1085 1086 1087 1088 1089 1090 1091 1092 1093 | |
to_yaml
to_yaml(layer_file: str | Path) -> None
Export layer properties to a YAML file.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
layer_file
|
str | Path
|
Name of the file to write LayerViews to. |
required |
Source code in gdsfactory/technology/layer_views.py
1204 1205 1206 1207 1208 1209 1210 1211 1212 1213 1214 1215 1216 1217 1218 1219 1220 1221 1222 1223 1224 1225 1226 1227 1228 1229 1230 1231 1232 1233 1234 1235 1236 1237 1238 1239 1240 1241 1242 1243 | |
LogicalLayer
Bases: AbstractLayer
GDS design layer.
Source code in gdsfactory/technology/layer_stack.py
159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 | |
__eq__
__eq__(other: object) -> bool
Check if two LogicalLayer instances are equal.
This method compares the 'layer' attribute of the two LogicalLayer instances.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
other
|
LogicalLayer
|
The other LogicalLayer instance to compare with. |
required |
Returns:
| Name | Type | Description |
|---|---|---|
bool |
bool
|
True if the 'layer' attributes are equal, False otherwise. |
Raises:
| Type | Description |
|---|---|
NotImplementedError
|
If 'other' is not an instance of LogicalLayer. |
Source code in gdsfactory/technology/layer_stack.py
164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 | |
__hash__
__hash__() -> int
Generates a hash value for a LogicalLayer instance.
This method allows LogicalLayer instances to be used in hash-based data structures such as sets and dictionaries.
Returns:
| Name | Type | Description |
|---|---|---|
int |
int
|
The hash value of the layer attribute. |
Source code in gdsfactory/technology/layer_stack.py
182 183 184 185 186 187 188 189 190 | |
__repr__
__repr__() -> str
Print text representation.
Source code in gdsfactory/technology/layer_stack.py
220 221 222 | |
get_shapes
get_shapes(component: Component) -> kf.kdb.Region
Return the shapes of the component argument corresponding to this layer.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
component
|
Component
|
Component from which to extract shapes on this layer. |
required |
Returns:
| Type | Description |
|---|---|
Region
|
kf.kdb.Region: A region of polygons on this layer. |
Source code in gdsfactory/technology/layer_stack.py
192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 | |
lyp_to_dataclass
lyp_to_dataclass(
lyp_filepath: str | Path,
overwrite: bool = True,
sort_by_name: bool = True,
map_name: str = "LayerMapFab",
output_filepath: Path | str | None = None,
) -> str
Returns python LayerMap script from a klayout layer properties file lyp.
Source code in gdsfactory/technology/layer_map.py
13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 | |
Pack
pack
pack a list of components into as few components as possible.
Adapted from PHIDL https://github.com/amccaugh/phidl/ by Adam McCaughan
pack
pack(
component_list: Sequence[ComponentSpec],
spacing: float = 10.0,
aspect_ratio: Float2 = (1.0, 1.0),
max_size: tuple[float | None, float | None] = (
None,
None,
),
sort_by_area: bool = True,
density: float = 1.1,
precision: float = 0.01,
text: TextFunction | None = None,
text_prefix: str = "",
text_mirror: bool = False,
text_rotation: int = 0,
text_offsets: tuple[Float2, ...] = ((0, 0),),
text_anchors: tuple[Anchor, ...] = ("cc",),
name_prefix: str | None = None,
rotation: int = 0,
h_mirror: bool = False,
v_mirror: bool = False,
add_ports_prefix: bool = True,
add_ports_suffix: bool = False,
csvpath: str | None = None,
) -> list[Component]
Pack a list of components into as few Components as possible.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
component_list
|
Sequence[ComponentSpec]
|
list or tuple. |
required |
spacing
|
float
|
Minimum distance between adjacent shapes. |
10.0
|
aspect_ratio
|
Float2
|
(width, height) ratio of the rectangular bin. |
(1.0, 1.0)
|
max_size
|
tuple[float | None, float | None]
|
Limits the size into which the shapes will be packed. |
(None, None)
|
sort_by_area
|
bool
|
Pre-sorts the shapes by area. |
True
|
density
|
float
|
Values closer to 1 pack tighter but require more computation. |
1.1
|
precision
|
float
|
Desired precision for rounding vertex coordinates. |
0.01
|
text
|
TextFunction | None
|
Optional function to add text labels. |
None
|
text_prefix
|
str
|
for labels. For example. 'A' will produce 'A1', 'A2', ... |
''
|
text_mirror
|
bool
|
if True mirrors text. |
False
|
text_rotation
|
int
|
Optional text rotation. |
0
|
text_offsets
|
tuple[Float2, ...]
|
relative to component size info anchor. Defaults to center. |
((0, 0),)
|
text_anchors
|
tuple[Anchor, ...]
|
relative to component (ce cw nc ne nw sc se sw center cc). |
('cc',)
|
name_prefix
|
str | None
|
for each packed component (avoids the Unnamed cells warning). Note that the suffix contains a uuid so the name will not be deterministic. |
None
|
rotation
|
int
|
optional component rotation in degrees. |
0
|
h_mirror
|
bool
|
horizontal mirror in y axis (x, 1) (1, 0). This is the most common. |
False
|
v_mirror
|
bool
|
vertical mirror using x axis (1, y) (0, y). |
False
|
add_ports_prefix
|
bool
|
adds port names with prefix. |
True
|
add_ports_suffix
|
bool
|
adds port names with suffix. |
False
|
csvpath
|
str | None
|
optional path to save the packed component list as a CSV file. |
None
|
Example
import gdsfactory as gf
from functools import partial
components = [gf.components.triangle(x=i) for i in range(1, 10)]
c = gf.pack(
components,
spacing=20.0,
max_size=(100, 100),
text=partial(gf.components.text, justify="center"),
text_prefix="R",
name_prefix="demo",
text_anchors=["nc"],
text_offsets=[(-10, 0)],
v_mirror=True,
)
c[0].plot()
Source code in gdsfactory/pack.py
97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 | |
grid
pack a list of components into a grid.
Adapted from PHIDL https://github.com/amccaugh/phidl/ by Adam McCaughan
grid
grid(
components: ComponentSpecs = ("rectangle", "triangle"),
spacing: Spacing | float = (5.0, 5.0),
shape: tuple[int, int] | None = None,
align_x: Literal[
"origin", "xmin", "xmax", "center"
] = "center",
align_y: Literal[
"origin", "ymin", "ymax", "center"
] = "center",
rotation: int = 0,
mirror: bool = False,
flex: bool = False,
) -> Component
Returns Component with a 1D or 2D grid of components.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
components
|
ComponentSpecs
|
Iterable to be placed onto a grid. (can be 1D or 2D). |
('rectangle', 'triangle')
|
spacing
|
Spacing | float
|
between adjacent elements on the grid, can be a tuple for different distances in height and width or a single float. |
(5.0, 5.0)
|
shape
|
tuple[int, int] | None
|
x, y shape of the grid (see np.reshape). If no shape and the list is 1D, if np.reshape were run with (1, -1). |
None
|
align_x
|
Literal['origin', 'xmin', 'xmax', 'center']
|
x alignment along (origin, xmin, xmax, center). |
'center'
|
align_y
|
Literal['origin', 'ymin', 'ymax', 'center']
|
y alignment along (origin, ymin, ymax, center). |
'center'
|
rotation
|
int
|
for each component in degrees. |
0
|
mirror
|
bool
|
horizontal mirror y axis (x, 1) (1, 0). most common mirror. |
False
|
flex
|
bool
|
use minimal row height and column width where possible. |
False
|
Returns:
| Type | Description |
|---|---|
Component
|
Component containing components grid. |
Example
import gdsfactory as gf
components = [gf.components.triangle(x=i) for i in range(1, 10)]
c = gf.grid(
components,
shape=(1, len(components)),
rotation=0,
mirror=False,
spacing=(100, 100),
)
c.plot()
Source code in gdsfactory/grid.py
20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 | |
grid_with_text
grid_with_text(
components: Sequence[ComponentSpec] = (
"rectangle",
"triangle",
),
text_prefix: str = "",
text_offsets: Sequence[Float2] | None = None,
text_anchors: Sequence[Anchor] | None = None,
text_mirror: bool = False,
text_rotation: int = 0,
text: ComponentSpec | None = "text_rectangular",
spacing: Spacing | float = (5.0, 5.0),
shape: tuple[int, int] | None = None,
align_x: Literal[
"origin", "xmin", "xmax", "center"
] = "center",
align_y: Literal[
"origin", "ymin", "ymax", "center"
] = "center",
rotation: int = 0,
mirror: bool = False,
labels: Sequence[str] | None = None,
flex: bool = False,
) -> Component
Returns Component with 1D or 2D grid of components with text labels.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
components
|
Sequence[ComponentSpec]
|
Iterable to be placed onto a grid. (can be 1D or 2D). |
('rectangle', 'triangle')
|
text_prefix
|
str
|
for labels. For example. 'A' will produce 'A1', 'A2', ... |
''
|
text_offsets
|
Sequence[Float2] | None
|
relative to component anchor. Defaults to center. |
None
|
text_anchors
|
Sequence[Anchor] | None
|
relative to component (ce cw nc ne nw sc se sw center cc). |
None
|
text_mirror
|
bool
|
if True mirrors text. |
False
|
text_rotation
|
int
|
Optional text rotation. |
0
|
text
|
ComponentSpec | None
|
function to add text labels. |
'text_rectangular'
|
spacing
|
Spacing | float
|
between adjacent elements on the grid, can be a tuple for different distances in height and width. |
(5.0, 5.0)
|
shape
|
tuple[int, int] | None
|
x, y shape of the grid (see np.reshape). |
None
|
align_x
|
Literal['origin', 'xmin', 'xmax', 'center']
|
x alignment along (origin, xmin, xmax, center). |
'center'
|
align_y
|
Literal['origin', 'ymin', 'ymax', 'center']
|
y alignment along (origin, ymin, ymax, center). |
'center'
|
rotation
|
int
|
for each component in degrees. |
0
|
mirror
|
bool
|
horizontal mirror y axis (x, 1) (1, 0). most common mirror. |
False
|
labels
|
Sequence[str] | None
|
list of labels for each component. |
None
|
flex
|
bool
|
use minimal row height and column width where possible. |
False
|
Example
import gdsfactory as gf
components = [gf.components.triangle(x=i) for i in range(1, 10)]
c = gf.grid_with_text(
components,
shape=(1, len(components)),
rotation=0,
mirror=False,
spacing=(100, 100),
text_offsets=((0, 100), (0, -100)),
text_anchors=("nc", "sc"),
)
c.plot()
Source code in gdsfactory/grid.py
83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 | |
grid_with_text
grid_with_text(
components: Sequence[ComponentSpec] = (
"rectangle",
"triangle",
),
text_prefix: str = "",
text_offsets: Sequence[Float2] | None = None,
text_anchors: Sequence[Anchor] | None = None,
text_mirror: bool = False,
text_rotation: int = 0,
text: ComponentSpec | None = "text_rectangular",
spacing: Spacing | float = (5.0, 5.0),
shape: tuple[int, int] | None = None,
align_x: Literal[
"origin", "xmin", "xmax", "center"
] = "center",
align_y: Literal[
"origin", "ymin", "ymax", "center"
] = "center",
rotation: int = 0,
mirror: bool = False,
labels: Sequence[str] | None = None,
flex: bool = False,
) -> Component
Returns Component with 1D or 2D grid of components with text labels.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
components
|
Sequence[ComponentSpec]
|
Iterable to be placed onto a grid. (can be 1D or 2D). |
('rectangle', 'triangle')
|
text_prefix
|
str
|
for labels. For example. 'A' will produce 'A1', 'A2', ... |
''
|
text_offsets
|
Sequence[Float2] | None
|
relative to component anchor. Defaults to center. |
None
|
text_anchors
|
Sequence[Anchor] | None
|
relative to component (ce cw nc ne nw sc se sw center cc). |
None
|
text_mirror
|
bool
|
if True mirrors text. |
False
|
text_rotation
|
int
|
Optional text rotation. |
0
|
text
|
ComponentSpec | None
|
function to add text labels. |
'text_rectangular'
|
spacing
|
Spacing | float
|
between adjacent elements on the grid, can be a tuple for different distances in height and width. |
(5.0, 5.0)
|
shape
|
tuple[int, int] | None
|
x, y shape of the grid (see np.reshape). |
None
|
align_x
|
Literal['origin', 'xmin', 'xmax', 'center']
|
x alignment along (origin, xmin, xmax, center). |
'center'
|
align_y
|
Literal['origin', 'ymin', 'ymax', 'center']
|
y alignment along (origin, ymin, ymax, center). |
'center'
|
rotation
|
int
|
for each component in degrees. |
0
|
mirror
|
bool
|
horizontal mirror y axis (x, 1) (1, 0). most common mirror. |
False
|
labels
|
Sequence[str] | None
|
list of labels for each component. |
None
|
flex
|
bool
|
use minimal row height and column width where possible. |
False
|
Example
import gdsfactory as gf
components = [gf.components.triangle(x=i) for i in range(1, 10)]
c = gf.grid_with_text(
components,
shape=(1, len(components)),
rotation=0,
mirror=False,
spacing=(100, 100),
text_offsets=((0, 100), (0, -100)),
text_anchors=("nc", "sc"),
)
c.plot()
Source code in gdsfactory/grid.py
83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 | |
Netlist
get_netlist
get_netlist(
cell: ProtoTKCell[Any],
*,
on_multi_connect: ErrorBehavior = "error",
on_dangling_port: ErrorBehavior = "warn",
instance_namer: InstanceNamer | None = None,
component_namer: ComponentNamer = function_namer,
port_matcher: PortMatcher | None = None,
serialization_max_digits: int = DEFAULT_SERIALIZATION_MAX_DIGITS
) -> dict[str, Any]
Extract netlist from a cell's port connectivity.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
cell
|
ProtoTKCell[Any]
|
The cell to extract the netlist from. |
required |
on_multi_connect
|
ErrorBehavior
|
What to do when more than two ports overlap. "ignore": silently allow, "warn": allow with warning, "error": raise. |
'error'
|
on_dangling_port
|
ErrorBehavior
|
What to do when an instance port is not connected. "ignore": silently allow, "warn": allow with warning, "error": raise. |
'warn'
|
instance_namer
|
InstanceNamer | None
|
Callable to name instances. Defaults to SmartNamer(component_namer). |
None
|
component_namer
|
ComponentNamer
|
Callable to name components. Defaults to function_namer. |
function_namer
|
port_matcher
|
PortMatcher | None
|
Callable to determine if two ports are connected. Defaults to SmartPortMatcher(). |
None
|
serialization_max_digits
|
int
|
How many float digits to preserve. Defaults to DEFAULT_SERIALIZATION_MAX_DIGITS |
DEFAULT_SERIALIZATION_MAX_DIGITS
|
Returns:
| Type | Description |
|---|---|
dict[str, Any]
|
A dictionary containing instances, placements, ports, and nets. |
Source code in gdsfactory/get_netlist.py
332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 | |