Subject: CGAL users discussion list
List archive
- From: "Sebastien Loriot (GeometryFactory)" <>
- To:
- Subject: Re: [cgal-discuss] The triangle closest to a query point
- Date: Mon, 29 Sep 2014 12:14:04 +0200
- Organization: GeometryFactory
On 09/23/2014 04:43 PM, vahid wrote:
Actually, what I want to do is to project the query point on the
surface, and use the closest point on the surface to distribute some
information from the query point to the nodes of the closest triangle.
My question specifically is that when CGAL returns the coordinates of
the vertices of the triangle which includes the closest point, how can I
find out the ID numbers of the vertices. For instance, if my surface has
thousands of vertices and triangles, and I have found the closest point
on the surface with the triangle that passes through that point, how can
I find out the ID numbers of the vertices constructing that triangle
(instead of their coordinates). That means if I call points a, b, c, d,
etc as points 1, 2, 3, 4, ... then is there any way for CGAL to give me
the ID number of the three vertices making the closest triangle (such as
points 1, 2, and 4)?
Thanks,
Vahid
What you have as input is a soup of triangles (that is with no relationships with each other). So there is even no notion of
vertices for the whole set of triangles.
What you can easily get is the id of the triangle (since the closest_primitive() function will return the iterator corresponding
to the input triangle). Provided you have you own way to index
vertices from a triangle id, then you can associate your information.
Sebastien.
On Tue, Sep 23, 2014 at 3:52 AM, Sebastien Loriot (GeometryFactory) [via
cgal-discuss] <[hidden email]
</user/SendEmail.jtp?type=node&node=4659884&i=0>> wrote:
On 09/22/2014 09:58 PM, vahid wrote:
> Thank you so much Sebastien for your help.
>
> I can get the vertex coordinates of the closest triangles by using:
> std::cerr << "closest primitive is: " << *closest_primitive <<
std::endl;
> which gives me the coordinates of all the three vertices constructing
the
> triangle, consecutively. How can I get the location of the points
separately
> instead of having them all together? (I guess it is an easy process,
but I
> am a beginner in both CGAL and C++) .
>
> My other question is that then how can I know which points are involved
with
> this triangles? I mean in the same example, is there a way so I can
know for
> instance points a,b, and d are the ones that are making the closest
triangle
> to the query point without performing a search among all the points?
>
The closest point is a point that is not necessarily a triangle vertex,
it is the closest points on the set of triangles provided.
If you want to perform nearest neighbors queries, you should use this
package:
http://doc.cgal.org/latest/Spatial_searching/index.html#Chapter_dD_Spatial_Searching
Sebastien.
> Vahid
>
>
>
> --
> View this message in context:
http://cgal-discuss.949826.n4.nabble.com/The-triangle-closest-to-a-query-point-tp4659854p4659870.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://sympa.inria.fr/sympa/info/cgal-discuss
------------------------------------------------------------------------
If you reply to this email, your message will be added to the
discussion below:
http://cgal-discuss.949826.n4.nabble.com/The-triangle-closest-to-a-query-point-tp4659854p4659874.html
To unsubscribe from The triangle closest to a query point, click here.
NAML
<http://cgal-discuss.949826.n4.nabble.com/template/NamlServlet.jtp?macro=macro_viewer&id=instant_html%21nabble%3Aemail.naml&base=nabble.naml.namespaces.BasicNamespace-nabble.view.web.template.NabbleNamespace-nabble.view.web.template.NodeNamespace&breadcrumbs=notify_subscribers%21nabble%3Aemail.naml-instant_emails%21nabble%3Aemail.naml-send_instant_email%21nabble%3Aemail.naml>
--
Vahid Abdollahi
PhD Candidate
CFD Lab, Mechanical Engineering Department
McGill University, Montreal, QC, Canada
Phone: (+1) 514 8051374
[hidden email] </user/SendEmail.jtp?type=node&node=4659884&i=1>
------------------------------------------------------------------------
View this message in context: Re: The triangle closest to a query point
<http://cgal-discuss.949826.n4.nabble.com/The-triangle-closest-to-a-query-point-tp4659854p4659884.html>
Sent from the cgal-discuss mailing list archive
<http://cgal-discuss.949826.n4.nabble.com/> at Nabble.com.
- [cgal-discuss] The triangle closest to a query point, vahid, 09/18/2014
- Re: [cgal-discuss] The triangle closest to a query point, Sebastien Loriot (GeometryFactory), 09/22/2014
- Re: [cgal-discuss] The triangle closest to a query point, vahid, 09/22/2014
- Re: [cgal-discuss] The triangle closest to a query point, Sebastien Loriot (GeometryFactory), 09/23/2014
- Re: [cgal-discuss] The triangle closest to a query point, vahid, 09/23/2014
- Re: [cgal-discuss] The triangle closest to a query point, Sebastien Loriot (GeometryFactory), 09/29/2014
- Re: [cgal-discuss] The triangle closest to a query point, vahid, 09/23/2014
- Re: [cgal-discuss] The triangle closest to a query point, Sebastien Loriot (GeometryFactory), 09/23/2014
- Re: [cgal-discuss] The triangle closest to a query point, vahid, 09/22/2014
- Re: [cgal-discuss] The triangle closest to a query point, Sebastien Loriot (GeometryFactory), 09/22/2014
Archive powered by MHonArc 2.6.18.