Paths
I want to apply a taper or attach bridges along an entire path. Can I do this without having to worry about each individual segment in the path?
You can use the simplify!
function to combine some range of segments into a single compound segment with a single style.
A caveat: Decorated styles should not become part of compound styles, for now. Avoid this by decorating / attaching references at the end.
GDS output
I can't save my GDS file.
Try deleting any file that happens to be at the target path. A corrupted file at the target path may prevent saving.
When I refresh KLayout after saving changes to a file, everything disappears. Where did it go?
The most likely answer is that the name of the top-level cell changed. To show the new geometry, right click on the cell name in the upper left panel and choose "Show As New Top". To avoid this in the future, make sure your top-level cell has a fixed name, rather than something generated by uniquename
. For example, if you are saving the result of a flatten
operation, you can use the name
keyword argument in flatten
.
When I look at my final GDS file, there are ~1nm gaps between edges that should coincide. Why is this happening, and can it be avoided?
This can happen for at least two reasons, both of which are related to the use of integer coordinates in a database unit (typically 1nm) by the GDSII format.
Gaps between elements in the same
Cell
can occur if you have two line segments that are meant to be collinear but have different endpoints. The four endpoints will be rounded to four points on the integer grid, and these four points will not necessarily be collinear. One solution here is to insert a point in either line segment where any endpoint of the other falls. This is how an open CPW termination created byPaths.terminate!
is drawn (when not using rounding), instead of just placing a four-point rectangle at the end of the CPW.Gaps between elements in different
Cell
s can occur if you're usingCellReference
s (corresponding to SREF in the GDSII format described here), since coordinates within each cell as well as the origins of cell references are rounded to integers on saving. This occurs particularly often when rotating references by angles other than multiples of 90 degrees. One solution is toflatten
cells before saving, since DeviceLayout's internal representation ofCell
s uses 64-bit floating point precision.