mirror of https://github.com/CGAL/cgal
prevent filter failures
This commit is contained in:
parent
7a3d8afb8c
commit
6d1dd4bb0e
|
|
@ -183,18 +183,19 @@ class SNC_intersection : public SNC_const_decorator<SNC_structure_> {
|
||||||
Point_3& p) const {
|
Point_3& p) const {
|
||||||
if(s2.has_on(s1.target()))
|
if(s2.has_on(s1.target()))
|
||||||
return false;
|
return false;
|
||||||
return (does_intersect_internally(Ray_3(s1.source(), s1.target()), s2, p)
|
Ray_3 r(s1.source(), s1.target());
|
||||||
&& s1.has_on(p));
|
if(!does_intersect_internally(r, s2, p))
|
||||||
|
return false;
|
||||||
|
Plane_3 pl(s1.target(), r.to_vector());
|
||||||
|
return (pl.oriented_side(p) == CGAL::NEGATIVE);
|
||||||
}
|
}
|
||||||
|
|
||||||
bool does_intersect_internally( const Ray_3& s1,
|
bool does_intersect_internally( const Ray_3& s1,
|
||||||
const Segment_3& s2,
|
const Segment_3& s2,
|
||||||
Point_3& p) const {
|
Point_3& p) const {
|
||||||
CGAL_NEF_TRACEN("does intersect internally without LINE3_LINE3_INTERSECTION");
|
CGAL_NEF_TRACEN("does intersect internally without LINE3_LINE3_INTERSECTION");
|
||||||
if ( s1.is_degenerate() || s2.is_degenerate())
|
CGAL_assertion(!s1.is_degenerate());
|
||||||
// the segment is degenerate so there is not internal intersection
|
CGAL_assertion(!s2.is_degenerate());
|
||||||
return false;
|
|
||||||
if ( orientation( s1.source(), s1.point(1), s2.source(), s2.target())
|
if ( orientation( s1.source(), s1.point(1), s2.source(), s2.target())
|
||||||
!= COPLANAR)
|
!= COPLANAR)
|
||||||
// the segments doesn't define a plane
|
// the segments doesn't define a plane
|
||||||
|
|
@ -217,7 +218,14 @@ class SNC_intersection : public SNC_const_decorator<SNC_structure_> {
|
||||||
// since line(s1) and line(s2) are not parallel they intersects in only
|
// since line(s1) and line(s2) are not parallel they intersects in only
|
||||||
// one point
|
// one point
|
||||||
CGAL::assign( p ,o);
|
CGAL::assign( p ,o);
|
||||||
return( s1.has_on(p) && s2.has_on(p));
|
Plane_3 pl(s1.source(), vs1);
|
||||||
|
if(pl.oriented_side(p) != CGAL::POSITIVE)
|
||||||
|
return false;
|
||||||
|
pl = Plane_3(s2.source(), vs2);
|
||||||
|
if(pl.oriented_side(p) != CGAL::POSITIVE)
|
||||||
|
return false;
|
||||||
|
pl = Plane_3(s2.target(), vs2);
|
||||||
|
return (pl.oriented_side(p) == CGAL::NEGATIVE);
|
||||||
}
|
}
|
||||||
|
|
||||||
#endif // LINE3_LINE3_INTERSECTION
|
#endif // LINE3_LINE3_INTERSECTION
|
||||||
|
|
@ -268,12 +276,8 @@ class SNC_intersection : public SNC_const_decorator<SNC_structure_> {
|
||||||
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);
|
||||||
if( ray.is_degenerate())
|
CGAL_assertion(!ray.is_degenerate());
|
||||||
/* no possible internal intersection */
|
CGAL_assertion(!h.has_on(ray.source()));
|
||||||
return false;
|
|
||||||
if( h.has_on( ray.source()))
|
|
||||||
/* no possible internal intersection */
|
|
||||||
return false;
|
|
||||||
Object o = intersection( h, ray);
|
Object o = intersection( h, ray);
|
||||||
if( !CGAL::assign( p, o))
|
if( !CGAL::assign( p, o))
|
||||||
return false;
|
return false;
|
||||||
|
|
@ -291,9 +295,7 @@ class SNC_intersection : public SNC_const_decorator<SNC_structure_> {
|
||||||
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);
|
||||||
if( ray.is_degenerate())
|
CGAL_assertion(!ray.is_degenerate());
|
||||||
/* no possible internal intersection */
|
|
||||||
return false;
|
|
||||||
if( h.has_on( ray.source()))
|
if( h.has_on( ray.source()))
|
||||||
/* no possible internal intersection */
|
/* no possible internal intersection */
|
||||||
return false;
|
return false;
|
||||||
|
|
@ -314,9 +316,7 @@ class SNC_intersection : public SNC_const_decorator<SNC_structure_> {
|
||||||
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("-> segment: " << seg);
|
CGAL_NEF_TRACEN("-> segment: " << seg);
|
||||||
if( seg.is_degenerate())
|
CGAL_assertion(!seg.is_degenerate());
|
||||||
/* no possible internal intersection */
|
|
||||||
return false;
|
|
||||||
if( h.has_on( seg.source()) || h.has_on(seg.target()))
|
if( h.has_on( seg.source()) || h.has_on(seg.target()))
|
||||||
/* no possible internal intersection */
|
/* no possible internal intersection */
|
||||||
return false;
|
return false;
|
||||||
|
|
@ -344,9 +344,7 @@ class SNC_intersection : public SNC_const_decorator<SNC_structure_> {
|
||||||
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("-> segment: " << seg);
|
CGAL_NEF_TRACEN("-> segment: " << seg);
|
||||||
if( seg.is_degenerate())
|
CGAL_assertion(!seg.is_degenerate());
|
||||||
/* no possible internal intersection */
|
|
||||||
return false;
|
|
||||||
if( h.has_on( seg.source()) || h.has_on(seg.target()))
|
if( h.has_on( seg.source()) || h.has_on(seg.target()))
|
||||||
/* no possible internal intersection */
|
/* no possible internal intersection */
|
||||||
return false;
|
return false;
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue