What does Entities.transform_by_vectors actually do?
-
http://code.google.com/apis/sketchup/docs/ourdoc/entities.html#transform_by_vectors
The manual doesn't help me much here... Anyone care to enlighten me? -
It makes your heart happy!
It transforms all given entities at once. So what? Try to move a series of edges/faces/vertices one at a time using the regular transformations. SU will automatically add geometry in between each transformation, delete faces on accident, re-orient things....it gets ugly quick!
transform_by_vectors treats the entire preocess as a single movement, so it doesn't add faces or anything until after the whole thing is over.
It works by giving it an array of entities to move and a corresponding array of vectors to move them by. That means each victor is in the direction of the move and is set to the correct length before running the transform_by_vectors method.
Its couterpart entities.transform_entities is also useful, but it only allows a single transformation object to be applied to all entities uniformly. So use transform_by_vector when you have lots of entities to transform simultaneously, using different transformations for each entitity.
Does that begin to explain it?
Chris
-
Yea I understand now. Think I'll add that entry to the request of updated API manual.
Thanks for the explanation. I'm sure I'll come in use soon.
..though, not what I hoped for... oh well.
-
Thanks for the info. Might come handy for an update of my align script.
Advertisement