sketchucation logo sketchucation
    • Login
    โ„น๏ธ Licensed Extensions | FredoBatch, ElevationProfile, FredoSketch, LayOps, MatSim and Pic2Shape will require license from Sept 1st More Info

    Move point?

    Scheduled Pinned Locked Moved Developers' Forum
    6 Posts 3 Posters 257 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.
    • A Offline
      alz
      last edited by

      (newb question here)

      With "ComponentInstance" and "tranformation" you can move a selected component around.

      Is there a way to move a selected point around? Or does it get complicated by having to select an edge, then find the points in it to move?

      1 Reply Last reply Reply Quote 0
      • TIGT Offline
        TIG Moderator
        last edited by

        You can move Instances/Groups, Points and Vertices.

        You apply transformations to most but for vertices you must use another method
        'Transformations' can be points, translations, rotations and scaling etc...

        tr=Geom::Transformation.translation([0,0,1]) ### =='changes' something; here == move it up 1 unit...
        group.transform!(tr) ### =='changes' the group by 'tr', up 1 unit...
        or
        point.transform!(tr) ### =='changes' point by 'tr', up 1 unit...

        but for a vertex or vertices you need to use...
        entities.transform_entities(tr,[vertices])

        here an array (list) of vertices have 'tr' applied...

        or
        entities.transform_by_vectors([vertices],[vectors])

        you take an array of vertices and apply an array of vectors to do the translation...

        So for one vertex
        entities.transform_by_vectors([vertex],[[0,0,1]]) ### moves vertex by vector up 1 unit in Z...

        You can also apply these 'entities.transform....' methods to any collection of 'things' like an array of group.entities...

        TIG

        1 Reply Last reply Reply Quote 0
        • A Offline
          alz
          last edited by

          Very cool! Thanks for the examples, TIG!

          The difference between 'point' and 'vertex' is construction point vs. edge point?

          1 Reply Last reply Reply Quote 0
          • thomthomT Offline
            thomthom
            last edited by

            ConstructionPoint is a construciton point Entity.
            Vertex is the end points of Edges.

            Point3d is just a point in 3d space.

            Thomas Thomassen โ€” SketchUp Monkey & Coding addict
            List of my plugins and link to the CookieWare fund

            1 Reply Last reply Reply Quote 0
            • TIGT Offline
              TIG Moderator
              last edited by

              ...and vertex.position returns the point in space that the vertex is ๐Ÿ˜„

              TIG

              1 Reply Last reply Reply Quote 0
              • A Offline
                alz
                last edited by

                Awesome -- all very helpful bits of info!

                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