File tree Expand file tree Collapse file tree 2 files changed +10
-0
lines changed
Expand file tree Collapse file tree 2 files changed +10
-0
lines changed Original file line number Diff line number Diff line change @@ -252,6 +252,9 @@ def bend_circular(
252252) -> gf .Component :
253253 """Returns circular bend.
254254
255+ Cross-sections have a minimum value of allowed bend radius, which is half their total width.
256+ If the user-specified radius is smaller than this value, it is adjusted to the minimum acceptable one.
257+
255258 Args:
256259 angle: Angle of the bend in degrees.
257260 radius: Radius of the bend in μm.
@@ -261,6 +264,12 @@ def bend_circular(
261264 allow_min_radius_violation: Allow radius smaller than cross-section radius.
262265 **kwargs: Additional arguments passed to gf.c.bend_circular (e.g., angular_step).
263266 """
267+ radius_min = gf .get_cross_section (cross_section ).radius_min
268+ if radius_min is not None and radius < radius_min :
269+ radius = radius_min
270+ print (
271+ f"Bend radius needs to be >= { radius_min } for this cross-section. Setting it to the minimum acceptable value."
272+ )
264273 return gf .c .bend_circular (
265274 angle = angle ,
266275 radius = radius ,
Original file line number Diff line number Diff line change @@ -287,6 +287,7 @@ def coplanar_waveguide(
287287 ),
288288 gf .Section (width = width , layer = LAYER .WG , name = "waveguide" ),
289289 ),
290+ radius_min = (width + 2 * gap ) / 2 ,
290291 )
291292
292293
You can’t perform that action at this time.
0 commit comments