Excavating Soil from Topo Mesh

Hi all,

I’ve been slowly plodding away at this script for a while now, thanks to anyone that’s already helped out!

I’m basically trying to produce something that can take a series of room boundaries, project them onto a terrain mesh and then create a stepped foundation slab in a position that requires almost the same amount of excavation as it does infill. The attached gh file somewht achieves this.

The next thing that I want to achieve is to be able to create the new topography mesh based on this stepped slab, so basically excavating all parts of the topo that sit above the slab and filling all parts of the mesh that are below the slab.

I am having some difficulties with this. I have tried two different approaches;

  1. Projecting the slab outline to the World XY, and then extruding this planar surface through the terrain and using this to cut a hole in the mesh. This somewhat works as it creates the hole, but also seems to merge the extrusion to it so that I’m left with some weird tree trunk-type thing. Ideally I would like to just create the hole, and then use the outer edges of the slab and the edges of this newly cut hole to trim the extrusion and create the walls.

  1. Create a ‘box’ base to the terrain, lofting edges together to create a closed mesh (although I always return error messages that the mesh is not closed) and then use a similar approach to above to create the imprint of the slab. I can then find the difference of these two theoretically closed mesh to see the difference in volume of excavation or infill. I’m having little joy with this, and the new mesh is affected outwith the projected footprint of the slab.

My gut feeling is that approach 1 maybe isn’t a million miles off and is perhaps easier to make look right, but in order to obtain volumes I may need to adopt some of approach 2. I’m also looking to try and achieve this without using additional plug-ins, if possible. I have no idea if this is a complex task, I’m just over complicating it or it’s beyond my somewhat beginner level skillset, but any help would be greatly appreciated!

190425_Excavated Land_WIP.gh (31.9 KB)