Grasshopper

algorithmic modeling for Rhino

how to creat a line which is tangent from a given curve on certain t parameter

i have read vb part of the new tutorial.

i have some problems with the chapter points and vectors.

i tried to creat a line which is tangent from a given curve on certain t parameter.
i get stucked when i get an on3dpoint from the curve class-- curve.tangentat(t)
this appear to me is a on3dpoint. not sure though.

i used the one on tutorial : dim dir_vector as new on3dvector = p1-p0
the output said 'end statement expected‘

and i also wandered if i need something like rhino.pointadd in VB.net
what should i do?

Views: 419

Replies to This Discussion

Try this code:

Sub RunScript(ByVal inCrv As OnCurve, ByVal t As Double, ByVal length As Double)
Dim tVec As New On3dVector
tVec = inCrv.TangentAt(t)
tVec = tVec * length

Dim ptStart As New On3dPoint(inCrv.PointAt(t))
Dim ptEnd As New On3dPoint
ptEnd = tVec + ptStart

Dim tLine As New OnLine(ptStart, ptEnd)
A = tLine
End Sub
cool.
thanks a lot.

i have got another question what is the difference bt. OnCurve and OnNurbsCurve?
and since OnCurve and OnLine is different, how to use the pointat in OnLine?
Check out my post @ the thread below. It explains a little bit about the different curve classes in the Rhino SDK.

http://grasshopper3d.ning.com/forum/topics/how-to-convert-online-to

Specifically, the PointAt method is going to be pretty much exactly the same for OnLine as it is in the OnCurve derived classes.
Best to read the SDK help file on Classes.

OnCurve is the parent class for OnNurbsCurve (OnCurve is also within OnGeometry Class - Open Nurbs Geometry).
OnLine is a derivative of the Curve Class rather than OnGeometry Class, however, it can be cast to OnGeometry.

OnLine.PointAt(t) should work exactly the same.
thanks a lot.


just wanna to be more clear, so if i had a VB component output A is a OnNurbsCurve, can i use this output for another VB Component as an input x as OnCurve?
yep - should be no problem.

RSS

About

Translate

Search

© 2024   Created by Scott Davidson.   Powered by

Badges  |  Report an Issue  |  Terms of Service