It looks like you're new here. If you want to get involved, click one of these buttons!
Matthias,
Try this: open a new layout with layer 1/0 present. The following very unremarkable code runs fine in KLayout 0.23.11. It is supposed to draw a curved path in the upper two quadrants, centered at zero.
num_pts = 1000
dt = 2 * Math::PI / num_pts # radians
r = 100.0
w = 10.0
theta = 0.step(1*Math::PI,dt).to_a # radians
include RBA
lv = Application.instance.main_window.current_view
ly = lv.active_cellview.layout
dbu = ly.dbu
cell = lv.active_cellview.cell
layer = LayerInfo.new(1,0)
# Figure out the points of the circular path
pts = theta.map { |t|
x = r * Math::cos(t)
y = r * Math::sin(t)
Point.new(x/dbu,y/dbu)
}
path = Path.new(pts,w/dbu)
cell.shapes(ly.layer(layer)).insert(path)
Then I install 0.24.3 and run that code. It has strange result -- Nothing but a sliver along y=0 shows on the screen. The backbone is there, as you can see if you drag a box to select it.
If you change 1Math::PI to 1.5Math::PI then no sliver at all shows up, but you can still drag to select it.
This is hard to describe. Just run the script and hopefully you will see.
As a sanity check, I then reinstall 0.23.11 and run it again. It runs fine. Then I reinstall 0.24.3 and run it again. Again it doesn't work.
I think the problem is in the final line. Perhaps some relevant part of the API changed in 0.24, but I cannot find what it could be. Any ideas?
Thanks,
David
Comments
Very bizarre - by changing only the num_pts parameter (on KL 0.24.3) I am able to make the curved path either show up or not show up.
Try this modified code. It is the same except for the first two lines and the .each_with_index block. That just allows us to try different num_pts and see them all on the screen at once.
Here is what I see when I run that code:
But, as you can see, if I drag a selection box around all of them, they are all present. (Selected in bold red border.)
Count them -- you will notice the num_pts that causes failure are 808, 810 and the final two, 900,1000. All the other num_pts tried here seems to draw the path just fine. I can't find a way to explain this. Also, saving as .oas, closing KL, reopening KL, and reopening the .oas file doesn't fix it.
David
Hi David,
thanks for these nice pictures!
This well prepared report would deserve an equally well-prepared response. But I think the solution is pretty trivial: it's a drawing bug I think. That happens always when "smooth" paths are present - some that vary little and each segment is quite parallel to the previous one. KLayout optimizes drawing of such segments but it does not take into account that cumulative error so it will finally optimize away the whole chain. The dependence on the number of points is an indicator of that issue.
I have received some complaints in the direction from users dealing with smooth waveguide designs. In every case, the problem shows up differently on different zoom levels. In any case, this only applies to paths. You should be able to see the desired structure after converting all to polygons (i.e. through Edit/Selection/Merge Selected Shapes).
I have fixed the drawing issue already and will release it in 0.24.4. I cannot reproduce your problem with my current development code any longer.
Thanks and best regards,
Matthias
Matthias,
I too thought it was a drawing issue. However I observed before (though I forgot to mention) that the effect described above is not dependent on view level -- you can zoom in or out all you want, but the invisible ones never show up.
However, some of the working (visible, correct) ones do get messed up when you way zoom in on them. In other words, the non-working ones never get fixed through zooming, and the working ones sometimes break (but, break in a different way -- they show up as downsampled paths).
Anyway let's not get in to that -- we'll just forget about it for now and I'll see if I can reproduce the problem with 0.24.4 when it comes out.
David
Is there a way to receive an email when you release a new version?
Hi David,
you can subscribe to the RSS feed at the main page. It was intended to mirror the newsfeed. I hope it's working.
Best regards,
Matthias
Thanks! I was already subscribed to the RSS feed on this forum, but didn't realize there was also a news section with an RSS feed.
Matthias,
You are right; the issue is resolved in 0.24.4. Thanks!
David
You're welcome :-)
Matthias