sketchucation logo sketchucation
    • Login
    Oops, your profile's looking a bit empty! To help us tailor your experience, please fill in key details like your SketchUp version, skill level, operating system, and more. Update and save your info on your profile page today!
    🛣️ Road Profile Builder | Generate roads, curbs and pavements easily Download

    [REQ SU api] Set component axis

    Scheduled Pinned Locked Moved Developers' Forum
    5 Posts 3 Posters 585 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.
    • PixeroP Offline
      Pixero
      last edited by

      @SketchUp team

      Please add a way to set a component definitions origin and axis directly.

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

        Although it's convoluted you can do it already... You use:
        definition.entities.transform_entities(Geom::Transformation.translation(ORIGIN.vector_to(some_other_point_in_the_context)), definition.entities.to_a)
        to move the origin/insertion-point of the definition.
        If there are any existing 'instances' you'll also need to apply an inverse transformation to them ?
        If the axes are rotated you can also do a ...Geom::Transformation.rotation(anchor_point, axis_vector, angle)...
        and again you might need to fix any existing 'instances'...

        TIG

        1 Reply Last reply Reply Quote 0
        • PixeroP Offline
          Pixero
          last edited by

          Yeah, thats what I use but using the inverse transformation IS convoluted.
          It would be so much easier if there was a set origin and axis.

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

            @pixero said:

            Yeah, thats what I use but using the inverse transformation IS convoluted.
            It would be so much easier if there was a set origin and axis.
            I agree !
            I was just saying it was possible - albeit convoluted...

            TIG

            1 Reply Last reply Reply Quote 0
            • kimpastroK Offline
              kimpastro
              last edited by

              @tig said:

              Although it's convoluted you can do it already... You use:
              definition.entities.transform_entities(Geom::Transformation.translation(ORIGIN.vector_to(some_other_point_in_the_context)), definition.entities.to_a)
              to move the origin/insertion-point of the definition.
              If there are any existing 'instances' you'll also need to apply an inverse transformation to them ?
              If the axes are rotated you can also do a ...Geom::Transformation.rotation(anchor_point, axis_vector, angle)...
              and again you might need to fix any existing 'instances'...

              Sorry bring back this post but, with this is possible to do the second move (at right)?

              6.png

              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