Can't reading POLYLINE correctly

If you are having problems with dxflib, post here. Please report bugs here.

Moderator: andrew

Post Reply
Rex
Registered Member
Posts: 2
Joined: Mon Nov 03, 2008 6:19 am

Can't reading POLYLINE correctly

Post by Rex » Mon Nov 03, 2008 6:37 am

Firstly, thank you for this wonderful DXF parsing library!

I'm facing a problem when I read a POLYLINE entity. I have a file which contains a polygon mesh. It has four vertexes(1, 2, 3, 4) and three faces(face 1 contains vertexes: 1,2,3; face 2: 2, 3, 4; face 3: 1, 3, 4). As DXF specification mentioned that the three faces will also be presented as VERTEX entity and using group code 71, 72, 73, 74 to store vertext index, but when dxflib calls my addVertex function, the parameter DL_VertexData only contains the value of group code 10, 20, 30.

How can I get the group code that store vertext index?

So sorry for my poor English.

User avatar
andrew
Site Admin
Posts: 9019
Joined: Fri Mar 30, 2007 6:07 am

Post by andrew » Mon Nov 03, 2008 10:48 am

Unfortunately, polygon meshes are not supported by dxflib at this point. Note that polylines are supported but are different from polygon meshes. If addVertex is called outside the context of a polyline, the call should be ignored by the application.

Rex
Registered Member
Posts: 2
Joined: Mon Nov 03, 2008 6:19 am

Post by Rex » Tue Nov 04, 2008 3:19 am

Thank you for replying so soon!

I think that polygon meshes are not complex. Why is it not supported at this point? I'v tried to fix it, my solution follows:

I just want to get the value of group code 71, 72, 73, 74, so I modified the DL_VertexData structure to contain more four fields, and in the DL_Dxf::addVertex() function, asign toReal(values[71]),toReal(values[72]),toReal(values[73]),toReal(values[74]) to these four fields, thus I know which points make up a face in my application.

bobmcgee
Newbie Member
Posts: 4
Joined: Thu Jul 16, 2009 2:34 pm

Post by bobmcgee » Thu Jul 16, 2009 2:44 pm

What exactly is the difference between a polygon mesh and a polyface mesh? I don't see a 'polygon mesh' entity in the autodesk specifications at this link:

http://www.autodesk.com/techpubs/autocad/acad2000/dxf/

I do, however, see that a polyface mesh is just a special case of the polyline type, with the 64 bit set to 1 in the group's flags:

http://www.autodesk.com/techpubs/autoca ... dxf_06.htm

In my application it appears that these 'mesh vertices' are, in fact, being properly read in, although at the moment I'm only just drawing the vertices, not the faces.

bobmcgee
Newbie Member
Posts: 4
Joined: Thu Jul 16, 2009 2:34 pm

Post by bobmcgee » Thu Jul 16, 2009 8:02 pm

After a closer inspection I see exactly what Rex is talking about. I also want to say that it's quite a pain that the mesh functionality isn't supported by DXF LIB. I am currently also trying to figure out a good work around because I need meshes. I also would have preferred to not have to modify the dl_dxf library but there's apparently not a better solution. I am also forced into implementing a hack workaround similar to rex's solution rather than being able to create an elegant fix.

Post Reply

Return to “dxflib Troubleshooting and Problems”