[Question] on transformation.rotation
-
Hi all SUdudes...
I have a problem rotating a component instance around itself from a chosen inputpoint.
the component instance have been added, and then I want to rotate it:...... ip.pick view, x, y point = ip.position vector = Geom;;Vector3d.new 0,0,1 angle = 2 t= Geom;;Transformation.rotation point, vector, angle yv_instance.transformation = t
I expected it to rotate around the point with the vector and rotate it 2 radians. BUT instead of rotating it around itself, it rotates around the ip-point and 0,0,0... hmmm hope you understand.
the question is: How do I rotate a component around itself???
tnx in advance
-
The transformation
t=Geom::Transformation.rotation(point, Z_AXIS, angle)
[no need for another vector]
and its use
yv_instance.transform!(t)
should rotate the 'instance' around theZ_AXIS
centered on thepoint
...
The 'angle
' should be in radians.
You set it to '2
' ? To use degrees try2.degrees
...
Note how I have enclosed he arguments inside( )
- the recommended way - as 'un-parenthesized' arguments might get deprecated in a future release of Sketchup's Ruby... -
Great, thanks TIG!
Now it works
Advertisement