Page 1 of 1

Re-entrant polygons/embedded polygon

Posted: Mon Mar 22, 2010 7:07 pm
by jjq
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

Posted: Mon Mar 22, 2010 8:34 pm
by andrew
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.

Thanks

Posted: Tue Mar 23, 2010 8:41 pm
by jjq
Andrew,

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