Ruby transformation issue?
-
I'm trying to graphically explain the following coding problem I'm having, please see the attachment.
Under 5, I would like to use a move transformation of that face, only, to a new location, without it affecting the entire transformation which follows in 6. How would I code that move transformation to affect 5 only?

-
I don't think that
.move!is really what you are after...
to rotate the group itself try...
group.transform!(t)
OR if you want to change the contents WITHIN the group use...
group.entities.transform_entities(t, group.entities.to_a)
If you want to JUST affect the 'base' inside the group use...
group.entities.transform_entities(t, base)
BUT 't' can be any 'transformation' you want...

-
the rotation works as written, It just happens the 4 new points defining the new face in 5 need to be moved/centered before 6 rotates all of these entities (think about moving a glass plane to the center of a window frame before the entire window frame and glass gets rotated)
The alternative naturally would be to simply create 4 new points defining a face at the center of the window frame. in which case I would not be asking for help. -
So as I thought I had explained... make a transformation [tb] for 'base' and use it just on that entity
group.entities.transform_entities(tb, **base**)THEN make and use another transformation [t] on the whole 'group'...
Also note that your approximations of PI etc could be replaced by
60.degreesor other values in degrees, to give consistently accurate angles...
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