Skip to Content.
Sympa Menu

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

Subject: CGAL users discussion list

List archive

[cgal-discuss] Re: Finding intersection segment


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


Sebastien Loriot (GeometryFactory) wrote
>
> Note that the intersection might be not a segment.
> See
> http://www.cgal.org/Manual/latest/doc_html/cgal_manual/Kernel_23_ref/Function_intersection.html
>

I know, but my goal is to come up with polyline of intersection of two
triangulated surfaces, so the points won't matter here and I can ignore
them.



> Also if the triangle comes from the same polyhedron, you might want to use
> incidence of faces using opposite relations of halfedges.
>

I will try this way, thanks! But for starters I'd just like to see what the
intersection segments are. Any hint how I should correct the code to get the
segments into a file?



> Is the vector empty or
>

It is empty while there definitely are intersections (I output the
intersecting triangles into a file, and it is not empty).

On Tuesday, March 20, 2012, Oleg &lt;olegs@&gt; wrote:
> 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?

--
You are currently subscribed to cgal-discuss.
To unsubscribe or access the archives, go to
https://lists-sop.inria.fr/wws/info/cgal-discuss



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



Archive powered by MHonArc 2.6.16.

Top of Page