Subject: CGAL users discussion list
List archive
Re: [cgal-discuss] AABB_tree all_intersections: Multiple identical intersections
Chronological Thread
- From: Lefieux Adrien <>
- To:
- Subject: Re: [cgal-discuss] AABB_tree all_intersections: Multiple identical intersections
- Date: Tue, 20 Nov 2012 17:33:18 -0500
Thank you Sebastien for your answer.
Actually, I tried my code alse with segment primitives instead of triangle primitives but it appears that every polyhedron in the tree has its own segments so I get again multiple identical solutions. Of course, I can write a function to check how many intersection are unique but I wondered if there are any approaches in CGAL and where I can find them.
In the end, I would like to consider a triangulation of a domain in R^3 and say to get its intersection with a plane. It is likely that the plane is going to intersect with a ridge and this ridge is possibly common to many polyhedra. Hence I would like to get only one intersection because the common ridge can be uniquely defined.
Thank you,
Adrien
Le 11/20/12 5:41 AM, Sebastien Loriot (GeometryFactory) a écrit :
The result is correct, it reports 3 intersections because 3 triangles
are intersected, and the primitive is a triangle.
They are many solutions to avoid that but it depends on what is your final goal.
Sebastien.
On 11/20/2012 02:05 AM, alef wrote:
Hello everybody,
Problem: My code computes multiple identical intersections of a segment with
a polyhedron.
I try to solve the following problem from
examples/AABB_tree/AABB_polyhedron_facet_intersection_example.cpp
The kernel is defined exactly as follow:
/typedef CGAL::Gmpq FT;
typedef CGAL::Lazy_exact_nt<FT> RT;
typedef CGAL::Simple_cartesian<RT> K;/
the tetrahedron is defined by:
/Point p1(1.0, 0.0, 0.0);
Point q1(0.0, 1.0, 0.0);
Point r1(0.0, 0.0, 1.0);
Point s1(0.0, 0.0, 0.0);
polyhedron.make_tetrahedron(p1, q1, r1, s1);/
The segment is defined by:
/Point a(0.25, 0.25, 1.0);
Point b(-0.25, -0.25, 1.0);
Segment segment_query(a,b);/
The intersection is performed by:
/std::vector<Object_and_primitive_id> intersections;
tree.all_intersections(segment_query, std::back_inserter(intersections));/
The result should be: 1 intersection at (0,0,1).
But the it gives me 3 intersections each one at (0,0,1). Is it normal or is
it a bug? if it is a bug then what could be the solution?
Cordially,
Adrien
--
View this message in context: http://cgal-discuss.949826.n4.nabble.com/AABB-tree-all-intersections-Multiple-identical-intersections-tp4656289.html
Sent from the cgal-discuss mailing list archive at Nabble.com.
- [cgal-discuss] AABB_tree all_intersections: Multiple identical intersections, alef, 11/20/2012
- <Possible follow-up(s)>
- [cgal-discuss] AABB_tree all_intersections: Multiple identical intersections, alef, 11/20/2012
- Re: [cgal-discuss] AABB_tree all_intersections: Multiple identical intersections, Sebastien Loriot (GeometryFactory), 11/20/2012
- Re: [cgal-discuss] AABB_tree all_intersections: Multiple identical intersections, Lefieux Adrien, 11/20/2012
- [cgal-discuss] Re: AABB_tree all_intersections: Multiple identical intersections, alef, 11/21/2012
- Re: [cgal-discuss] Re: AABB_tree all_intersections: Multiple identical intersections, Sebastien Loriot (GeometryFactory), 11/21/2012
- Re: [cgal-discuss] AABB_tree all_intersections: Multiple identical intersections, Sebastien Loriot (GeometryFactory), 11/20/2012
Archive powered by MHonArc 2.6.18.