Making a copy of a face with holes
-
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 faceptsThe 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
-
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).
-
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 toolThanks again
Advertisement