Grasshopper

algorithmic modeling for Rhino

Hi,
Does anyone have a suggestion to the rhino function to use when trying to intersect a given surface with a given plane? Basically I'm looking for the VB equivalent of the Sec (Brep|Plane) grasshopper function. I wish to do this via script because this tool will be recursive and will set up the next cut plane based on the last cut plane.

Thanks.

kermin

Views: 3938

Replies to This Discussion

I use RhinoIntersectBreps in Grasshopper. You just have to make sure that your plane is converted into an OnPlaneSurface which truly intersects the entire base shape.

--
David Rutten
david@mcneel.com
Seattle, WA
Thanks. In order to create the onplanesurface, I'm trying to use the RhUtil.RhinoCreateSurfaceFromCorners function. Unfortunately, this completely crashes grasshopper even before I can get to the intersection part.

I plan to set up a unit plane and then use a separate function to reset it to the correct location etc.

Any ideas to why the code below might cause the crash?

Dim CornerPts(3) As On3dPoint

CornerPts(0) = New On3dPoint(0, 0, 0)
CornerPts(1) = New On3dPoint(1, 0, 0)
CornerPts(2) = New On3dPoint(1, 1, 0)
CornerPts(3) = New On3dPoint(0, 1, 0)

Dim CutPlane As New OnSurface = RhUtil.RhinoCreateSurfaceFromCorners(CornerPts(0), CornerPts(1), CornerPts(2), CornerPts(3))

print(cutplane.IsValid)
Change the last line to:
Dim CutPlane As New OnNurbsSurface(RhUtil.RhinoCreateSurfaceFromCorners(CornerPts(0), CornerPts(1), CornerPts(2), CornerPts(3)))
Have a look at the RhinoCutPlane, RhinoExtendLineThroughBox and especially the RhinoPlaneThroughBox functions in RhUtil.

They are all useful functions in this context.

--
David Rutten
david@mcneel.com
Seattle, WA

Thanks a lot for this thread!

What type hint should be associated with a plane and how can they be converted to OnPlaneSurface?

 

Hi Arthur,

 

are you still coding in the old SDK?

 

--

David Rutten

david@mcneel.com

Poprad, Slovakia

Hi David,

Really sorry I actually understood a bit late that this thread was using Rhutil...etc... and there is an "Intersection Surface with Plane" tool too in GH now so I got it all wrong. I was still curious which type hint would be selected if I plugged in a plane though?

 

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