Opened 7 years ago

Closed 7 years ago

#7038 closed defect (fixed)

DXF: Algorithm for reading SOLIDs fails on certain shapes

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

Description (last modified by Alan Thomas)

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 Alan Thomas 7 years ago.
solid-less-than-4-vertices.dxf (802 bytes ) - added by Alan Thomas 7 years ago.
OGR-DXF-solid-algorithm-fix.diff (8.0 KB ) - added by Alan Thomas 7 years ago.

Download all attachments as: .zip

Change History (10)

by Alan Thomas, 7 years ago

Attachment: solid-parallelogram.dxf added

by Alan Thomas, 7 years ago

by Alan Thomas, 7 years ago

comment:1 by Alan Thomas, 7 years ago

Description: modified (diff)

comment:2 by Alan Thomas, 7 years ago

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 by Even Rouault, 7 years ago

In 40058:

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

comment:4 by Even Rouault, 7 years ago

In 40059:

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

comment:5 by Even Rouault, 7 years ago

In 40060:

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

comment:6 by Even Rouault, 7 years ago

In 40061:

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

comment:7 by Even Rouault, 7 years ago

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.