As a consequence of previous changes check_has_on is never called with false

This commit is contained in:
Giles Bathgate 2022-03-20 10:44:17 +00:00
parent 0124fc9e6d
commit e451af9f50
2 changed files with 6 additions and 11 deletions

View File

@ -72,9 +72,8 @@ class SNC_intersection {
} }
static bool does_contain_internally(Halffacet_const_handle f, static bool does_contain_internally(Halffacet_const_handle f,
const Point_3& p, const Point_3& p) {
bool check_has_on = true) { if(!f->plane().has_on(p))
if(check_has_on && !f->plane().has_on(p))
return false; return false;
return point_in_facet_interior( p, f); return point_in_facet_interior( p, f);
} }
@ -101,19 +100,15 @@ class SNC_intersection {
static bool does_intersect_internally(const Ray_3& ray, static bool does_intersect_internally(const Ray_3& ray,
Halffacet_const_handle f, Halffacet_const_handle f,
Point_3& p, Point_3& p) {
bool check_has_on = true) {
CGAL_NEF_TRACEN("-> Intersection facet - ray"); CGAL_NEF_TRACEN("-> Intersection facet - ray");
Plane_3 h( f->plane()); Plane_3 h( f->plane());
CGAL_NEF_TRACEN("-> facet's plane: " << h); CGAL_NEF_TRACEN("-> facet's plane: " << h);
CGAL_NEF_TRACEN("-> a point on the plane: " << h.point()); CGAL_NEF_TRACEN("-> a point on the plane: " << h.point());
CGAL_NEF_TRACEN("-> ray: " << ray); CGAL_NEF_TRACEN("-> ray: " << ray);
CGAL_assertion(!ray.is_degenerate()); CGAL_assertion(!ray.is_degenerate());
if(check_has_on) { if(h.has_on(ray.source()))
if(h.has_on(ray.source())) return false;
return false;
} else
CGAL_assertion(!h.has_on(ray.source()));
Object o = intersection( h, ray); Object o = intersection( h, ray);
if( !CGAL::assign( p, o)) if( !CGAL::assign( p, o))
return false; return false;

View File

@ -272,7 +272,7 @@ public:
Point_3 q; Point_3 q;
_CGAL_NEF_TRACEN("trying facet with on plane "<<f->plane()<< _CGAL_NEF_TRACEN("trying facet with on plane "<<f->plane()<<
" with point on "<<f->plane().point()); " with point on "<<f->plane().point());
if( is.does_intersect_internally( ray, f, q, true) ) { if( is.does_intersect_internally( ray, f, q) ) {
_CGAL_NEF_TRACEN("ray intersects facet on "<<q); _CGAL_NEF_TRACEN("ray intersects facet on "<<q);
_CGAL_NEF_TRACEN("prev. intersection? "<<hit); _CGAL_NEF_TRACEN("prev. intersection? "<<hit);
if( hit) { _CGAL_NEF_TRACEN("prev. intersection on "<<eor); } if( hit) { _CGAL_NEF_TRACEN("prev. intersection on "<<eor); }