Skip to content

Commit

Permalink
spec: WIP MESH class_version = 0
Browse files Browse the repository at this point in the history
  • Loading branch information
rurban committed Sep 26, 2024
1 parent 970e290 commit 45ddbb9
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 13 deletions.
4 changes: 2 additions & 2 deletions src/dec_macros.h
Original file line number Diff line number Diff line change
Expand Up @@ -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) \
Expand Down
28 changes: 17 additions & 11 deletions src/dwg.spec
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit 45ddbb9

Please sign in to comment.