Re-entrant polygons/embedded polygon

Use this forum to ask questions about how to do things in dxflib.

Moderator: andrew

Re-entrant polygons/embedded polygon

Postby jjq » Mon Mar 22, 2010 7:07 pm

Hello,

We are evaluating DXFLIB. DXF files with embedded polygons seems to show up just fine in QCAD.

However, there seems to be an issue handling such polygons when using DXFLIB.

See the attached picture. The first is in QCAD where the polygons are being treated OK, the second is using DXLIB. As you can see there is a clear difference. Is there some functionality that I am missing in DXFLIB?

Image
Image

Thanks,
-S
jjq
Registered Member
 
Posts: 2
Joined: Mon Mar 22, 2010 6:56 pm

Postby andrew » Mon Mar 22, 2010 8:34 pm

These are "solid fill" entities which contain more than one "loop". The outer polygon is one loop, each island is another loop.

To correctly interpret solid fills with islands, you need to implement addHatch (called for every solid fill), addHatchLoop (called for every loop) and addHatchEdge (called for every edge element).

To display a solid fill with multiple loops correctly, all loops of the same solid fill have to be filled alternating. I.e. the outer loop is filled, loops inside the outer loop are not filled, loops inside those loops are filled again, etc.
User avatar
andrew
Site Admin
 
Posts: 2547
Joined: Fri Mar 30, 2007 6:07 am

Thanks

Postby jjq » Tue Mar 23, 2010 8:41 pm

Andrew,

Thanks for the prompt reply. I'll take a look.
jjq
Registered Member
 
Posts: 2
Joined: Mon Mar 22, 2010 6:56 pm


Return to dxflib 'How Do I' Questions

Who is online

Users browsing this forum: Yahoo [Bot] and 1 guest