Grasshopper

algorithmic modeling for Rhino

Hi,

I would like to create a cylinder with VB from a given point. I tried this:

Dim plane_test As New Plane(cylinder_point(0), cylinder_normal(0))
Dim circle_test As New Circle(plane_test, cylinder_point(0), 50)
Dim cylinder_test As New Cylinder(circle_test)
cylinder_test.Height1 = 50
cylinder_test.Height2 = 50
Dim surface_test As NurbsSurface
surface_test = NurbsSurface.CreateFromCylinder(cylinder_test)

A = surface_test

It's probably clear, but cylinder_point(0) and cylinder_normal(0) contain the center point of the circle and its vector/normal orientation.

Unfortunately this does not result in a cylinder in Rhino's viewport.

What am I doing wrong?

Thanks,

Fernando

Views: 747

Replies to This Discussion

Height1 and Height2 define at what offsets from the base plane the cylinder starts and stops. If they are equal, then the cylinder has no height and doesn't exist. Or at least it isn't valid. The following code works:

Dim basePlane As Plane = Plane.WorldYZ
Dim baseCircle As New Circle(basePlane, 10)
Dim cyl As New Cylinder(baseCircle)
cyl.Height1 = 10
cyl.Height2 = 50
A = cyl.ToBrep(True, True)

--

David Rutten

david@mcneel.com

Poprad, Slovakia

Thank you David, my Height2 should have been -50 instead of 50!

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