Skip to Content.
Sympa Menu

cgal-discuss - Re: [cgal-discuss] How do I get the primitive out of a tree after an intersection?

Subject: CGAL users discussion list

List archive

Re: [cgal-discuss] How do I get the primitive out of a tree after an intersection?


Chronological Thread 
  • From: Rash <>
  • To: "" <>
  • Subject: Re: [cgal-discuss] How do I get the primitive out of a tree after an intersection?
  • Date: Tue, 3 Jul 2018 23:07:25 +0200
  • Authentication-results: mail3-smtp-sop.national.inria.fr; spf=None ; spf=None ; spf=None
  • Ironport-phdr: 9a23:8yNjGRCjGyog2sOh4WAKUyQJP3N1i/DPJgcQr6AfoPdwSPT7ocbcNUDSrc9gkEXOFd2Cra4c1ayO6+jJYi8p2d65qncMcZhBBVcuqP49uEgeOvODElDxN/XwbiY3T4xoXV5h+GynYwAOQJ6tL1LdrWev4jEMBx7xKRR6JvjvGo7Vks+7y/2+94fcbglUhTexe69+IAmrpgjNq8cahpdvJLwswRXTuHtIfOpWxWJsJV2Nmhv3+9m98p1+/SlOovwt78FPX7n0cKQ+VrxYES8pM3sp683xtBnMVhWA630BWWgLiBVIAgzF7BbnXpfttybxq+Rw1DWGMcDwULs5Xymp4aV2Rx/ykCoJKj43/n/Nisx+j6xVrhyuqBN9zIHIb4+YL+Z+c6DHcN8GWWZMUMRcWipcCY28dYsPCO8BMP5EoYbnvFsOrQa1CA62BOz10T9Ihn720rAh3uQkEAHG2BYvEM4JsHTRttn6KbkdXPmzwaLVwzvDaPZW1i386IjOah0huu2MUqhsfsrSzkkvCR3Kjk+eqYzhODOU2P4BvHSc7+plU++klm0pqxlprzWsxsogkJTFi4wPxlzZ+yh0xJw5KcC7RUN4edKoDZhduiKAO4ZyQ84uWXxktSUkxrEcp5K3YCgHxZI6zBDFcfOHaZKH4hf7WeaRPzh4gHVldaqiiBmv7EStzuLxWte73VpQrSpKiMLMtmsT2BzJ9MiIVOF98l291jaI0gDf8uBEIUYqmqrHM5Mswb49moAOvUnNBCP6hUv7gauMekk5+eWl6PzrYrD8qZ+dM490hBv+MqMrmsGnG+Q3KBMOX2ia+euhz7Dj+Ez5QLFQgfIqlanZtYrWKtkFqaKhGQ9azp4j6wqjDzehyNkXgXYHI0hBeB6ekofpOkrOL+zlDfekmFShiyxrxvDDPr35GJrBNHnDkLH7fbZ88UFQ0gQzzcoMr65TX/sKL/v3H0Pwr9fFFQQRMgquwu+hBs83ntcVVmuLR6OYK6jPqkSg5+Q1IuDKapVD6wzwM/w02/m7hnAwnRoRfLKiwIAMQHG+BPVvZUuDMlT2hdJUK24RvkJqVuXxiFyOeTtSY3+5WKd66jxtW9HuNpvKWo342O/J5yy8BJADPjkXWGDJKm/hcsC/Y9lJbSuTJsF7lTldD+qkSoso3har8gP3meI+crjkvxYAvJem7+BbovXJnEhopzl1C82W1GTLQ2wmxjpVFQ9z57h2pAlG8nnG0aV8hKYDR9BfvqIVCFt8NpfH1OFgFd3oHAnGe4XRRQ==

Here is the solution

https://stackoverflow.com/questions/51148826/get-primitive-from-aabb-tree-intersection/51162811#51162811

Cgal has some nice features, but could realy use more documentation.

Am 03.07.2018 um 19:14 schrieb Rash:
Dear Readers,

I fail horribly at retrieving the primitive which causes the intersection. I calculate a hit:

                boost::optional<Primitive_id> hit = tree.first_intersected_primitive(rays[this->transformCoordinates(y,x)]);

Then check if a hit happened:

if(hit)

And then the chaos starts. There is simply no "getIntersectedPrimitive" member function of primitive id. What I am doing wrong? How can I do it right?

Currently I am getting an iterrator for faces (at least this is what I think what I am doing). Then I get the first face. This seems to be a pretty strange approach. How can I get the the normal of I_Polyhedron_facet and how do I get the intersection point?


CGAL::internal::In_place_list_iterator<CGAL::HalfedgeDS_in_place_list_face<CGAL::I_Polyhedron_facet<CGAL::HalfedgeDS_face_base<CGAL::HalfedgeDS_list_types<CGAL::Simple_cartesian<double>, CGAL::I_Polyhedron_derived_items_3<CGAL::Polyhedron_items_3>, std::allocator<int> >, CGAL::Boolean_tag<true>, CGAL::Plane_3<CGAL::Simple_cartesian<double> > > > >, std::allocator<CGAL::HalfedgeDS_in_place_list_face<CGAL::I_Polyhedron_facet<CGAL::HalfedgeDS_face_base<CGAL::HalfedgeDS_list_types<CGAL::Simple_cartesian<double>, CGAL::I_Polyhedron_derived_items_3<CGAL::Polyhedron_items_3>, std::allocator<int> >, CGAL::Boolean_tag<true>, CGAL::Plane_3<CGAL::Simple_cartesian<double> > > > > > > it = *hit;


CGAL::I_Polyhedron_facet<CGAL::HalfedgeDS_face_base<CGAL::HalfedgeDS_list_types<CGAL::Simple_cartesian<double>, CGAL::I_Polyhedron_derived_items_3<CGAL::Polyhedron_items_3>, std::allocator<int> >, CGAL::Boolean_tag<true>, CGAL::Plane_3<CGAL::Simple_cartesian<double> > > >::Halfedge_around_facet_circulator ipfacet = it->facet_begin();

Kind regards
Rashid




Archive powered by MHonArc 2.6.18.

Top of Page