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

C#.net how do I access the geometric center of a closed polyline?

3 REPLIES 3
SOLVED
Reply
Message 1 of 4
jeff.wangD95HG
248 Views, 3 Replies

C#.net how do I access the geometric center of a closed polyline?

its the point that shows up once you turn on object snap -> geometric center on a closed polyline.

How do I gain access to referencing that point?

if not I am wondering about what is the algorithm they use to calculate that point. and its not as simple as take all the points and average them because the points distribution might be skewed on one side

3 REPLIES 3
Message 2 of 4
_gile
in reply to: jeff.wangD95HG

Hi,

The GeometryExtension library provides a Polyline.Centroid() and a Polyline.Centroid2d() methods.

You can also get a method which uses the same algorithm in this reply.



Gilles Chanteau
Programmation AutoCAD LISP/.NET
GileCAD
GitHub

Message 3 of 4
jeff.wangD95HG
in reply to: _gile

thanks for the quick reply. this works. I used the region method in this reply.
Message 4 of 4
_gile
in reply to: jeff.wangD95HG


@jeff.wangD95HG  a écrit :
thanks for the quick reply. this works. I used the region method in this reply.

The first one (GetPolylineCentroid) is much more faster.



Gilles Chanteau
Programmation AutoCAD LISP/.NET
GileCAD
GitHub

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

Post to forums  

AutoCAD Inside the Factory


Autodesk Design & Make Report