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

    Ruby transformation issue?

    Scheduled Pinned Locked Moved Developers' Forum
    4 Posts 2 Posters 121 Views 2 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.
    • T Offline
      tomot
      last edited by

      I'm trying to graphically explain the following coding problem I'm having, please see the attachment.
      Under 5, I would like to use a move transformation of that face, only, to a new location, without it affecting the entire transformation which follows in 6. How would I code that move transformation to affect 5 only?


      panel.jpg

      [my plugins](http://thingsvirtual.blogspot.ca/)
      tomot

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

        I don't think that .move! is really what you are after...
        to rotate the group itself try...
        group.transform!(t)
        OR if you want to change the contents WITHIN the group use...
        group.entities.transform_entities(t, group.entities.to_a)
        If you want to JUST affect the 'base' inside the group use...
        group.entities.transform_entities(t, base)
        BUT 't' can be any 'transformation' you want...
        🤓

        TIG

        1 Reply Last reply Reply Quote 0
        • T Offline
          tomot
          last edited by

          the rotation works as written, It just happens the 4 new points defining the new face in 5 need to be moved/centered before 6 rotates all of these entities (think about moving a glass plane to the center of a window frame before the entire window frame and glass gets rotated)
          The alternative naturally would be to simply create 4 new points defining a face at the center of the window frame. in which case I would not be asking for help.

          [my plugins](http://thingsvirtual.blogspot.ca/)
          tomot

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

            So as I thought I had explained... make a transformation [tb] for 'base' and use it just on that entity
            group.entities.transform_entities(tb, **base**)

            THEN make and use another transformation [t] on the whole 'group'...

            Also note that your approximations of PI etc could be replaced by 60.degrees or other values in degrees, to give consistently accurate angles...

            TIG

            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