I could think of something like finding all edge intersections, trimming and creating new edges and make a new Brep from that. But this sounds like a lot of work as I cannot say for sure how many overlapping areas the BrepFaces might have.
Is there an easy way to accomplish that via RhinoCommon?
What you have said here is what i was going to suggest:
I could think of something like finding all edge intersections, trimming and creating new edges and make a new Brep from that. But this sounds like a lot of work as I cannot say for sure how many overlapping areas the BrepFaces might have.
It is really hard to say without any file. But I would go this way:
Extract BRep boundaries
get boundary curves after solving intersections
Project boundaries onto surface and trim the surface with said boudnaries
Which I find quite strange. At least this is not the behaviour I would expect from that function. The Brep.CreateBooleanUnion results in an Array of 4 different Breps (see picture above). (These face-edges in the corners come from some other changes I did).
The Brep.MergeCoplanarFaces does really only work if the surfaces are planes and in my case with curved surfaces always fails.
Here you can see the starting point with the two Breps that shall become one face. Hope this helps: 2_open-breps.3dm (81.6 KB)
@Mahdiyar Thank you! This looks exactly like, what I was searching for. Is there a detailed information about the Seam-Parameter? I find the description not very precise. I would like to automate the finding of a “good” parameter value instead of trying different ones by hand. Do you have any suggestions for that? https://developer.rhino3d.com/api/RhinoCommon/html/M_Rhino_Geometry_Brep_ChangeSeam.htm