Grasshopper

algorithmic modeling for Rhino

is it possible to access control points in vb? I was looking to make these rhinscript commands in vb:

Rhino.ObjectGripCount()
Rhino.ObjectGripLocation()

Views: 885

Replies to This Discussion

This should work for curve control points. Feed a curve to the 'x' input of a vb.net component and use the following code:

Dim crv As New OnNurbsCurve
crv = x.NurbsCurve
Dim pts As New List(Of On3dPoint)
For i As Integer = 0 To crv.m_cv_count - 1
Dim pt As New On3dPoint
crv.getcv(i, pt)
pts.Add(pt)
Next
a = pts
how about these?
Rhino.CurveClosestPoint()
Rhino.EvaluateCurve()

thanks alot for the help...
Instead of giving out the equivalent of every rhinoscript function, ill just tell you a way to find them out for yourself. After you have 'crv' defined as onnurbscurve, just type "crv.". A popup will appear with a list of all the onnurbscurve methods. If what you are looking for is not there, try "rhutil." and "onutil." for more functions.
If you are not sure on how to use a specific method, there may be an example here:
http://en.wiki.mcneel.com/default.aspx/McNeel/Rhino4DotNetPlugIns.html
I'm sorry. You're completely right. I looked through the dot net chm file for info but couldn't find any _ I am still unsure what all those prefixes mean for the different classes...like On, IOn, etc etc - and the only methods I found that sounded like what I was looking for only return booleans...
Those two are also available as components btw.
Čaf David.
Chcel by som sa na niečo opýtať. Neviem, možno mi budeš vediet pomocť.
Mam dve uzavrete krivky rozneho tvaru. napriklad krivka nepravidelneho tvaru a druha krivka je hviezdica.
Chcel by som dostat tuto hviezdicu na obežnu drahu tej nepravidelnej krivky,.
t.j. stred hviezdice na určitý bod
Ak by si mi vedel pomoct a mal chvilu času.
Dakujem
S pozdravom Pavol.
Ahoj Pavol,

moja slovencina neni as taka dobra. Ale myslim ze rozumiem...

Asi musis pouzivat doska "Orient", aby si dostal hviezdicka v dobrom miestu (orientation = translation + rotation).
Attachments:
thanks david. they were to be used as part of a larger vb.net algorithm but maybe I can break the whole pattern into different parts and use those components instead.
after returning to the GH primer and checking with the SDK chm file I still am unsure about those missing functions - basically looking to get the parameter along a curve closest to a point.

I am wondering if maybe I have it wrong - are those functions which return booleans to be used by cycling through an entire list, the closest point being the one that returns a true value? or is there a function that will give you this point outright?

I found one that does what I want for breps, but not for curves. And then there is something called a "curvetree" that speeds closest points and intersection calculations...any advice is really appreciated
The boolean that is returned only tells you if there was a problem with the function. To get the parameter that corresponds to the closest point of a curve, just use:

x.GetClosestPoint(y, a)

where 'x' is the input curve, 'y' is the input point and 'a' is the output parameter.
Sorry for my language. I was thinking that you are from Poprad I am from Kežmarok is it near of your town.
Thank for answer. You understand everthing.

RSS

About

Translate

Search

Videos

  • Add Videos
  • View All

© 2024   Created by Scott Davidson.   Powered by

Badges  |  Report an Issue  |  Terms of Service