Merge pull request #5254 from janetournois/Tet_remeshing-fix_split_on_surfaces-GF

Tetrahedral remeshing - fix edge split step
This commit is contained in:
Laurent Rineau 2020-12-16 17:47:56 +01:00
commit 5ebf01ede1
3 changed files with 30 additions and 1 deletions

View File

@ -53,7 +53,21 @@ typename C3t3::Vertex_handle split_edge(const typename C3t3::Edge& e,
(point(v1->point()), point(v2->point()));
//backup subdomain info of incident cells before making changes
short dimension = (std::max)((std::max)(1, c3t3.in_dimension(v1)), c3t3.in_dimension(v2));
short dimension = 0;
if(c3t3.is_in_complex(e))
dimension = 1;
else
{
const std::size_t nb_patches = nb_incident_surface_patches(e, c3t3);
if(nb_patches == 1)
dimension = 2;
else if(nb_patches == 0)
dimension = 3;
else
CGAL_assertion(false);//e should be in complex
}
CGAL_assertion(dimension > 0);
boost::unordered_map<Facet, Subdomain_index> cells_info;
boost::unordered_map<Facet, std::pair<Vertex_handle, Surface_patch_index> > facets_info;

View File

@ -617,6 +617,9 @@ public:
ossi << "statistics_" << it_nb << ".txt";
Tetrahedral_remeshing::internal::compute_statistics(
tr(), m_cell_selector, ossi.str().c_str());
#endif
#ifdef CGAL_TETRAHEDRAL_REMESHING_DEBUG
CGAL::Tetrahedral_remeshing::debug::check_surface_patch_indices(m_c3t3);
#endif
}

View File

@ -1173,6 +1173,18 @@ void dump_polylines(const CellRange& cells, const char* filename)
ofs.close();
}
template<typename C3t3>
void check_surface_patch_indices(const C3t3& c3t3)
{
typedef typename C3t3::Vertex_handle Vertex_handle;
for (Vertex_handle v : c3t3.triangulation().finite_vertex_handles())
{
if (v->in_dimension() != 2)
continue;
CGAL_assertion(surface_patch_index(v, c3t3) != typename C3t3::Surface_patch_index());
}
}
template<typename Tr>
bool are_cell_orientations_valid(const Tr& tr)
{