SiEPIC-Tools
SiEPIC-Tools copied to clipboard
Automatic SBend
Automatically detect when an SBend is needed in the Waveguide.
For this, should it insert an SBend PCell on site (ask the user?) or generate an SBend curve as part of the waveguide?
I think either is okay. It can be implemented in a similar manner to compound waveguides in which a taper cell is automatically instantiated https://github.com/SiEPIC/SiEPIC_EBeam_PDK/blob/a45f05eab1f27c842352d5f0ab44987876b52a99/klayout_dot_config/tech/EBeam/WAVEGUIDES.xml#L232
What do you think?
SBends PCells are pretty generic provided the PDK has a Cell for it, so it should be possible to insert the cell as the compound does without the need to specifying it in the waveguides.xml.
But I think it might be easier to just use the geometry.bezier.parallel function to add the bend in place as a list of points to append to the ones that define the wg polygon.
I guess there still needs to be a minimum SBend radius to be calculated from the original bending radius?
-
~~With the changes I made, because I'm modifying layout_waveguide2(), opening an older file would insert SBends wherever they are found, as long as they were created after #118 . This is probably an unwanted behavior, so to avoid it I could include a 'insert sbend' parameter in the waveguide PCell, and check whether that parameter exists or not before inserting the SBend. What do you think? This of course affects only sections that had errors on the bends (that couldn't fit normal bends) but could fit an SBend.~~ This was included in merged version of #179
-
The use of the 'optimal' sBend methods also makes the process very slow, especially when the debugger is open.
Hey @lukasc-ubc I think we can close this issue, addressed in #179. However, the current version of the automatic SBends uses the bezier_parallel function that is pretty slow. So maybe an uodate on either to make it more efficeint will help its usage be more smooth.
Waveguide definitions need only to include the follwoing parameter to allow for automatic sbends:
<sbends>y</sbends>
@jevillegasd I really like the automated SBends.
In terms of performance, I added some lrcache functions late last year. Can you check if that improved the performance?
For verification, indeed we need to remove the min-radius error for cases where the sbend is instantiated.