Transformation.x/y/zaxis and transformation.axes
-
Silly question, but...
Why do the transformation.xaxis,transformation.yaxis and transformation.zaxis methods return points, whereas the transformation.axes asks for vectors as input ?
To be honest, I don't see any instance where I would use an axis as a point rather than a vector. That might just be me. But the fact that I have to convert points back into vectors afterwards does seem counter-intuitive to me.
(it's not something that's bothering me, I'm just curious as to why things are so)
-
Error in the Ruby API documentation. They return Vector3d objects. If t is a Transformation, try t.xaxis.class
-
Is that so ?
I'll have to check some of the code I wrote then, because I made the conversions and it worked as I expected to. Perhaps there's an implicit point to vector conversion or vice-versa, but in that case the API makes no mention of it.
-
@oajfh said:
Perhaps there's an implicit point to vector conversion or vice-versa, but in that case the API makes no mention of it.
In mathematics, both are represented as arrays.
@unknownuser said:
** class](http://www.sketchup.com/intl/en/developer/docs/ourdoc/array.php)":1hykbm7x]
Introduction
The SketchUp
Arrayclass adds additional methods to the standard RubyArrayclass. Specifically, it contains methods allowing an array to behave just as aVector3dorPoint3dobject (which can be thought of as arrays of 3 coordinate values.) Therefore, you can use theArrayclass in place of aPoint3dorVector3das a way to pass coordinate values.The opposite is also often true, as well.
The API docs need updating in regard to allowable parameter types.
P.S. - The docs are misleading when it says "The SketchUp
Arrayclass ..."
There is only oneArrayclass. The SketchUp API just modifies the Ruby Array base class.
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