[gdal-dev] Correct reading of ellipse entities (ticket #5705) when extrusion vector is (0, 0, -1)
Pero Brbora
pero.brbora at stud.unidu.hr
Sat Mar 19 18:17:33 PDT 2016
Hi all
Thanks for feedback, unfortunate :)
I already started working on ticket #5705 "[AutoCAD DXF] Incorrect
processing of Ellipses with negative extrusion" before I read Dmitry's
post, and here are my results.
First I tested ticket sample files to check the status with the
current code base and defect is still there.
After some internet searching I found that:
1. ellipse entity doesn't use OCS (based on that support for ellipse
entity came latter to AutoCAD/DXF), but this is not confirmed so
calling ApplyOCSTransformer in TranslateELLIPSE (file ogrdxflayer.cpp)
may not be needed for ellipses.
(source: theswamp.org - CAD related forum)
2. when extrusion (normal) is [0,0,-1] ellipse is reversed
(source: stackoverflow and my inspection of sample files in text
editor and QCAD)
Note: When extrusion (normal) is [0,0,1] there is also no need to call
ApplyOCSTransform, but this applies to all entities. Currently
transform is applied whenever extrusion data is present (small
optimisation).
Based on (2) at least defect reported in ticket #5705 can be resolved.
I made a quick fix against a trunk branch and since I have Github
account (unused until now) I decided to send pull request, it should
be up now.
I tested it with files from the ticket and my fix produces correct results.
And for proposal I should say that I can write code for DWG read
support for R2000 (AutoCAD 2000) version files using ogr dxf support
files as a template. Other options are possible but please let me know
if you are interested in my work for GSOC 2016.
Anyway I will keep an eye on GDAL mailing list and help you out.
Side note:
On Building on Unix wiki page
(https://trac.osgeo.org/gdal/wiki/BuildingOnUnix) there is a typo:
----
% export LD_LIBRARY_PATH=/path/to/install/prefix/lib:$PATH
----
should read:
----
% export LD_LIBRARY_PATH=/path/to/install/prefix/lib:$LD_LIBRARY_PATH
----
IMHO as everyone says.
Thanks bye
More information about the gdal-dev
mailing list