Skip to Content.
Sympa Menu

cgal-discuss - Re: [cgal-discuss] segment_3 sphere intersection

Subject: CGAL users discussion list

List archive

Re: [cgal-discuss] segment_3 sphere intersection


Chronological Thread 
  • From: "Sebastien Loriot (GeometryFactory)" <>
  • To:
  • Subject: Re: [cgal-discuss] segment_3 sphere intersection
  • Date: Tue, 14 May 2013 17:40:02 +0200
  • Organization: GeometryFactory

On 05/14/2013 05:13 PM, mriem wrote:
Hello

I was looking into the CGAL intersections utilities at

http://www.cgal.org/Manual/latest/doc_html/cgal_manual/Kernel_23_ref/Function_intersection.html

and I could not find a segment_3 sphere intersection.

It is inside "With the 3D Spherical Kernel", because you need a Kernel
which is a Spherical_kernel [1].

Sebastien.

[1] http://www.cgal.org/Manual/latest/doc_html/cgal_manual/Circular_kernel_3/Chapter_main.html#chapter-spherical-kernel

I have tried to implement the example code from that page


#include<CGAL/intersections.h>

void foo(CGAL::Segment_2<Kernel> seg, CGAL::Line_2<Kernel> line)
{
CGAL::Object result = CGAL::intersection(seg, line);
if (const CGAL::Point_2<Kernel> *ipoint =
CGAL::object_cast<CGAL::Point_2&lt;Kernel> >(&result)) {
// handle the point intersection case with *ipoint.
} else
if (const CGAL::Segment_2<Kernel> *iseg =
CGAL::object_cast<CGAL::Segment_2&lt;Kernel> >(&result)) {
// handle the segment intersection case with *iseg.
} else {
// handle the no intersection case.
}
}

changing function arguments

seg to type

CGAL::Segment_3<Kernel>

and line to
CGAL::Sphere_3<Kernel>

but the linker complains there is no such specialization for that templated
function.

Can I do segment_3 to sphere intersection?

Thank you very much.

Miguel Oliveira

PS: in fact, for this particular case, I only needed a do_intersect
functionality, but I think that if a do_intersect exists, so will the
intersect.





--
View this message in context:
http://cgal-discuss.949826.n4.nabble.com/segment-3-sphere-intersection-tp4657426.html
Sent from the cgal-discuss mailing list archive at Nabble.com.





Archive powered by MHonArc 2.6.18.

Top of Page