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

    Making a copy of a face with holes

    Scheduled Pinned Locked Moved Developers' Forum
    3 Posts 2 Posters 440 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
      BillW
      last edited by

      I am writing a tool that initially has a set of selected faces.
      I want to make a copy of each selected face modifying each vertex to a zero height, applying a pushpull and adding to a group. The problem I have got is there doesnt seem to be a copy method for a face as there is for a group. Not even a clone method.

      I have found a way around with the following code

      facepts = curface.vertices.collect { | vert |
      pt = vert.position
      pt.z = 0
      pt
      }
      newface = grp.entities.add_face facepts

      The problem with this solution is that it doesnt handle holes in faces.

      Has anyone found a way of duplicating a face with holes

      Thanks in advance.

      Bill Wood

      1 Reply Last reply Reply Quote 0
      • fredo6F Offline
        fredo6
        last edited by

        You need to use the 'loops' of the face in order to keep the right topology and handle holes. You have the outer loop and the others which are precisely defining the holes (or embedded faces) if any.

        Then you create faces for each loops, keep the outer loop, and erase the othe face created for the other loops (which keeps however their contour).

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

          Thanks Fredo6

          I knew I had to work with loops but wasnt sure of what to do.
          I have now found an example of how to do this in Didier's double_rectangle.rb tool

          Thanks again

          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