Re-entrant polygons/embedded polygon

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

Moderator: andrew

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

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

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

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.

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

Thanks

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

Andrew,

Thanks for the prompt reply. I'll take a look.


Return to “dxflib 'How Do I' Questions”

Who is online

Users browsing this forum: No registered users and 1 guest