Opened 8 years ago

Closed 8 years ago

#6459 closed enhancement (fixed)

Improve dxf driver

Reported by: perob Owned by: warmerdam
Priority: normal Milestone: 2.1.0
Component: default Version: unspecified
Severity: normal Keywords: dxf
Cc:

Description (last modified by perob)

Hi,

I have modified dxf driver for better support of drawings drawn in various object coordinate systems. Pull request is sent also.

Entities changed are: point, line, polyline, ellipse, spline and text.

Remove ocs transformations for: point, line and spline. Remove ocs transformations based on entity data: polyline, ellipse. Add anchor position for text entity.

Points, lines and splines are always in world coordinate system.

Polylines may be 2d (ocs, with or without elevation) or 3d (wcs) and this information is stored in polyline flag.

Ellipses are stored in wcs but calculations must be done in ocs. Added inverse transform to OCSTransformer class and updated ellipse handling accordingly.

Anchor position for text entities was added to style string.

Object coordinate system features of DXF format are rarely used so please comment if this feature is needed for dxf driver.

Screenshots of sample files show desired output in CAD program.

Thanks, bye

EDIT: Forgot to say that I disabled parsing of polygon/polyface meshes stored in polyline entity. It's possible to handle them. Question is in which geometry to store them? Collection of polygons?

Attachments (4)

ocs2wcs1.dxf (346.9 KB ) - added by perob 8 years ago.
ocs xy plane parallel to wcs
ocs2wcs2.dxf (350.4 KB ) - added by perob 8 years ago.
ocs xy plane NOT parallel to wcs
ocs2wcs1.png (15.8 KB ) - added by perob 8 years ago.
screenshot as drawn
ocs2wcs2.png (22.6 KB ) - added by perob 8 years ago.
screenshot as drawn

Download all attachments as: .zip

Change History (6)

by perob, 8 years ago

Attachment: ocs2wcs1.dxf added

ocs xy plane parallel to wcs

by perob, 8 years ago

Attachment: ocs2wcs2.dxf added

ocs xy plane NOT parallel to wcs

by perob, 8 years ago

Attachment: ocs2wcs1.png added

screenshot as drawn

by perob, 8 years ago

Attachment: ocs2wcs2.png added

screenshot as drawn

comment:1 by perob, 8 years ago

Description: modified (diff)

comment:2 by Even Rouault, 8 years ago

Keywords: dxf added
Milestone: 2.1.0
Resolution: fixed
Status: newclosed

trunk r33980, branches/2.1 r33981 r33982 "DXF reader: better handling of various object coordinate systems found in dxf files for point, line, polyline, spline and ellipse entities. Add anchor position to text styles. Remove polygon/polyface mesh parsing from polyline entity (patch by Pero Brbora, https://github.com/OSGeo/gdal/pull/118, #6459)"

Note: to keep test data as small as possible, I've stripped down your dxf files to just contain the ENTITIES section.

Note: See TracTickets for help on using tickets.