gdsfactory / kfactory

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

get_route fails for waveguides close to each other #257

Closed joamatab closed 4 months ago

joamatab commented 4 months ago

    c = gf.Component("waypoints_sample")
    w = gf.components.straight()
    top = c << w
    bot = c << w
    bot.d.move((0, -2))

    p0 = top.ports["o2"]
    p1 = bot.ports["o2"]

    r = gf.routing.route_single(
        c,
        p0,
        p1,
        cross_section="xs_rc",
    )
    c.show()

will fail

it you shift one versus the other it can work bot.d.move((1,-2)) but it will create unnecessary long route

image

in gdsfactory this can be more compact image

joamatab commented 4 months ago

@damienbonneau

sebastian-goeldi commented 4 months ago

Can you check whether this fixes it?

https://github.com/gdsfactory/kfactory/pull/275

Also, I think this fixes the weirdly long routing

joamatab commented 4 months ago

not really

this is what i get image

this is how it should look like image