Opened 6 weeks ago

Closed 6 weeks ago

#7038 closed defect (fixed)

DXF: Algorithm for reading SOLIDs fails on certain shapes

Reported by: atlight Owned by: warmerdam
Priority: normal Milestone:
Component: OGR_SF Version: svn-trunk
Severity: normal Keywords: dxf
Cc:

Description (last modified by atlight)

The algorithm for translating SOLID entities fails on certain shapes. On the attached parallelogram, it creates invalid self-intersecting POLYGONs. On other SOLIDs with one or two distinct points, it returns empty POLYGONs.

In the attached patch, I have reimplemented the algorithm using a Jarvis march. The patch also fixes an unrelated crash that I was hitting in PrepareLineStyle.

Attachments (3)

solid-parallelogram.dxf (202 bytes) - added by atlight 6 weeks ago.
solid-less-than-4-vertices.dxf (802 bytes) - added by atlight 6 weeks ago.
OGR-DXF-solid-algorithm-fix.diff (8.0 KB) - added by atlight 6 weeks ago.

Download all attachments as: .zip

Change History (10)

Changed 6 weeks ago by atlight

Attachment: solid-parallelogram.dxf added

Changed 6 weeks ago by atlight

Changed 6 weeks ago by atlight

comment:1 Changed 6 weeks ago by atlight

Description: modified (diff)

comment:2 Changed 6 weeks ago by atlight

You might also want to edit drv_dxf.html to mention that SOLIDs may be imported as POINTs, LINESTRINGs or POLYGONs depending on the number of distinct points.

comment:3 Changed 6 weeks ago by Even Rouault

In 40058:

DXF: fix potential null pointer dereference in PrepareLineStyle? (patch by atlight, relates to refs #7038)

comment:4 Changed 6 weeks ago by Even Rouault

In 40059:

DXF: fix potential null pointer dereference in PrepareLineStyle? (patch by atlight, relates to refs #7038)

comment:5 Changed 6 weeks ago by Even Rouault

In 40060:

DXF: actually fix potential null pointer dereference in PrepareLineStyle? (patch by atlight, relates to refs #7038)

comment:6 Changed 6 weeks ago by Even Rouault

In 40061:

DXF: actually fix potential null pointer dereference in PrepareLineStyle? (patch by atlight, relates to refs #7038)

comment:7 Changed 6 weeks ago by Even Rouault

Resolution: fixed
Status: newclosed

In 40062:

DXF: fix algorithm to reorder correctly vertices for SOLID to avoid self-crossing polygons (patch by athlight, with fixes/adjustments/tests by myself, fixes #7038)

Note: See TracTickets for help on using tickets.