Path length analysis

Path length analysis#

Extract pathlength and curvature from component#

import gdsfactory as gf

import gplugins.path_length_analysis.path_length_analysis_from_gds as pl
c = gf.components.bend_circular()
path_dict, ev_path_dict = pl.extract_paths(c, plot=True, under_sampling=1)
r_and_l_dict = pl.get_min_radius_and_length_path_dict(path_dict)
for ports, (min_radius, length) in r_and_l_dict.items():
    print(f"Ports: {ports}")
    print(f"Minimum radius of curvature: {min_radius:.2f}")
    print(f"Length: {length:.2f}")
    pl.plot_curvature(path_dict[ports])
print(c.info)
../_images/ec42013052a00c1f98d3016c5d5397650061bb36231c0a9dcea948686277c6ac.png
Ports: o1;o2
Minimum radius of curvature: 9.28
Length: 15.63
../_images/f37c0d2ed054d6c00a413adcc5869aca47c1f1a96b726b2d1ba338f295b096bd.png
Info(length=15.708 dy=10.0 radius=10.0 width=0.5 route_info_type='strip' route_info_length=15.708 route_info_weight=15.708 route_info_strip_length=15.708 route_info_n_bend_90=1.0 route_info_min_bend_radius=10.0)
c = gf.components.bend_euler()
path_dict, ev_path_dict = pl.extract_paths(c, plot=True, under_sampling=1)
r_and_l_dict = pl.get_min_radius_and_length_path_dict(path_dict)
for ports, (min_radius, length) in r_and_l_dict.items():
    print(f"Ports: {ports}")
    print(f"Minimum radius of curvature: {min_radius:.2f}")
    print(f"Length: {length:.2f}")
    pl.plot_curvature(path_dict[ports])
print(c.info)
../_images/68782d14fab68bc20e385d6d0e2dd9d9f3a47d9d5568c7419e7d180bf776f4df.png
Ports: o1;o2
Minimum radius of curvature: 0.36
Length: 17.05
../_images/52877e564d4db28a83cd0826f533f65c63757bbac72306c8fb9efacc9220815c.png
Info(length=16.637 dy=10.0 min_bend_radius=7.061 radius=10.0 width=0.5 route_info_type='strip' route_info_length=16.637 route_info_weight=16.637 route_info_strip_length=16.637 route_info_n_bend_90=1.0 route_info_min_bend_radius=7.061)
c = gf.components.coupler()
path_dict, ev_path_dict = pl.extract_paths(c, plot=True, under_sampling=1)
r_and_l_dict = pl.get_min_radius_and_length_path_dict(path_dict)
for ports, (min_radius, length) in r_and_l_dict.items():
    print(f"Ports: {ports}")
    print(f"Minimum radius of curvature: {min_radius:.2f}")
    print(f"Length: {length:.2f}")
    pl.plot_curvature(path_dict[ports])
print(c.info)
../_images/a8ec6eafe0ab03ca8dea2b6624c796bfa4faaa4add7eaf4dc2c9a54233ff947b.png
Ports: o1;o4
Minimum radius of curvature: 0.05
Length: 72.96
../_images/01b86f000a563270d2835ee413cb925c26af87d0dab135526560096a901e0d60.png
Ports: o2;o3
Minimum radius of curvature: 0.05
Length: 73.50
../_images/1a2046bed17a5e68c531d978839c1c576001f80081cb4369f48ebed249a3d114.png
Info(length=10.186 min_bend_radius=11.857)