Skip to content

Commit

Permalink
allow 'vertex_index' properties
Browse files Browse the repository at this point in the history
  • Loading branch information
LiangliangNan committed Jun 16, 2021
1 parent 1d11d2f commit 3b46f08
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 8 deletions.
8 changes: 5 additions & 3 deletions easy3d/fileio/graph_io_ply.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -111,10 +111,12 @@ namespace easy3d {
}
}
else if (e.name == "edge") {
if (details::extract_named_property(e.int_list_properties, edge_vertex_indices, "vertex_indices"))
continue;
if (details::extract_named_property(e.int_list_properties, edge_vertex_indices, "vertex_indices") ||
details::extract_named_property(e.int_list_properties, edge_vertex_indices, "vertex_index"))
continue;
else {
LOG(ERROR) << "edge properties might not be parsed correctly because \'vertex_indices\' does not defined on edges";
LOG(ERROR)
<< "edge properties might not be parsed correctly because both 'vertex_indices' and 'vertex_index' not defined on edges";
return false;
}
}
Expand Down
15 changes: 10 additions & 5 deletions easy3d/fileio/surface_mesh_io_ply.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -134,18 +134,23 @@ namespace easy3d {
}
}
else if (e.name == "face") {
if (details::extract_named_property(e.int_list_properties, face_vertex_indices, "vertex_indices"))
if (details::extract_named_property(e.int_list_properties, face_vertex_indices, "vertex_indices") ||
details::extract_named_property(e.int_list_properties, face_vertex_indices, "vertex_index"))
continue;
else {
LOG(ERROR) << "\'vertex_indices\' does not defined on faces";
LOG(ERROR) << "edge properties might not be parsed correctly because both 'vertex_indices' and 'vertex_index' not defined on faces";
return false;
}
}
else if (e.name == "edge") {
if (details::extract_named_property(e.int_list_properties, edge_vertex_indices, "vertex_indices"))
if (details::extract_named_property(e.int_list_properties, edge_vertex_indices, "vertex_indices") ||
details::extract_named_property(e.int_list_properties, edge_vertex_indices, "vertex_index"))
continue;
else
LOG(ERROR) << "edge properties might not be parsed correctly because \'vertex_indices\' does not defined on edges";
else {
LOG(ERROR)
<< "edge properties might not be parsed correctly because both 'vertex_indices' and 'vertex_index' not defined on edges";
// return false; // no return because the model can still be visualized
}
}
}

Expand Down

0 comments on commit 3b46f08

Please sign in to comment.