Subject: CGAL users discussion list
List archive
- From: "Sebastien Loriot (GeometryFactory)" <>
- To: "" <>
- Subject: [cgal-discuss] Finding intersection segment
- Date: Tue, 20 Mar 2012 11:12:11 +0100
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
Also if the triangle comes from the same polyhedron, you might want to use incidence of faces using opposite relations of halfedges.
Sebastien
Is the vector empty or
On Tuesday, March 20, 2012, Oleg <> 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?
>
> --
> 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.
>
> --
> You are currently subscribed to cgal-discuss.
> To unsubscribe or access the archives, go to
> https://lists-sop.inria.fr/wws/info/cgal-discuss
>
>
- [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.