Hello all,
I am very new to Rhino so please forgive the following stupidity. I’ll reduce my problem to one very simple manoeuvre. Or what should be simple.
I need to project a point, lying outside a sphere onto the surface of the sphere but with the centre of the sphere as the point of direction. In other words the point heads for the centre of the sphere but stops on the surface.
There does not seem to a command for this. There are similar commands but not quite the same.
There is rhinoscript …ProjectPointtoSurface which goes as follows…
Sub TestProjectPoints
Dim arrObjects, strSurface
strSurface = Rhino.GetObject(“Select surface to project onto”, 8)
arrObjects = Rhino.GetObjects(“Select points to project”, 1)
Dim nBound, arrPoints
nBound = UBound(arrObjects)
ReDim arrPoints( nBound )
Dim i
For i = 0 To nBound
arrPoints(i) = Rhino.PointCoordinates( arrObjects(i) )
Next
’ Project down…
Dim arrResults
arrResults = Rhino.ProjectPointToSurface(arrPoints, strSurface, Array(0,0,-1))
Rhino.AddPoints arrResults
End Sub
This is close but I’m guessing its using the c-plane as the ‘vector’ (?). I have tried rewriting the code so that I can choose a point or vector of direction but to no avail. I wont publish my rewrites for they may disturb (or depress) you. I’ll keep trying to get the code right but at the same time I feel like I must be missing something incredibly simple that does not require script.
I dont need to project vast or complex arrays. I’m happy to go point by point. If anyone has a simple solution for this I’d be very grateful.
Thanks.