gdsfactory / kfactory

gdsfactory with a klayout backend
https://gdsfactory.github.io/kfactory/
MIT License
27 stars 10 forks source link

routing with bboxes seems to ignore the bboxes #386

Open joamatab opened 3 weeks ago

joamatab commented 3 weeks ago
import gdsfactory as gf

c = gf.Component()
columns = 2
ptop = c << gf.components.pad_array(columns=columns, port_orientation=270)
pbot = c << gf.components.pad_array(port_orientation=270, columns=columns)
ptop.dmovex(300)
ptop.dmovey(300)

obstacle = c << gf.c.rectangle(size=(300, 100), layer="M3")
obstacle.dymin = pbot.dymax - 10
obstacle.dxmin = pbot.dxmax - 10

routes = gf.routing.route_bundle_electrical(
    c,
    pbot.ports,
    ptop.ports,
    start_straight_length=100,
    separation=20,
    bboxes=[
        obstacle.bbox(),
        pbot.bbox(),
        ptop.bbox(),
    ],  # will be able avoid obstacles soon
    sort_ports=True,
)

c.show()

Image

sebastian-goeldi commented 3 weeks ago

Partially fixed by https://github.com/gdsfactory/kfactory/pull/388

At least for starting/end bboxes. It is howerver not implemented for general obstacles like this one (yet) or waypoints.

sebastian-goeldi commented 3 weeks ago

Also in this special example, there is no way to avoid that obstacle unless I am missing something. You can't just avoid it with 20um separation and still have space to route