.NET

Reply
Contributor
17 Posts
0 Kudos
Registered: ‎06-30-2010
Post 1 of 4
Accepted Solution

Perpendicular Points on Polyline

976 Views, 3 Replies
07-19-2010 04:42 AM

Hi,

 

Is there is any way to get perpendicular points on both sides of a polyline at a specified distance?

 

 

I tried to offset the polyline (PL) on both directions as (PL1 & PL2) but still confused how to get a perpendicular point on PL1 & PL2 with a given point on PL.

 

Your inputs will be much appreciated.

 

Prajith.

Hi Friends,

 

Goal achieved using the below function.

 

  Shared Function PolarPoint(ByVal BasePoint As Point3d, ByVal angle As Double, ByVal distance As Double) As Point3d
        Dim x As Double = distance * Sin(angle)
        Dim y As Double = distance * Cos(angle)
        Return New Point3d(BasePoint.X - x, BasePoint.Y + y, BasePoint.Z)
    End Function

 

Hi Tony,

I am not familiar with GetFirstDerivative() method. Certainly I will look at it how it goes.

 

Thanks a lot.

 

Prajith.

Distinguished Contributor
147 Posts
3 Kudos
Registered: ‎08-15-2007
Post 2 of 4

Re: Perpendicular Points on Polyline

07-19-2010 07:31 AM in reply to: Prajith76

Prajith,

 

Do a search for 'Polar' points in this Forum. This should provide you the answer you are looking for.

Josh Modglin
Advanced Technologies Solutions Logo
Valued Mentor
305 Posts
2 Kudos
Registered: ‎01-26-2005
Post 3 of 4

Re: Perpendicular Points on Polyline

07-19-2010 08:56 AM in reply to: Prajith76

You can use the GetFirstDerivative() method to get the direction

of the tangent vector at a given point on the polyline, which is

at a right angle with the perpendiuclar vector.

 



AcadXTabs for AutoCAD
Supporting AutoCAD 2000-2011


Contributor
17 Posts
0 Kudos
Registered: ‎06-30-2010
Post 4 of 4

Re: Perpendicular Points on Polyline

07-20-2010 02:07 AM in reply to: Prajith76

Hi Friends,

 

Goal achieved using the below function.

 

  Shared Function PolarPoint(ByVal BasePoint As Point3d, ByVal angle As Double, ByVal distance As Double) As Point3d
        Dim x As Double = distance * Sin(angle)
        Dim y As Double = distance * Cos(angle)
        Return New Point3d(BasePoint.X - x, BasePoint.Y + y, BasePoint.Z)
    End Function

 

Hi Tony,

I am not familiar with GetFirstDerivative() method. Certainly I will look at it how it goes.

 

Thanks a lot.

 

Prajith.

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!