Grasshopper

algorithmic modeling for Rhino

Any idea why the following code from my 'scriptable component' works fine in Rhino5 but Rhino4 complains:

"Error: Value of type 'Rhino.Geometry.Plane' cannot be converted to 'Double'. (line 91)

Error: Value of type 'Rhino.Geometry.Plane' cannot be converted to 'Rhino.Geometry.Vector3d'. (line 91)"

 

...and subsequently returns a <null>?

 

 

The code:

 

Private Sub RunScript(ByVal lstPln1 As List(Of Plane), ByVal plnXY As Plane, ByRef Qout As Object)

     'your code goes here…

    Dim i As Int32

    Dim lstOut As New List (Of Object)
    For i = 0 To lstPln1.Count - 1

      Dim Q As Quaternion = Quaternion.Rotation(lstPln1(i), plnXY)

      Dim q1 As Double = Q.A * -1

      Dim q2 As Double = Q.B * -1

      Dim q3 As Double = Q.C * -1

      Dim q4 As Double = Q.D * -1

      Dim strQ As String = Q.A.ToString & "," & Q.B.ToString & "," & q3.ToString & "," & q4.ToString

      lstOut.Add(strQ)

    Next

    Qout = lstOut

  End Sub

Views: 768

Replies to This Discussion

Quaternion doesn't exist in Rhino4, the class only has empty function calls.

 

--

David Rutten

david@mcneel.com

Poprad, Slovakia

Is there a working Quaternions object in the works or should I just stick to Rhino5?

We're not investing any development effort into Rhino4 anymore. There is a fully functioning Quaterion class, but it's Rhino5 only.

 

--

David Rutten

david@mcneel.com

Poprad, Slovakia

That's what I figured, I'll pass it on.

RSS

About

Translate

Search

Photos

  • Add Photos
  • View All

Videos

  • Add Videos
  • View All

© 2024   Created by Scott Davidson.   Powered by

Badges  |  Report an Issue  |  Terms of Service