Add precondition that sizing field and remeshing vpmap must be the same

This commit is contained in:
Ivan Paden 2023-08-18 20:17:38 +02:00
parent 35153d509d
commit 040b9ab194
4 changed files with 11 additions and 2 deletions

View File

@ -223,12 +223,14 @@ public:
return boost::none;
}
virtual Point_3 split_placement(const halfedge_descriptor h, const PolygonMesh& pmesh) const
Point_3 split_placement(const halfedge_descriptor h, const PolygonMesh& pmesh) const
{
return midpoint(get(m_vpmap, target(h, pmesh)),
get(m_vpmap, source(h, pmesh)));
}
const DefaultVPMap& get_vpmap() const { return m_vpmap; }
void update_sizing_map(const vertex_descriptor v, const PolygonMesh& pmesh)
{
// calculating it as the average of two vertices on other ends

View File

@ -126,12 +126,14 @@ public:
return boost::none;
}
virtual Point_3 split_placement(const halfedge_descriptor h, const PolygonMesh& pmesh) const
Point_3 split_placement(const halfedge_descriptor h, const PolygonMesh& pmesh) const
{
return midpoint(get(m_vpmap, target(h, pmesh)),
get(m_vpmap, source(h, pmesh)));
}
const VPMap& get_vpmap() const { return m_vpmap; }
private:
FT m_sq_short;
FT m_sq_long;

View File

@ -53,6 +53,8 @@ public:
const PolygonMesh& pmesh) const = 0;
virtual Point_3 split_placement(const halfedge_descriptor h, const PolygonMesh& pmesh) const = 0;
virtual const VPMap& get_vpmap() const = 0;
};
}//end namespace CGAL

View File

@ -277,6 +277,9 @@ void isotropic_remeshing(const FaceRange& faces
}
#endif
CGAL_precondition_msg((sizing.get_vpmap()) == vpmap, "Input mesh/vertex point map is not the same as the "
"one used for sizing field. Remeshing aborted.");
#ifdef CGAL_PMP_REMESHING_VERBOSE
t.stop();
std::cout << "\rRemeshing parameters done ("<< t.time() <<" sec)" << std::endl;