Merge branch 'delete_vertex_crash_subdivider' into 'master'

Delete vertex crash subdivider

Closes #65

See merge request OpenMesh/OpenMesh!219
This commit is contained in:
Jan Möbius
2019-04-09 16:18:47 +02:00
4 changed files with 466 additions and 7 deletions

View File

@@ -321,7 +321,7 @@ private: // topological modifiers
typename mesh_t::VertexHandle vh1(_m.to_vertex_handle(heh));
typename mesh_t::Point midP(_m.point(_m.to_vertex_handle(heh)));
midP += _m.point(_m.to_vertex_handle(opp_heh));
midP *= static_cast<typename mesh_t::Point::value_type>(0.5);
midP *= static_cast<RealType>(0.5);
// new vertex
vh = _m.new_vertex( midP );
@@ -363,7 +363,11 @@ private: // topological modifiers
_m.set_face_handle( new_heh, _m.face_handle(heh) );
_m.set_halfedge_handle( vh, new_heh);
_m.set_halfedge_handle( _m.face_handle(heh), heh );
// We cant reconnect a non existing face, so we skip this here if necessary
if ( !_m.is_boundary(heh) )
_m.set_halfedge_handle( _m.face_handle(heh), heh );
_m.set_halfedge_handle( vh1, opp_new_heh );
// Never forget this, when playing with the topology
@@ -389,7 +393,7 @@ private: // geometry helper
// boundary edge: just average vertex positions
if (_m.is_boundary(_eh) )
{
pos *= static_cast<typename MeshType::Point::value_type>(0.5);
pos *= static_cast<RealType>(0.5);
}
else // inner edge: add neighbouring Vertices to sum
{

View File

@@ -356,7 +356,11 @@ private: // topological modifiers
_m.set_face_handle( new_heh, _m.face_handle(heh) );
_m.set_halfedge_handle( vh, new_heh);
_m.set_halfedge_handle( _m.face_handle(heh), heh );
// We cant reconnect a non existing face, so we skip this here if necessary
if ( !_m.is_boundary(heh) )
_m.set_halfedge_handle( _m.face_handle(heh), heh );
_m.set_halfedge_handle( vh1, opp_new_heh );
// Never forget this, when playing with the topology
@@ -383,7 +387,7 @@ private: // geometry helper
{
pos = _m.point(a_0);
pos += _m.point(a_1);
pos *= static_cast<typename mesh_t::Point::value_type>(9.0/16.0);
pos *= static_cast<RealType>(9.0/16.0);
typename mesh_t::Point tpos;
if(_m.is_boundary(heh))
{
@@ -396,7 +400,7 @@ private: // geometry helper
tpos = _m.point(_m.to_vertex_handle(_m.next_halfedge_handle(opp_heh)));
tpos += _m.point(_m.to_vertex_handle(_m.opposite_halfedge_handle(_m.prev_halfedge_handle(opp_heh))));
}
tpos *= static_cast<typename mesh_t::Point::value_type>(-1.0/16.0);
tpos *= static_cast<RealType>(-1.0/16.0);
pos += tpos;
}
else
@@ -499,7 +503,7 @@ private: // geometry helper
}
else //at least one endpoint is [irregular and not in boundary]
{
typename mesh_t::Point::value_type normFactor = static_cast<typename mesh_t::Point::value_type>(0.0);
RealType normFactor = static_cast<RealType>(0.0);
if(valence_a_0!=6 && !_m.is_boundary(a_0))
{