How to get a polysurface's outer boundary?

Hello friends, I have a 3d slab brep, and the final goal is to extract the outer boundary of the top of the slab. I’ve managed to get the top surface as a single polysurface but I am not sure how to proceed. Files are attached. Any help is appreciated!

BREP OUTER EDGE QUESTION2.3dm (6.9 MB)

BREP OUTER EDGE QUESTION.gh (7.1 KB)

This has worked for me.

Closest functionality I’ve found to the Rhino curve Boolean method

Thanks! I’m looking to extract the 3d boundary, is there a way to do it?

maybe ‘dupborder’ :slightly_smiling_face:, that looks like a mesh though and you want .gh :sweat_smile:

I’m sure there’s a way though, some our gh buddies will show up soon :smiley: me jus doin’ what I can to keep this at top of list :innocent:

Welp, would like to edit the main post but it won’t let me… Correction: I thought I got it, but I didn’t, so I failed to get the top surface geometry. I planned to get all surfaces’ normal and only keep those with a positive z value to get all the top-facing ones, but the result is not consistent; many top surfaces were eliminated, and many bottom surfaces were selected. scratching my head now….

Understanding this isn’t about the outer edge/boundary anymore.

See if this helps:
special-uncap.gh (500.7 KB)

*From here if brep outer edges are needed simply ‘Brep Join’ both sets (top/bottom) and use ‘DeBrep’ or ‘Brep Edges’ component(s).

i don t see myself as a gh buddy nor a spaghetti-master … but lets try to help:

OrientationIsReversed

Please note, that BrepFaces might have a reversed orientation compared to the underlaying surface. This property is as far as I see not exposed to vanilla Gh.
This is why my definition is lazy: i extract the “around-faces” by an angle-threshold against Z-Axis and join the remaining Faces - expecting 2 Breps (top and bottom).
Then sort them by maximum z.
Of course this could be addressed by scripting-Component.

DubBoarder

looks like there is no DubBoarder in vanilla gh.
BrepEdge.Valence will tell if the Edge is naked / therefore part of the boarder.
I solved this by a small script without any error-handling (are there any naked edges ? are the results of JoinCurves closed …) :

private void RunScript(Brep brep, ref object a)
    {
        List<Curve> crvs = new();
        foreach(BrepEdge edge in brep.Edges)
        {
            if (edge.Valence == EdgeAdjacency.Naked)
                crvs.Add(edge.DuplicateCurve());
        }
        a = Curve.JoinCurves(crvs);
    }

gh file

find my approach here:

Brep_extracdtByAngle_dubBoarder.gh (20.6 KB)

hope this helps - happy spaghetti - tom

Absolutely wonderful! I guess using the 0.5,0.5 uv point for surface normal is more efficient than ‘surface centroid - closet point to brep - surface normal‘?

Hi Tom, this is another great solution, thank you so much! I figured out my previous script was using the ‘closest point to surface’ instead of ‘closest point to brep’, which is causing some normals to be misinterpreted as the opposite direction.

is not correct - as the domain of the surface is not addressed “normalized”.
this is why i use the grouped/named “domain center” section.

but yes addressing a point on a surface by u,v is much faster then calculating area centroid and closest point. but does not look like performance is important for this sketch.

the selected solution does not address the topics title issue “boundary”

cheers - tom

Can’t tell if derisive or not.


i am refering to

and

( i used some c# script to solve the question)

and i love this forum :heart: and all members.

have a nice evening - cheers - tom

Yes, some surfaces, especially the ‘less planar ones’ or the long, curved ‘side (vertical) strips’ will often show you the area centroid in a location that’s not directly on the object—which is 100% normal given an area centroid does not equate to evaluating a surface.

This way you get a more or less exact outline since you have to transform brep into mesh.

I’d be careful with this, not all breps go into ‘mesh’ smoothly, as you can see by how long that mesh outline is taking. It’s probably an easier shot to rely on the already-separated surfaces (unless the goal is indeed just the actual outline, not the border—in that case, though, I’d sill attempt to grab the borders, project them flat and unify regions (if the goal is a 2D boundary like ‘mesh outline’) OR {again} grab the borders, join them and leave them where they are (if the goal is a 3D boundary).

Either from the top/bottom surfaces:

or the ‘side surfaces’:

Same difference.
Cheers!

Hi Tom, thank you! Your solution is also super helpful! I had to select Rene’s reply as the solution just because his message came in sooner, and he explained the boundary extraction in the text. Again, I very appreciate everyone’s help!

Thanks bud! That’s another way to look at it.