.NET

.NET

Reply
Member
5 Posts
0 Kudos
Registered: ‎11-24-2013
Post 1 of 3
Accepted Solution

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

215 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*
2,142 Posts
255 Kudos
Registered: ‎04-29-2006
Post 2 of 3

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
5 Posts
0 Kudos
Registered: ‎11-24-2013
Post 3 of 3

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 interested in helping shape the future of the Autodesk Community? To participate in this brief usability study, please click here. Your time and input is greatly appreciated!