Closed meffe1984 closed 1 year ago
I will fix this in the next update. Next time upload the full DXF instead of just a piece of it, it makes my life a lot easier.
I will fix this in the next update. Next time upload the full DXF instead of just a piece of it, it makes my life a lot easier.
Thank you very much. I'm sorry for the partial dxf file but it is not mine and I prefer to not share the whole file.
I'm having difficulties loading a Dxf file that contains some splines, with the flag SplineTypeFlags.ClosedPeriodicSpline on. I've found that, during DxfReader.ReadSpline(), in this case, the code tries to remove a range of elements from two lists: controlPoints and weights. This RemoveRange fails when performed on the weights list, because it's empty. I've analyzed the dxf and in fact found a spline that adds control points (code 30) but not weights (code 41), and the dxf is read by other programs but also old versions of netDxf (v. 1.1.2.0). Reading some autodesk documentation, it seems like the weights on a spline are optional, with a default value of 1, so maybe the weights list should be filled along with the control points (with value 1) and then, eventually, overwritten if values are present.
Here is the spline