algorithmic modeling for Rhino
import Rhino as r
import math
L=[]
linesseg=r.Geometry.Polyline.GetSegments(polyline)
for line in linesseg:
startpt=r.Geometry.Line.PointAt(line,0)
Zstartpt=r.Geometry.Point3d(startpt[0],startpt[1],5)
Zvector=Zstartpt-startpt
endpt=r.Geometry.Line.PointAt(line,1)
vector=endpt-startpt
vector1=r.Geometry.Vector3d.Rotate(vector,math.radians(90),Zvector)
midpt=r.Geometry.Line.PointAt(line,0.5)
r.Geometry.Transform()
# i wanna move the midpt alone the vector1, i couldnt find the related method.
#Thank you
-Carcassi
Tags:
wouldn't adding the point and the move vector together equate to the new point location
import Rhino as rc
# moving vector and base point
movingVector = rc.Geometry.Vector3d(10,10,10)
point = rc.Geometry.Point3d.Origin
# probably you are looking for something like this
newPt = rc.Geometry.Point3d.Add(point, movingVector)
print newPt
# or as Danny mentioned simply add them up
newPt2 = point + movingVector
print newPt2
dunno how it works in python but there is also another method in vb, which is something like :
Dim pt As New point3d(0, 1, 2)
Dim vec As New vector3d(1, 1, 1)
Dim tr As New rhino.geometry.transform
tr = rhino.geometry.Transform.Translation(vec)
pt.transform(tr)
Yea, it's a slightly complicated method... but it gives an opportunity to work with tranformation matrices.
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