<?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: &amp;quot;center of gravity&amp;quot; of a AcDbPolyLine in ObjectARX Forum</title>
    <link>https://forums.autodesk.com/t5/objectarx-forum/quot-center-of-gravity-quot-of-a-acdbpolyline/m-p/325578#M33592</link>
    <description>"Robert Nihl" &lt;NOSPAM&gt; wrote in message&lt;BR /&gt;
news:7F1FE3B716E28CDFBB75DF2BEB9B2307@in.WebX.maYIadrTaRb...&lt;BR /&gt;
&amp;gt; Hello,&lt;BR /&gt;
&amp;gt;&lt;BR /&gt;
&amp;gt; I am not a mathematician. Has anybody a algorithm to calculate the "center&lt;BR /&gt;
&amp;gt; of gravity" of a closed Polyline ?&lt;BR /&gt;
&amp;gt;&lt;BR /&gt;
&amp;gt; Regards&lt;BR /&gt;
&amp;gt;&lt;BR /&gt;
&amp;gt; Robert&lt;BR /&gt;
&amp;gt;&lt;BR /&gt;
&amp;gt;&lt;BR /&gt;
&lt;BR /&gt;
Hi,&lt;BR /&gt;
&lt;BR /&gt;
gx = ( x0 + x1 + ... + xn ) / n&lt;BR /&gt;
&lt;BR /&gt;
n - numVerts&lt;BR /&gt;
&lt;BR /&gt;
x0...xn - x coordinates of the polyline vertexes&lt;BR /&gt;
&lt;BR /&gt;
And apply the same formula for gy and gz.&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
Regards,&lt;BR /&gt;
&lt;BR /&gt;
Bogdan&lt;/NOSPAM&gt;</description>
    <pubDate>Thu, 16 Oct 2003 01:22:49 GMT</pubDate>
    <dc:creator>Anonymous</dc:creator>
    <dc:date>2003-10-16T01:22:49Z</dc:date>
    <item>
      <title>"center of gravity" of a AcDbPolyLine</title>
      <link>https://forums.autodesk.com/t5/objectarx-forum/quot-center-of-gravity-quot-of-a-acdbpolyline/m-p/325577#M33591</link>
      <description>Hello,&lt;BR /&gt;
&lt;BR /&gt;
I am not a mathematician. Has anybody a algorithm to calculate the "center&lt;BR /&gt;
of gravity" of a closed Polyline ?&lt;BR /&gt;
&lt;BR /&gt;
Regards&lt;BR /&gt;
&lt;BR /&gt;
Robert</description>
      <pubDate>Wed, 15 Oct 2003 23:20:28 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/objectarx-forum/quot-center-of-gravity-quot-of-a-acdbpolyline/m-p/325577#M33591</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2003-10-15T23:20:28Z</dc:date>
    </item>
    <item>
      <title>Re: "center of gravity" of a AcDbPolyLine</title>
      <link>https://forums.autodesk.com/t5/objectarx-forum/quot-center-of-gravity-quot-of-a-acdbpolyline/m-p/325578#M33592</link>
      <description>"Robert Nihl" &lt;NOSPAM&gt; wrote in message&lt;BR /&gt;
news:7F1FE3B716E28CDFBB75DF2BEB9B2307@in.WebX.maYIadrTaRb...&lt;BR /&gt;
&amp;gt; Hello,&lt;BR /&gt;
&amp;gt;&lt;BR /&gt;
&amp;gt; I am not a mathematician. Has anybody a algorithm to calculate the "center&lt;BR /&gt;
&amp;gt; of gravity" of a closed Polyline ?&lt;BR /&gt;
&amp;gt;&lt;BR /&gt;
&amp;gt; Regards&lt;BR /&gt;
&amp;gt;&lt;BR /&gt;
&amp;gt; Robert&lt;BR /&gt;
&amp;gt;&lt;BR /&gt;
&amp;gt;&lt;BR /&gt;
&lt;BR /&gt;
Hi,&lt;BR /&gt;
&lt;BR /&gt;
gx = ( x0 + x1 + ... + xn ) / n&lt;BR /&gt;
&lt;BR /&gt;
n - numVerts&lt;BR /&gt;
&lt;BR /&gt;
x0...xn - x coordinates of the polyline vertexes&lt;BR /&gt;
&lt;BR /&gt;
And apply the same formula for gy and gz.&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
Regards,&lt;BR /&gt;
&lt;BR /&gt;
Bogdan&lt;/NOSPAM&gt;</description>
      <pubDate>Thu, 16 Oct 2003 01:22:49 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/objectarx-forum/quot-center-of-gravity-quot-of-a-acdbpolyline/m-p/325578#M33592</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2003-10-16T01:22:49Z</dc:date>
    </item>
    <item>
      <title>Re:</title>
      <link>https://forums.autodesk.com/t5/objectarx-forum/quot-center-of-gravity-quot-of-a-acdbpolyline/m-p/325579#M33593</link>
      <description>&amp;gt; gx = ( x0 + x1 + ... + xn ) / n&lt;BR /&gt;
&amp;gt; n - numVerts&lt;BR /&gt;
&amp;gt; x0...xn - x coordinates of the polyline vertexes&lt;BR /&gt;
&amp;gt;&lt;BR /&gt;
&amp;gt; And apply the same formula for gy and gz.&lt;BR /&gt;
&amp;gt;&lt;BR /&gt;
&lt;BR /&gt;
That is much easier as I expected &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;BR /&gt;
&lt;BR /&gt;
Thanx&lt;BR /&gt;
&lt;BR /&gt;
Robert</description>
      <pubDate>Thu, 16 Oct 2003 01:22:49 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/objectarx-forum/quot-center-of-gravity-quot-of-a-acdbpolyline/m-p/325579#M33593</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2003-10-16T01:22:49Z</dc:date>
    </item>
    <item>
      <title>Re:</title>
      <link>https://forums.autodesk.com/t5/objectarx-forum/quot-center-of-gravity-quot-of-a-acdbpolyline/m-p/325580#M33594</link>
      <description>Hi, Bogdan!&lt;BR /&gt;
You wrote  to newsgroup &lt;AUTODESK.AUTOCAD.OBJECTARX&gt;   Thu, 16 Oct 2003&lt;BR /&gt;
02:22:49 -0700:&lt;BR /&gt;
 B&amp;gt; Hi,&lt;BR /&gt;
 B&amp;gt;&lt;BR /&gt;
 B&amp;gt; gx = ( x0 + x1 + ... + xn ) / n&lt;BR /&gt;
 B&amp;gt;&lt;BR /&gt;
 B&amp;gt; n - numVerts&lt;BR /&gt;
 B&amp;gt;&lt;BR /&gt;
 B&amp;gt; x0...xn - x coordinates of the polyline vertexes&lt;BR /&gt;
 B&amp;gt;&lt;BR /&gt;
 B&amp;gt; And apply the same formula for gy and gz.&lt;BR /&gt;
&lt;BR /&gt;
It's not exactly for polyline with arc segments!&lt;BR /&gt;
&lt;BR /&gt;
Best Regards,&lt;BR /&gt;
Alexander Rivilis&lt;/AUTODESK.AUTOCAD.OBJECTARX&gt;</description>
      <pubDate>Thu, 16 Oct 2003 05:06:46 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/objectarx-forum/quot-center-of-gravity-quot-of-a-acdbpolyline/m-p/325580#M33594</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2003-10-16T05:06:46Z</dc:date>
    </item>
    <item>
      <title>Re:</title>
      <link>https://forums.autodesk.com/t5/objectarx-forum/quot-center-of-gravity-quot-of-a-acdbpolyline/m-p/325581#M33595</link>
      <description>Agree, I've written the answer without thinking at arcs.&lt;BR /&gt;
Also, there is another error in my previous post: the last x value should&lt;BR /&gt;
have the indices n-1.&lt;BR /&gt;
If the polyline has arc segments an AcDbRegion could be made from the&lt;BR /&gt;
polyline and use getAreaProp(...) method to find the centroid of the region.&lt;BR /&gt;
&lt;BR /&gt;
Regards,&lt;BR /&gt;
Bogdan&lt;BR /&gt;
&lt;BR /&gt;
"Alexander Rivilis" &lt;RIVILIS&gt; wrote in message&lt;BR /&gt;
news:6B4BBFFCC6B30EA3AC5F59D91EB82205@in.WebX.maYIadrTaRb...&lt;BR /&gt;
&amp;gt; Hi, Bogdan!&lt;BR /&gt;
&amp;gt; You wrote  to newsgroup &lt;AUTODESK.AUTOCAD.OBJECTARX&gt;   Thu, 16 Oct 2003&lt;BR /&gt;
&amp;gt; 02:22:49 -0700:&lt;BR /&gt;
&amp;gt;  B&amp;gt; Hi,&lt;BR /&gt;
&amp;gt;  B&amp;gt;&lt;BR /&gt;
&amp;gt;  B&amp;gt; gx = ( x0 + x1 + ... + xn ) / n&lt;BR /&gt;
&amp;gt;  B&amp;gt;&lt;BR /&gt;
&amp;gt;  B&amp;gt; n - numVerts&lt;BR /&gt;
&amp;gt;  B&amp;gt;&lt;BR /&gt;
&amp;gt;  B&amp;gt; x0...xn - x coordinates of the polyline vertexes&lt;BR /&gt;
&amp;gt;  B&amp;gt;&lt;BR /&gt;
&amp;gt;  B&amp;gt; And apply the same formula for gy and gz.&lt;BR /&gt;
&amp;gt;&lt;BR /&gt;
&amp;gt; It's not exactly for polyline with arc segments!&lt;BR /&gt;
&amp;gt;&lt;BR /&gt;
&amp;gt; Best Regards,&lt;BR /&gt;
&amp;gt; Alexander Rivilis&lt;BR /&gt;
&amp;gt;&lt;BR /&gt;
&amp;gt;&lt;/AUTODESK.AUTOCAD.OBJECTARX&gt;&lt;/RIVILIS&gt;</description>
      <pubDate>Thu, 16 Oct 2003 08:33:08 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/objectarx-forum/quot-center-of-gravity-quot-of-a-acdbpolyline/m-p/325581#M33595</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2003-10-16T08:33:08Z</dc:date>
    </item>
  </channel>
</rss>

