.NET

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

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

209 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,104
Registered: ‎04-29-2006
Message 2 of 3 (199 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 (177 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
Need installation help?

Start with some of our most frequented solutions or visit the Installation and Licensing Forum to get help installing your software.