Skip to Content.
Sympa Menu

cgal-discuss - [cgal-discuss] Why do_intersect and not an intersection?

Subject: CGAL users discussion list

List archive

[cgal-discuss] Why do_intersect and not an intersection?


Chronological Thread 
  • From: Ashwin Nanjappa <>
  • To:
  • Subject: [cgal-discuss] Why do_intersect and not an intersection?
  • Date: Thu, 16 Jul 2009 17:00:22 +0800
  • Domainkey-signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:from:date:message-id:subject:to:content-type :content-transfer-encoding; b=uJ+dtYc/s+bx94tvzi31GOqFhhYiOzbbx3t1RnILNJEUGUYCXQGuC+ysAME7r0S+fV Y6Z0zZBhGMGEzI9ZLr3cSkununOhOta1jI+OJcoCjnYFN8B3ST0kcG5vai75CZeREeUb K8DjQrjVpkhab9G3wYfiHTzf6EoFM5LYIhYlU=

Hi,

Recently I had to write some code to find the intersection of a
Triangle_3 and Segment_3. I noticed that I could do a
CGAL::do_intersect() [1] of these to find *if* there is any
intersection. But, I *cannot* do a CGAL::intersection() [2] of these
objects to obtain the intersection object. What is the reason for this
API design?

Currently, I get around this by:
(1) Getting the Plane_3 of the triangle using Triangle_3::supporting_plane()
(2) CGAL::intersection of the Plane_3 and the Segment_3 to get the
intersection object.
(3) Checking if the intersection CGALObject thus obtained lies on the
Triangle_3.

Is there a better way to do this?

[1]
<http://www.cgal.org/Manual/3.4/doc_html/cgal_manual/Kernel_23_ref/Function_do_intersect.html>
[2]
<http://www.cgal.org/Manual/3.4/doc_html/cgal_manual/Kernel_23_ref/Function_intersection.html>

Regards,
~ash



Archive powered by MHonArc 2.6.16.

Top of Page