Merge fixes

This commit is contained in:
Thomas Krijnen
2019-01-23 17:27:13 +01:00
parent 884064f213
commit 24b552a822
14 changed files with 472 additions and 450 deletions
@@ -23,10 +23,10 @@ void triangulate_helper(const cgal_shape_t& shape_const, const IfcGeom::Iterator
}
// Triangulate the shape and compute the normals
// std::map<cgal_vertex_descriptor_t, Kernel::Vector_3> vertex_normals;
// boost::associative_property_map<std::map<cgal_vertex_descriptor_t, Kernel::Vector_3>> vertex_normals_map(vertex_normals);
std::map<cgal_face_descriptor_t, Kernel::Vector_3> face_normals;
boost::associative_property_map<std::map<cgal_face_descriptor_t, Kernel::Vector_3>> face_normals_map(face_normals);
// std::map<cgal_vertex_descriptor_t, Kernel_::Vector_3> vertex_normals;
// boost::associative_property_map<std::map<cgal_vertex_descriptor_t, Kernel_::Vector_3>> vertex_normals_map(vertex_normals);
std::map<cgal_face_descriptor_t, Kernel_::Vector_3> face_normals;
boost::associative_property_map<std::map<cgal_face_descriptor_t, Kernel_::Vector_3>> face_normals_map(face_normals);
bool success = false;
try {
@@ -37,8 +37,8 @@ void triangulate_helper(const cgal_shape_t& shape_const, const IfcGeom::Iterator
}
if (!success) {
Logger::Message(Logger::LOG_ERROR, return;
"Triangulation failed");
Logger::Message(Logger::LOG_ERROR, "Triangulation failed");
return;
}
// std::cout << "Triangulated model: " << s.size_of_facets() << " facets and " << s.size_of_vertices() << " vertices" << std::endl;
@@ -50,12 +50,13 @@ void triangulate_helper(const cgal_shape_t& shape_const, const IfcGeom::Iterator
// CGAL::Polygon_mesh_processing::compute_normals(s, vertex_normals_map, face_normals_map);
CGAL::Polygon_mesh_processing::compute_face_normals(s, face_normals_map);
int num_faces = 0, num_vertices = 0;
for (auto &face: faces(s)) {
if (!face->is_triangle()) {
std::cout << "Warning: non-triangular face!" << std::endl;
continue;
}
CGAL::Polyhedron_3<Kernel>::Halfedge_around_facet_const_circulator current_halfedge = face->facet_begin();
CGAL::Polyhedron_3<Kernel_>::Halfedge_around_facet_const_circulator current_halfedge = face->facet_begin();
do {
t->addVertex(surface_style_id,
CGAL::to_double(current_halfedge->vertex()->point().cartesian(0)),