Grasshopper

algorithmic modeling for Rhino

Equivalent GH Component to the Rhino BooleanSplit Command Available?

The Rhino BooleanSplit command has the nice feature of taking a polysurface (solid) and dividing it into several parts using a surface. In the particular case I'm using it makes two solids from one - split right along the surface. Just how I like it :) 

 

I don't see a native GH component to do this. I've looked into using a VB Script component. I've found code in the forums like this: 

 

Private Sub RunScript(ByVal surface_1 As Surface, ByVal volume As Brep, ByRef A As Object)     

    Dim s_1 As Brep    

    s_1 = surface_1.ToBrep
    Dim s_2 As New List(Of Brep)    

    s_2.Add(s_1)
    Dim v_1 As New List(Of Brep)    

    v_1.Add(volume)
    Dim inter As System.Collections.Generic.IEnumerable(Of Brep)    

    inter = Rhino.Geometry.Brep.CreateBooleanDifference(s_2, v_1, 0.01)
    A = inter  

End Sub

 

This comes close to working - but it doesn't produce separate solids. Instead it makes a new surface as shown in the attached image. 

 

Has anyone found a way to actually duplicate what BooleanSplit does?

 

Thanks, 

-MM

 

Views: 3057

Attachments:

Replies to This Discussion

Hi MM,

 

you could try flipping the cutting surface and doing another boolean difference. It would take twice as long, the beauty of BooleanSplit is that it only performs the intersection logic once. But I don't think the function is exposed (I'll dig around a bit, maybe I can write a RhinoCommon wrapper for it).

 

Another approach is to split the shape with the surface, then the surface with the shape. You should now have all the facets needed to create the two shapes, but finding which ones belong together might be tricky.

 

--

David Rutten

david@mcneel.com

Poprad, Slovakia

Thanks, David. 

 

>>you could try flipping the cutting surface and doing another boolean difference.

I've experimented with this with some success. However capping the (non-planar) holes in the resulting object is a problem. 

 

BTW, I realize now that Intersect / Boolean / Solid Difference is the same as the VB Script node I was using :)

 

>>(I'll dig around a bit, maybe I can write a RhinoCommon wrapper for it).

That'd certainly be very useful for the future. 

 

Thanks again, 

-MM

 

An old thread..but still a big question.  Is there a BooleanSplit equivalent in GH?  Has anyone found out a way to implement it, or emulate it?

AA

There still isn't.

--

David Rutten

david@mcneel.com

RSS

About

Translate

Search

Photos

  • Add Photos
  • View All

Videos

  • Add Videos
  • View All

© 2024   Created by Scott Davidson.   Powered by

Badges  |  Report an Issue  |  Terms of Service