Grasshopper

algorithmic modeling for Rhino

Hello,

In VB, I'm trying to create a surface that is "bounded" by a set of curves.   I can do it in Rhino by using the NetworkSrf command.   I can do it in Grasshopper by using the "Boundary Surface" block.  But I have not yet found a way to do this in a VB script.

For example, my VBScript to create the curves would look something like:

Dim example As New List(Of Curve)

Dim exleft As New Line(New Point3d(0, 0, 0), New Point3d(10, 0, 0))
Dim extop As New Line(New Point3d(10, 0, 0), New Point3d(10, 10, 0))
Dim exright As New Line(New Point3d(10, 10, 0), New Point3d(0, 10, 0))
Dim exbottom As New Line(New Point3d(0, 10, 0), New Point3d(0, 0, 0))

example.add(exleft.ToNurbsCurve())
example.add(extop.ToNurbsCurve())
example.add(exright.ToNurbsCurve())
example.add(exbottom.ToNurbsCurve())

C = example

Which gives me "curves" that create a square in Rhino (the actual script will produce something much more complex than a square, but basically a bunch of curves on the same plane).

My block that uses that script looks like the following image (it has a bunch of inputs and another A and B outputs that are not used in this example, but has a purpose in my real script).  

To make a surface out of the curves, I can use the Boundary block.   But I want to make that surface in the VB script instead

Any pointers?

Thanks.

 

Views: 684

Replies to This Discussion

Dim brp As brep() = brep.CreatePlanarBreps(example)
Dim srf As brep = Nothing
If (brp IsNot Nothing) Then srf = brp(0) 
A = srf

Thank you for your quick response.   It worked like a charm.

Is there an easy way to find information about which commands are available?   Are the list of commands documented somewhere?

Thanks again.

RSS

About

Translate

Search

Photos

  • Add Photos
  • View All

Videos

  • Add Videos
  • View All

© 2025   Created by Scott Davidson.   Powered by

Badges  |  Report an Issue  |  Terms of Service