algorithmic modeling for Rhino
I am trying to create sections within a brep(Hull) by intersecting the brep with the XY plane. The idea is that within the loop, the plane moves along the length of the brep. I can't seem to get this operation to work. Ideally it would create however many sections the user wants, input as the NumberOfWaterlines variable. Here is my code:
Dim i As Integer
Dim WLintCurves As Curve()
Dim WLintPoints As point3d()
Dim Waterplanes As Brep()
Dim WaterplanesBreps As array
For i = 0 To NumberOfWaterlines - 1
XYPlane.OriginZ = i * Depth / NumberOfWaterlines
Rhino.Geometry.Intersect.intersection.BrepPlane(Hull, XYPlane, 0.0001, WLintCurves, WLintPoints)
Waterplanes = Rhino.Geometry.Brep.CreatePlanarBreps(WLintCurves)
WaterplanesBreps(i) = Waterplanes
Next
Any help would be greatly appreciated!
Tags:
Hi Dorvieto,
don't use arrays like this:
Dim WaterplanesBreps As array
It's much easier to use Lists instead:
Dim WaterplanesBreps As New List(Of Brep)
Then you can easily append your Planar Breps like so:
WaterplanesBreps.AddRange(Waterplanes)
--
David Rutten
david@mcneel.com
Poprad, Slovakia
Welcome to
Grasshopper
Added by Parametric House 0 Comments 0 Likes
Added by Parametric House 0 Comments 0 Likes
Added by Parametric House 0 Comments 0 Likes
© 2024 Created by Scott Davidson. Powered by