Problem with MergeFaces

Hi all,

I’m running into a problem (bug?) with the MergeFaces component in Grasshopper (Rhino 6).

When I try to merge the faces for a large BREP (~1000 faces), the canvas freezes for hours and never comes back. Checking the RAM, it never seems to get full.

I’m attaching a gh file with the issue. The BREP is generated from extruded footprints that are previously BooleanUnioned.

Anyone knows a way to solve this or an alternative method to merge large BREP faces?

Thanks,
Rafael
MergeFaces.gh (581.3 KB)

I baked the Brep and ran the Show Edges command and What command. Your Brep has a non-manifold edge.

Ah! Thanks, I had totally missed this.

I’ll work it out fixing my geometry upstream then.

It seems I found another exception that crashes the MergeFaces component in gh and even Rhino if I try with a command there.

This time there are not non-manifold edges, so I can’t really figure out what could be the cause.

Would you know some other cause for crashing MergeFaces command?

MergeFaces forum.gh (91.8 KB)

Thanks,
Rafael

What’s your file tolerance for this object?

I generated the brep in gh with a Rhino file with 0.01m tolerance if I’m not mistaken.

Does the rhino file tolerance affect this?
I never got to understand which role does the tolerance play in cases like this.

It appears you need to shrink the surfaces before joining.

1 closed polysurface added to selection.
Command: Explode
Exploded a polysurface into 240 surfaces.
Command: ShrinkTrimmedSrf
Shrunk 130 surfaces. 110 surfaces are already shrunk.
Creating meshes… Press Esc to cancel
Command: Join
Surface join in progress… Press Esc to cancel
240 surfaces or polysurfaces joined into one closed polysurface.
Creating meshes… Press Esc to cancel
Command: MergeAllCoplanarFaces
Unable to move edges within face tolerance, nothing done
Unable to move edges within face tolerance, nothing done
Unable to move edges within face tolerance, nothing done
Unable to move edges within face tolerance, nothing done
Unable to move edges within face tolerance, nothing done
Unable to move edges within face tolerance, nothing done
Unable to move edges within face tolerance, nothing done
Unable to move edges within face tolerance, nothing done
Unable to move edges within face tolerance, nothing done
Unable to move edges within face tolerance, nothing done
Unable to move edges within face tolerance, nothing done
Unable to move edges within face tolerance, nothing done
Creating meshes… Press Esc to cancel
Command: _CommandHistory
1 closed polysurface added to selection.
Command: _Explode
Exploded a polysurface into 168 surfaces.
Command: _CommandHistory

Using millimeters as units and 0.001 units tolerance, the final Brep contains 168 surfaces.

Looking at this, I suspect something is wrong with that surface:

I suspect it might be a problem when you’re trying to join and merge many surfaces that contain surfaces that are coplanar and boundaries within each other in one go. Not exactly sure how to describe it better.

Thanks @martinsiegrist for looking into this in such detail.

Exploding the BREP and doing the ShrinkTrimmedSrf now works pretty well in Rhino, even with a file in meters and 0.01 tolerance.

However, when I translate these commands into .gh, the file keeps crashing.

MergeFaces forum.gh (94.8 KB)

This BREP comes from multiple footprint extrusions that are then Boolean Unioned together. Maybe there is a more optimal way to address this upstream in gh?

I’m automating this process over 100s of BREPs in gh, so I need an workable alternative there :sweat:

You can find the base surfaces and divided BREPs here if they are useful:
Merge Faces - Detailed building.gh (270.8 KB)

Rafael

I´m still trying to resolve the issue above - would anyone around here have some leads?

Thanks,
Rafael