<?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 Largest Rectangle Inside Regular or Irregular Shape? in .NET Forum</title>
    <link>https://forums.autodesk.com/t5/net-forum/largest-rectangle-inside-regular-or-irregular-shape/m-p/5048570#M43920</link>
    <description>&lt;P&gt;I have an assignment where I need to determine the largest rectangle that can be drawn inside of any shape.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Think about these objects:&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;Triangles&lt;/LI&gt;&lt;LI&gt;Circles&lt;/LI&gt;&lt;LI&gt;Ovals&lt;/LI&gt;&lt;LI&gt;Parallelograms&lt;/LI&gt;&lt;LI&gt;&lt;A target="_self" href="http://www.math-salamanders.com/image-files/printable-shapes-regular-and-irregular-shapes-bw-nolab.gif"&gt;Irregular shapes&lt;/A&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;Does anyone know of a way with AutoCad.NET or just a general algorithm that could be used to determine the largest possible rectangle inside of any of these shapes?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Robert&lt;/P&gt;</description>
    <pubDate>Thu, 22 May 2014 02:49:22 GMT</pubDate>
    <dc:creator>Anonymous</dc:creator>
    <dc:date>2014-05-22T02:49:22Z</dc:date>
    <item>
      <title>Largest Rectangle Inside Regular or Irregular Shape?</title>
      <link>https://forums.autodesk.com/t5/net-forum/largest-rectangle-inside-regular-or-irregular-shape/m-p/5048570#M43920</link>
      <description>&lt;P&gt;I have an assignment where I need to determine the largest rectangle that can be drawn inside of any shape.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Think about these objects:&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;Triangles&lt;/LI&gt;&lt;LI&gt;Circles&lt;/LI&gt;&lt;LI&gt;Ovals&lt;/LI&gt;&lt;LI&gt;Parallelograms&lt;/LI&gt;&lt;LI&gt;&lt;A target="_self" href="http://www.math-salamanders.com/image-files/printable-shapes-regular-and-irregular-shapes-bw-nolab.gif"&gt;Irregular shapes&lt;/A&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;Does anyone know of a way with AutoCad.NET or just a general algorithm that could be used to determine the largest possible rectangle inside of any of these shapes?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Robert&lt;/P&gt;</description>
      <pubDate>Thu, 22 May 2014 02:49:22 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/largest-rectangle-inside-regular-or-irregular-shape/m-p/5048570#M43920</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2014-05-22T02:49:22Z</dc:date>
    </item>
    <item>
      <title>Re: Largest Rectangle Inside Regular or Irregular Shape?</title>
      <link>https://forums.autodesk.com/t5/net-forum/largest-rectangle-inside-regular-or-irregular-shape/m-p/5048722#M43921</link>
      <description>&lt;P&gt;for your first 4 kinds of shape, it does have some geometry &lt;SPAN&gt;algorithms, but i have not heard a general&amp;nbsp;&lt;SPAN&gt;algorithm for any given curve.&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 22 May 2014 06:37:05 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/largest-rectangle-inside-regular-or-irregular-shape/m-p/5048722#M43921</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2014-05-22T06:37:05Z</dc:date>
    </item>
    <item>
      <title>Re: Largest Rectangle Inside Regular or Irregular Shape?</title>
      <link>https://forums.autodesk.com/t5/net-forum/largest-rectangle-inside-regular-or-irregular-shape/m-p/5049886#M43922</link>
      <description>&lt;P&gt;Of course the irregular shapes are the most difficult to treat. I don't know of a generic algorithm, but if you can make some assumptions you may find a smart way.&lt;/P&gt;&lt;P&gt;For example, if the centroid of the shape is likely to lay also inside the rectangle, you may collect a number of points from the shape/curve and sort them out above, below, on the right and on the left of the centroid, finding the minumum and maximum. You should get a definite number of rectangle, not many my guess...&lt;/P&gt;&lt;P&gt;This if you assume the shape is already aligned with one side of the rectangle, if not, you have to rotate the shape to find the largest rectangle...&lt;/P&gt;&lt;P&gt;I speak of oassumption because generally speaking such requests have connection to the real world and some shortcuts or assumptions may be valid.&lt;/P&gt;</description>
      <pubDate>Thu, 22 May 2014 15:00:48 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/largest-rectangle-inside-regular-or-irregular-shape/m-p/5049886#M43922</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2014-05-22T15:00:48Z</dc:date>
    </item>
    <item>
      <title>Re: Largest Rectangle Inside Regular or Irregular Shape?</title>
      <link>https://forums.autodesk.com/t5/net-forum/largest-rectangle-inside-regular-or-irregular-shape/m-p/5050192#M43923</link>
      <description>&lt;P&gt;Thank you for your insight!&amp;nbsp; I will think about it more.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;In my case I'm trying to automatically lay out rectangular solar panels on a roof.&amp;nbsp; If the roof is rectangular then of course this is rather easy but I'm trying to come up with an algorithm that will work in a more general sense.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I'm thinking that the simplest way to do this is to start laying out the panels in the center and then laying out additional ones in +x, -x, +y, &amp;amp; -y directions, looking for intersections with the exterior boundary.&amp;nbsp; I'm not 100% certain of this approach yet but am going to give it a try.&lt;/P&gt;</description>
      <pubDate>Thu, 22 May 2014 16:30:11 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/largest-rectangle-inside-regular-or-irregular-shape/m-p/5050192#M43923</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2014-05-22T16:30:11Z</dc:date>
    </item>
    <item>
      <title>Re: Largest Rectangle Inside Regular or Irregular Shape?</title>
      <link>https://forums.autodesk.com/t5/net-forum/largest-rectangle-inside-regular-or-irregular-shape/m-p/5051592#M43924</link>
      <description>&lt;P&gt;Ah! This is an altogether different problem! Since you have definite panel sizes, it's more a matter of 2D cut optimization. I believe you can also make use of some software already available, or maybe study some algorithm from open source c# projects and see if something may fit your needs.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;You have a number of assumpion here you can use to semplify your work, like:&lt;/P&gt;&lt;P&gt;- solar panels are rectangular and of fixed sizes;&lt;/P&gt;&lt;P&gt;- panels are generally layout aligned to one side (I mean not freely rotated);&lt;/P&gt;&lt;P&gt;- roofs are generally planar, at least roofs where you want to install solar panels;&lt;/P&gt;&lt;P&gt;- roofs are generally rectangular themselves, even if some obstacles may lay around;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;However, the techique I was speaking about in the previuos post may help you to find the origin of the biggest rectangles and start building a grid from there, it may even work with shaped roof, as long as the roof is planar.&lt;/P&gt;&lt;P&gt;Once you filled the biggest rectangle, you start again with the remaining space filling other smaller rectangles, just keeping the origins aligned to the same grid, to maintain a regular layout.&lt;/P&gt;</description>
      <pubDate>Fri, 23 May 2014 06:17:03 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/largest-rectangle-inside-regular-or-irregular-shape/m-p/5051592#M43924</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2014-05-23T06:17:03Z</dc:date>
    </item>
    <item>
      <title>Re: Largest Rectangle Inside Regular or Irregular Shape?</title>
      <link>https://forums.autodesk.com/t5/net-forum/largest-rectangle-inside-regular-or-irregular-shape/m-p/5051598#M43925</link>
      <description>&lt;P&gt;Excellent insight!&amp;nbsp; Thank YOU.&lt;/P&gt;</description>
      <pubDate>Fri, 23 May 2014 06:27:10 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/largest-rectangle-inside-regular-or-irregular-shape/m-p/5051598#M43925</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2014-05-23T06:27:10Z</dc:date>
    </item>
  </channel>
</rss>

