Re-Extrude Geometry Data Error

I’m working on processing a site model from another person that came in as meshes. I have converted the objects to nurbs but want to re-extrude the bottom face to clean up the topology. I will be doing this a lot so thought to automate it with Grasshopper. The script I have works for +90% of the objects, but for some reason a few objects over or under extrude and I can’t figure out why. Oddly, when implementing a move to plane component at the beginning of the script to move everything flat at Z=0, or projecting the faces to the cplane, the problematic shapes change. The ones with a certain setup extrude correctly one way and then wrong with a slightly different script.

This is what happens with the script I’ve uploaded.


Re-Extrusion Script.gh (609.2 KB)

Here is the example of where simply adding a project component before the extrude causes breps that are over and under-extruding to change.


Any help is great!

Edit: It looks like the problem is some of my objects have two bottom faces instead of just the one I was expecting. I ended up solving it by brep joining and merging faces again and that cleaned it up for this instance. I could then re-extrude and all the values aligned correctly.


Please let me know if there is a better way to do this.

Edit:

RegionUnion is what I was looking for and booleans the shapes together nicely

This change seems to solve the problem but perhaps the method of selecting the surfaces to extrude needs to be revised.
Re-Extrusion Script a.gh (617.0 KB)

If you fix these breps there will be no problems.

you didn’t have double bottom, but some bottoms were not joined to the rest of the Breps:

passing your initial list of Breps through a Brep Join component makes it work fine :+1:

regarding merging the intersecting buildings, I think Region union is fine up to a certain point: your definition has a crossroad when one side you find the lowest face (base/footprint of the building) and on the other side you get building height through its bounding box

if you merge two bases into one, on the bottom branch you will still have two separate heights for those two bases that became one

the most straightforward method I’d suggest is to Solid Union at the very end, and eventually Merge Faces after that

Thank you for the help, and I like your idea to just solid union at the end.