Grasshopper

algorithmic modeling for Rhino

Hi all,

I am trying to make a GH component in VS (C#) that will return a surface with an opening. I manage to do so in grasshopper with the 'Solid difference' Component under 'Intersect' inputting a surface and a rectangle but when I try to do so in c# I cannot as the Brep.CreateBooleanIntersection(Brep A, Brep B, tolerance) asks for to Breps. 

I manage to convert the surface with the .ToBrep method but it is impossible to find how to deal with the rectangle I have created and want to use as my second geometry.

any ideas on either:

- how to convert a Rectangle3d to Surface or Brep or

- how to use the Brep.CreateBooleanIntersection(Brep A, Brep B, tolerance) by    inputting a brep and a rectangle or

- even better how to get a new surface defined by the interection of two (co-  planar) geometries? 

Thank you in advance for any input!!

Best,

Tasos

Views: 1302

Replies to This Discussion

If it's just a set of co-planar closed curves, then you can use CreatePlanarBreps method. You'll have to convert your rectangle into a Curve (either Nurbscurve or Polylinecurve) and get the boundary curve of your base surface.

--

David Rutten

david@mcneel.com

Tirol, Austria

Hi David,

thanks for the reply! any idea of how to extract (as a closed curve or Polyline) the Perimeter that defines my surface? It's the only think I miss to get this thing to work  but so far I oly managed to extract each one of the edges individually and not as a closed curve to use for the CreatePlanarBreps method! 

Thanks again! 

Tasos

At this point I'd like to see a picture of the geometries involved.

I worry we may be talking about two different things.

--

David Rutten

david@mcneel.com

Tirol, Austria

David! thanks for the reply again! this is what I try to achieve in the end more or less with the opening and its center point (green one) being able to expand and move within the limits of the "large" surface!

what I get so far is a bre[p within a brep and not an opening as I was expecting! 

hi again, any idea on how to create a surface from a rectangle or a surface with dimensions defined by me in c#? This will do what I am trying to achieve here but cannot find the proper command in the .dll! Please any input will be really helpful! 

thanks! 

well, eventually I needed to to create a rectangle3d for the inner geometry, turn in into a nurbscurve and then to a brep by CreatePlanarBreps(). Then the subtraction is working with the CreateBooleanDifference() and gives you back the surface as shown at the picture above as long as the external surface  is also (turned into) a Brep.

Thanks!

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