Find the largest possible rectangle inside an irregular closed curve - Grasshopper2024-03-29T01:28:33Zhttps://www.grasshopper3d.com/forum/topics/find-the-largest-possible-rectangle-inside-a-closed-curve?id=2985220%3ATopic%3A1224484&feed=yes&xn_auth=noHi Laurent, thanks for your c…tag:www.grasshopper3d.com,2017-04-03:2985220:Comment:17267642017-04-03T22:43:24.624Zfranco ferreirohttps://www.grasshopper3d.com/profile/francoferreiro
<p>Hi Laurent, thanks for your component !!. Worked ok !, but it lacks performance for what i need... .5 sec per point is way too much for my use case ... is that what it should be ? .</p>
<p>tweaked some stuff around and added my tests in the attach, hope helps someone else.</p>
<p>Im looking for components - like this one - for tagging labels into cnc machined pieces , and also looking for solutions for nesting ("open gh definitions") and for unrolling surfaces (generic for any weird…</p>
<p>Hi Laurent, thanks for your component !!. Worked ok !, but it lacks performance for what i need... .5 sec per point is way too much for my use case ... is that what it should be ? .</p>
<p>tweaked some stuff around and added my tests in the attach, hope helps someone else.</p>
<p>Im looking for components - like this one - for tagging labels into cnc machined pieces , and also looking for solutions for nesting ("open gh definitions") and for unrolling surfaces (generic for any weird curvature :) ie by smart tesselation) if you or someone else happen to know about ...</p>
<p>best !</p>
<p>Franco</p>
<p> </p>
<p></p>
<p></p>
<p></p>
<p></p> Hi Daniel, i guess i unblocke…tag:www.grasshopper3d.com,2017-04-03:2985220:Comment:17266672017-04-03T20:23:39.528Zfranco ferreirohttps://www.grasshopper3d.com/profile/francoferreiro
<p>Hi Daniel, i guess i unblocked the dll but haven't a clue on how to reference them... if it's what i think...(i would probably need to install huge MS stuff in my case - no sense in this case !-) , so could be possible for you to bundle them in an installer ? x64 ?</p>
<p>tnks</p>
<p>Hi Daniel, i guess i unblocked the dll but haven't a clue on how to reference them... if it's what i think...(i would probably need to install huge MS stuff in my case - no sense in this case !-) , so could be possible for you to bundle them in an installer ? x64 ?</p>
<p>tnks</p> Hi Avi
Apologies for delay i…tag:www.grasshopper3d.com,2017-01-16:2985220:Comment:16731522017-01-16T19:55:40.361ZDaniel Finkhttps://www.grasshopper3d.com/profile/danielsusername
<p>Hi Avi</p>
<p></p>
<p>Apologies for delay in replying. I'm not sure exactly why you received the error, but it usually is a sign of 32-bit & 64-bit incompatibilities. What version of Rhino & Windows are you running?</p>
<p></p>
<p></p>
<p>Hi Avi</p>
<p></p>
<p>Apologies for delay in replying. I'm not sure exactly why you received the error, but it usually is a sign of 32-bit & 64-bit incompatibilities. What version of Rhino & Windows are you running?</p>
<p></p>
<p></p> hi Daniel Fink
i am working…tag:www.grasshopper3d.com,2016-10-11:2985220:Comment:16164332016-10-11T03:24:11.086Zavi.pterodactylhttps://www.grasshopper3d.com/profile/AvinashMewada
hi Daniel Fink<br />
<br />
i am working on a UNI project and wanted a similar output as you have shown in the image. i have download the GH file and library as you have instructed after which i got the error as below.<br />
<br />
1. An attempt was made to load a program with an incorrect format. (Exception from HRESULT: 0x8007000B) (line: 0)<br />
<br />
can you help me fix this ?
hi Daniel Fink<br />
<br />
i am working on a UNI project and wanted a similar output as you have shown in the image. i have download the GH file and library as you have instructed after which i got the error as below.<br />
<br />
1. An attempt was made to load a program with an incorrect format. (Exception from HRESULT: 0x8007000B) (line: 0)<br />
<br />
can you help me fix this ? While this isn't exactly an…tag:www.grasshopper3d.com,2016-07-27:2985220:Comment:15722462016-07-27T21:05:44.150ZDaniel Finkhttps://www.grasshopper3d.com/profile/danielsusername
<p><a href="http://storage.ning.com/topology/rest/1.0/file/get/2769172455?profile=original" target="_self"><img class="align-full" src="http://storage.ning.com/topology/rest/1.0/file/get/2769172455?profile=RESIZE_1024x1024" width="721"></img></a></p>
<p></p>
<p>While this isn't exactly an answer to the original question (solving for arbitrary curves, let alone concave ones), I've managed to solve this for convex polygons with the rectangle aligned to any of the polygon's segments (effectively the Alt Hsu Snoeyink paper "Computing the largest inscribed isothetic rectangle"), although I don't assume its as fast as…</p>
<p><a target="_self" href="http://storage.ning.com/topology/rest/1.0/file/get/2769172455?profile=original"><img width="721" class="align-full" src="http://storage.ning.com/topology/rest/1.0/file/get/2769172455?profile=RESIZE_1024x1024" width="721"/></a></p>
<p></p>
<p>While this isn't exactly an answer to the original question (solving for arbitrary curves, let alone concave ones), I've managed to solve this for convex polygons with the rectangle aligned to any of the polygon's segments (effectively the Alt Hsu Snoeyink paper "Computing the largest inscribed isothetic rectangle"), although I don't assume its as fast as their O(log n) algorithm.</p>
<p>The problem is constructed as a nonlinear optimization with linear constraints, using a nonlinear (in this case Interior Point method) solver: define the variables as (x,y) origin of the rectangle, the objective as its width*height, and then the constraints are the polygon segments' Cartesian line inequations.</p>
<p>Thankfully the C# FuncLib library (<a href="https://funclib.codeplex.com/" target="_blank">https://funclib.codeplex.com/</a>) provides nice representation of objectives & constraints to the IPOPT library (<a href="https://projects.coin-or.org/Ipopt" target="_blank">https://projects.coin-or.org/Ipopt</a>) by handling all the matrix operations & determinants etc. The compiled binaries from the codeplex site are x86 only, but you can compile them to x64 using the '3.9.2' binaries at <a href="http://www.coin-or.org/download/binary/Ipopt/" target="_blank">http://www.coin-or.org/download/binary/Ipopt/</a></p>
<p>I've attached the GH + C# script and x64 FuncLib DLLs. Make sure to unblock & reference the assemblies etc</p>
<p>Hope this helps!</p>
<p></p> Hi Laurent!
Finally had some…tag:www.grasshopper3d.com,2016-06-17:2985220:Comment:15495002016-06-17T12:27:10.169ZChristian Assmannhttps://www.grasshopper3d.com/profile/ChristianAssmann
<p>Hi Laurent!</p>
<p>Finally had some time to play with your code...</p>
<p>Thank you so much!!!! What I came up with took half an hour to compute (galapagos time) and came up with pretty much the same result.</p>
<p>I guess it's not worth posting then.</p>
<p>Made my day for sure!</p>
<p>Cheers,</p>
<p></p>
<p>Christian</p>
<p>Hi Laurent!</p>
<p>Finally had some time to play with your code...</p>
<p>Thank you so much!!!! What I came up with took half an hour to compute (galapagos time) and came up with pretty much the same result.</p>
<p>I guess it's not worth posting then.</p>
<p>Made my day for sure!</p>
<p>Cheers,</p>
<p></p>
<p>Christian</p> I did begin something, surely…tag:www.grasshopper3d.com,2016-06-01:2985220:Comment:15403222016-06-01T20:06:20.363ZLaurent DELRIEUhttps://www.grasshopper3d.com/profile/LaurentDelrieu
<p>I did begin something, surely not optimized but it could help you elaborate a solution to find the maximum.</p>
<p>At the moment my component in C# accept :</p>
<ol>
<li>a closed curve on XY plane and</li>
<li>points. </li>
</ol>
<p>Each point are considered as the center of the rectangle. </p>
<p>It outputs bigger rectangle for each point</p>
<p>An angle characteristic of the rectange, angle. Angle is always lesser or equal to PI/2. angle = PI/2 => it is a square. </p>
<p>An orientation…</p>
<p>I did begin something, surely not optimized but it could help you elaborate a solution to find the maximum.</p>
<p>At the moment my component in C# accept :</p>
<ol>
<li>a closed curve on XY plane and</li>
<li>points. </li>
</ol>
<p>Each point are considered as the center of the rectangle. </p>
<p>It outputs bigger rectangle for each point</p>
<p>An angle characteristic of the rectange, angle. Angle is always lesser or equal to PI/2. angle = PI/2 => it is a square. </p>
<p>An orientation angle if 0 the rectangle has its longer side parallel to X</p>
<p>The surface of rectangle.</p>
<p></p>
<p>If useful, I can add/give explanations.</p>
<p><a href="http://storage.ning.com/topology/rest/1.0/file/get/2769158180?profile=original" target="_self"><img width="721" src="http://storage.ning.com/topology/rest/1.0/file/get/2769158180?profile=RESIZE_1024x1024" width="721" class="align-full"/></a><a href="http://storage.ning.com/topology/rest/1.0/file/get/2769158271?profile=original" target="_self"><img width="721" src="http://storage.ning.com/topology/rest/1.0/file/get/2769158271?profile=RESIZE_1024x1024" width="721" class="align-full"/></a><a href="http://storage.ning.com/topology/rest/1.0/file/get/2769158455?profile=original" target="_self"><img width="721" src="http://storage.ning.com/topology/rest/1.0/file/get/2769158455?profile=RESIZE_1024x1024" width="721" class="align-full"/></a><a href="http://storage.ning.com/topology/rest/1.0/file/get/2769158636?profile=original" target="_self"><img width="721" src="http://storage.ning.com/topology/rest/1.0/file/get/2769158636?profile=RESIZE_1024x1024" width="721" class="align-full"/></a><a href="http://storage.ning.com/topology/rest/1.0/file/get/2769158898?profile=original" target="_self"><img width="721" src="http://storage.ning.com/topology/rest/1.0/file/get/2769158898?profile=RESIZE_1024x1024" width="721" class="align-full"/></a></p> Thanks a lot!
will try to get…tag:www.grasshopper3d.com,2016-05-30:2985220:Comment:15390312016-05-30T10:01:14.045ZChristian Assmannhttps://www.grasshopper3d.com/profile/ChristianAssmann
<p>Thanks a lot!</p>
<p>will try to get through 'em and post whatever I can concoct.</p>
<p>Cheers!</p>
<p>Thanks a lot!</p>
<p>will try to get through 'em and post whatever I can concoct.</p>
<p>Cheers!</p> ... solved/forgotten ...
rath…tag:www.grasshopper3d.com,2016-05-28:2985220:Comment:15378582016-05-28T06:44:21.237Zpeter fotiadishttps://www.grasshopper3d.com/profile/peterfotiadis
<p><em>... solved/forgotten ...</em></p>
<p>rather (completely) forgotten ... but check these (a "similar" problem)</p>
<p><a href="http://cgm.cs.mcgill.ca/~athens/cs507/Projects/2003/DanielSud/" rel="nofollow" target="_blank">http://cgm.cs.mcgill.ca/~athens/cs507/Projects/2003/DanielSud/…</a></p>
<p></p>
<p><em>... solved/forgotten ...</em></p>
<p>rather (completely) forgotten ... but check these (a "similar" problem)</p>
<p><a rel="nofollow" href="http://cgm.cs.mcgill.ca/~athens/cs507/Projects/2003/DanielSud/" target="_blank">http://cgm.cs.mcgill.ca/~athens/cs507/Projects/2003/DanielSud/</a></p>
<p><a href="http://mathoverflow.net/questions/105837/get-largest-inscribed-rectangle-of-a-concave-polygon" target="_blank">http://mathoverflow.net/questions/105837/get-largest-inscribed-rect...</a></p>
<p><a href="https://www.google.gr/url?sa=t&rct=j&q=&esrc=s&source=web&cd=6&cad=rja&uact=8&ved=0ahUKEwid7PnnlPzMAhULvRQKHRKiB9sQFghRMAU&url=http%3A%2F%2Fftp.cs.stanford.edu%2Fcs%2Frobotics%2Fdyhsu%2Fpapers%2Fcccg95.pdf&usg=AFQjCNEqs3BhTxl18hSPwWGHSXjKXanxxg" target="_blank">https://www.google.gr/url?sa=t&rct=j&q=&esrc=s&sour...</a></p>
<p><a href="http://gis.stackexchange.com/questions/59215/how-to-find-the-maximum-area-rectangle-inside-a-convex-polygon" target="_blank">http://gis.stackexchange.com/questions/59215/how-to-find-the-maximu...</a></p>
<p><a href="http://www.drdobbs.com/database/the-maximal-rectangle-problem/184410529" target="_blank">http://www.drdobbs.com/database/the-maximal-rectangle-problem/18441...</a></p>
<p>And this as well</p>
<p><a href="https://www.google.gr/url?sa=t&rct=j&q=&esrc=s&source=web&cd=15&cad=rja&uact=8&ved=0ahUKEwjmx8yMl_zMAhUGvxQKHZD4DEU4ChAWCEkwBA&url=http%3A%2F%2Fpage.mi.fu-berlin.de%2Fjeschmid%2FKnauer2010.pdf&usg=AFQjCNFdcBchp4hixp3kZQ5hI8o88irP7Q" target="_blank">https://www.google.gr/url?sa=t&rct=j&q=&esrc=s&source=web&cd=15&cad=rja&uact=8&ved=0ahUKEwjmx8yMl_zMAhUGvxQKHZD4DEU4ChAWCEkwBA&url=http%3A%2F%2Fpage.mi.fu-berlin.de%2Fjeschmid%2FKnauer2010.pdf&usg=AFQjCNFdcBchp4hixp3kZQ5hI8o88irP7Q</a></p> Would Reccardos approach, in…tag:www.grasshopper3d.com,2016-05-27:2985220:Comment:15374792016-05-27T13:17:28.493ZChristian Assmannhttps://www.grasshopper3d.com/profile/ChristianAssmann
<p>Would Reccardos approach, in conjunction with an evolutionary solver and this "sequence" make sense, or would it be too hefty?</p>
<p>I'll try and post my findings, but if anybody has experience and foresight in the field please give a hint?!? ;-)</p>
<p>Would Reccardos approach, in conjunction with an evolutionary solver and this "sequence" make sense, or would it be too hefty?</p>
<p>I'll try and post my findings, but if anybody has experience and foresight in the field please give a hint?!? ;-)</p>