algorithmic modeling for Rhino
This is my code
While not a c# solution, ladybug has an orient to camera component. I very slightly modified for our use to include the option to rotate in XYZ or XY.
import scriptcontext as sc
import Rhino as rc
cameraX = sc.doc.Views.ActiveView.ActiveViewport.CameraX
cameraY = sc.doc.Views.ActiveView.ActiveViewport.CameraY
cameraZ = rc.Geometry.Vector3d(0.0,0.0,1.0)
def main(_pts):
if _XYorXYZ == True:
oriented = rc.Geometry.Plane(_pts, cameraX, cameraZ) #2D
else:
oriented = rc.Geometry.Plane(_pts, cameraX, cameraY) #3D
return oriented
if _pts:
oriented = main(_pts)
Welcome to
Grasshopper
Added by Parametric House 0 Comments 0 Likes
Added by Parametric House 0 Comments 0 Likes
Added by Parametric House 0 Comments 0 Likes
Added by Parametric House 0 Comments 0 Likes
Added by Parametric House 0 Comments 0 Likes
© 2024 Created by Scott Davidson. Powered by