Avoid a geometric test

This commit is contained in:
Andreas Fabri 2021-03-11 13:32:46 +00:00
parent 2334ec5f4b
commit d04b26b0e4
1 changed files with 18 additions and 1 deletions

View File

@ -849,7 +849,24 @@ public:
_CGAL_NEF_TRACEN("found on facet...");
return make_object(f);
}
if( is.does_intersect_internally(s,f,ip)) {
// We next check if v is a vertex on the face to avoid a geometric test
bool v_vertex_of_f = false;
Halffacet_cycle_iterator fci;
for(fci=f->facet_cycles_begin(); fci!=f->facet_cycles_end(); ++fci) {
if(fci.is_shalfedge()) {
SHalfedge_around_facet_circulator sfc(fci), send(sfc);
CGAL_For_all(sfc,send) {
if(sfc->source()->center_vertex() == v){
v_vertex_of_f = true;
break;
}
}
}
}
if( (! v_vertex_of_f) && is.does_intersect_internally(s,f,ip) ) {
s = Segment_3(p, normalized(ip));
result = make_object(f);
}