Skip to Content.
Sympa Menu

cgal-discuss - Re: [cgal-discuss] Trouble using ::intersection() on triangle intersections

Subject: CGAL users discussion list

List archive

Re: [cgal-discuss] Trouble using ::intersection() on triangle intersections


Chronological Thread 
  • From: "Sebastien Loriot (GeometryFactory)" <>
  • To:
  • Subject: Re: [cgal-discuss] Trouble using ::intersection() on triangle intersections
  • Date: Thu, 07 Aug 2014 14:41:16 +0200
  • Organization: GeometryFactory

On 08/04/2014 11:44 PM, EnricoLop wrote:
Hi, I am not very experienced with cgal. I am trying to implement a 3D map of
a terrain with textures. Now i am checking for intersections on each image
to see what image will be better on each triangle(surface is made of
triangles).

I tried following the examples on
http://doc.cgal.org/latest/Kernel_23/group__intersection__linear__grp.html
but my code is genarating some erros:

/TextureManager.cpp:109: error: could not convert 'result' from
'CGAL::cpp11::result_of<CGAL::CommonKernelFunctors::Intersect_3&lt;CGAL::Cartesian&lt;double>
(CGAL::Triangle_3<CGAL::Cartesian&lt;double> >,
CGAL::Triangle_3<CGAL::Cartesian&lt;double> >)>::type {aka CGAL::Object}' to
'bool'

TextureManager.cpp:110: error: no match for 'operator*' (operand type is
'CGAL::cpp11::result_of<CGAL::CommonKernelFunctors::Intersect_3&lt;CGAL::Cartesian&lt;double>
(CGAL::Triangle_3<CGAL::Cartesian&lt;double> >,
CGAL::Triangle_3<CGAL::Cartesian&lt;double> >)>::type {aka CGAL::Object}')

this code :

struct Intersection_visitor {
typedef void result_type;
void operator()(const Point3 & p) const{
// handle point
}
void operator()(const Segment3 & s) const{
// handle segment
}
void operator()(const Triangle3 & t) const{
// handle point
}
};

CGAL::cpp11::result_of<tc::Intersect_3(Triangle3,Triangle3)>::type
result = CGAL::intersection(*t_3,*tLado1_3);
if(result) { // ERROR LINE
boost::apply_visitor(Intersection_visitor(), *result); // ERROR2 LINE
}
else { // empty
}

These are the declarations:

typedef CGAL::Cartesian<double> tc;
typedef tc::Ray_3 Ray3;
typedef tc::Line_3 Line3;
typedef tc::Vector_3 Vector3;
typedef tc::Point_3 Point3;
typedef tc::Plane_3 Plane3;
typedef tc::Triangle_3 Triangle3;
typedef tc::Segment_3 Segment3;



I gave an answer here:
http://stackoverflow.com/questions/25123939/cgalintersection-error/25152543#25152543

Sebastien




--
View this message in context:
http://cgal-discuss.949826.n4.nabble.com/Trouble-using-intersection-on-triangle-intersections-tp4659679.html
Sent from the cgal-discuss mailing list archive at Nabble.com.





Archive powered by MHonArc 2.6.18.

Top of Page