Grasshopper

algorithmic modeling for Rhino

Hey all I'm giong through the old tutorials to refresh my memory. Rhino Common is just different enough that I'm having some trouble.

 

I'm having trouble rotating a line!!!! ridic.

 

a little reminder or any tips would be appreciated.

 

Function Rotate_Scale_Line(ByVal aline As Line, ByVal A As Double)As Line


    'Take a portion of the new line
    Dim new_line As New Line
    Dim e_pt As New Point3d

    new_line = aline

    'Declare Initial States
    e_pt = new_line.PointAt(0.95)

    new_line.To = e_pt

    'Rotate

    new_line.Direction.Rotate(A, Vector3d.ZAxis)

    'Function Return
    Rotate_Scale_Line = new_line

  End Function

Views: 279

Replies to This Discussion

How about this:

Private Function RotateLine(ByVal line As Line, ByVal A As Double) As Line
      line.To = line.PointAt(0.95)
      line.Transform(Transform.Rotation(A, Vector3d.ZAxis, line.From))

      Return line
End Function


--
David Rutten
david@mcneel.com
Poprad, Slovakia
David,

Thank you! I can see this becoming more straightforward. great!
Yeah I must admit RhinoCommon is a lot more logical.......

RSS

About

Translate

Search

Videos

  • Add Videos
  • View All

© 2024   Created by Scott Davidson.   Powered by

Badges  |  Report an Issue  |  Terms of Service