#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)
Change History (5)
comment:1 by , 7 years ago
comment:2 by , 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:4 by , 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.
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