Grasshopper

algorithmic modeling for Rhino

Hi,

 

I looking for a simple function to trim 2 breps against each other.

 

Basically, I want to split the green cylinder(smaller) with the surface of the blue (larger) cylinder and keep the larger part of the green.

 

I know there are Brep/Brep intersections to get the intersecting curve. Does anyone know how this intersection curve can be eventually used to split the Brep?

 

The Rhino command "trim" seems to take care of this problem. What does this "trim" command do and can we replicate this with code in GH or existing components?

 

Thanks.

 

Kermin 

 

BrepTrimQuestionjpg.jpg

Views: 3626

Attachments:

Replies to This Discussion

Split can be fickle...

 

You could extend your intersection curve and then project it back to the surface you want to split.  That should work.

Sounds like an approach. I'll try it out.

 

 

Does anyone know if the native "Trim" command in rhino performs this sequence of operations in the background so the command works?

 

If we can simply replicate the operations that the Rhino-Trim command does, it should be easier in the future.

 

 

From your image it looks like you have to cylindrical surfaces, which is good. You can use brep/brep intersect to get the curve and then split the green surface with the curve generated by the intersect, lastly cull out the surface that you want to keep.

 

This Definition should work for you, keep in mind the split will only work for a surface not a polysurface/brep

Attachments:

Hi,

Thanks for the input.


In the end, I used the Rhinocommon function Brep.split. Most of the time it worked except for figuring out which end of the trim or split to keep.

 

Also tricky was the fact that if this function fails, it returns "nothing" instead of a zero length array which wasn't clear to me at the beginning. This was causing some major fails.

excuse me kermin, 

but what do you mean by rhinocommon function?

is it a component ?

sorry for the "stupid" question, i googled rhinocommon and couldn't really understand.

thanks,

amir.

 

(i'm also looking to split a brep in gh)

RhinoCommon is the new Rhino SDK. Grasshopper is using RhinoCommon for all its geometry and the VB/C# components use RhinoCommon as well.

 

There's also Legacy VB and C# components that use the old Rhino SDK (called Rhino_DotNET), but I highly recommend RhinoCommon instead.

 

--

David Rutten

david@mcneel.com

Poprad, Slovakia

so if i find a command in rhinocommon i can use it in a vb component?

or is it a bit more complex?

thanks a lot

amir

hey Kermin, how did you write your VB/C# for this little command?

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