It looks like you're new here. If you want to get involved, click one of these buttons!
I used code like below.
obj = pya.Path(points, width, bgn_ext, end_ext, r)
print(obj) # (0,0;1,0;1,1;2,1) w=1 bx=1 ex=1 r=true
From the print result I get right result. But when I export it into KLayout. The end is still rectangular rather than round. Is this a bug?
Comments
I think it's not a bug.
Maybe you saved it to a GDS file.
The round end of a Path can be saved and drawn if and only if:
(1) the output format is GDS
(2) (if not zero) bgn_ext = end_ext = width/2
See the experiments below.
Oh! Thank you very much, bro. Your explanation is very clear to me.
You deserve a small red flower from my side.
Have a nice day.
@BigPanda To the perfect explanation of @sekigawa I can only add that in your original sample all the parameters are very small values. If you use
Path, the coordinates are in database units - so they are integers and as the database unit is typically very small (fractions of nanometers), a width of 1 corresponds to a very small width.Furthermore, 1 cannot be divided by two for the extensions, so you cannot create a round-ended path with a width of 1 database units.
There is some documentation about paths here: https://www.klayout.de/doc-qt5/programming/geometry_api.html#h2-266.
Matthias
Thank you. I get it. So is there a way to change unit from dbu to um by using Python Script? I mean not by multiplying like 1e3 or something. What I really want is like a global unit control.
dbu=0.001[um].This is equivalent to using the class
Layout's setter:Pointin the macro.DPath(notPath) instances by passing the integerPoints, whereDPath's constructor takes care of type-casting.In other words,
DPathneedsDPoints and knows how to construct them fromPoints.1becomes1.0 [um]==1000 [dbu]in the layout.See the grid scale of the screenshots.
Sorry, I do not understand very well, for first step, how you set
dbu = 0.001 um?Here is a PyPI version...
Thank you very much , you are so patient. Have a nice day! @sekigawa . Thank you for the same. @Matthias . Both of you are nice.