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
Array
class adds additional methods to the standard RubyArray
class. Specifically, it contains methods allowing an array to behave just as aVector3d
orPoint3d
object (which can be thought of as arrays of 3 coordinate values.) Therefore, you can use theArray
class in place of aPoint3d
orVector3d
as 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
Array
class ..."
There is only oneArray
class. The SketchUp API just modifies the Ruby Array base class.
Advertisement