Select surface from unioned brep

guys, i am stuck by trying to extract a intact surface from a unioned brep.
I got a lot of identical boxes which were adjacent . then I chose some of them to do solid union. so I got a variety of boxes. When I deconstructed them, I guess i can get complete faces which are unioned. however, it just showed original faces.
for instance, there is a unioned brep from two boxes. i want to get the surface from 6 after deconstructed it. but it actually have 10.

select surface from unioned brep.gh (11.0 KB)
how can i get the surface i want?
thanks

you can’t do that.

You’re creating a polysurface from two boxes, this doesn’t mean that each of the co-planar surfaces are merged into a single surface. It means only that whatever is enclosed inside is removed from the boolean union operation.

if you so much wanna do that, you’ll have to extract the meshes out of these co-planar surfaces, merge the meshes and convert back to surface. Although, you’ll run into other issues.

Will the merge faces component help here, or am I misunderstanding the problem?

Not sure if this is what you’re trying to do, but maybe it’ll work.

discourse_elect surface from unioned brep.gh (8.5 KB)

the method in RhinoCommon with the same name combines two brep faces into a one brep face, but the surfaces are two.

At least that’s my experience with it.

I’m not sure I fully understand.

This looks like it yields a single surface.

discourse_elect surface from unioned brep2.gh (8.6 KB)

1 Like

That’s @DavidRutten’s magic :smiley:

I’d like to understand how he did it.

In GH polycurve is converted into a single NURBS curve, I guess he did the same with co-planar NURBS surfaces.

I don’t understand the underlying code and math well enough to get why this is a hard thing to do.

MergeAllFaces and MergeAllEdges work fine in Rhino, if the input is coplanar/colinear. The simplify curve component in grasshopper does too: if you take co-linear line segments, join them, put it in simplify curve, what comes out is one segment that can’t be exploded.

I’m not an experienced coder, that makes it hard. I tried using merge faces last week for one task and the result wasn’t a single surface. But I applied it on curved surfaces, maybe this is the case, it has to be co-planar surfaces. Another issue might have been that the two surfaces I wanted to apply this method on, were trimmed and this method may be working only on untrimmed nurbs surfaces. I don’t know. Next time I need to do a similar task I’ll research more.

Yeah, it only works on coplanar surfaces.

I won’t even work if you take a single untrimmed surface, split it, join the halves, and try to merge faces, it won’t work.

1 Like

Yeah, cannot do that in my use case.

The only time I use merge all faces is if I’ve done boolean unions or subtractions between planar geometry, and I need a single face border to turn into a toolpath on the CNC.

Also sometimes use it to consolidate flat or flat-enough faces that are part of an object I made using Clayoo SubD - a bunch of creased edges can flatten a subD surface, but sometimes you can’t joint them into one surface in SubD or it changes the way they pull on other more curvy stuff on the same object.

thank you max3, you help me out! i didn’t notice the component before.
but here is another problem, how can i get surfaces in the same direction? like, every single brep’s west facade.

Take a look at the attachment.


Brep Face Directions_re.gh (11.7 KB)

4 Likes

Thank you kim. You inspired me the use of planer. Thank you again.

I’m not an experienced coder, that makes it hard. I tried using merge faces last week for one task and the result wasn’t a single surface.

MergeCoplanarFaces from rhinocommon makes a single surface. If in your case it didn’t then it means the surfaces were not co-planar, even if they looked like they were. Or you may have had some micro gap on the edge.

1 Like

I tried to extract and reuse this sorting method on another Brep, but it would not work, the Top and Bottom both get highlighted by filter gate 4 and nothing gets highlighted by filter gate 5.

Can you tell me what I did wrong or left out? File attached with internal ized data.

Brep Face Directions Sort top bottom broken.gh (26.5 KB)

This one is working more accurately than the previous one.


Brep Face Directions Sort top bottom broken_re.gh (23.2 KB)

5 Likes

Thanks.

In my opinion, this should be clustered and made a standard component.

thanks bro… this works good