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/74fa4f8c834e2dc08c9f302689dbf05fed60c6112338e5e775caa47284e2d3bd.png
Ports: o1;o2
Minimum radius of curvature: 8.07
Length: 15.71
../_images/1e01355cda671accb05db54f18fa580c3a2e86ae272a5c69b524148da8b6e0cf.png
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/d331ba7160ecf3572ee698b7aa08c841312fd185fd1e13cac6c67f88319db389.png
Ports: o1;o2
Minimum radius of curvature: 0.13
Length: 16.62
../_images/53fb9316db55015698fe4341047ea01e1bd197e20c8711f66aa9ae9bffb77244.png
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/55e1c6cb1b6682f89144737ae316f16cd27f12fa1b25b82cc79eec3c861a209a.png
Ports: o1;o4
Minimum radius of curvature: 7.63
Length: 40.37
../_images/cea1c35aa363d93f6eb8321e34918bb48436780966b572dceb5adf1e20571cfd.png
Ports: o2;o3
Minimum radius of curvature: 7.34
Length: 40.37
../_images/9c69241d3e322b7722f2ecdc8ddfae15f634a337c8e281b7f3eff04224f7d131.png
length=10.186 min_bend_radius=11.857