Bug fix in drawing of interior faces when the outer boundary is pinched

This commit is contained in:
Guillaume Damiand 2023-09-28 19:21:49 +02:00
parent 8a4b492f1c
commit 2891528073
1 changed files with 17 additions and 15 deletions

View File

@ -746,10 +746,17 @@ protected:
fit->info().is_process = false; fit->info().is_process = false;
} }
// (2.2) We check if the facet is external or internal // (2.2) We check if the facet is external or internal
std::queue<typename CDT::Face_handle> face_queue; std::queue<typename CDT::Face_handle> face_queue, faces_internal;
typename CDT::Face_handle face_internal = nullptr; typename CDT::Face_handle face_internal = nullptr;
if (cdt.infinite_vertex()->face()!=nullptr) if (cdt.infinite_vertex()->face()!=nullptr)
{ face_queue.push(cdt.infinite_vertex()->face()); } {
typename CDT::Face_circulator
incident_faces(cdt.infinite_vertex()), end_incident_faces(incident_faces);
do
{ face_queue.push(incident_faces); }
while(++incident_faces!=end_incident_faces);
}
// std::cout<<"# faces PUSHED "<<face_queue.size()<<std::endl;
while(!face_queue.empty()) while(!face_queue.empty())
{ {
typename CDT::Face_handle fh=face_queue.front(); typename CDT::Face_handle fh=face_queue.front();
@ -764,21 +771,16 @@ protected:
if (fh->neighbor(i)!=nullptr) if (fh->neighbor(i)!=nullptr)
{ face_queue.push(fh->neighbor(i)); } { face_queue.push(fh->neighbor(i)); }
} }
else if (face_internal==nullptr) else
{ { faces_internal.push(fh->neighbor(i)); }
face_internal = fh->neighbor(i);
}
} }
} }
} }
if ( face_internal!=nullptr ) while(!faces_internal.empty())
{ face_queue.push(face_internal); }
while(!face_queue.empty())
{ {
typename CDT::Face_handle fh = face_queue.front(); typename CDT::Face_handle fh=faces_internal.front();
face_queue.pop(); faces_internal.pop();
if(!fh->info().is_process) if(!fh->info().is_process)
{ {
fh->info().is_process = true; fh->info().is_process = true;
@ -788,7 +790,7 @@ protected:
if(!cdt.is_constrained(std::make_pair(fh, i))) if(!cdt.is_constrained(std::make_pair(fh, i)))
{ {
if (fh->neighbor(i)!=nullptr) if (fh->neighbor(i)!=nullptr)
{ face_queue.push(fh->neighbor(i)); } { faces_internal.push(fh->neighbor(i)); }
} }
} }
} }