Select downward facing faces while keeping a polysurface intact

Hi all,

I’m working with a geometry that has varying bottom face heights, and I need to align these faces in the Z-axis using SetPt, so the geometry is printable.

I’ve managed to select the bottom faces in Grasshopper, but when I align them in Z, I’m left with only the faces, which means I would have to rebuild the geometry. I’ve also tried using a Python script where I was able to select the downward-facing faces by exploding the brep, but I’m still struggling to retain the entire geometry intact after the alignment.

What I’m looking for is a script or a workflow that:

  1. Identifies the bottom faces of a geometry.
  2. Selects these faces.
  3. Allows me to use SetPt to align them in Z while keeping the rest of the geometry intact.

Any suggestions or help with scripting would be greatly appreciated!

posting your geometries and the GH file you have been working with in the meanwhile would be a good starting point :slight_smile:

You tried using this?

The issue is that a single polysurface has multiple bottom faces at different Z elevations.

varyingZ_bottom_faces.3dm (969.5 KB)

So in this instance what must happen? Must that protruding block move down and get longer or just move down and change position? I’m assuming you just want the bottom extended to the ground?


xsxs

Just the bottom i.e. select all bottom faces using a script (I’ve got thousands of these houses) and use SetPt afterwards to align them to the desired Z elevation.

Here’s a quick solution.


trim.gh (126.2 KB)

But really - if you’ve already got a script to select the bottom faces then select them, extrude them in Z direction and then trim the extrusion back with a boolean difference & union with the original part. Seems like you’re halfway there you just need to extrude those faces down…

Thanks for the suggestion! The challenge with that approach is that it would require extruding all the bottom faces below the level of the lowest face. However, what I’m aiming for with SetPt is to reposition the bottom faces to the average/arbitrary Z elevation, meaning some faces would move up, and some would move down, without adding any extra geometry to the original polysurface.

Just moving faces up and down might lead to invalid polysurfaces.

The quickest and safest way is to move all downwards facing surfaces so the heighest is below the chosen average. Then split with a plane and cap…

I don’t see how that’s an issue. You have a ground level 0. You extrude all bottom faces above ground down past 0 (and faces below 0 also get extruded down). So now you have a bunch of geometry extending past ground level. Use the ground to trim all that geometry back. The end result is exactly what you’re after no?

Besides - where’s this SetPt command in Grasshopper that you want to use?


90.gh (18.8 KB)

The issue with extruding and trimming is that it adds unnecessary geometry and complexity. With SetPt, I can simply reposition the existing bottom faces to a common Z elevation, where some faces move up and others move down, without generating or trimming additional surfaces. This keeps the geometry clean and avoids extra steps.

With the solution you’re suggesting the ground level 0 will always be determined by the lowest face when extruding. In some cases, only a small part of the geometry may be significantly lower than the rest, and in those instances, it would be better to move that lower part up rather than lowering the entire geometry.

I think the SetPt command is only available in Rhino, not in Grasshopper. That’s why I’d prefer a RhinoScript to handle this seemingly simple task - selecting all downward-facing faces while keeping the polysurface intact.

I tried to put that down in GH components, just a fast and dirty sketch

there’s something that is not working, expecially when some bottom surfaces are “interrupted” by some tiny vertical ones (like in the following image) have to study what’s going on a bit more in depth

this is how it looks (and fails) in the current state:

Brep extension by projecting points.gh (150.3 KB)

1 Like