-
Notifications
You must be signed in to change notification settings - Fork 409
Two issues with LibreCAD DXF import #439
Comments
At the moment and for a while I will not be able to take a deep look into this. But here are a few tips. If the code raises and assertion that means that you are using a Debug build not a Release build. Assertions, not Exceptions, are used in the code, to check for things that should not happen but are fixed or a workaround has been applied. I use them to keep track of weird things just in case they might raise a more serious problem down the line. You should not worry about them, they are for debugging purposes, and can be bypassed without problems. Use the Release build. I tried to load your DXF with Autodesk DWG TrueView 2020 and it shows the same result as netDxf. in the "ClosedSplineError.jpg", also does QCad; so, the problem must be with LibreCAD. In case of doubt, always try the DWG TrueView, it only lets you see the DXF but at least is also free. That application is from Autodesk and for better or worse they are the ones that establish the rules. |
Thanks for the very quick reply. Wow, you're right. It does seem to unique to LibreCAD. That's a relief. I was indeed using a debug version. But I don't have an urgent need to upgrade if there is no actual problem with the NURBs evaluator. So don't rush to fix Issue 1 on my account. Thanks again. |
There is nothing to fix in your Issue 1, it is a warning not an error, use the Release build and it will be fine. |
When you said "At the moment and for a while I will not be able to take a deep look into this." I assumed you were referring to Issue 1 since Issue 2 appears to be the fault of LiberCAD. Are you saying you are going to look further into issue 2 to see if there is some minor nuance to the LiberCAD exports that you can detect to make it load correctly? |
I was referring at that I do not have time to know what is the exact problem with the LibreCAD DXF, and why it is behaving that way. I do not even know if I can add a workaround, what it is clear is that LibreCAD is not working as it should. The assertion that was raised is related with reading a handle value that was not properly written, I doubt it is related with the spline issue but since I did not check it I cannot be 100% sure. Probably, LibreCAD wrote a table object name where the handle was expected, it is not the first time I have seen this kind of issues. |
mikau16, Thanks |
"Also, I don't honestly know better, so please educate me, why is it that if a work-around can be done in the netDXF, even just temporarily, that you cannot modify the source yourself?" |
Thank you! That makes perfect sense to me. |
Issue 1:
I had a version of NetDXF that was a few months old. I was able to read exports from LibreCAD just fine. Today I upgraded to the latest. The import crashes with a failed assertion.
Attached is the DXF file imported from LibreCAD: closedSpline1.dxf, and a screenshot of the location of the failed assertion.
LibreCAD is free, fyi, I am testing on Version: 2.2.0.
Issue 2:
The reason I was upgrading was I noticed a bug with the closed spline evaluator, and wanted to see if getting latest would fix it. I am the one who wrote the original NURBS evaluator (that is, the Spline.ToPolyline2D() method). It seems to work okay for open splines but I see some changes were made to handle closed or periodic splines, and that seems to be not behaving correctly here. Its possible this is due LibreCAD doing something unorthodox, but I don't know. I'd be willing to help try to debug, but I'd need Issue 1 resolved first. Attached is a screenshot of the discrepancy between the LibreCAD and NetDXF calculated splines.
LibreCAD_NetDxf_Issues_Docs.zip
The text was updated successfully, but these errors were encountered: