• Login
sketchucation logo sketchucation
  • Login
🤑 SketchPlus 1.3 | 44 Tools for $15 until June 20th Buy Now

Making a copy of a face with holes

Scheduled Pinned Locked Moved Developers' Forum
3 Posts 2 Posters 440 Views
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 3 Sept 2008, 18:20

    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
    • F Offline
      fredo6
      last edited by 3 Sept 2008, 18:42

      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 3 Sept 2008, 18:59

        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
        1 / 1
        • First post
          1/3
          Last post
        Buy SketchPlus
        Buy SUbD
        Buy WrapR
        Buy eBook
        Buy Modelur
        Buy Vertex Tools
        Buy SketchCuisine
        Buy FormFonts

        Advertisement