Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix bend_direction ports #2577

Merged
merged 1 commit into from Mar 3, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
9 changes: 5 additions & 4 deletions gdsfactory/components/bend_euler.py
Expand Up @@ -80,16 +80,17 @@
radius=radius, angle=angle, p=p, use_eff=with_arc_floorplan, npoints=npoints
)
ref = c << p.extrude(x)

if direction == "cw":
ref.mirror(p1=[0, 0], p2=[1, 0])

Check warning on line 85 in gdsfactory/components/bend_euler.py

View check run for this annotation

Codecov / codecov/patch

gdsfactory/components/bend_euler.py#L85

Added line #L85 was not covered by tests

c.add_ports(ref.ports)
c.info["length"] = float(np.round(p.length(), 3))
c.info["dy"] = float(np.round(abs(float(p.points[0][0] - p.points[-1][0])), 3))
c.info["radius_min"] = float(np.round(p.info["Rmin"], 3))
c.info["radius"] = radius
c.info["width"] = x.width

if direction == "cw":
ref.mirror(p1=[0, 0], p2=[1, 0])

x.validate_radius(radius)

top = None if int(angle) in {180, -180, -90} else 0
Expand Down Expand Up @@ -245,5 +246,5 @@


if __name__ == "__main__":
c = bend_euler()
c = bend_euler(direction="cw")
c.show(show_ports=True)