algorithmic modeling for Rhino
i am new to the vb.net in grasshopper ,since i start to learn it.and i am trying study it from this example:http://issuu.com/pabloherrera/docs/vb-workshop-harvard-gsd-woojsung... .but i met an error and have no idea what happen.coule somebody help me!!!
Tags:
You need to do some null checking to make sure that your variables actually exist.
I'd also recommend getting the casing of your types and method names right. VB is not case-sensitive, but other languages are so it makes translating code between languages a lot more hassle:
If (basesrf Is Nothing) Then Return
If (Not input_pt.IsValid) Then Return
Dim u, v As Double
basesrf.ClosestPoint(input_pt, u, v)
Dim normal As Vector3d
normal = basesrf.NormalAt(u, v)
Dim drain As vector3d = Vector3d.CrossProduct(normal, Vector3d.ZAxis)
If (Not drain.IsValid) Then Return
If (drain.IsZero) Then Return
drain.Unitize()
drain.Transform(Transform.Rotation(Math.PI * 0.5, normal, input_pt))
Dim moved_pt As Point3d = input_pt + distance * drain
basesrf.ClosestPoint(moved_pt, u, v)
Dim output_pt As Point3d = basesrf.PointAt(u, v)
A = output_pt
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
Added by Parametric House 0 Comments 0 Likes
Added by Parametric House 0 Comments 0 Likes
© 2025 Created by Scott Davidson.
Powered by