Skip to Content.
Sympa Menu

cgal-discuss - Re: [cgal-discuss] Intersection between plane and triangle through the same three points

Subject: CGAL users discussion list

List archive

Re: [cgal-discuss] Intersection between plane and triangle through the same three points


Chronological Thread 
  • From: Andreas Fabri <>
  • To:
  • Subject: Re: [cgal-discuss] Intersection between plane and triangle through the same three points
  • Date: Tue, 18 May 2021 12:01:16 +0200
  • Authentication-results: mail2-smtp-roc.national.inria.fr; spf=None ; spf=None ; spf=None
  • Ironport-hdrordr: A9a23:BGqvCK0QDE9bHieE4xid9wqjBKkkLtp133Aq2lEZdPUzSKylfqGV/cjzuiWftN98YgBDpTniAse9qA3nhP1ICOAqVN/IYOCMggeVxe9ZgLcKjweOJxHD
  • Ironport-phdr: A9a23:ZCK7Vh2LFOZDt1+ismDOjAIyDhhOgF0UFjAc5pdvsb9SaKPrp82kYBWOo68z0hSUAs3y0LFts6LuqafuWGgNs96qkUspV9hybSIDktgchAc6AcSIWgXRJf/uaDEmTowZDAc2t360PlJIF8ngelbcvmO97SIIGhX4KAF5Ovn5FpTdgsiq0+2+4YPfbgRJiTayYb5/Lgi9oBnMuMURnYZsMLs6xAHTontPdeRWxGdoKkyWkh3h+Mq+/4Nt/jpJtf45+MFOTav1f6IjTbxFFzsmKHw65NfqtRbYUwSC4GYXX3gMnRpJBwjF6wz6Xov0vyDnuOdxxDWWMMvrRr0yRD+s7bpkSAXwhSkaKTA5/mHZhM9+gq1Vrx2upQBwzYHPbYGJN/dzZL/Rcc8USGdDWMtaSixPApm7b4sKF+cMIeBYoJTnp1QQtxS+HhSnCuP1xTBTnH/23LAx3uM7HgHAwQMgBcwBv27PrNnvOqcdS/u6zLPJzTjYYPNZxzD96I3WfRA9u/GNXbxwftDNxkkzEAPFlFWRpZb5MDOS0+QAqm6W5PdvWuyzkWAosR1xoiSxycc2jInEnp4YxkzL+yhl3Io4JMC1RVJ5bNK6EJZdsyWXOpVqTs4jTGxkpig3x6MJtJOnYSUH1JcqygLDZvCafIaE/hDuWeSXLDxlin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lVjPK6xvyPYytwgD/ci0AfmdNBaYvvs/O7aTYsfAJHxeaovklmtKxUZIKZV6q5yOc66JaPu5Q==

Hi Marc,

Even with an Exact_predicates_exact_constructions_kernel you should pay attention
not to construct something and later use it in a predicate where you could exploit
combinatorial information.

Say you construct the midpoint mp  of a segment seg and later call seg.has_on(mp).

As in the exact construction kernel the predicate is first computed with interval arithmetic
the collinearity test has all chances to fail with interval arithmetic, and  it will
be done with arbitrary precision rational numbers.

And such mistakes are sometimes still made even in CGAL, if you look at some
recent pull requests concerning Boolean operations with Nef Polyhedra.

Best,

Andreas

On 5/18/21 11:20 AM, Michael Hoffmann wrote:
Hi Marc,

the coordinates of your points look nice in decimal, but they (e.g., 1.1,
0.3, 0.7) get pretty ugly once converted to binary…

Best, Michael

On 18 May 2021, at 11:16, Marc Alexa <> wrote:

Hi Andreas,

Thanks for the quick answer.

I think I just now fully understood the consequences of “inexact
constructions”. It does lead to some interesting results, I have to say. I
put a minimal program together that generates such a result, which is of
course unsurprising in general, but still a bit surprising to me for the
‘exact predicates’ statement.

Best,
Marc

#include <CGAL/Exact_predicates_inexact_constructions_kernel.h>
#include <CGAL/intersections.h>

typedef CGAL::Exact_predicates_inexact_constructions_kernel K;
typedef K::Point_3 Point;
typedef K::Line_3 Line;
typedef K::Plane_3 Plane;
typedef K::Triangle_3 Triangle;

int main()
{
Point V0(1.0,0.3,0.7);
Point V1(0.3,1.1,0.2);
Point V2(3.3,4.7,5.1);

Plane p(V0,V1,V2);
std::cerr << "V0 on plane? " << p.has_on(V0) << std::endl;
std::cerr << "V1 on plane? " << p.has_on(V1) << std::endl;
std::cerr << "V2 on plane? " << p.has_on(V2) << std::endl;

Triangle t(V0,V1,V2);
std::cerr << "Triangle intersects plane? " << CGAL::do_intersect(p,t) << std::endl;
Line l(V0,V1);
std::cerr << "V0 on line? " << l.has_on(V0) << std::endl;
std::cerr << "V1 on line? " << l.has_on(V1) << std::endl;

std::cerr << "Triangle intersects line? " << CGAL::do_intersect(l,t) <<
std::endl;

std::cerr << "Plane intersects line? " << CGAL::do_intersect(l,p) <<
std::endl;

return 0;
}



On 17. May 2021, at 20:53, Andreas Fabri <>
wrote:

Hi Marc,

As the plane is internally a point and a normal this is a construction.
So if the point is slightly off the plane of the triangle and the normal
happens to be correct the plane and the triangle plane are parallel.

Even if one takes a vertex of the triangle as base for the plane
there is no guarantee that the intersection is the full triangle.

andreas

On 5/17/21 7:07 PM, Marc Alexa ( via cgal-discuss Mailing
List) wrote:
Dear all,

I’m a checking the intersection between Triangle_3 and Plane_3 objects. If
both are constructed from the same triple of points, the result is false for
most triples, but sometimes true. I’m using the exact predicates / inexact
constructions kernel. Is this the expected / desired behavior? I had hope
because of the exact predicates that the result for such intersection tests
is at least consistent (and actually consistently true).

Thanks!
-Marc



--
You are currently subscribed to cgal-discuss.
To unsubscribe or access the archives, go to
https://sympa.inria.fr/sympa/info/cgal-discuss



--
You are currently subscribed to cgal-discuss.
To unsubscribe or access the archives, go to
https://sympa.inria.fr/sympa/info/cgal-discuss





Archive powered by MHonArc 2.6.19+.

Top of Page