Changes between Initial Version and Version 2 of Ticket #7106
- Timestamp:
- Oct 22, 2017, 8:30:47 PM (6 years ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
Ticket #7106 – Description
initial v2 5 5 Suppose the DXF file defines two blocks, block1 and block2. The block1 block contains an INSERT entity that references block2. Because block2 has not been read in when block1's contents are being translated into feature, it doesn't exist from OGR's perspective, so the INSERT is incorrectly omitted. 6 6 7 This patch defers the processing of INSERTs until they actually need to be inlined, either from the Blocks layer, or TranslateINSERTin the Entities layer.7 This patch defers the processing of INSERTs until they actually need to be inlined, either from the Blocks layer, or `TranslateINSERT` in the Entities layer. 8 8 9 This also allows for more flexibility for merging geometries. Currently blocks are merged by OGRDXFDataSource::ReadBlocksSection, but I'm imagining that, in the future, OGR could implement a flag like DXF_MERGE_COMPLEX_GEOMETRIES allowing the user to obtain DIMENSIONs, LEADERs etc as a single GeometryCollection. This would require OGR to decide whether to merge the block on-the-fly, which is easily possible with this patch.9 This also allows for more flexibility for merging geometries. Currently blocks are merged by `OGRDXFDataSource::ReadBlocksSection`, but I'm imagining that, in the future, OGR could implement a flag like DXF_MERGE_COMPLEX_GEOMETRIES allowing the user to obtain DIMENSIONs, LEADERs etc as a single GeometryCollection. This would require OGR to decide whether to merge the block on-the-fly, which is easily possible with this patch. 10 10 11 11 == Issue 2: The name of the block referred to by an INSERT inside a BLOCK is not preserved 12 12 13 This issue is alluded to #4369. Suppose DXF_INLINE_BLOCKS and DXF_MERGE_BLOCK_GEOMETRIES are both set to FALSE. Each INSERT entity is translated into a POINT with the BlockName, BlockAngle and BlockScalefields set.13 This issue is alluded to in #4369. Suppose DXF_INLINE_BLOCKS and DXF_MERGE_BLOCK_GEOMETRIES are both set to FALSE. Each INSERT entity is translated into a POINT with the `BlockName`, `BlockAngle` and `BlockScale` fields set. 14 14 15 If an INSERT occurs within a block and you query the Blocks layer, you will find a POINT entity with correct BlockAngle and BlockScale, but the BlockName field has been replaced by the name of the block on which the INSERT has been placed!15 If an INSERT entity exists within a block and you query the Blocks layer, you will find a POINT entity with correct BlockAngle and BlockScale, but the BlockName field has been replaced by the name of the block which **contains** the INSERT entity, instead of the block it refers to! 16 16 17 The patch fixes this by placing the name of the owning block on a "Block" field for all entities when DXF_INLINE_BLOCKS is FALSE, instead of confusingly reusing "BlockName". **This is an unavoidable breaking change** -- I'm not sure how that is usually handled.17 The patch fixes this by placing the name of the owning block on a "Block" field for all entities when DXF_INLINE_BLOCKS is FALSE, instead of confusingly reusing "BlockName". This change also impacts the DXF writer. **This is an unavoidable breaking change** -- I'm not sure how that is usually handled. 18 18 19 19 == Issue 3: OCS of INSERT entities is not stored when DXF_INLINE_BLOCKS is false … … 21 21 Without the OCS normal vector, there is not enough information for an application to recreate the block insertion properly. 22 22 23 This patch stores the OCS in a new "BlockOCS" field. 23 This patch stores the OCS in a new "BlockOCS" field. 24 25 The patch also changes the location of an INSERT entity with DXF_INLINE_BLOCKS set to false to be in the OCS... this is less than ideal for end users, but it is essential to preserve proper read/write round-tripping of DXF files. Alternative suggestions would be welcomed. 24 26 25 27 == Issue 4: INSERT entities are incorrectly merged into a GeometryCollection when DXF_INLINE_BLOCKS is false