Skip to Content.
Sympa Menu

cgal-discuss - Re: [cgal-discuss] Can't call CGAL::intersection() function

Subject: CGAL users discussion list

List archive

Re: [cgal-discuss] Can't call CGAL::intersection() function


Chronological Thread 
  • From: Marc Glisse <>
  • To:
  • Subject: Re: [cgal-discuss] Can't call CGAL::intersection() function
  • Date: Sun, 20 Feb 2022 21:14:40 +0100 (CET)

On Sun, 20 Feb 2022, Bob Bill wrote:

I am facing the following problem: I have two 2D objects. Each one could be a
triangle, a rectangle or a segment, and I need to compute their intersection
using CGAL::intersection().
So I created a function `create_suitable_object` that takes the vector with
the vertices and create the corresponding CGAL object. As the return type is
not unique, I used `boost::variant`.
Then in my main I created the two objects calling the above mentioned
function for each vector of vertices, and then I wanted to pass those objects
to CGAL::intersection(). 

Where in the documentation did you see that it was ok to pass a variant to CGAL::intersection? As far as I can see, it only lists overloads like intersection(segment, triangle), etc, so you need to handle the dispatching yourself.

--
Marc Glisse



Archive powered by MHonArc 2.6.19+.

Top of Page