Skip to content

HATCH entities exported with 0 boundary paths (group code 91=0) #1220

@omriattiya-il

Description

@omriattiya-il

Problem

When converting a DWG file to DXF using dwgread -O dxf, certain HATCH entities are exported with zero boundary paths (group code 91 = 0). These hatches are SOLID fill hatches that should have boundary geometry but are written without any boundary path data.

During conversion, libredwg emits repeated warnings for the affected handles:

Warning: Object handle not found 376480/0x5BEA0 in N objects of max 0x67DDB handles
Warning: Object handle not found 336670/0x5231E in N objects of max 0x67DDB handles

This suggests the hatch objects fail handle resolution during DWG parsing, resulting in incomplete entity data being written to the DXF.

Affected Entities

Handle Size (bytes) bitsize Paths in DXF associative
5BEA0 88 669 0 0
5231E 92 669 0 1

Both have identical bitsize: 669 despite being separate entities — suspiciously uniform for hatches that should contain different boundary geometry. For comparison, normal hatches in the same file have sizes ranging from 111 to 52,092 bytes.

Raw DXF Output (handle 5BEA0)

  0
HATCH
  5
5BEA0
330
2
100
AcDbEntity
  8
DP06-SD-Conc_Ent_RNF$0$S-CONCRETE-HATCH
100
AcDbHatch
 10
0.0
 20
0.0
 30
0.0
...
  2
SOLID
 70
     1
 71
     0
 91
        0

Group code 91 (number of boundary paths) = 0.

JSON Output Comparison

Bad hatch (5BEA0) — no paths key present:

{
  "entity": "HATCH",
  "handle": [0, 3, 376480],
  "size": 88,
  "bitsize": 669,
  "name": "SOLID",
  "is_solid_fill": 1,
  "is_associative": 0,
  "has_derived": 0
}

Normal hatch — has paths with boundary segments:

{
  "entity": "HATCH",
  "handle": [0, 3, 89556],
  "size": 670,
  "bitsize": 5315,
  "name": "SOLID",
  "is_solid_fill": 1,
  "paths": [{"flag": 1, "segs": [...], "boundary_handles": []}]
}

File Details

  • Total HATCHes in file: 17,588
  • HATCHes with 0 paths: 2 (handles 5BEA0, 5231E)
  • Layer: DP06-SD-Conc_Ent_RNF$0$S-CONCRETE-HATCH

Impact

Downstream tools raise errors when attempting to process these empty hatches.

I can provide the DWG file upon request.

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions