Login  Register

Re: DXF read gives only points, no lines 2.1.0

Posted by PCB.Wiz on Jun 20, 2016; 2:35am
URL: https://forum.librecad.org/DXF-read-gives-only-points-no-lines-2-1-0-tp5713964p5713968.html

ravas wrote
hmm, interesting, that does seem to have changed the phase a little around VERTEX & SEQEND ?
The comment L2526 says  //another vertex, but the code says v.reset();

The new code also seems to create a new DRW_Vertex{v}), even on SEQEND, which seems suss ?
The DXF I have has 2 VERTEX and 1 SEQEND for one single XY line pair, so it should add only 2 vertex when called 3 times as VERTEX.VERTEX.SEQEND

I do not know the whole flow, but I think it makes more sense to read nextentity, then do
v = new DRW_Vertex(); as the DXF is like this = order is (code)(nextentity)(possible XY)
and 0 SEQEND looks like it should be a pure exit-done (old code looks ok ?)

I wonder what this was trying to fix - was there a specific DXF parsing issue ?
The title says only  fixed a potential memory leak ?

cleaned DXF version, that still fails :
  0
POLYLINE
  8
2DLINES_1
 66
1
 40
1.000000
 41
1.000000
  0
VERTEX
 10
5.08000
 20
43.18000
  0
VERTEX
 10
5.96900
 20
44.06900
  0
SEQEND