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

    Push pull problems/face orientation wobbly

    Scheduled Pinned Locked Moved Developers' Forum
    3 Posts 2 Posters 333 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.
    • S Offline
      spireup
      last edited by

      Hi

      Im creating 3d geometry using the method in the 'Creating Geometry' tutorial at https://developers.google.com/sketchup/docs/tutorial_geometry

      ie specify point then add a face then use push pull to add third dimension.

      Problem is sometimes the push pull is going in the wrong direction. Ive read somewhere thats to do with face orientation. I think whats happening is that when the geometry is being drawn next to existing geometry it is triggering some sort of new face or face orientation linked to the existing geometry that is different to what I would expect if I was drawing in isolation.

      Workarounds Ive thought of are

      1. draw the new geometry outside the models bounding box and bring it into place.
      2. use another way than pushpull to create the extra dimension
      3. build in context awareness to the code so that the face orientation cant be messed up by existing geometry.
      4. find a way to force the face orientation in every case regardless of context.

      Anyway I thought Id put the problem to the group because I imagine this could be quite a nooby way of creating geometry and Id be keen to hear of better ways. Im keen to hear of any better ways to do things/think.

      Thanks for your help.

      Paul

      1 Reply Last reply Reply Quote 0
      • Dan RathbunD Offline
        Dan Rathbun
        last edited by

        @unknownuser said:

        ](https://developers.google.com/sketchup/docs/ourdoc/face#pushpull)":181okd10]The distance is measured in the direction that the face normal is pointing.

        So use face.normal() to get the directional vector of the front of your face. Compare it to the direction you wish to pushpull, and if it's opposite, then call face.reverse! before you pushpull it.

        I'm not here much anymore.

        1 Reply Last reply Reply Quote 0
        • S Offline
          spireup
          last edited by

          Thanks Dan. Will do.

          [edit]
          In the end I set up a vector in the direction I wanted the face to go and used "samedirection" to check and used reverse liked you suggested. Initially I tried 'parrallel?' not thinking that that wouldnt catch vectors in the exact opposite direction.

          if not(face.normal.samedirection? correctV3d ) then face.reverse!
          	
          end
          

          This worked.

          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