sketchucation logo sketchucation
    • Login
    ℹ️ Licensed Extensions | FredoBatch, ElevationProfile, FredoSketch, LayOps, MatSim and Pic2Shape will require license from Sept 1st More Info

    Transformation.x/y/zaxis and transformation.axes

    Scheduled Pinned Locked Moved Developers' Forum
    4 Posts 3 Posters 376 Views 3 Watching
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • O Offline
      oajfh
      last edited by

      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)

      1 Reply Last reply Reply Quote 0
      • S Offline
        slbaumgartner
        last edited by

        Error in the Ruby API documentation. They return Vector3d objects. If t is a Transformation, try t.xaxis.class

        1 Reply Last reply Reply Quote 0
        • O Offline
          oajfh
          last edited by

          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.

          1 Reply Last reply Reply Quote 0
          • Dan RathbunD Offline
            Dan Rathbun
            last edited by

            @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 Ruby Array class. Specifically, it contains methods allowing an array to behave just as a Vector3d or Point3d object (which can be thought of as arrays of 3 coordinate values.) Therefore, you can use the Array class in place of a Point3d or Vector3d 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 one Array class. The SketchUp API just modifies the Ruby Array base class.

            💭

            I'm not here much anymore.

            1 Reply Last reply Reply Quote 0
            • 1 / 1
            • First post
              Last post
            Buy SketchPlus
            Buy SUbD
            Buy WrapR
            Buy eBook
            Buy Modelur
            Buy Vertex Tools
            Buy SketchCuisine
            Buy FormFonts

            Advertisement