Bug report #21330

Missing hatch, wrong text alignment and line width from DWG import

Added by Antoine Lafranchis almost 6 years ago. Updated almost 6 years ago.

Status:Closed
Priority:Normal
Assignee:Jürgen Fischer
Category:DWG/DXF import
Affected QGIS version:3.5(master) Regression?:No
Operating System: Easy fix?:No
Pull Request or Patch supplied:No Resolution:
Crashes QGIS or corrupts data:No Copied to github as #:29148

Description

When I imported a DWG in Qgis, I noticed the following problems:
- One hatch is missing (exists in attribute table but without geometry)
- The texts are wrongly aligned (centered in Autocad, top left aligned in Qgis)
- The line width (defined in the layer in Autocad) doesn't appear in Qgis
Also the hatch pattern and hatch opacity aren't converted but these are minor issues.

hatches_text.dwg - Extract of DWG drawing (53.2 KB) Antoine Lafranchis, 2019-02-20 09:59 PM

hatches_text_autocad_screenshot.png - Screenshot in Autocad (63.4 KB) Antoine Lafranchis, 2019-02-20 09:59 PM

hatches_text.gpkg - Geopackage created by Qgis from the above DWG (276 KB) Antoine Lafranchis, 2019-02-20 09:59 PM

hatches_text_qgis_screenshot.png - Screenshot in Qgis with the problems (46.7 KB) Antoine Lafranchis, 2019-02-20 09:59 PM

qgis_dwg_import_settings.png - Screenshot of DWG import settings (22.8 KB) Antoine Lafranchis, 2019-02-20 09:59 PM

Associated revisions

Revision 92e7faab
Added by Jürgen Fischer almost 6 years ago

dwg/dxf import: fix angle and alignment handing of (m)texts

Revision b8c727f1
Added by Jürgen Fischer almost 6 years ago

dwg import: force polyline and hatch/ring continuity

Revision 6bf2d9d4
Added by Jürgen Fischer almost 6 years ago

dwg import: implement suggestion from #21330

History

#1 Updated by Jürgen Fischer almost 6 years ago

Antoine Lafranchis wrote:

When I imported a DWG in Qgis, I noticed the following problems:
- One hatch is missing (exists in attribute table but without geometry)
- The texts are wrongly aligned (centered in Autocad, top left aligned in Qgis)

was already fixed.

- The line width (defined in the layer in Autocad) doesn't appear in Qgis

That's a more involved problem. polylines (can) have width in map units - but also have a linewidth in render units, which might even be inherited from the layer.

So we have two possibilities for units, but those currently cannot be data defined. In your case the polylines don't have a explicit polyline width. Therefore the width attribute is 0. linewidth is set to 0.5, but currently not used for polylines as the line symbol is set to use width with unit hardwired to map units. The latter wouldn't make sense for linewidth.

All I can offer now is the option change such polyline layers manually - which also only would work, if you don't have mixed cases.

#2 Updated by Antoine Lafranchis almost 6 years ago

  • Status changed from Open to Closed

I installed yesterday's build and the missing hatch and misaligned text issues are indeed fixed! Thanks!

For the mixed width/linewidth i found a solution: i add two Simple Line symbols, one with map units and the other with pixels. For the first one i add data-defined 'enable layer' property with expression "width" > 0 and for the second one 'enable layer' is set to "width" = 0.

#3 Updated by Jürgen Fischer almost 6 years ago

Antoine Lafranchis wrote:

For the mixed width/linewidth i found a solution: i add two Simple Line symbols, one with map units and the other with pixels. For the first one i add data-defined 'enable layer' property with expression "width" > 0 and for the second one 'enable layer' is set to "width" = 0.

also implemented. transparency should also be in places - although it's a property of the color, so inheritance of only color or transparency might not work.

#4 Updated by Antoine Lafranchis almost 6 years ago

Thanks for fixing this.
It looks like there is still an issue with transparency applied in lines that should be opaque, but the problem is not in the symbology (it matches the rgba color value in the attribute table). I will create new clean DWG file and if the issue is confirmed I will open another report.

Also available in: Atom PDF