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

    Pushpull face on a cube

    Scheduled Pinned Locked Moved Developers' Forum
    6 Posts 2 Posters 1.4k 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.
    • B Offline
      biervat
      last edited by

      In my script I want to pushpull a newly created face on a side of a cube. When an edge of the face coincide with the edge of the cube the resulting group isn't a solid group. I don't have this problem when the edges don't coincide. What am I doing wrong?

      
      # create cube
      subelement.entities.add_face(pointscube).pushpull(height)
      # create face on side of cube
      face = subelement.entities.add_face(points)
      face.pushpull(isolatie + binnenschil)
      
      

      Capture.PNG

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

        Your explanation is not that clear.

        In your screenshot assume that the flat slab and new block would both be solid if they didn't share an edge, e.g. if they were made as separate groups.
        However, sharing an edge means that the shared edge supports four faces.
        A solid's edges must all support two faces - no fewer and no more.

        Try this manually to see the issue.

        You are doing nothing 'wrong' - you are simply making something that can never be a solid ??

        TIG

        1 Reply Last reply Reply Quote 0
        • B Offline
          biervat
          last edited by

          Sorry for my explanation but english isn't my first language.
          I first create a plane inside a group and pushpull it. This is the slab in the picture.
          Then I create a face inside the same group. But when I pushpull this one it creates a new cube touching the slab. When I manually delete the mutual face it becomes a solid group.

          Both objects in the picture are created with the same script.


          Capture.PNG

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

            If you cut a cross-section through the two objects you should find that the 'good' one has no internal partitions - but the 'bad' one probably leaves an internal partition face because of the edge that the rectangle shares with another face...

            To trap for these odd events you probably need to model in a context - e.g. a group - then inspect the faces after the pushpull.

            You can do a raytest from the each [new] face.bounds.center using the face.normal...

            If it hits another face that is in the same context then it's probably the partition, erase it.

            ORperhaps, before doing the pushpull get the face's data = face.plane, face.normal and face.bounds... .max/.min/.diagonal/.center etc...
            Then inspect the new faces after the pushpull and if there's a face that's an exact match to that face data, then you can erase it ?

            Do some test to see if this works...

            TIG

            1 Reply Last reply Reply Quote 0
            • B Offline
              biervat
              last edited by

              Thanks that did the trick. Is there a reason why the face isn't removed by the pushpull command?

              
              # create cube
              subelement.entities.add_face(pointscube).pushpull(height)
              # create face on side of cube
              face = subelement.entities.add_face(retourpoints)
              fbounds = face.bounds
              face.pushpull(isolatie + binnenschil)
              subelement.entities.each do |ent|
                if ent.is_a?(Sketchup;;Face)
              	ebounds = ent.bounds
              	if ebounds.max == fbounds.max and ebounds.min == fbounds.min
              	  ent.erase!
              	  break
              	end
                end
              end
              
              
              1 Reply Last reply Reply Quote 0
              • TIGT Offline
                TIG Moderator
                last edited by

                As I already explained...
                And you can see this when it's done 'manually' too...
                If a rectangle face is wholly within another planar face and none of its edges are shared with any other faces, then the PushPull leaves a hole where the original face was.
                If a rectangle face has any edges shared with other faces - as in the case you have where the face is on the corner of the form and one edge has another non-planar face - then the PushPull can leave the original face behind in the new geometry...

                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