Grasshopper

algorithmic modeling for Rhino

Hi everybody!

I'm currently doing some GH and VB engines for a design studio at university. I managed quite quickly to get a point on a OnCurve defined by a certain t-value using crv.PointAt(t).
Now i would need the t-value of a certain point on the curve - so exactly the other way around. Is there a way to do that? And i yes, how? Something like crv.TAt(point) - I knwo that that expression doesn't exist but just to illustrate what I'm looking for.

A second question concerning t-values on a curve is following: using a evaluate curve component in GH allows to reparametrize the input curves so that the t-value of the starting point is always 0 and the one of the endpoint 1. Is there a way to do that in VB as well? So far I always got t-values which go up to quite high numbers...

I would really apreciate your help!
Martin

Views: 1296

Replies to This Discussion

Try something like this:
Dim t As Double
crv.GetClosestPoint(pt, t)
a = crv.Domain.NormalizedParameterAt(t)

Edit: There's also crv.Domain(0,1) on 0.7 but i can't make it work it works.
On 0.6 try crv.SetDomain(0,1)
I forgot to change it, it's:
crv.Domain = New interval(0, 1)
Thanks so much for your very quick help!!
Both worked very well in GH 0.6.0059! I'll try afterwords to install and use the new GH-version but I'm somehow afraid, that my other scripts won't work anymore... But as David Rutten mentiones the "old" version will be still available for a while.

RSS

About

Translate

Search

Videos

  • Add Videos
  • View All

© 2024   Created by Scott Davidson.   Powered by

Badges  |  Report an Issue  |  Terms of Service