.NET

Reply
Member
DeZert
Posts: 5
Registered: ‎11-24-2013
Message 1 of 3 (192 Views)
Accepted Solution

Reinventing the wheel, or how to found the closest vertex of polyline?

192 Views, 2 Replies
12-04-2013 08:59 PM
I keep asking simple questions.. :smileyembarrassed:
I have a point on polyline (not vertex!) as Point3D, and I need to find closest vertex of polyline.
 
In other words, I put a points on the polyline, and they should not be located closer than 50 meter vertices of the polyline. For this I need to find closest vertex to point.
 
Previously sorry for my wrong English )
*Expert Elite*
_gile
Posts: 2,077
Registered: ‎04-29-2006
Message 2 of 3 (182 Views)

Re : Reinventing the wheel, or how to found the closest vertex of polyline?

12-04-2013 10:06 PM in reply to: DeZert

Hi,

 

If the input point is on the polyline, you can get its parameter (double).

Parameters of polylines are integer on vertices, so it's easy to get the closest vertex.

 

Point3d closestVertex = 
    pline.GetPointAtParam(Math.Round(pline.GetParamAtPoint(inputPoint)));

 

Gilles Chanteau
Member
DeZert
Posts: 5
Registered: ‎11-24-2013
Message 3 of 3 (160 Views)

Re : Reinventing the wheel, or how to found the closest vertex of polyline?

12-05-2013 02:25 AM in reply to: _gile
Very thanks!

You are not logged in.

Log into access your profile, ask and answer questions, share ideas and more. Haven't signed up yet? Register

Announcements
Are you familiar with the Autodesk Expert Elites? The Expert Elite program is made up of customers that help other customers by sharing knowledge and exemplifying an engaging style of collaboration. To learn more, please visit our Expert Elite website.

Need installation help?

Start with some of our most frequented solutions to get help installing your software.

Ask the Community