Brep Join : what tolerance ? - Grasshopper2024-03-29T11:48:25Zhttps://www.grasshopper3d.com/forum/topics/brep-join-what-tolerance?commentId=2985220%3AComment%3A1488642&feed=yes&xn_auth=noThe Python script Nik Willmor…tag:www.grasshopper3d.com,2017-08-26:2985220:Comment:18040012017-08-26T17:19:37.092ZStan Carrollhttps://www.grasshopper3d.com/profile/Stan_Carroll
<p>The Python script Nik Willmore provided is an excellent solution to this problem. The ability to control tolerance in GH should become standard. </p>
<p>The Python script Nik Willmore provided is an excellent solution to this problem. The ability to control tolerance in GH should become standard. </p> Your network surface works fo…tag:www.grasshopper3d.com,2016-03-20:2985220:Comment:14890322016-03-20T16:41:25.498ZNik Willmorehttps://www.grasshopper3d.com/profile/NikFromNYC
<p>Your network surface works for a good join when done manually in Rhino using Loose instead of Position:</p>
<p><a href="http://storage.ning.com/topology/rest/1.0/file/get/2769125975?profile=original" target="_self"><img class="align-full" src="http://storage.ning.com/topology/rest/1.0/file/get/2769125975?profile=original" width="224"></img></a></p>
<p>Rhinocommon does have Rhino.Geometry.NurbsSurface.<span>CreateNetworkSurface with an auto-sorting version available:…</span></p>
<p></p>
<p></p>
<p>Your network surface works for a good join when done manually in Rhino using Loose instead of Position:</p>
<p><a href="http://storage.ning.com/topology/rest/1.0/file/get/2769125975?profile=original" target="_self"><img src="http://storage.ning.com/topology/rest/1.0/file/get/2769125975?profile=original" width="224" class="align-full"/></a></p>
<p>Rhinocommon does have Rhino.Geometry.NurbsSurface.<span>CreateNetworkSurface with an auto-sorting version available:</span></p>
<p></p>
<p><span><a rel="nofollow" href="http://4.rhino3d.com/5/rhinocommon/html/Overload_Rhino_Geometry_NurbsSurface_CreateNetworkSurface.htm" target="_blank">http://4.rhino3d.com/5/rhinocommon/html/Overload_Rhino_Geometry_Nur...</a></span></p>
<p></p>
<p><span>Here is Python for that.</span></p>
<p><a href="http://storage.ning.com/topology/rest/1.0/file/get/2769125999?profile=original" target="_self"><img src="http://storage.ning.com/topology/rest/1.0/file/get/2769125999?profile=original" width="721" class="align-full"/></a></p>
<p><span>However, I *still* have to use my Python brep joiner since not even Rhino can join this version of a network surface. How very odd.</span></p>
<p><a href="http://storage.ning.com/topology/rest/1.0/file/get/2769126476?profile=original" target="_self"><img src="http://storage.ning.com/topology/rest/1.0/file/get/2769126476?profile=original" width="709" class="align-full"/></a></p>
<p>Settings have little effect on output and I can see the mismatch between the network surface and the flat bottom cap always the same, zoomed in, in wireframe mode so the crude preview mesh is invisible:</p>
<p><span><a href="http://storage.ning.com/topology/rest/1.0/file/get/2769126746?profile=original" target="_self"><img width="721" src="http://storage.ning.com/topology/rest/1.0/file/get/2769126746?profile=RESIZE_1024x1024" width="721" class="align-full"/></a>Anyway, this Python version will auto-sort your curves, saving much hassle.</span></p>
<p></p> In Rhino the CurveBoolean com…tag:www.grasshopper3d.com,2016-03-20:2985220:Comment:14886992016-03-20T15:47:16.893ZNik Willmorehttps://www.grasshopper3d.com/profile/NikFromNYC
<p>In Rhino the CurveBoolean command requires manual selection of inside spaces, akin to a coloring book.</p>
<p></p>
<p>The Rhinocommon command Rhino.Geometry.Curve.<span>CreateBooleanUnion </span>is here and seems happily devoid of user input:</p>
<p></p>
<p><a href="http://4.rhino3d.com/5/rhinocommon/?topic=html/M_Rhino_Geometry_Curve_CreateBooleanUnion.htm" rel="nofollow" target="_blank">http://4.rhino3d.com/5/rhinocommon/?topic=html/M_Rhino_Geometry_Cur...</a></p>
<p></p>
<p>This is…</p>
<p>In Rhino the CurveBoolean command requires manual selection of inside spaces, akin to a coloring book.</p>
<p></p>
<p>The Rhinocommon command Rhino.Geometry.Curve.<span>CreateBooleanUnion </span>is here and seems happily devoid of user input:</p>
<p></p>
<p><a rel="nofollow" href="http://4.rhino3d.com/5/rhinocommon/?topic=html/M_Rhino_Geometry_Curve_CreateBooleanUnion.htm" target="_blank">http://4.rhino3d.com/5/rhinocommon/?topic=html/M_Rhino_Geometry_Cur...</a></p>
<p></p>
<p>This is failing to give anything, only an empty list, even if I try the arcane option of tenderly feeding it a formal Rhino CurvesList to begin with.</p>
<p></p>
<p>A forum search ( <a rel="nofollow" href="http://www.grasshopper3d.com/forum/topics/curve-createbooleanunion-and-regions?commentId=2985220%3AComment%3A656984" target="_blank">http://www.grasshopper3d.com/forum/topics/curve-createbooleanunion-...</a> ) reveals the CreatePlanarBreps command, said to work:</p>
<p></p>
<p><a rel="nofollow" href="http://4.rhino3d.com/5/rhinocommon/?topic=html/Overload_Rhino_Geometry_Brep_CreatePlanarBreps.htm" target="_blank">http://4.rhino3d.com/5/rhinocommon/?topic=html/Overload_Rhino_Geome...</a></p>
<p></p>
<p>This works for *some* curves, in a very confusing manner, in that when I feed it all of these curves, I get two surfaces, but it fails when I only feed it the left collection, while the right collection itself works fine?!</p>
<p><a href="http://storage.ning.com/topology/rest/1.0/file/get/2769126699?profile=original" target="_self"><img src="http://storage.ning.com/topology/rest/1.0/file/get/2769126699?profile=original" width="686" class="align-full"/></a></p>
<p></p>
<p>I don't get it. Rhino.Curves.CreateBooleanUnion won't work at all on the set or the right or left collections either.</p>
<p></p>
<p>Rhino/Grasshopper is often broken, actually. Same old story. Robust basic functionality goes missing for years.</p>
<p></p>
<p>This C# version of Rhino.Curves.CreateBooleanUnion similarly fails:</p>
<p></p>
<p><a rel="nofollow" href="http://www.grasshopper3d.com/forum/topics/curveboolean-union-of-curves-in-script?commentId=2985220%3AComment%3A797418" target="_blank">http://www.grasshopper3d.com/forum/topics/curveboolean-union-of-cur...</a></p>
<p></p>
<p>That seems to require only closed curves as input? Ah, indeed, the Rhinocommon entries use the term "loops" which formally must mean *closed* curves, not just open loopy shapes, but then CreatePlanarBreps uses the same term yet does work sporadically.</p>
<p></p>
<p>Here is the CreatePlanarBreps Python script:</p>
<p><a href="http://storage.ning.com/topology/rest/1.0/file/get/2769126997?profile=original" target="_self"><img src="http://storage.ning.com/topology/rest/1.0/file/get/2769126997?profile=original" width="660" class="align-full"/></a></p>
<p>The key seems to be to include at least one dummy curve in the system that is self-looping and that changes the algorithm to let the big collection work:</p>
<p><a href="http://storage.ning.com/topology/rest/1.0/file/get/2769127142?profile=original" target="_self"><img src="http://storage.ning.com/topology/rest/1.0/file/get/2769127142?profile=original" width="404" class="align-full"/></a></p>
<p>The self-looped curve is required to be included for the big collection to work, whereas merely the lone unlooped curve being included doesn't fix it.</p>
<p></p>
<p>So include a dummy self-looped curve to fix the command and then filter it out later?</p> Hi Nik,
Thanks for this.
It…tag:www.grasshopper3d.com,2016-03-20:2985220:Comment:14889242016-03-20T12:20:06.231ZOlivier Suirehttps://www.grasshopper3d.com/profile/OlivierSuire
<p>Hi Nik,</p>
<p></p>
<p>Thanks for this.</p>
<p>It can come in handy indeed.</p>
<p>I wonder whether it could invoke CurveBoolean which is something I miss in GH...</p>
<p></p>
<p>Back to my geometry, I think I'd better model my shape in a more reliable way : Network Surface seems to screw with these edges.</p>
<p>Depending on the input dimensions, they are either in the same plane or not, which doesn't make sense given the way the initial curves are…</p>
<p>Hi Nik,</p>
<p></p>
<p>Thanks for this.</p>
<p>It can come in handy indeed.</p>
<p>I wonder whether it could invoke CurveBoolean which is something I miss in GH...</p>
<p></p>
<p>Back to my geometry, I think I'd better model my shape in a more reliable way : Network Surface seems to screw with these edges.</p>
<p>Depending on the input dimensions, they are either in the same plane or not, which doesn't make sense given the way the initial curves are generated.</p>
<p></p>
<p>Cheers</p>
<p></p> Here's a Python script that i…tag:www.grasshopper3d.com,2016-03-20:2985220:Comment:14886522016-03-20T08:32:10.662ZNik Willmorehttps://www.grasshopper3d.com/profile/NikFromNYC
<p>Here's a Python script that invokes Rhinocommon and accepts tolerance input:</p>
<p><a href="http://storage.ning.com/topology/rest/1.0/file/get/2769126804?profile=original" target="_self"><img class="align-full" src="http://storage.ning.com/topology/rest/1.0/file/get/2769126804?profile=original" width="660"></img></a></p>
<p><a href="http://4.rhino3d.com/5/rhinocommon/?topic=html/M_Rhino_Geometry_Brep_JoinBreps.htm" rel="nofollow" target="_blank">http://4.rhino3d.com/5/rhinocommon/?topic=html/M_Rhino_Geometry_Bre...</a></p>
<p></p>
<p>All I had to do was right click the Python inputs to set a type hint and…</p>
<p>Here's a Python script that invokes Rhinocommon and accepts tolerance input:</p>
<p><a href="http://storage.ning.com/topology/rest/1.0/file/get/2769126804?profile=original" target="_self"><img src="http://storage.ning.com/topology/rest/1.0/file/get/2769126804?profile=original" width="660" class="align-full"/></a></p>
<p><a rel="nofollow" href="http://4.rhino3d.com/5/rhinocommon/?topic=html/M_Rhino_Geometry_Brep_JoinBreps.htm" target="_blank">http://4.rhino3d.com/5/rhinocommon/?topic=html/M_Rhino_Geometry_Bre...</a></p>
<p></p>
<p>All I had to do was right click the Python inputs to set a type hint and item or list access. If you zoom way in you see the means to adding and removing inputs:</p>
<p><a href="http://storage.ning.com/topology/rest/1.0/file/get/2769126989?profile=original" target="_self"><img width="721" src="http://storage.ning.com/topology/rest/1.0/file/get/2769126989?profile=RESIZE_1024x1024" width="721" class="align-full"/></a>The Rhino.Geometry and Rhino.Collections namespaces contain most normal Rhino commands.</p>
<p><a rel="nofollow" href="http://4.rhino3d.com/5/rhinocommon/#" target="_blank">http://4.rhino3d.com/5/rhinocommon/#</a></p>
<p></p>
<p>A tolerance of 10,000 works fine, so yeah, Grasshopper is being stingy.</p> Maybe David can give you a pr…tag:www.grasshopper3d.com,2016-03-20:2985220:Comment:14886422016-03-20T08:10:55.161ZBirk Binnardhttps://www.grasshopper3d.com/profile/BirkBinnard
<p>Maybe David can give you a precise answer, but it looks to me like "that's just the way GH works." Your end result has 2 naked edges on each of the long sides. If you bake the result and then use Rhino's "Join 2 naked edges" function to carefully select each naked edge you can join them together. The Rhino join command will tell you that it has to use a tolerance of 0.0172909. Accepting that joins the naked edge pairs and this should give you a 'solid" result.</p>
<p>Maybe David can give you a precise answer, but it looks to me like "that's just the way GH works." Your end result has 2 naked edges on each of the long sides. If you bake the result and then use Rhino's "Join 2 naked edges" function to carefully select each naked edge you can join them together. The Rhino join command will tell you that it has to use a tolerance of 0.0172909. Accepting that joins the naked edge pairs and this should give you a 'solid" result.</p>