Grasshopper

algorithmic modeling for Rhino

hello,

we are trying to write a vb loop where we need to find the closest point on a curve at every iteration .
we found the rhutil.RhinoBrepClosestPoint but are failing in feeding in a curve



many thx in advance
alex , christoph , daniel

Views: 505

Replies to This Discussion

hi guys
greetings from innsbruck to vienna!

below the vb.net code for closest point
if you are working with the sdk keep in mind that you have to search for the right classes
so in your case oncurve and not onbrep
the function you have written down is for brep and prep is a polysurface
the easiest way to work with the sdk is to search in the index typ per example on_curve and then you get back all the possibilities for the class on curve and so on

best [to

Dim crv As OnCurve = x
Dim test_point As On3dPoint = y
'dim cpt as var for closest point
Dim cpt As on3dpoint

Dim t As Double
'this function returns the evaluation parameter t on the closest point to the test_point
crv.GetClosestPoint(test_point, t)
'returns the 3Dpoint on the location t
cpt = crv.PointAt(t)
I make an simple example file using to]'s script.
Attachments:
hey guys ,

thx for the fast help it´s exactly what we where searching for ..
hope that we can show you some results soon
...

greets from vienna
alex, chris, daniel

RSS

About

Translate

Search

© 2024   Created by Scott Davidson.   Powered by

Badges  |  Report an Issue  |  Terms of Service