Skip to Content.
Sympa Menu

cgal-discuss - [cgal-discuss] Exact_predicates_inexact_constructions_kernel - sign checks are in the wrong order?

Subject: CGAL users discussion list

List archive

[cgal-discuss] Exact_predicates_inexact_constructions_kernel - sign checks are in the wrong order?


Chronological Thread 
  • From: Jeffrey Bush <>
  • To: "" <>
  • Subject: [cgal-discuss] Exact_predicates_inexact_constructions_kernel - sign checks are in the wrong order?
  • Date: Thu, 7 Feb 2013 15:31:03 -0800

Hi,

I am using AABB_tree to determine intersections between a plane (call it "h") and a polyhedron, resulting in a vector of segments ("segs"). However the following test fails:

h.has_on(*segs.begin())

This shouldn't be. However doing research I realized the result may be because of using Cartesian instead of Exact_predicates_inexact_constructions_kernel, so I switched to that. But still the same problem!

Running the debugger I get to this function:
  inline
  Uncertain<Sign>
  sign (const Interval_nt<Protected> & d)
  {
    if (d.inf() > 0.0) return POSITIVE;
    if (d.sup() < 0.0) return NEGATIVE;
    if (d.inf() == d.sup()) return ZERO;
    return Uncertain<Sign>::indeterminate();
  }
With the following value for d:

d = {
  _inf=5.6843418860808015e-014,
  _sup=5.6843418860808015e-014,
  tester={...}
}

It seems as though the d.inf() == d.sup() check should be first? It seems that if sup <= inf and inf > 0 or sup < 0, then the d.inf() == d.sup() can only be 0 == 0... (but I guess sup > inf - I don't understand exactly what this is all about).

Just for scale, my points have values on the order of 2500 and the plane is <0,0,1> -300. 

If this is right (and I could easily be, I don't know too much about double-precision mathematical testing), then what am I doing wrong? My meshes are LARGE so I don't want to use the infinite-precision numbers.

Thanks!
Jeff



Archive powered by MHonArc 2.6.18.

Top of Page