<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: Internal angles of a polyline in .NET Forum</title>
    <link>https://forums.autodesk.com/t5/net-forum/internal-angles-of-a-polyline/m-p/3792845#M50867</link>
    <description>&lt;P&gt;Hello,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Here is a thread that might give you some ideas to solve the issue :&lt;/P&gt;
&lt;P&gt;&lt;A href="https://forums.autodesk.com/t5/NET/Get-angle-between-LineSegments-polyline/m-p/3568906/highlight/true#M30395" target="_blank"&gt;http://forums.autodesk.com/t5/NET/Get-angle-between-LineSegments-polyline/m-p/3568906/highlight/true#M30395&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I havent tried the code that Gilles Chanteau has suggested in that thread.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I also have a more complicated way to solve this problem &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;It works for both the kind of closed polylines that you have mentioned about.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The idea is the almost the same as Gilles suggests. Use the "GetAngleTo" method to determine the angle which will always lie between 0 and PI. But there is also an additional check to see if that angle is an interior angle of the closed polyline.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I have attached the source code in case you wish to try.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Thu, 28 Feb 2013 19:35:52 GMT</pubDate>
    <dc:creator>Balaji_Ram</dc:creator>
    <dc:date>2013-02-28T19:35:52Z</dc:date>
    <item>
      <title>Internal angles of a polyline</title>
      <link>https://forums.autodesk.com/t5/net-forum/internal-angles-of-a-polyline/m-p/3790552#M50866</link>
      <description>&lt;P&gt;Hi:&lt;/P&gt;&lt;P&gt;I have created the following code in VB.NET that i allows you to&lt;BR /&gt;calculate the internal angle of a polyline. First delivery getting the angle of&lt;BR /&gt;deflection, a ves obtained 180 you rest this and get the inner corner. All fine, as long as the polyline is the image-1.png. Otherwise, if the polyline is as in the image-2.png there is an error in the&lt;BR /&gt;vertex B.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;That algorithm could follow in order to comply with the correct value. Since&lt;BR /&gt;later this data i presented it in a table of AutoCAD.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;thanks for your help.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;Public Shared Function AngleDeflection(ByVal pto3d As Point3dCollection) As ArrayList
            Dim anguloM As Double = 0
            Dim vangl As ArrayList = New ArrayList
            For i As Integer = 0 To pto3d.Count - 2
                Dim V As Integer = pto3d.Count - 2
                If i = 0 Then
                    anguloM = Math.Atan2(pto3d.Item(i).Y - pto3d.Item(V).Y, pto3d.Item(i).X - pto3d.Item(V).X) - Math.Atan2(pto3d.Item(i + 1).Y - pto3d.Item(i).Y, pto3d.Item(i + 1).X - pto3d.Item(i).X)
                    vangl.Add(anguloM)
                Else
                    anguloM = Math.Atan2(pto3d.Item((i - 1) + 1).Y - pto3d.Item(i - 1).Y, pto3d.Item((i - 1) + 1).X - pto3d.Item(i - 1).X) - Math.Atan2(pto3d.Item((i - 1) + 2).Y - pto3d.Item((i - 1) + 1).Y, pto3d.Item((i - 1) + 2).X - pto3d.Item((i - 1) + 1).X)
                    vangl.Add(anguloM)
                End If

            Next
            Return vangl
        End Function&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 26 Feb 2013 17:37:10 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/internal-angles-of-a-polyline/m-p/3790552#M50866</guid>
      <dc:creator>ccalvo12</dc:creator>
      <dc:date>2013-02-26T17:37:10Z</dc:date>
    </item>
    <item>
      <title>Re: Internal angles of a polyline</title>
      <link>https://forums.autodesk.com/t5/net-forum/internal-angles-of-a-polyline/m-p/3792845#M50867</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Here is a thread that might give you some ideas to solve the issue :&lt;/P&gt;
&lt;P&gt;&lt;A href="https://forums.autodesk.com/t5/NET/Get-angle-between-LineSegments-polyline/m-p/3568906/highlight/true#M30395" target="_blank"&gt;http://forums.autodesk.com/t5/NET/Get-angle-between-LineSegments-polyline/m-p/3568906/highlight/true#M30395&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I havent tried the code that Gilles Chanteau has suggested in that thread.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I also have a more complicated way to solve this problem &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;It works for both the kind of closed polylines that you have mentioned about.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The idea is the almost the same as Gilles suggests. Use the "GetAngleTo" method to determine the angle which will always lie between 0 and PI. But there is also an additional check to see if that angle is an interior angle of the closed polyline.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I have attached the source code in case you wish to try.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 28 Feb 2013 19:35:52 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/internal-angles-of-a-polyline/m-p/3792845#M50867</guid>
      <dc:creator>Balaji_Ram</dc:creator>
      <dc:date>2013-02-28T19:35:52Z</dc:date>
    </item>
    <item>
      <title>Re: Internal angles of a polyline</title>
      <link>https://forums.autodesk.com/t5/net-forum/internal-angles-of-a-polyline/m-p/3793609#M50868</link>
      <description>&lt;P&gt;Hello:&lt;/P&gt;&lt;P&gt;thank you very much for the reply, I reviewed the code and definitely is going to help me in solving the problem.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Greetings&lt;/P&gt;</description>
      <pubDate>Fri, 01 Mar 2013 15:42:25 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/internal-angles-of-a-polyline/m-p/3793609#M50868</guid>
      <dc:creator>ccalvo12</dc:creator>
      <dc:date>2013-03-01T15:42:25Z</dc:date>
    </item>
  </channel>
</rss>

