.NET

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

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

213 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 )

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)));

 

*Expert Elite*
_gile
Posts: 2,115
Registered: ‎04-29-2006
Message 2 of 3 (203 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 (181 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!
Post to the Community

Have questions about Autodesk products? Ask the community.

New Post
Announcements
Are You Going To Be @ AU 2014? Feel free to drop by our AU topic post and share your plans, plug a class that you're teaching, or simply check out who else from the community might be in attendance. Ohh and don't forgot to stop by the Autodesk Help | Learn | Collaborate booths in the Exhibit Hall and meet our community team if you get a chance!