-
Notifications
You must be signed in to change notification settings - Fork 101
Description
Hi, I have another question: I used the method of detecting overlapping faces to find some overlapping faces, and then used the method you suggested last time to optimize these overlapping faces. The code is as follows:
def repair_overlap(mesh:mm.Mesh , bitSet: mm.FaceBitSet):
# expand to nighbors
badFaces = mm.expandFaces(mesh.topology,bitSet)
log(1,f"")
for b in badFaces:
log(1,f"b:{b}")
# patch
regionBDs = mm.delRegionKeepBd(mesh,badFaces)
log(1,f"")
for r in regionBDs:
log(1,f"r:{r}")
# fill
for bd in regionBDs:
mm.fillHole(mesh,bd[0] ) # you might want to use custom parameters or mm.fillHoleNicely
return TrueThe results showed that this process works fine for very smooth, large areas.
However, at corners or right angles, the above logic occurs, causing the area to be removed.
This results in damage, but Magic RP can repair it and maintain the original right angle effect.
Below is a corner area where overlapping faces are found:
Using the repair_overlap logic to repair it results in the following damaged effect.
Below is the effect of repairing it using Magic RP, which basically maintains the right angle:
Do you have any other ideas or functions that, when optimizing overlapping faces, can preserve the original contour features instead of removing the area?
I found that these overlapping faces, which are on the same plane, are actually very similar to the concept of self-intersection.
Therefore, I think that for a given set of overlapping faces, it's necessary to check if they are on the same horizontal plane. If so, special handling is required.
The function badFaces = mm.expandFaces(mesh.topology, bitSet), which expands nearby faces, might need special handling, or it might not need to be called at all. Only overlapping faces that are not spatially on the same horizontal plane need to expand their nearby faces.
This is my thinking.