How to merge brepface


image

How should it be merged? The mergedBrep in the above code is always null

Aren’t you looking for MergeCoplanarFaces method?

private void RunScript(Brep brep, ref object A)
{
  brep.MergeCoplanarFaces(Rhino.RhinoDoc.ActiveDoc.ModelAbsoluteTolerance);
  A = brep;
}


MergeCoplanarFaces.gh (5.9 KB)

1 Like

But there may be multiple faces on a solid with this split, how does the MergeCoplanarFaces method specify which two faces to merge?

Is this operation currently supported?

@dale

Any solution?

Hi @ken_zhang,

I believe @Mahdiyar gave you the solution. Is this not working?

– Dale

@dale
But I added the description

But there may be multiple faces on a solid with this split, how does the MergeCoplanarFaces method specify which two faces to merge?

And after I actually called this method, the merge was not successful

error: 无法在面允许的公差内移动边缘,无任何动作

@dale

After studying the mechanism of GH, it has an Untrim mechanism. Its untrim is just to brep the surface. My understanding is that the surface itself does not have any trim, so it is untrim. I think I want to delete a Trim, but Trim also has no Api to delete

 var os = doc.Objects.OfType<BrepObject>().FirstOrDefault();
            os.BrepGeometry.MergeCoplanarFaces(1);
            os.CommitChanges();
            doc.Views.Redraw();

All the divisions are gone, but I just want to erase the A side or the B side

Hi @ken_zhang,

Currently, RhinoCommon doesn’t have a method that allows you to specify which coplanar faces to merge. I’ve logged the request.

https://mcneel.myjetbrains.com/youtrack/issue/RH-68618

– Dale

@dale
The link can’t open

Nope, can’t find it!

It could mean that the URL points to a page that doesn’t exist or the URL is correct and you don’t have permission to view this content.

By the way, you’re currently browsing as a Guest . If you have an account, you might have more luck if you log in.

I have no idea what your talking about - sorry.

– Dale

RH-68618 is fixed in Rhino 7 Service Release 19

@brian
Thanks for the quick response. Hope to be notified here after the official release, thank you.

Hi Ken -

There are no further notifications for individual fixes. Either set your update frequency to Service Releases or make sure to follow the Service Release thread to find out when SR 19 is released:

-wim