[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 = tI 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_AXIScentered 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

Hello! It looks like you're interested in this conversation, but you don't have an account yet.
Getting fed up of having to scroll through the same posts each visit? When you register for an account, you'll always come back to exactly where you were before, and choose to be notified of new replies (either via email, or push notification). You'll also be able to save bookmarks and upvote posts to show your appreciation to other community members.
With your input, this post could be even better π
Register LoginAdvertisement