.NET
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

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

2 REPLIES 2
SOLVED
Reply
Message 1 of 3
DeZert
485 Views, 2 Replies

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

I keep asking simple questions.. Smiley Embarassed
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 )
2 REPLIES 2
Message 2 of 3
_gile
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
Programmation AutoCAD LISP/.NET
GileCAD
GitHub

Message 3 of 3
DeZert
in reply to: _gile

Very thanks!

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

Autodesk DevCon in Munich May 28-29th


Autodesk Design & Make Report

”Boost