Skip to content

Fixing issues related to overlapping faces at right angles or corners. #5662

@jiushi-ai

Description

@jiushi-ai

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 True

The 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:

Image

Using the repair_overlap logic to repair it results in the following damaged effect.

Image

Below is the effect of repairing it using Magic RP, which basically maintains the right angle:

Image

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.

Image Image Image Image

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions