The actual situation with parsing of POLYLINE and VERTEX entities in preR13 is this:
* In preR13 is one entity for all POLYLINE and VERTEX types. This means, that the DWG file contains a flag for the (un)presence of variables in the entity and an optional flag (default without this flag is POLYLINE_2D, VERTEX_2D) which means which entity type is present (3D, MESH, PFACE)
* We have naive parsing (polyline - https://github.com/LibreDWG/libredwg/blob/master/src/decode.c#L6614, vertex - https://github.com/LibreDWG/libredwg/blob/master/src/decode.c#L6630) based on entity variables which is not valid for detection.
* There are issues like the entity is presented as POLYLINE_3D, but it's POLYLINE_MESH. Same with VERTEX.

I created [PR](https://github.com/LibreDWG/libredwg/pull/711) for a fix of the polyline, but the issue is with the naivety of parsing.

What about this?
Possibilities:
* Add better detection in the actual block - this means adding parsing of entity flag, which is after elevation, handle, and other common entity things, and will create detection based on this flag.
* Add code for common parsing of preR13 POLYLINE and VERTEX entities - different that POLYLINE_3D (and others) in dwg.spec. And we do some convert to concrete entities.

Example of failing POLYLINE MESH:
[PFACE.DXF.gz](https://github.com/LibreDWG/libredwg/files/11341290/PFACE.DXF.gz)
[PFACE.DWG.gz](https://github.com/LibreDWG/libredwg/files/11341291/PFACE.DWG.gz)

There are other failing situations.

Wrong POLYLINE and VERTEX parsing in preR13
This is a GitHub Issue
repo:libredwg
owner:LibreDWG
Title : Wrong POLYLINE and VERTEX parsing in preR13
Issue date:

--- start body ---
The actual situation with parsing of POLYLINE and VERTEX entities in preR13 is this:
* In preR13 is one entity for all POLYLINE and VERTEX types. This means, that the DWG file contains a flag for the (un)presence of variables in the entity and an optional flag (default without this flag is POLYLINE_2D, VERTEX_2D) which means which entity type is present (3D, MESH, PFACE)
* We have naive parsing (polyline - https://github.com/LibreDWG/libredwg/blob/master/src/decode.c#L6614, vertex - https://github.com/LibreDWG/libredwg/blob/master/src/decode.c#L6630) based on entity variables which is not valid for detection.
* There are issues like the entity is presented as POLYLINE_3D, but it's POLYLINE_MESH. Same with VERTEX.

I created [PR](https://github.com/LibreDWG/libredwg/pull/711) for a fix of the polyline, but the issue is with the naivety of parsing.

What about this?
Possibilities:
* Add better detection in the actual block - this means adding parsing of entity flag, which is after elevation, handle, and other common entity things, and will create detection based on this flag.
* Add code for common parsing of preR13 POLYLINE and VERTEX entities - different that POLYLINE_3D (and others) in dwg.spec. And we do some convert to concrete entities.

Example of failing POLYLINE MESH:
[PFACE.DXF.gz](https://github.com/LibreDWG/libredwg/files/11341290/PFACE.DXF.gz)
[PFACE.DWG.gz](https://github.com/LibreDWG/libredwg/files/11341291/PFACE.DWG.gz)

There are other failing situations.

--- end body ---
