mirror of https://github.com/CGAL/cgal
setting Has_static_filters for Epeck to true
fixing static filter for Sphere_3 Iso_cuboid_3 intersection
This commit is contained in:
parent
6cb3723772
commit
b090cd8c22
|
|
@ -774,23 +774,9 @@ public:
|
||||||
|
|
||||||
// If the center is inside the box, check the distance to the closest box face and the furthest corner.
|
// If the center is inside the box, check the distance to the closest box face and the furthest corner.
|
||||||
if (distance == 0) {
|
if (distance == 0) {
|
||||||
double dx = (std::min)(bxmax - scx, scx - bxmin);
|
double dx = (std::max)(bxmax - scx, scx - bxmin);
|
||||||
double dy = (std::min)(bymax - scy, scy - bymin);
|
double dy = (std::max)(bymax - scy, scy - bymin);
|
||||||
double dz = (std::min)(bzmax - scz, scz - bzmin);
|
double dz = (std::max)(bzmax - scz, scz - bzmin);
|
||||||
|
|
||||||
// Distance to closest box face
|
|
||||||
distance = (std::min)(dx, (std::min)(dy, dz)) - ssr;
|
|
||||||
|
|
||||||
if ((distance < 3.33558365626356687717e-147) || (distance > 1.67597599124282407923e+153)) {
|
|
||||||
CGAL_BRANCH_PROFILER_BRANCH_2(tmp);
|
|
||||||
return Base::operator()(s, b);
|
|
||||||
}
|
|
||||||
|
|
||||||
eps = 1.99986535548615598560e-15 * (std::max)(ssr, distance);
|
|
||||||
|
|
||||||
// Is the sphere fully contained in the box?
|
|
||||||
if (distance > eps)
|
|
||||||
return false;
|
|
||||||
|
|
||||||
dx = square(dx);
|
dx = square(dx);
|
||||||
dy = square(dy);
|
dy = square(dy);
|
||||||
|
|
@ -804,13 +790,14 @@ public:
|
||||||
|
|
||||||
eps = 1.99986535548615598560e-15 * (std::max)((std::max)(ssr, dx), (std::max)(dy, dz));
|
eps = 1.99986535548615598560e-15 * (std::max)((std::max)(ssr, dx), (std::max)(dy, dz));
|
||||||
|
|
||||||
double outer_distance = dx + dy + dz - ssr;
|
distance = dx + dy + dz - ssr;
|
||||||
|
|
||||||
// Is the box fully contained in the sphere?
|
// Is the box fully contained in the sphere?
|
||||||
if (outer_distance > eps)
|
if (distance > eps)
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
if (distance < eps && outer_distance < eps)
|
// Does the box intersect the sphere or is the sphere fully contained in the box?
|
||||||
|
if (distance < -eps)
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -84,11 +84,7 @@ public:
|
||||||
#ifdef CGAL_NO_STATIC_FILTERS_FOR_LAZY_KERNEL
|
#ifdef CGAL_NO_STATIC_FILTERS_FOR_LAZY_KERNEL
|
||||||
enum { Has_static_filters = false };
|
enum { Has_static_filters = false };
|
||||||
#else
|
#else
|
||||||
// @fixme, this should be 'true' but it's broken because EPIC_predicate_if_convertible
|
enum { Has_static_filters = true };
|
||||||
// assumes the static filtered predicate and the (non-static) filtered predicate
|
|
||||||
// have the same signature, which is not always the case, for example in
|
|
||||||
// Do_intersect_3(Sphere_3, Bbox_3, *bool*)
|
|
||||||
enum { Has_static_filters = false };
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
// Types
|
// Types
|
||||||
|
|
|
||||||
|
|
@ -309,20 +309,6 @@ int main(int argc, char **argv)
|
||||||
assert( !CGAL::Epick::Has_static_filters);
|
assert( !CGAL::Epick::Has_static_filters);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef CGAL_DONT_USE_LAZY_KERNEL
|
|
||||||
#ifdef CGAL_NO_STATIC_FILTERS
|
|
||||||
assert( !CGAL::Epeck::Has_static_filters);
|
|
||||||
#else
|
|
||||||
assert( CGAL::Epeck::Has_static_filters);
|
|
||||||
#endif
|
|
||||||
#else
|
|
||||||
#ifdef CGAL_LAZY_KERNEL_USE_STATIC_FILTERS_BY_DEFAULT
|
|
||||||
assert( CGAL::Epeck::Has_static_filters);
|
|
||||||
#else
|
|
||||||
assert( !CGAL::Epeck::Has_static_filters);
|
|
||||||
#endif
|
|
||||||
#endif
|
|
||||||
|
|
||||||
assert( K2::Has_static_filters);
|
assert( K2::Has_static_filters);
|
||||||
assert(! K4::Has_static_filters);
|
assert(! K4::Has_static_filters);
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -82,12 +82,18 @@ do_intersect_sphere_box_3(const typename K::Sphere_3& sphere,
|
||||||
{
|
{
|
||||||
d = to_FT(bzmin) - to_FT(center.z());
|
d = to_FT(bzmin) - to_FT(center.z());
|
||||||
d = square(d);
|
d = square(d);
|
||||||
|
if (certainly(d > sr))
|
||||||
|
return false;
|
||||||
|
|
||||||
distance += d;
|
distance += d;
|
||||||
}
|
}
|
||||||
else if(compare(center.z(), bzmax) == LARGER)
|
else if(compare(center.z(), bzmax) == LARGER)
|
||||||
{
|
{
|
||||||
d = to_FT(center.z()) - to_FT(bzmax);
|
d = to_FT(center.z()) - to_FT(bzmax);
|
||||||
d = square(d);
|
d = square(d);
|
||||||
|
if (certainly(d > sr))
|
||||||
|
return false;
|
||||||
|
|
||||||
distance += d;
|
distance += d;
|
||||||
}
|
}
|
||||||
// Note that with the way the distance above is computed, the distance is '0'
|
// Note that with the way the distance above is computed, the distance is '0'
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue