Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Round corners #306

Closed
martin-gustafsson opened this issue Jul 19, 2019 · 5 comments

Comments

@martin-gustafsson
Copy link

commented Jul 19, 2019

Using "Edit/Selection/Round corners" produces unexpected results on shapes which bend in more than one direction.

Here are two paths before rounding:
KLayout rounding, before

Here they are again after rounding, both with the same parameters (72um outer radius, 50um inner radius, 100 points).
KLayout rounding, after

@klayoutmatthias

This comment has been minimized.

Copy link
Collaborator

commented Jul 21, 2019

Hi,

I'm sorry, but I can't reproduce the issue. I have prepared some layout which looks roughly like the one you pasted:

issue_306.gds.zip

But all I get are reasonable images. Here for example outer radius = 225, inner radius = 200:

image

Could you provide a layout file and give some details about KLayout version and OS?

Matthias

@martin-gustafsson

This comment has been minimized.

Copy link
Author

commented Jul 22, 2019

@klayoutmatthias

This comment has been minimized.

Copy link
Collaborator

commented Jul 22, 2019

Hi Martin,

I'm sorry, but I don't see an attachment :-(

Maybe this is because you replied by mail to this conversation thread. I think that GitHub strips attachments from mail replies. Maybe you can navigate to GitHub and drag and drop the file there. You will probably need to provide a .zip archive to make GitHub accept it. The issue link is: #306

Thanks,

Matthias

@martin-gustafsson

This comment has been minimized.

Copy link
Author

commented Jul 22, 2019

Hi Matthias,

Sure! Here is the layout as a zipped GDS file.

Best wishes
Martin

KLayout_rounding_demo.zip

@klayoutmatthias

This comment has been minimized.

Copy link
Collaborator

commented Aug 17, 2019

Thanks for the file ... I found some time to look into this issue.

Here is the analysis: The rounding function tries to guess whether the original shape already had some rounding and tries to undo this before applying the new rounding. In this case, because of the bent nature of the wire, the algorithm is fooled into thinking some rounding had been applied already. There is a numerical issue which eventually leads to this strange result.

I think the solution should be twofold: first, the algorithm needs to be a little more robust numerically and with respect to telling true rounded from fake rounded cases. Second, there needs to be an option to start with the actual polygon rather than the "unrounded" version.

Thanks for this test case,

Matthias

klayoutmatthias added a commit that referenced this issue Aug 18, 2019
Second fix for issue #306 (round function problem)
This fix adds a "amend" option to the rounded corners
dialog - disabling this option allows to skip the "undo rounding"
step in case the algorithm does not determine the rounding
properties of the input properly.

Without "amend" enabled, the rounding will always be
applied atop of any existing rounding.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
2 participants
You can’t perform that action at this time.