Closed JamesBremner closed 3 months ago
@asmwarrior Please provide a small, simple example of a DXF file that fails.
There are 3 test files in the dxf folder that contain splines. Two of these work for me. How about for you?
Hi, James, thanks for creating a new issue.
I see that you said:
Please open an issue for this and provide a small, simple example of a DXF file that fails. Ensure that you do NOT have SPLINE with fit AND control points.
My guess that my DXF file may belong to the "SPLINE with fit AND control points". I need to take some time to check the DXF files and the parser code to confirm this.
BTW: how hard is it to implement/support the "SPLINE with fit AND control points"?
Thanks.
( Problem was some type drawing functions tried to use their own color, resulting in drawing black line on a black background. Now all types used the default color, white. )
All spline test files now produce reasonable looking displays. This includes spline_mixed.dxf
which contains BOTH control and fit points.
Please test with release v1.0.0
Hi, in the test folder, I see the spline related files can be loaded and drawn correctly.
I have uploaded a new dxf, which can't be read by this library(an exception will happen). I'm not sure this kinds of dxf can be handled. Thanks.
Did you test with the v1.0.0 release?
When I try it here, it seems fine
Note that Drawing2,dxf contains no splines. So it probably should not be in this issue.
Note that Drawing2,dxf contains no splines. So it probably should not be in this issue.
Oh I'm sorry, I see I uploaded the wrong test dxf file.
I will create a new one when I got to the office.
OK, this is the dxf file, which can't be parsed by this library.
It will report that: throw std::runtime_error("Spline has no points");
This file can be opened in the LibreCAD, see the image shot below:
Thanks.
Cause: Your test file specifies the number of fit points to be zero. The parsing code assumes that, if there are zero fit points, then the code-value pair would be omitted. I will modify the code to check for a zero count specified, in which case it will behave as if the code-value pair had been omitted.
Thanks, I see this issue happens several years ago. I believe it is in year 2020. And in that time, I see the DXF file converted from dwg files (using some autoCAD like tool) can't loaded by this library. The only way till now is that I need to convert all the spline lines in the dwg file to polygon lines, so that the converted dxf file does not contains any spline lines.
If you can solve the problem, it will be great!
I see this issue happens several years ago. I believe it is in year 2020.
Did you report it at that time?
I see this issue happens several years ago. I believe it is in year 2020.
Did you report it at that time?
Oh, I think I haven't reported this issue before.
Now, this the latest git head, I see the file can be loaded and shown, thanks, see below:
You see the inner red line is missing, Compared with the image I posted before in LiberCAD.
It looks like there are some layer information in this DXF file, and DXF_Viewer's parser can't parse it.
See the LibreCAD screen shot.
So, you can see, the inner red lines belong to the second layer.
I think I haven't reported this issue before.
Well then, you should not expect it to be fixed without a report
there are some layer information in this DXF file
If so, then merge the layers.
I think I haven't reported this issue before.
Well then, you should not expect it to be fixed without a report
OK.
there are some layer information in this DXF file
If so, then merge the layers.
Can the parser parse the layer information?
Such as when it see the layer start token or layer end token, it mark the objects in a specified layer. Even though a DXF has many layers, the parser can still skip the layer start or end token, so those objects can still be drawn.
Did you try merging the layers so as to check if that is really the problem?
Did you try merging the layers so as to check if that is really the problem?
LiberCAD can not merge the layers, I will try other tools tomorrow.
I see the file can be loaded and shown, thanks,
Reported in #23 by @asmwarrior