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

    Transformation help req'd!

    Scheduled Pinned Locked Moved Developers' Forum
    3 Posts 2 Posters 204 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

      How to I stop the transformation for the "left leaf" from influencing the "right leaf" ?
      is there some type of reset statement available? TIA

      group=entities.add_group
          entities=group.entities 
          #----left leaf
          left=entities.add_face($pt00, $pt4, $pt5, $pt33)
          left.pushpull $ddthick 
          #rotation is about point $pt000 and about the blue axis 80 degrees
          t=Geom;;Transformation.rotation($pt000,Geom;;Vector3d.new(0,0,1), -pi*0.8888/2)
          group.move!(t)
             
              
          group=entities.add_group
          entities=group.entities 
          #----right leaf 
          right=entities.add_face($pt4, $pt11, $pt22, $pt5)
          right.pushpull $ddthick
      

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

      1 Reply Last reply Reply Quote 0
      • Chris FullmerC Offline
        Chris Fullmer
        last edited by

        OK, after playing with your snippet of code for a bit, I think the problem is that the first leaf is being created in its own group. Then the 2nd leaf is being made in a group inside the first group. So when you transform the first group, you are altering where your points for the right leaf will be made.

        So change your code so that the right leaf is being made inside the model entities, not inside the left leaf group entities. Look at this code for some subtle changes.

        group=entities.add_group
            g_entities=group.entities 
            #----left leaf
            left=g_entities.add_face($pt00, $pt4, $pt5, $pt33)
            left.pushpull $ddthick 
            #rotation is about point $pt000 and about the blue axis 80 degrees
            t=Geom;;Transformation.rotation($pt000,Geom;;Vector3d.new(0,0,1), -pi*0.8888/2)
            group.move!(t)
               
                
            group=entities.add_group
            g_entities=group.entities 
            #----right leaf 
            right=g_entities.add_face($pt4, $pt11, $pt22, $pt5)
            right.pushpull $ddthick
        

        Essentially I just separated your entities variable into 2. "entities" now holds the model entities. g_entities now holds the group entities. This way when you create your second group, it is being made inside the model entities, not inside the previous group.

        Chris

        Lately you've been tan, suspicious for the winter.
        All my Plugins I've written

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

          Thanks for shining a light on this for me Chris, I need to get new batteries 😄

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

          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