<?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: Space line, how to find the red boundary? in ObjectARX Forum</title>
    <link>https://forums.autodesk.com/t5/objectarx-forum/space-line-how-to-find-the-red-boundary/m-p/11209826#M2505</link>
    <description>&lt;P&gt;(6-7-8-9-?-?...-?-19) can be split into smaller loops. (6,7,4,3) can't. You must sort out all loops that can be split! I.e. consider (6,7,8,9,10,5,4,3,18,19). It includes the connected points (6,3), (7,4) and (5,8). So it can be split at these three connections in three steps:&lt;/P&gt;
&lt;OL&gt;
&lt;LI&gt;split at (6,3): (&lt;U&gt;&lt;STRONG&gt;6,7,8,9,10,5,4,3&lt;/STRONG&gt;&lt;/U&gt;,18,19) =&amp;gt; (6,3,18,19) + (6,7,8,9,10,5,4,3)&lt;/LI&gt;
&lt;LI&gt;split at (7,4): (6,&lt;U&gt;&lt;STRONG&gt;7,8,9,10,5,4&lt;/STRONG&gt;&lt;/U&gt;,3) =&amp;gt; (6,7,4,3) + (7,8,9,10,5,4)&lt;/LI&gt;
&lt;LI&gt;split at (5,8): (7,8,9,10,5,4)=(&lt;U&gt;&lt;STRONG&gt;5,4,7,8&lt;/STRONG&gt;&lt;/U&gt;,9,10) =&amp;gt; (5,8,9,10) + (5,4,7,8)&lt;/LI&gt;
&lt;/OL&gt;
&lt;P&gt;Result: (6,3,18,19) + (6,7,4,3) + (5,8,9,10).&lt;/P&gt;
&lt;P&gt;This includes (6,7) only once.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Thu, 02 Jun 2022 07:49:01 GMT</pubDate>
    <dc:creator>tbrammer</dc:creator>
    <dc:date>2022-06-02T07:49:01Z</dc:date>
    <item>
      <title>Space line, how to find the red boundary?</title>
      <link>https://forums.autodesk.com/t5/objectarx-forum/space-line-how-to-find-the-red-boundary/m-p/11200497#M2492</link>
      <description>&lt;P&gt;Space line, how to find the red boundary?&lt;/P&gt;</description>
      <pubDate>Sun, 29 May 2022 10:23:32 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/objectarx-forum/space-line-how-to-find-the-red-boundary/m-p/11200497#M2492</guid>
      <dc:creator>1127204185</dc:creator>
      <dc:date>2022-05-29T10:23:32Z</dc:date>
    </item>
    <item>
      <title>Re: Space line, how to find the red boundary?</title>
      <link>https://forums.autodesk.com/t5/objectarx-forum/space-line-how-to-find-the-red-boundary/m-p/11201836#M2493</link>
      <description>&lt;DIV id="areafixed" class="Element710" style="width: 2153px;"&gt;
&lt;DIV class="Element92"&gt;
&lt;DIV class="Element5"&gt;ObjectARX has classes like &lt;FONT face="courier new,courier"&gt;AcDbSubDMesh&lt;/FONT&gt; that can represent meshes. But I don't think that there&lt;/DIV&gt;
&lt;DIV class="Element5"&gt;is an API that can find the border lines.&lt;/DIV&gt;
&lt;/DIV&gt;
&lt;/DIV&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="tbrammer_0-1653897177597.png" style="width: 600px;"&gt;&lt;img src="https://forums.autodesk.com/t5/image/serverpage/image-id/1073465iE11D26D5E2C7D758/image-size/medium?v=v2&amp;amp;px=400" role="button" title="tbrammer_0-1653897177597.png" alt="tbrammer_0-1653897177597.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;Basically the algorithm would be like this:&lt;/P&gt;
&lt;P&gt;1.) Build an index of all start- and endpoints of the lines.&lt;/P&gt;
&lt;P&gt;2.) Now you can represent lines by index pairs. I.e. the four lines around face A are (0,1), (1,4), (0,3) and (3,4).&lt;/P&gt;
&lt;P&gt;3.) Create a "connection map". I.e.:&lt;/P&gt;
&lt;LI-CODE lang="cpp"&gt;std::map&amp;lt;unsigned, std::vector&amp;lt;unsigned&amp;gt; &amp;gt; connections;
connections[0].push_back(1);
connections[1].push_back(0);
connections[0].push_back(3);
connections[3].push_back(0);
connections[3].push_back(4);
connections[4].push_back(3);
connections[3].push_back(6);
connections[6].push_back(3);
...&lt;/LI-CODE&gt;
&lt;P&gt;4.) For every connection look for closed triangle- or quad-loops. I.e. (3,4) has two loops: face A and C. If a connection is within two loops, it is an &lt;U&gt;inner&lt;/U&gt; connection. If it has only one loop, like (6,7) and (7,8) it is an &lt;U&gt;outer boundary&lt;/U&gt;.&lt;/P&gt;</description>
      <pubDate>Mon, 30 May 2022 08:48:30 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/objectarx-forum/space-line-how-to-find-the-red-boundary/m-p/11201836#M2493</guid>
      <dc:creator>tbrammer</dc:creator>
      <dc:date>2022-05-30T08:48:30Z</dc:date>
    </item>
    <item>
      <title>Re: Space line, how to find the red boundary?</title>
      <link>https://forums.autodesk.com/t5/objectarx-forum/space-line-how-to-find-the-red-boundary/m-p/11202557#M2494</link>
      <description>&lt;P&gt;You might find my code sample &lt;A href="https://forums.autodesk.com/t5/objectarx/closed-line-to-3dmesh/td-p/10662358" target="_blank" rel="noopener"&gt;here&lt;/A&gt; useful.&lt;/P&gt;
&lt;P&gt;But note that it works for triangles only. You must enhance the code so that it also works with quads.&lt;/P&gt;</description>
      <pubDate>Mon, 30 May 2022 14:21:56 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/objectarx-forum/space-line-how-to-find-the-red-boundary/m-p/11202557#M2494</guid>
      <dc:creator>tbrammer</dc:creator>
      <dc:date>2022-05-30T14:21:56Z</dc:date>
    </item>
    <item>
      <title>Re: Space line, how to find the red boundary?</title>
      <link>https://forums.autodesk.com/t5/objectarx-forum/space-line-how-to-find-the-red-boundary/m-p/11202632#M2495</link>
      <description>&lt;P&gt;The difficulty is how to find these closed areas？&lt;/P&gt;&lt;P&gt;A:0-1-4-3&lt;/P&gt;&lt;P&gt;B:1-2-5-4&lt;/P&gt;&lt;P&gt;D:3-4-7-6&lt;/P&gt;&lt;P&gt;C:4-5-8-7&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 30 May 2022 14:51:56 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/objectarx-forum/space-line-how-to-find-the-red-boundary/m-p/11202632#M2495</guid>
      <dc:creator>1127204185</dc:creator>
      <dc:date>2022-05-30T14:51:56Z</dc:date>
    </item>
    <item>
      <title>Re: Space line, how to find the red boundary?</title>
      <link>https://forums.autodesk.com/t5/objectarx-forum/space-line-how-to-find-the-red-boundary/m-p/11202669#M2496</link>
      <description>&lt;P&gt;It's not too difficult.&lt;/P&gt;
&lt;P&gt;&lt;BR /&gt;Let's say you start at (3,4) &lt;BR /&gt;In the &lt;FONT face="courier new,courier"&gt;connections&lt;/FONT&gt; map you find the points connected to 3 and 4.&lt;/P&gt;
&lt;UL&gt;
&lt;LI&gt;Set3: 0,6,9&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; (point 9 is left of point 3. It isn't drawn in my picture)&lt;/LI&gt;
&lt;LI&gt;Set4: 1,5,7&lt;/LI&gt;
&lt;/UL&gt;
&lt;P&gt;We first check, whether there is a triangle:&amp;nbsp; Does one or two of the points in Set3 connect to 4?&lt;/P&gt;
&lt;P&gt;If there are less than two triangle connections then we search for quad connections between Set3 and Set4.&lt;/P&gt;
&lt;P&gt;In this case there is no triangle connection. But we easily find the two quad connections (0,1) and (6,7).&lt;BR /&gt;And now, because we found &lt;U&gt;two&lt;/U&gt; connections, you can tell that (3,4) is an inner connection.&lt;/P&gt;</description>
      <pubDate>Mon, 30 May 2022 15:26:02 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/objectarx-forum/space-line-how-to-find-the-red-boundary/m-p/11202669#M2496</guid>
      <dc:creator>tbrammer</dc:creator>
      <dc:date>2022-05-30T15:26:02Z</dc:date>
    </item>
    <item>
      <title>Re: Space line, how to find the red boundary?</title>
      <link>https://forums.autodesk.com/t5/objectarx-forum/space-line-how-to-find-the-red-boundary/m-p/11202749#M2497</link>
      <description>&lt;P&gt;My algorithm，3-4 there are two results, proving that it is not a boundary&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="test.jpg" style="width: 600px;"&gt;&lt;img src="https://forums.autodesk.com/t5/image/serverpage/image-id/1073660i77549504DFE302FF/image-size/large?v=v2&amp;amp;px=999" role="button" title="test.jpg" alt="test.jpg" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="cpp"&gt;No. 1
3-4

No. 2
3-4-1
3-4-5
3-4-7

No. 3
3-4-1-0
3-4-1-14
3-4-1-2
3-4-5-2
3-4-5-10
3-4-5-8
3-4-7-6
3-4-7-8

No. 4
3-4-1-0-15
3-4-1-0-17
3-4-1-0-3  Found a closed body A
3-4-1-14-15
3-4-1-14-?
3-4-1-14-13
3-4-1-2-13
3-4-1-2-11
3-4-1-2-5
3-4-5-2-1
3-4-5-2-13
3-4-5-2-11
3-4-5-2-5
3-4-5-10-11
3-4-5-10-?
3-4-5-10-9
3-4-5-8-9
3-4-5-8-7
3-4-7-6-3 Found a closed body C
3-4-7-6-19
3-4-7-8-5
3-4-7-8-9&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 30 May 2022 15:50:41 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/objectarx-forum/space-line-how-to-find-the-red-boundary/m-p/11202749#M2497</guid>
      <dc:creator>1127204185</dc:creator>
      <dc:date>2022-05-30T15:50:41Z</dc:date>
    </item>
    <item>
      <title>Re: Space line, how to find the red boundary?</title>
      <link>https://forums.autodesk.com/t5/objectarx-forum/space-line-how-to-find-the-red-boundary/m-p/11202767#M2498</link>
      <description>&lt;LI-CODE lang="cpp"&gt;No. 1
6-7

No. 2
6-7-4
6-7-8

No. 3
6-7-4-3
6-7-4-1
6-7-4-5
6-7-8-5
6-7-8-9

No. 4
6-7-4-3-6  Found a closed body C
6-7-4-3-0
6-7-4-3-18
6-7-4-1-0
6-7-4-1-14
6-7-4-1-2
6-7-4-5-2
6-7-4-5-10
6-7-4-5-8
6-7-8-5-2
6-7-8-5-10
6-7-8-5-4
6-7-8-5-9
6-7-8-9-10
6-7-8-9-?&lt;/LI-CODE&gt;</description>
      <pubDate>Mon, 30 May 2022 15:58:50 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/objectarx-forum/space-line-how-to-find-the-red-boundary/m-p/11202767#M2498</guid>
      <dc:creator>1127204185</dc:creator>
      <dc:date>2022-05-30T15:58:50Z</dc:date>
    </item>
    <item>
      <title>Re: Space line, how to find the red boundary?</title>
      <link>https://forums.autodesk.com/t5/objectarx-forum/space-line-how-to-find-the-red-boundary/m-p/11203943#M2499</link>
      <description>&lt;P&gt;Yep, you got the algorithm. Now you just need to code it &lt;span class="lia-unicode-emoji" title=":beaming_face_with_smiling_eyes:"&gt;😁&lt;/span&gt;.&lt;/P&gt;</description>
      <pubDate>Tue, 31 May 2022 06:53:38 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/objectarx-forum/space-line-how-to-find-the-red-boundary/m-p/11203943#M2499</guid>
      <dc:creator>tbrammer</dc:creator>
      <dc:date>2022-05-31T06:53:38Z</dc:date>
    </item>
    <item>
      <title>Re: Space line, how to find the red boundary?</title>
      <link>https://forums.autodesk.com/t5/objectarx-forum/space-line-how-to-find-the-red-boundary/m-p/11204378#M2500</link>
      <description>&lt;P&gt;Still don't understand&lt;/P&gt;&lt;LI-CODE lang="cpp"&gt; no.5 
3-4-5-2-1-0 
 no.6 
3-4-5-2-1-0-3 &lt;/LI-CODE&gt;</description>
      <pubDate>Tue, 31 May 2022 10:19:53 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/objectarx-forum/space-line-how-to-find-the-red-boundary/m-p/11204378#M2500</guid>
      <dc:creator>1127204185</dc:creator>
      <dc:date>2022-05-31T10:19:53Z</dc:date>
    </item>
    <item>
      <title>Re: Space line, how to find the red boundary?</title>
      <link>https://forums.autodesk.com/t5/objectarx-forum/space-line-how-to-find-the-red-boundary/m-p/11204849#M2501</link>
      <description>&lt;P&gt;My idea was to search for triangles and quads &lt;EM&gt;only&lt;/EM&gt; because your drawing only contains triangles and quads and because it is common to form shells from triangles an quads.&lt;/P&gt;
&lt;P&gt;I would not search for loops that contain more than four points!&lt;/P&gt;
&lt;P&gt;So neither 3-4-5-2-1-0&amp;nbsp; nor 3-4-5-2-1-0-3 is a "valid" loop.&amp;nbsp; I would check 3-4-5-2 and discard it, because 2 isn't connected to 3.&lt;/P&gt;
&lt;P&gt;If you expect faces with more than 4 edges the algorithm becomes much more complex. In this case you have to "walk along" all possible paths and remember which points you have already visited. You will find a bunch of long loops that can be split into shorter loops like (3,4,5,2,1,0) =&amp;gt; (3,4,1,0)+(4,5,2,1). These long loops must be sorted out.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 31 May 2022 13:04:37 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/objectarx-forum/space-line-how-to-find-the-red-boundary/m-p/11204849#M2501</guid>
      <dc:creator>tbrammer</dc:creator>
      <dc:date>2022-05-31T13:04:37Z</dc:date>
    </item>
    <item>
      <title>Re: Space line, how to find the red boundary?</title>
      <link>https://forums.autodesk.com/t5/objectarx-forum/space-line-how-to-find-the-red-boundary/m-p/11205063#M2502</link>
      <description>&lt;P&gt;I would search for loops that contain more than four points!&lt;/P&gt;</description>
      <pubDate>Tue, 31 May 2022 14:18:03 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/objectarx-forum/space-line-how-to-find-the-red-boundary/m-p/11205063#M2502</guid>
      <dc:creator>1127204185</dc:creator>
      <dc:date>2022-05-31T14:18:03Z</dc:date>
    </item>
    <item>
      <title>Re: Space line, how to find the red boundary?</title>
      <link>https://forums.autodesk.com/t5/objectarx-forum/space-line-how-to-find-the-red-boundary/m-p/11205187#M2503</link>
      <description>&lt;P&gt;Hm. Really? It's quite challenging to find an effective algorithm for this.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I already wrote one basic idea above: Walk along all possible paths and remember which points you have already visited. If you come to a point that you visited before you found a loop. Store all loops. You will find a bunch of long loops that can be split into shorter loops like (3,4,5,2,1,0) =&amp;gt; (3,4,1,0)+(4,5,2,1). These long loops must be sorted out. Analyse the remaining short loops and look for single connections. These are the border lines.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If you find loops with 4 and more points the points may not be in the same plane and/or the face might be concave.&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="tbrammer_0-1654009257958.png" style="width: 600px;"&gt;&lt;img src="https://forums.autodesk.com/t5/image/serverpage/image-id/1074213i1673F4AD2F3F1733/image-size/medium?v=v2&amp;amp;px=400" role="button" title="tbrammer_0-1654009257958.png" alt="tbrammer_0-1654009257958.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;What is this?&lt;/P&gt;
&lt;UL&gt;
&lt;LI&gt;If all four points 0,1,2 and 3 are within the same plane you have a triangle (0,1,2) and a concave quad (0,1,3,2).&lt;BR /&gt;In this case (1,2,3) is the outer border.&lt;/LI&gt;
&lt;LI&gt;Otherwise you have two triangles (0,1,2) and (1,2,3).&lt;BR /&gt;In this case (1,3,2,0) is the outer border.&lt;/LI&gt;
&lt;/UL&gt;
&lt;P&gt;Now imagine loops with 5, 6, ... points.&lt;/P&gt;
&lt;P&gt;Maybe it makes sense to look for points within (nearly?) the same plane while searching for loops.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 31 May 2022 15:10:55 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/objectarx-forum/space-line-how-to-find-the-red-boundary/m-p/11205187#M2503</guid>
      <dc:creator>tbrammer</dc:creator>
      <dc:date>2022-05-31T15:10:55Z</dc:date>
    </item>
    <item>
      <title>Re: Space line, how to find the red boundary?</title>
      <link>https://forums.autodesk.com/t5/objectarx-forum/space-line-how-to-find-the-red-boundary/m-p/11208301#M2504</link>
      <description>&lt;P&gt;Each edge can get 2 closed&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;6-7 -4-3-6&lt;/P&gt;&lt;P&gt;6-7-8-9-?-?...-?-19-6&lt;/P&gt;</description>
      <pubDate>Thu, 02 Jun 2022 05:20:51 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/objectarx-forum/space-line-how-to-find-the-red-boundary/m-p/11208301#M2504</guid>
      <dc:creator>1127204185</dc:creator>
      <dc:date>2022-06-02T05:20:51Z</dc:date>
    </item>
    <item>
      <title>Re: Space line, how to find the red boundary?</title>
      <link>https://forums.autodesk.com/t5/objectarx-forum/space-line-how-to-find-the-red-boundary/m-p/11209826#M2505</link>
      <description>&lt;P&gt;(6-7-8-9-?-?...-?-19) can be split into smaller loops. (6,7,4,3) can't. You must sort out all loops that can be split! I.e. consider (6,7,8,9,10,5,4,3,18,19). It includes the connected points (6,3), (7,4) and (5,8). So it can be split at these three connections in three steps:&lt;/P&gt;
&lt;OL&gt;
&lt;LI&gt;split at (6,3): (&lt;U&gt;&lt;STRONG&gt;6,7,8,9,10,5,4,3&lt;/STRONG&gt;&lt;/U&gt;,18,19) =&amp;gt; (6,3,18,19) + (6,7,8,9,10,5,4,3)&lt;/LI&gt;
&lt;LI&gt;split at (7,4): (6,&lt;U&gt;&lt;STRONG&gt;7,8,9,10,5,4&lt;/STRONG&gt;&lt;/U&gt;,3) =&amp;gt; (6,7,4,3) + (7,8,9,10,5,4)&lt;/LI&gt;
&lt;LI&gt;split at (5,8): (7,8,9,10,5,4)=(&lt;U&gt;&lt;STRONG&gt;5,4,7,8&lt;/STRONG&gt;&lt;/U&gt;,9,10) =&amp;gt; (5,8,9,10) + (5,4,7,8)&lt;/LI&gt;
&lt;/OL&gt;
&lt;P&gt;Result: (6,3,18,19) + (6,7,4,3) + (5,8,9,10).&lt;/P&gt;
&lt;P&gt;This includes (6,7) only once.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 02 Jun 2022 07:49:01 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/objectarx-forum/space-line-how-to-find-the-red-boundary/m-p/11209826#M2505</guid>
      <dc:creator>tbrammer</dc:creator>
      <dc:date>2022-06-02T07:49:01Z</dc:date>
    </item>
    <item>
      <title>Re: Space line, how to find the red boundary?</title>
      <link>https://forums.autodesk.com/t5/objectarx-forum/space-line-how-to-find-the-red-boundary/m-p/11210128#M2506</link>
      <description>&lt;P&gt;Problem code&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="general"&gt;static void MyGroupMyCommand1 () {
	ads_name sset;
	resbuf *rbList = acutBuildList(RTDXF0, _T("LINE"), RTNONE);
	int result = acedSSGet(NULL, NULL, NULL, rbList, sset);
	if (result != RTNORM) { return; }
	Adesk::Int32 length = 0;
	acedSSLength(sset, &amp;amp;length);
	Acad::ErrorStatus es = Acad::eOk;


	resbuf StartTime;
	acedGetVar(_RXST("TDUSRTIMER"), &amp;amp;StartTime); 


	vector&amp;lt;AcGePoint3dArray&amp;gt; dat,dat2;
	vector&amp;lt;AcGePoint3dArray&amp;gt; dattemp1;
	AcGePoint3dArray dattemp,dat3;
	for (int i = 0; i &amp;lt; length; i++)
	{
		ads_name ename;
		acedSSName(sset, i, ename);
		dattemp.removeAll();
		AcDbObjectId objId = AcDbObjectId::kNull;
		es = acdbGetObjectId(objId, ename);
		if (es != Acad::eOk) { continue; }
		AcDbEntity* pEnt = NULL;
		es = acdbOpenObject(pEnt, objId, AcDb::kForRead);
		if (es != Acad::eOk) { continue; }
		if (pEnt-&amp;gt;isKindOf(AcDbCurve::desc()))
		{
			AcDbCurve* pCurve = AcDbCurve::cast(pEnt);
			AcGePoint3d staPt,entPt;
			pCurve-&amp;gt;getStartPoint(staPt);
			pCurve-&amp;gt;getEndPoint(entPt);
			AcGePoint3dArray pa1;
			pa1.append(staPt);
			pa1.append(entPt);
			dat2.push_back(pa1);
			dat3.append(staPt);
			dat3.append(entPt);
			pa1.removeAll();
			pCurve-&amp;gt;close();
		}
		pEnt-&amp;gt;close();
	}
	acedSSFree(sset);

	AcGePoint3dArray dat4 =deletePoint(dat3,1e-7);
	acutPrintf(_RXST("\ndat3: %d \n"), dat3.length());
    acutPrintf(_RXST("\ndat4: %d \n"), dat4.length()); 
	acutPrintf(_RXST("\ndat2: %d \n"), dat2.size()); 

	map&amp;lt;int, AcGePoint3d&amp;gt; dats;
	dats.clear();
	for (int i = 1; i &amp;lt; dat4.length()+1; i++)
	{
		dats.insert(pair&amp;lt;int, AcGePoint3d&amp;gt;(i, dat4.at(i - 1)));
	}

	vector&amp;lt;vector&amp;lt;int&amp;gt;&amp;gt; dat5;
	AcGePoint3d  pp0,pp1;
	for (int i = 0; i &amp;lt; dat2.size(); i++)
	{
		pp0=dat2.at(i).at(0);
		pp1=dat2.at(i).at(1);
		int k1,k2;

		for(map&amp;lt;int, AcGePoint3d&amp;gt;::const_iterator it = dats.begin(); it != dats.end(); ++it) 
		{
			if (pp0.distanceTo(it-&amp;gt;second) &amp;lt; 1e-7)
			{
				k1=it-&amp;gt;first;
			} 
			if (pp1.distanceTo(it-&amp;gt;second) &amp;lt; 1e-7)
			{
				k2=it-&amp;gt;first;
			}
		} 
	    vector&amp;lt;int&amp;gt; temp;
		temp.push_back(k1);
		temp.push_back(k2);
		dat5.push_back(temp);
		acutPrintf(_RXST("\n  %d = %d _ %d"), i,k1,k2);

	}

		map&amp;lt;int, vector&amp;lt;int&amp;gt;&amp;gt; dat6;
		for (int i = 1; i &amp;lt; dats.size(); i++)
		{
			vector&amp;lt;int&amp;gt; temp;
			temp.clear();
			for (int ii = 0; ii &amp;lt; dat5.size(); ii++)
			{
				if (dat5.at(ii).at(0) == i)
				{
					temp.push_back(dat5.at(ii).at(1));
				}
				if (dat5.at(ii).at(1) == i)
				{
					temp.push_back(dat5.at(ii).at(0));
				}
			}
			dat6.insert(pair&amp;lt;int,  vector&amp;lt;int&amp;gt;&amp;gt;(i, temp));	
		}

		vector&amp;lt;int&amp;gt; temp,temp1,temp2,temp3;
		vector&amp;lt;vector&amp;lt;int&amp;gt;&amp;gt; temps,temps1,temps2,temps3;
		for (int i = 0; i &amp;lt; dat5.size(); i++)
		{
			int a1=dat5.at(i).at(0);
			int a2=dat5.at(i).at(1);
			temp.push_back(a1);
			temp.push_back(a2);
			temps.push_back(temp);
			while (temps1.size() != 2)
			{
				temp3.clear();
				for (int ii = 0; ii &amp;lt; temps.size(); ii++)
				{
					temp1=temps.at(ii);
					int a3=temp1.back();
					int a4=temp1.at(temp1.size() - 2);
					auto it1 =dat6.find(a3);
					vector&amp;lt;int&amp;gt; kk=it1-&amp;gt;second;
					for (int iii = 0; iii &amp;lt; kk.size(); iii++)
					{
                      temp3=temp1;
					  int a5 = kk.at(iii);
					  if ( a5 != a4  )   
					  {
						temp3.push_back(kk.at(iii));
						temps2.push_back(temp3);
					   }

					  if ( a5 = a1 || temp1.size() &amp;gt; 2)   
					  {
						  temp3.push_back(a5);
						  temps1.push_back(temp3);
					  }
	
                     }
				}
					temps=temps2;
			}

			}

	resbuf EndTime;
	acedGetVar(_RXST("TDUSRTIMER"), &amp;amp;EndTime);
	ads_real UserTime;
	UserTime = 86400.0 * (EndTime.resval.rreal - StartTime.resval.rreal);
	TCHAR ChTime[50];
	acdbRToS(UserTime, 2, 8, ChTime);
	acutPrintf(_RXST("\nTime: %s \n"), ChTime);

}&lt;/LI-CODE&gt;&lt;LI-CODE lang="general"&gt;&lt;/LI-CODE&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, 02 Jun 2022 10:27:33 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/objectarx-forum/space-line-how-to-find-the-red-boundary/m-p/11210128#M2506</guid>
      <dc:creator>1127204185</dc:creator>
      <dc:date>2022-06-02T10:27:33Z</dc:date>
    </item>
    <item>
      <title>Re: Space line, how to find the red boundary?</title>
      <link>https://forums.autodesk.com/t5/objectarx-forum/space-line-how-to-find-the-red-boundary/m-p/11218688#M2507</link>
      <description>&lt;P&gt;I haven't checked your code yet. What do you mean by "problem code"?&lt;/P&gt;
&lt;P&gt;Does it solve the problem for you or does it not work as expected? Please specify.&lt;/P&gt;</description>
      <pubDate>Tue, 07 Jun 2022 07:43:01 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/objectarx-forum/space-line-how-to-find-the-red-boundary/m-p/11218688#M2507</guid>
      <dc:creator>tbrammer</dc:creator>
      <dc:date>2022-06-07T07:43:01Z</dc:date>
    </item>
    <item>
      <title>Re: Space line, how to find the red boundary?</title>
      <link>https://forums.autodesk.com/t5/objectarx-forum/space-line-how-to-find-the-red-boundary/m-p/11218841#M2508</link>
      <description>&lt;LI-CODE lang="cpp"&gt; it not work as expected 


vector&amp;lt;int&amp;gt; temp,temp1,temp2,temp3;
		vector&amp;lt;vector&amp;lt;int&amp;gt;&amp;gt; temps,temps1,temps2,temps3;
		for (int i = 0; i &amp;lt; dat5.size(); i++)
		{
			int a1=dat5.at(i).at(0);
			int a2=dat5.at(i).at(1);
			temp.push_back(a1);
			temp.push_back(a2);
			temps.push_back(temp);
			while (temps1.size() != 2)
			{
				temp3.clear();
				for (int ii = 0; ii &amp;lt; temps.size(); ii++)
				{
					temp1=temps.at(ii);
					int a3=temp1.back();
					int a4=temp1.at(temp1.size() - 2);
					auto it1 =dat6.find(a3);
					vector&amp;lt;int&amp;gt; kk=it1-&amp;gt;second;
					for (int iii = 0; iii &amp;lt; kk.size(); iii++)
					{
                      temp3=temp1;
					  int a5 = kk.at(iii);
					  if ( a5 != a4  )   
					  {
						temp3.push_back(kk.at(iii));
						temps2.push_back(temp3);
					   }

					  if ( a5 = a1 || temp1.size() &amp;gt; 2)   
					  {
						  temp3.push_back(a5);
						  temps1.push_back(temp3);
					  }
	
                     }
				}
					temps=temps2;
			}

			}&lt;/LI-CODE&gt;</description>
      <pubDate>Tue, 07 Jun 2022 09:06:45 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/objectarx-forum/space-line-how-to-find-the-red-boundary/m-p/11218841#M2508</guid>
      <dc:creator>1127204185</dc:creator>
      <dc:date>2022-06-07T09:06:45Z</dc:date>
    </item>
    <item>
      <title>Re: Space line, how to find the red boundary?</title>
      <link>https://forums.autodesk.com/t5/objectarx-forum/space-line-how-to-find-the-red-boundary/m-p/11222281#M2509</link>
      <description>&lt;P&gt;In&amp;nbsp;&lt;FONT face="courier new,courier"&gt;MyGroupMyCommand1 ()&lt;/FONT&gt; you use a function&amp;nbsp;&lt;FONT face="courier new,courier"&gt;deletePoint(dat3, 1e-7)&lt;/FONT&gt;. Can you post the code?&lt;/P&gt;
&lt;P&gt;Comments in the code would be extremely helpful to show which results you expect and where things don't work as expected.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 08 Jun 2022 15:45:11 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/objectarx-forum/space-line-how-to-find-the-red-boundary/m-p/11222281#M2509</guid>
      <dc:creator>tbrammer</dc:creator>
      <dc:date>2022-06-08T15:45:11Z</dc:date>
    </item>
    <item>
      <title>Re: Space line, how to find the red boundary?</title>
      <link>https://forums.autodesk.com/t5/objectarx-forum/space-line-how-to-find-the-red-boundary/m-p/11222343#M2510</link>
      <description>&lt;P&gt;//Remove duplicates&amp;nbsp;&amp;nbsp;&lt;STRONG&gt;AcGePoint3d&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="general"&gt;static AcGePoint3dArray deletePoint(AcGePoint3dArray ptA,double minl)
{
	//AcGeTol pan;
	//pan.setEqualPoint(minl);
	if(ptA.length()&amp;gt;0)
	{
		for(int i=0;i&amp;lt;ptA.length()-1;i++)
		{  
			for(int j=ptA.length()-1;j&amp;gt;i;j--) 
			{   
				//if((ptA.at(i)).isEqualTo(ptA.at(j)))
				if((ptA.at(i)).distanceTo(ptA.at(j))&amp;lt;=minl)
				{  
					ptA.removeAt(j);
				}
			}  
		} 
	}
	return ptA;
}&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 08 Jun 2022 16:08:32 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/objectarx-forum/space-line-how-to-find-the-red-boundary/m-p/11222343#M2510</guid>
      <dc:creator>1127204185</dc:creator>
      <dc:date>2022-06-08T16:08:32Z</dc:date>
    </item>
    <item>
      <title>Re: Space line, how to find the red boundary?</title>
      <link>https://forums.autodesk.com/t5/objectarx-forum/space-line-how-to-find-the-red-boundary/m-p/11224768#M2511</link>
      <description>&lt;P&gt;At first glance I only see that some for loops use wrong ranges. i.e.:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;LI-CODE lang="cpp"&gt;map&amp;lt;int, AcGePoint3d&amp;gt; dats;
for (int i = 1; i &amp;lt; dat4.length()+1; i++)
	dats.insert(pair&amp;lt;int, AcGePoint3d&amp;gt;(i, dat4.at(i - 1)));

for (int i = 1; i &amp;lt; dats.size(); i++) 
// will only iterate over dats.size()-1 entries&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;It makes more sense to use the &lt;FONT face="courier new,courier"&gt;AcGePoint3dArray&lt;/FONT&gt;&amp;nbsp;&lt;FONT face="courier new,courier"&gt;dat4&lt;/FONT&gt;&amp;nbsp;directly instead of a &lt;FONT face="courier new,courier"&gt;map&lt;/FONT&gt;.&amp;nbsp; Simply use the array-index as point index! Note: Usually a map is filled like this:&lt;/P&gt;
&lt;LI-CODE lang="cpp"&gt;dats[i] = dat4[i-1]; // will create an entry at key i
&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;To understand the code better I have renamed some variables and made some changes. You find my code in the attached zip. Basically you have to code an algorithm that "walks along" all possible paths using&amp;nbsp;&lt;FONT face="courier new,courier"&gt;connectedPointsIndices &lt;/FONT&gt;and finds all the shortest possible closed loops. This isn't trivial - and it's your job. Good luck!&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 09 Jun 2022 13:56:22 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/objectarx-forum/space-line-how-to-find-the-red-boundary/m-p/11224768#M2511</guid>
      <dc:creator>tbrammer</dc:creator>
      <dc:date>2022-06-09T13:56:22Z</dc:date>
    </item>
  </channel>
</rss>

