Scripting - ExtrudeCrv ToBoundary

I’m wondering if it is possible in any way to script the ToBoundary function of ExtrudeCrv.

The only topic about this I could find was this one where the best solution seems to be call rs.Command() with a ExtrudeCrv command. This is rather clunky and I’m curious if people know of a more elegant solution to use the ToBoundary option or at least emulate the behaviour of the ToBoundary option?

Oh, I’m sure it’s possible without scripting the Rhino command. A quick “script logic” might be this:

  • Choose the curve or surface to extrude
  • Choose the boundary surface
  • Get a global bounding box for the two and concoct some distance that will ensure that when extruded, the extrusion goes past the boundary
  • Extrude
  • Intersect the extrusion and the boundary surface as a check
  • If it is successful, check surface normal of the boundary surface and flip if necessary
  • Use Brep.CreateBooleanDifference to subtract the boundary surface from the extrusion.
  • Along the way, various checks for validity, etc.

Would BooleanDifference work if neither of the surfaces are closed? :sweat_smile:

If not, I might have to rethink my plan. The boundingbox check is a very good point!

Could also go for an intersect -> if closecrv

I think it should, but haven’t tried. There is no remark in the api doc that says that it is limited to closed volumes, just this:

The solid orientation of the breps make a difference when calling this function

Which leads me to believe that it will work on open stuff…

I just realised that my description of “not closed” is open for interpretation.

sigh

Funny how you can be stuck on something for a long time and then as soon as you ask it, you find the solution.

Extrude airfoil past boundary
Boolean Difference -> Boundary -> Airfoil
Result (only necessary check is check for surface normals, but that’s already taken care of):

image

Optional Explode to separate surfaces

Yep, essentially the script logic above does what you can do manually with Rhino commands…

With the added bonus of looping through countless combinations of input parameters to create a geometryset for simulations. It would drive me mad to do that all myself haha