-
Notifications
You must be signed in to change notification settings - Fork 220
dxf file parsing error, about spline curve #1422
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
Comments
I do not have AutoCAD for comparison. Could you paste some reference images and describe the expected output? |
1、bo.dxf and potato.dxf you found the difference. Congratulations. Those differences are the problem. |
I tried that online viewer: https://products.groupdocs.app/viewer/total, but also others had difficulties with "R" and "potato". Anyway, if the "R" with the circular frame is correct it looks like I have fixed the problem. |
This one (https://3axis.co/dxf-viewer/dxf-viewer/) shows the "R" like KLayout now: But the potato looks strange: I guess nobody is perfect ... |
autocad is correct. Also, qcad is correct. |
Thanks for pointing me to qcad ... I tried FreeCAD, but it did not like the splines. |
Have all the problems been solved? Can you tell me what has been changed in the source code? |
Code change is this :35e42a8 The PR is linked to this ticket and will be merged soon into master. |
I tried using PR's new code and found that the program would crash. I'm already in the function spline_interpolate. Added: The assertion will take effect and an error will be reported. I opened the following three dxf files with the same problem. My programming environment is VS2019 x64. |
I am using exactly these files as unit test cases and they work in my case. They are called issue_1422a.dxf to issue_1422c.dxf. Tests pass for me on VS2017. I will take a look. VS has iterator assertions which may be useful here. Are you using debug mode? |
Please use the wip2 branch tip. The code reference was just for your information, not for reproducing the solution. wip2 branch works for me on Linux and Windows. Find the golden data for the tests here: https://github.com/KLayout/klayout/tree/wip2/testdata/dxf (issue_1422a_au.gds.gz to issue_1422c_au.gds.gz). Matthias |
Could you just tell me. For these three dxf files, which source files have the source code changed? Besides dbDXFReader.cc, are there any other files that need to be modified? I look at the 35e42a8, only dbDXFReader. Cc file is modified. But the potato.dxf problem was not solved. |
I'm sorry, but 35e42a8 are the only changes made. It should be enough to apply the changes of dbDXFReader.cc - the other modifications are only new tests to cover your case. The potato is reproduced without the sticks on MSVC2017, CentOS7 and Ubuntu 22 for me. |
I've put in an assertion and I can reproduce the array out of bounds issue. I will debug it. |
I have placed one more patch: 99df15a - this should fix the potato issue. |
Very good. I'll merge the PR then. Matthias |
I found a problem with parsing errors on dxf's spline curve. Here uploaded 3 dxf files, you can use klayout and AutoCAD for comparison. You can see that there are problems with spline curve analysis, either with more lines or less lines.
klayout version
0.28.8
dxf with spline
https://github.com/libaineu2004/myepolltest/releases/download/dxf/bo.dxf
https://github.com/libaineu2004/myepolltest/releases/download/dxf/potato.dxf
https://github.com/libaineu2004/myepolltest/releases/download/dxf/R.dxf
The text was updated successfully, but these errors were encountered: