From 45ddbb907afa0ff8c71ab0e9f63e5a225c409221 Mon Sep 17 00:00:00 2001 From: Reini Urban Date: Wed, 25 Sep 2024 23:02:05 +0200 Subject: [PATCH] spec: WIP MESH class_version = 0 GH #1019 --- src/dec_macros.h | 4 ++-- src/dwg.spec | 28 +++++++++++++++++----------- 2 files changed, 19 insertions(+), 13 deletions(-) diff --git a/src/dec_macros.h b/src/dec_macros.h index 59679f55e..303e41bb6 100644 --- a/src/dec_macros.h +++ b/src/dec_macros.h @@ -1241,8 +1241,8 @@ } \ } -#define FIELD_VECTOR(name, type, size, dxf) \ - FIELD_VECTOR_N (name, type, _obj->size, dxf) +#define FIELD_VECTOR(name, type, numfield, dxf) \ + FIELD_VECTOR_N (name, type, _obj->numfield, dxf) #define SUB_FIELD_VECTOR_TYPESIZE(o, name, size, typesize, dxf) \ if (_obj->o.size > 0) \ diff --git a/src/dwg.spec b/src/dwg.spec index e8d207892..37329f775 100644 --- a/src/dwg.spec +++ b/src/dwg.spec @@ -8747,20 +8747,26 @@ DWG_ENTITY_END DWG_ENTITY (MESH) SUBCLASS (AcDbSubDMesh) FIELD_BL (class_version, 71); // 0 or 2 - if (FIELD_VALUE(class_version) >= 2) { - FIELD_CAST (is_watertight, B, BL, 71); - } - else { + VALUEOUTOFBOUNDS (class_version, 5) + if (FIELD_VALUE(class_version) < 2) { // FIXME GH #1019 - // FIELD_CAST (is_watertight, BS, BL, 71); + //FIELD_CAST (num_subdiv_vertex, BS, BL, 91); + //FIELD_3DPOINT_VECTOR (subdiv_vertex, num_subdiv_vertex, 10); + FIELD_CAST (num_vertex, BS, BL, 92); DEBUG_HERE_OBJ + FIELD_3DPOINT_VECTOR (vertex, num_vertex, 10); + FIELD_CAST (num_faces, BS, BL, 93); + FIELD_VECTOR (faces, BL, num_faces, 90); + } + else { + FIELD_CAST (is_watertight, B, BL, 71); + FIELD_BL (num_subdiv_vertex, 91); // subdivision_levels 0 + FIELD_3DPOINT_VECTOR (subdiv_vertex, num_subdiv_vertex, 10); + FIELD_BL (num_vertex, 92); //14 @14 + FIELD_3DPOINT_VECTOR (vertex, num_vertex, 10); + FIELD_BL (num_faces, 93); // 30 + FIELD_VECTOR (faces, BL, num_faces, 90); } - FIELD_BL (num_subdiv_vertex, 91); // subdivision_levels 0 - FIELD_3DPOINT_VECTOR (subdiv_vertex, num_subdiv_vertex, 10); - FIELD_BL (num_vertex, 92); //14 @14 - FIELD_3DPOINT_VECTOR (vertex, num_vertex, 10); - FIELD_BL (num_faces, 93); // 30 - FIELD_VECTOR (faces, BL, num_faces, 90); FIELD_BL (num_edges, 94); // 19 REPEAT (num_edges, edges, Dwg_MESH_edge)