How to select only the top surface of a Brep

Hi guys.

Can any of you explain how I select the top surface of my Brep? I need to turn my upper surface of the Brep into a surface of its own, and therefore split the bottom and the top into to separate surfaces. The question is, how do I do that? I need this for laser cutting since I can’t unroll solid masses in Grasshopper.


You should post something by the way.

Other than that:

  1. If your Brep is a polySurface (R is a surface modeller) then you should decompose into the BrepFaces that compose the Brep. Kinda like a Mesh is a collection of MeshFaces (quads or triangles).
  2. Get the BrepFaces Normals according some rational way: i.e. a Normal that could identify the orientation that you want. That said (general case) this MAY be quite tricky. That said if the Brep is closed and is valid then Normals point outwards (in most of “normal” cases, that is).
  3. Compare the Normals against a Vector (say Z+ or some other). This means either measure the angle or use the DotProduct (this works in some specific cases). You can use other filters as well (general case) like planarity, connectivity, a bounding box and other.
  4. If the angle is greater than some value reject the donor BrepFace (or get it if the angle is less than some value).

BTW: A BrepFace is a thing that using an underlying Surface (as “template”) applies Trim(s) (inner[holes] or outer[boundary] - with regard their content [curves] these are called Loops) that define the “portion” of the Surface that is visible to you. This means that in most of cases - and with regard what you see - a Brep has no Surfaces (it has BrepFaces).

BTW: The general case of that puzzle is addressed by hard flat Clustering the BrepFaces according various criteria: but that requires code and is far beyond the scope of this thread.

two more, but less general ways which might help(depending on the geometry):

  1. decompose brep, get area centroid, sort points by Z value and sort faces accordingly(works for boxes e.g.)
  2. edcompose brep, get sum of all Z values and sort accordingly.

Those two obviously dont work in all cases, but are cheap ways if you can get away with it.