Grasshopper

algorithmic modeling for Rhino

Hi,

I try to move a point with (u.v) coordinate on a surface and get the coordinate of the point (x,y,z), but I get problems....

 

Please see the attach file,

 

Thanks to help

Views: 717

Attachments:

Replies to This Discussion

Hi RG,

 

it's the same problem as before, you're calling PointAt() on the Rhino.Geometry.Surface type. PointAt() is not a Shared function. It needs an actual surface to work on. You need to call it on the instance of Rhino.Geometry.Surface called 'surface' in your script.

 

When you type "Rhino.Geometry.Surface." there are only 3 methods in the autocompletion dropdown list. CreateExtrusion, CreateExtrusionToPoint and CreatePeriodicSurface. These are Shared methods. These you can call directly on Rhino.Geometry.Surface.

 

If you type "surface." you get a huge honking list of methods that are not shared and that available through the instance variable surface only.

 

I try to pick my variable names so that they do not conflict with Type names. "surface" is a confusing name as it now refers to both the instance you're inputting and the type in the Rhino SDK. I'd probably use "srf" or "srfBase" or "srfOriginal" or something.

 

--

David Rutten

david@mcneel.com

Poprad, Slovakia

Thanks,

 

so what still wrong:

 

Private Sub RunScript(ByVal s As Surface, ByVal u As Integer, ByVal v As Integer, ByRef point As Object)

    point = s.PointAt(u, v)

Nothing is wrong. This code is correct. Of course the actual values of u and v might be well beyond the domain of the surface, in which case the point will be somewhere far off. You should use Doubles for u and v, as integers do not give you the accuracy needed for evaluating nurbs geometry.

 

--

David Rutten

david@mcneel.com

Poprad, Slovakia

RSS

About

Translate

Search

Videos

  • Add Videos
  • View All

© 2024   Created by Scott Davidson.   Powered by

Badges  |  Report an Issue  |  Terms of Service