Opened 7 years ago

Closed 7 years ago

Last modified 7 years ago

#7089 closed defect (fixed)

DXF: SOLID algorithm is still wrong

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

Description

In #7038 I reimplemented the algorithm for SOLIDs to use a Jarvis march.

This was actually silly, because there is no guarantee that SOLIDs will be convex. So we have gone from one incorrect algorithm to another incorrect algorithm.

The only thing I can find on the Internet is https://knowledge.autodesk.com/support/autocad/learn-explore/caas/CloudHelp/cloudhelp/2016/ENU/AutoCAD-Core/files/GUID-0998E0EE-7829-4AA4-9282-4FC703F9B1F4-htm.html, which says that the third point is "opposite the second point". Is it possible that SOLID vertices are always drawn in the order 1-2-4-3-1?

Attachments (1)

OGR-DXF-solid-algo-try2.diff (12.6 KB ) - added by Alan Thomas 7 years ago.
Patch

Download all attachments as: .zip

Change History (5)

comment:1 by Even Rouault, 7 years ago

Is it possible that SOLID vertices are always drawn in the order 1-2-4-3-1?

The drawing is pretty clear about that apparently. So it is thought as a triangle strip ( https://en.wikipedia.org/wiki/Triangle_strip )

They also mention the possibility of polygons with more than 4 nodes, but I can't see how you would encode that in a single SOLID DXF entity

by Alan Thomas, 7 years ago

Patch

comment:2 by Alan Thomas, 7 years ago

If you continue to draw more than four vertices in AutoCAD it creates a series of SOLID objects, each of which shares a common edge with its neighbours.

Here is a patch that fixes this issue (hopefully for the last time!), and also adds support for three-dimensional SOLIDs.

For some reason the new test is failing, and I can't work out why. Can you see what is wrong?

comment:3 by Even Rouault, 7 years ago

Resolution: fixed
Status: newclosed

In 40482:

DXF: fix ordering of vertices in a SOLID entity (patch by atlight, fixes #7089)

comment:4 by Even Rouault, 7 years ago

For some reason the new test is failing, and I can't work out why. Can you see what is wrong?

Yes, this is a bit confusing admitedly. f.DumpFeature() uses ExportToIsoWKT() (which outputs POLYGON Z for 3D geometries), whereas the test used ExportToWKT() which doesn't add this Z.

Note: See TracTickets for help on using tickets.