Skip to Content.
Sympa Menu

cgal-discuss - [cgal-discuss] Finding intersection segment

Subject: CGAL users discussion list

List archive

[cgal-discuss] Finding intersection segment


Chronological Thread 
  • From: Oleg <>
  • To:
  • Subject: [cgal-discuss] Finding intersection segment
  • Date: Tue, 20 Mar 2012 01:32:28 -0700 (PDT)

Hi all! Another newbie question. I want to find intersection segment of two
triangles. I take Polyhedron\polyhedron_self_intersection.cpp example as the
starting point and add this piece of code:

--> std::vector<Segment> segments;
...
Triangle t1( h->vertex()->point(),
h->next()->vertex()->point(),
h->next()->next()->vertex()->point());
Triangle t2( g->vertex()->point(),
g->next()->vertex()->point(),
g->next()->next()->vertex()->point());
if ( CGAL::do_intersect( t1, t2)) {
//cerr << "Triangles intersect:\n T1: " << t1 << "\n T2 :"
// << t2 << endl;
triangles.push_back(t1);
triangles.push_back(t2);
--> CGAL::Object obj = CGAL::intersection(t1, t2);
--> Segment seg;
--> if (assign(seg, obj)) segments.push_back(seg);
}
...

In the output I get empty vector segments. What I'm doing wrong?

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



Archive powered by MHonArc 2.6.16.

Top of Page