Opened 10 years ago

Closed 6 years ago

Last modified 6 years ago

#5592 closed defect (fixed)

Reading DXF with AcDbBlockReference entity is offsetting points coordinates

Reported by: ngarel Owned by: warmerdam
Priority: normal Milestone:
Component: default Version: svn-trunk
Severity: normal Keywords: DXF
Cc: ngarel@…

Description

In the file attach, all the coordinates are offset from the first point of the string. This also happens in Quantum GIS, but not DWG true view.

For instance, if the first point in a string is at X = 20633.0213, the location of the point would be at 41266.0426 (20633.0213 + 20633.0213). If the second point is at X = 21068.8577, the location of the point would be at 41701.879 (21068.8577 + 20633.0213). And so on.

The problem is happening in OGRDWGLayer::TranslateINSERT( OdDbEntityPtr poEntity ) where a GeometryInsertTransformer is created and transofrmation is applied.

I do not understand the reason for this transformation.

Attachments (1)

test.DXF (3.9 KB ) - added by ngarel 10 years ago.
DXF issue

Download all attachments as: .zip

Change History (7)

by ngarel, 10 years ago

Attachment: test.DXF added

DXF issue

comment:1 by Even Rouault, 9 years ago

Milestone: 2.0

Removing obsolete milestone

comment:2 by Alan Thomas, 6 years ago

Opening the file in AutoCAD, I see two yellow rectangles, one inside the other (they are actually both INSERTs). According to the Properties pane, the inner rectangle is inserted at WCS (20661.4165, 10945.8265, 1018.3012) while the outer rectangle is inserted at WCS (20633.0213, 10964.5315, 1018.3012). They are about 400 units wide and 250 units tall.

In OGR, the features are indeed offset. This is because OGR ignores the origin (10/20/30) specified on the BLOCK entity in the DXF file. It seems that all the geometries should be offset by this amount when they are being read in by ogrdxf_blockmap.cpp.

I also see lots of unnecessary POINT features coming in because we don't honor the ATTDEF group code 70. If the LSB is set in this bit field, we should skip the ATTDEF: https://www.autodesk.com/techpubs/autocad/acadr14/dxf/attdef_al_u05_c.htm

comment:3 by Alan Thomas, 6 years ago

In 40712:

DXF: Correct color for ByBlock text features; respect hidden objects (refs #5592, refs #7099, refs #7121)

comment:4 by Alan Thomas, 6 years ago

In 40717:

DXF: Don't require subclasses to be present to correctly detect ATTDEFs (refs #5592)

comment:5 by Alan Thomas, 6 years ago

Resolution: fixed
Status: newclosed

In 40826:

DXF: Honor block base points (fixes #5592)

comment:6 by Alan Thomas, 6 years ago

In 41231:

DXF: Also transform original coordinates on INSERT entity inside a block with a base point (refs #5592)

Note: See TracTickets for help on using tickets.