<?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: 2d rectangle overlap find and filter in .NET Forum</title>
    <link>https://forums.autodesk.com/t5/net-forum/2d-rectangle-overlap-find-and-filter/m-p/2552861#M69176</link>
    <description>http://www.codeproject.com/KB/recipes/QuadTree.aspx&lt;BR /&gt;
&lt;BR /&gt;
-- &lt;BR /&gt;
http://www.caddzone.com&lt;BR /&gt;
&lt;BR /&gt;
AcadXTabs: MDI Document Tabs for AutoCAD&lt;BR /&gt;
Supporting AutoCAD 2000 through 2010&lt;BR /&gt;
&lt;BR /&gt;
http://www.acadxtabs.com&lt;BR /&gt;
&lt;BR /&gt;
Email: string.Format("{0}@{1}.com", "tonyt", "caddzone");&lt;BR /&gt;
&lt;BR /&gt;
&lt;RALSTOGJ&gt; wrote in message news:6250388@discussion.autodesk.com...&lt;BR /&gt;
Hi&lt;BR /&gt;
&lt;BR /&gt;
I am updating some 20 year old code in Autocad lisp that takes rectangles &lt;BR /&gt;
that&lt;BR /&gt;
surround text items and searches for text rectangles that overlap and &lt;BR /&gt;
filters out text based on a third elevation criteria.&lt;BR /&gt;
&lt;BR /&gt;
The raw data comes from scans of the sea floor and there can be 1000's of &lt;BR /&gt;
text rectangles. The existing rountine is just a loop that takes hours to &lt;BR /&gt;
run for large datasets.&lt;BR /&gt;
&lt;BR /&gt;
I found this discussion &lt;BR /&gt;
http://www.gamedev.net/community/forums/topic.asp?topic_id=445256 in a game &lt;BR /&gt;
programming forum from a couple of years ago where an r-tree is suggested as &lt;BR /&gt;
a good solution for a similar problem. Is there a build in r-tree type &lt;BR /&gt;
function in Autocad or something similar does anyone have some r-tree vb.net &lt;BR /&gt;
code or some other suggestion of how I could use built in functions in &lt;BR /&gt;
Autocad to search quickly&lt;BR /&gt;
for the overlapping rectangles.&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
Regards&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
Justin Ralston&lt;/RALSTOGJ&gt;</description>
    <pubDate>Tue, 08 Sep 2009 20:15:28 GMT</pubDate>
    <dc:creator>Anonymous</dc:creator>
    <dc:date>2009-09-08T20:15:28Z</dc:date>
    <item>
      <title>2d rectangle overlap find and filter</title>
      <link>https://forums.autodesk.com/t5/net-forum/2d-rectangle-overlap-find-and-filter/m-p/2552860#M69175</link>
      <description>Hi&lt;BR /&gt;
&lt;BR /&gt;
I am updating some 20 year old code in Autocad lisp that takes rectangles that&lt;BR /&gt;
surround text items and searches for text rectangles that overlap and filters out text based on a third elevation criteria.&lt;BR /&gt;
&lt;BR /&gt;
The raw data comes from scans of the sea floor and there can be 1000's of text rectangles. The existing rountine is just a loop that takes hours to run for large datasets.&lt;BR /&gt;
&lt;BR /&gt;
I found this discussion http://www.gamedev.net/community/forums/topic.asp?topic_id=445256 in a game programming forum from a couple of years ago where an r-tree is suggested as a good solution for a similar problem. Is there a build in r-tree type function in Autocad or something similar does anyone have some r-tree vb.net code or some other suggestion of how I could use built in functions in Autocad to search quickly&lt;BR /&gt;
for the overlapping rectangles.&lt;BR /&gt;
 &lt;BR /&gt;
&lt;BR /&gt;
Regards&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
Justin Ralston</description>
      <pubDate>Tue, 08 Sep 2009 10:11:35 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/2d-rectangle-overlap-find-and-filter/m-p/2552860#M69175</guid>
      <dc:creator>ralstogj</dc:creator>
      <dc:date>2009-09-08T10:11:35Z</dc:date>
    </item>
    <item>
      <title>Re: 2d rectangle overlap find and filter</title>
      <link>https://forums.autodesk.com/t5/net-forum/2d-rectangle-overlap-find-and-filter/m-p/2552861#M69176</link>
      <description>http://www.codeproject.com/KB/recipes/QuadTree.aspx&lt;BR /&gt;
&lt;BR /&gt;
-- &lt;BR /&gt;
http://www.caddzone.com&lt;BR /&gt;
&lt;BR /&gt;
AcadXTabs: MDI Document Tabs for AutoCAD&lt;BR /&gt;
Supporting AutoCAD 2000 through 2010&lt;BR /&gt;
&lt;BR /&gt;
http://www.acadxtabs.com&lt;BR /&gt;
&lt;BR /&gt;
Email: string.Format("{0}@{1}.com", "tonyt", "caddzone");&lt;BR /&gt;
&lt;BR /&gt;
&lt;RALSTOGJ&gt; wrote in message news:6250388@discussion.autodesk.com...&lt;BR /&gt;
Hi&lt;BR /&gt;
&lt;BR /&gt;
I am updating some 20 year old code in Autocad lisp that takes rectangles &lt;BR /&gt;
that&lt;BR /&gt;
surround text items and searches for text rectangles that overlap and &lt;BR /&gt;
filters out text based on a third elevation criteria.&lt;BR /&gt;
&lt;BR /&gt;
The raw data comes from scans of the sea floor and there can be 1000's of &lt;BR /&gt;
text rectangles. The existing rountine is just a loop that takes hours to &lt;BR /&gt;
run for large datasets.&lt;BR /&gt;
&lt;BR /&gt;
I found this discussion &lt;BR /&gt;
http://www.gamedev.net/community/forums/topic.asp?topic_id=445256 in a game &lt;BR /&gt;
programming forum from a couple of years ago where an r-tree is suggested as &lt;BR /&gt;
a good solution for a similar problem. Is there a build in r-tree type &lt;BR /&gt;
function in Autocad or something similar does anyone have some r-tree vb.net &lt;BR /&gt;
code or some other suggestion of how I could use built in functions in &lt;BR /&gt;
Autocad to search quickly&lt;BR /&gt;
for the overlapping rectangles.&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
Regards&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
Justin Ralston&lt;/RALSTOGJ&gt;</description>
      <pubDate>Tue, 08 Sep 2009 20:15:28 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/2d-rectangle-overlap-find-and-filter/m-p/2552861#M69176</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2009-09-08T20:15:28Z</dc:date>
    </item>
    <item>
      <title>Re: 2d rectangle overlap find and filter</title>
      <link>https://forums.autodesk.com/t5/net-forum/2d-rectangle-overlap-find-and-filter/m-p/2552862#M69177</link>
      <description>Thanks for the link Tony</description>
      <pubDate>Tue, 08 Sep 2009 21:19:42 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/2d-rectangle-overlap-find-and-filter/m-p/2552862#M69177</guid>
      <dc:creator>ralstogj</dc:creator>
      <dc:date>2009-09-08T21:19:42Z</dc:date>
    </item>
    <item>
      <title>Re: 2d rectangle overlap find and filter</title>
      <link>https://forums.autodesk.com/t5/net-forum/2d-rectangle-overlap-find-and-filter/m-p/2552863#M69178</link>
      <description>Hi Tony&lt;BR /&gt;
&lt;BR /&gt;
Access the C# dll code is something I have never done before I have referenced the .dll ok and come up with the following to load rectangles into the tree and query it. But do not know how to define a rectangle object correctly or define the item as an IHasRect correctly for the tree definition. If you could provide an example of how you would do it that would be great.&lt;BR /&gt;
&lt;BR /&gt;
Regards&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
Justin Ralston&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
    Public Sub Find_Overlapping_Text()&lt;BR /&gt;
&lt;BR /&gt;
        'Create the quadtree using the C# .dll from the website http://www.codeproject.com/KB/recipes/QuadTree.aspx&lt;BR /&gt;
        'to the extents of the points text&lt;BR /&gt;
&lt;BR /&gt;
        'To access the C# code that you want it be compiled as a DLL. Once that is done, &lt;BR /&gt;
        'simple add a reference to that project to your VB.Net project, import the namespace you need, &lt;BR /&gt;
        'and then you can use the C# code&lt;BR /&gt;
&lt;BR /&gt;
        Dim r As Rectangle = (100),100,100,100) 'Me.ClientRectangle&lt;BR /&gt;
        Dim item As IHasRect&lt;BR /&gt;
&lt;BR /&gt;
        Dim m_quadTree As New QuadTree(Of Item)(r)&lt;BR /&gt;
        'Dim m_quadTree As New QuadTree(Of Item)(Me.ClientRectangle)&lt;BR /&gt;
&lt;BR /&gt;
        'add random points (text rectangles) into the quadtree for querying&lt;BR /&gt;
&lt;BR /&gt;
        Random(rand = New Random(DateTime.Now.Millisecond))&lt;BR /&gt;
        m_quadTree.Add(New Item(e.Location, rand.Next(25) + 4))&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
        'loop through all the text rectangles and&lt;BR /&gt;
        'Query the quadtree with a rectangle to find any other text objects under it&lt;BR /&gt;
        Dim m_selectionRect As Rectangle = (20),20,20,20)&lt;BR /&gt;
        m_selectedItems = m_quadTree.Query(m_selectionRect)&lt;BR /&gt;
&lt;BR /&gt;
    End Sub</description>
      <pubDate>Wed, 09 Sep 2009 10:12:51 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/2d-rectangle-overlap-find-and-filter/m-p/2552863#M69178</guid>
      <dc:creator>ralstogj</dc:creator>
      <dc:date>2009-09-09T10:12:51Z</dc:date>
    </item>
  </channel>
</rss>

