Subject: CGAL users discussion list
List archive
- 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 <olegs@> 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.
- [cgal-discuss] Finding intersection segment, Oleg, 03/20/2012
- [cgal-discuss] Re: Finding intersection segment, Zohar, 03/20/2012
- [cgal-discuss] Re: Finding intersection segment, Oleg, 03/20/2012
- [cgal-discuss] Finding intersection segment, Sebastien Loriot (GeometryFactory), 03/20/2012
- [cgal-discuss] Re: Finding intersection segment, Oleg, 03/20/2012
- [cgal-discuss] Re: Finding intersection segment, Oleg, 03/21/2012
- [cgal-discuss] Re: Finding intersection segment, Oleg, 03/21/2012
- [cgal-discuss] Re: Finding intersection segment, Zohar, 03/21/2012
- [cgal-discuss] Re: Finding intersection segment, Zohar, 03/21/2012
- Re: [cgal-discuss] Re: Finding intersection segment, Laurent Rineau (GeometryFactory), 03/21/2012
- [cgal-discuss] Re: Finding intersection segment, Zohar, 03/20/2012
Archive powered by MHonArc 2.6.16.