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!
    🫛 Lightbeans Update | Metallic and Roughness auto-applied in SketchUp 2025+ Download

    Direction of Pushpull Is ?

    Scheduled Pinned Locked Moved Developers' Forum
    11 Posts 4 Posters 820 Views 4 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.
    • M Offline
      MartinRinehart
      last edited by

      ents = Sketchup.active_model.entities
      f = ents.add_face ...
      f.pushpull x
      
      

      Which way does that pushpull?

      Author, Edges to Rubies - The Complete SketchUp Tutorial at http://www.MartinRinehart.com/models/tutorial.

      1 Reply Last reply Reply Quote 0
      • J Offline
        Jim
        last edited by

        Always in the direction of the face normal. Modify your question a little.

        Hi

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

          Except if the face is lying flat on the ground. In that case, it is always pushpulled in the positive Z direction (upwards), regardless of its normal's direction.

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

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

            So [usually] if it faces up it pulls 'up' and if it faces down it pushes down...
            If you always want it to be pulled 'up' then face.reverse! if face.normal.z<0; face.pushpull(dist)
            but if you want it pushpulled in the direction of the face's normal then plain
            face.pushpull(dist) will work except if face normal==[0,0,1] and face.bounds.min.z==0 in which case adjust accordingly...

            TIG

            1 Reply Last reply Reply Quote 0
            • J Offline
              Jim
              last edited by

              I didn't want to spoil it - Martin seems like the kind of guy who enjoys figuring things out.

              I think it was trick question.

              Hi

              1 Reply Last reply Reply Quote 0
              • M Offline
                MartinRinehart
                last edited by

                @jim said:

                I think it was trick question.

                No quite. I knew, before I asked, that the answer was "positive distance is often toward the outside of the face" and that a fresh rectangle in the rg plane was an exception. What I didn't know was if the latter was THE exception or one member of a class of exceptions.

                Author, Edges to Rubies - The Complete SketchUp Tutorial at http://www.MartinRinehart.com/models/tutorial.

                1 Reply Last reply Reply Quote 0
                • J Offline
                  Jim
                  last edited by

                  Yes, but I am not seeing any exception.

                  Using this code, I get the following model - one face pushed up, the other down.

                  model = Sketchup.active_model
                  entities = model.entities
                  selection = model.selection
                  selection.each {|e|
                    if e.is_a? Sketchup;;Face
                      e.pushpull(10)
                    end
                  }
                  
                  

                  pptest.jpg


                  pptest.skp

                  Hi

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

                    Well that's odd. I could have sworn that a face on the ground plane will always head upwards.

                    Chris

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

                    1 Reply Last reply Reply Quote 0
                    • M Offline
                      MartinRinehart
                      last edited by

                      @chris fullmer said:

                      Well that's odd. I could have sworn that a face on the ground plane will always head upwards.

                      Me too. I just rectangled twice on the ground plane, reversed one of the faces.

                      This, from memory, was what I typed into the Ruby Console:

                      
                      ents = Sketchup.active_model.entities
                      f = []
                      ents.each { |e| f.push(e) if e.is_a? Sketchup;;Face }
                      f.each { |f| f.pushpull(10) }
                       
                      

                      Result: two rectangular parallelepipeds (that's pretentious for "box"), both with their blue dimensions ranging from 0 to 10.

                      So now we've really screwed this one down: always toward the outside face, except on the ground plane, but the exception doesn't apply to Jim.

                      Anyone happy with this?

                      Author, Edges to Rubies - The Complete SketchUp Tutorial at http://www.MartinRinehart.com/models/tutorial.

                      1 Reply Last reply Reply Quote 0
                      • M Offline
                        MartinRinehart
                        last edited by

                        @martinrinehart said:

                        Result: two rectangular parallelepipeds (that's pretentious for "box"), both with their blue dimensions ranging from 0 to 10.

                        Totally wrong! Went back and did it again, carefully, being sure to orbit around and under. Jim is right. Sorry, Jim.

                        Author, Edges to Rubies - The Complete SketchUp Tutorial at http://www.MartinRinehart.com/models/tutorial.

                        1 Reply Last reply Reply Quote 0
                        • J Offline
                          Jim
                          last edited by

                          Maybe version 6 behaved differently? I can check...

                          No, 2 faces on the RG plane with opposite normals, +Z and -Z, each pushpulled +10, each extruded in the direction of the normal - so one went up, the other went down.

                          Hi

                          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