Hello everyone, I have a problem. I’d like to create an excavation volume using Dynamo. This is the volume of earth to be excavated before positioning the footings of a building.
I was thinking of generating this volume by creating a bounding box around my footings and increasing its height until it intersects the topographical plan. However, I’m not very familiar with Dynamo; I don’t understand much, hence this post.
If anyone has a program, a simple script, or simply an explanation of the method to follow (I’m a complete beginner with Dynamo), I’d be grateful.
Thank you, and I hope I was clear and concise.
Have a good weekend,
Lucas
Original Post Below
Bonjour à tous, j’ai un souci, j’aimerais créer un volume de fouille, grâce à dynamo. C’est le volume de terre à décaisser avant de positionner les semelles d’un bâtiment.
Je pensais générer ce volume en créant une bounding box autour de mes semelles et en augmentant sa hauteur jusqu’à couper le plan topographique. Cependant je ne suis pas assez calé sur Dynamo, je ne comprend pas grand chose, d’où ce post.
Si quelqu’un a un programme, un script simple, ou simplement des explications sur la méthode à suivre (je débute vraiment sur dynamo), je suis preneur.
Hello, The forum language is English.
Please carefully read the forum usage guidelines.
For your problem:
0. Create a collection of foundations (categories-- all elements of category)
2. Retrieve the surfaces (Element.Faces) of your foundations
3. Use Listfilterbyboolmask with a vector component (0,0,-1) as a mask
4. Transform all these surfaces into a polysurface
5. Use thicken to make it a solid (a)
6. Excavation volume: intersection of a with the soil volume
The way i have focused on algorithmically solving this at work is:
Get the combined bounding box of the foundation elements
Split the bottom face into a grid of points to a known spacing, e.g. 1m x 1m
At each point, raybounce upwards from just below the point. If the first thing you hit is not topography, you are excavating from this point/height. If not, ignore this point
From that point, raybounce up to the natural ground level. Multiply that distance by the area of that cell and you have an approximate volume of excavation
Sum the total, and youre done
You can invert the logic to determine fill requirements as well, which is handy for optimizing siting for balanced cut/fill (literally what i use this technique for). I cant share my script as its company ip, but hopefully the algorithm gives room to explore and learn
This wont account for battered/tapered edges etc but ive found is a very quick approach. Whilst i do it in rhino inside for speed benefits, it would be possible in revit also using raybounce nodes or the revit API for it. Datashapes has a raybounce node that supports linked elements and category filters.
Its approximate given youre sampling a grid, but you can make the spacing smaller to refine the result. Its so much faster than trying to do solid differences which will often fail in dynamo anyway for complex forms for various reasons.
I do similar for generative design applications, but with VASA, but accounting for the slope and real shape not the bounding box. No ray tracing, fast as heck (~3 seconds), and no geometry issues with complex forms.
And as a reality check, excavation is never 100% accurate to a planar surface the way it is being described as stuff like rocks, soil quality, time since it last rained, and other items will impact the actual slope on site, so everything is an estimate here and so a reasonable accuracy and abstraction isn’t an issue.
Get the external envelope of the object (building, trench, site pad, parking lot, etc). This can require tracing your elements, pulling the surfaces and unioning into one, or extracting envelope elements with Revit, or otherwise sampling.
Ensure the perimeter shape is at the elevation you want. Sometimes when locating stuff the shape is just drawn in plan at elevation “0”, or otherwise out of sorts. If you have variable depth basements or stepped foundations this can get tricky.
Extract the topography triangles, and then convert to 9 number sequences of X1, Y1, Z1, X2, Y2, Z2, X3, Y3, Z3, and flatten the list. Use the flat list of doubles to convert to a voxel model representing your topography. Use VASA’s expand along Z to get a solid below the terrain top.
Extract the bounding box of the topography element and get the elevation of the maximum point. Get the difference from that and the lowest point of the excavation. The resulting double is the most change in elevation you could have on site by digging to your excavation depth.
At this point we will take the excavation slope factor (1/5, 5/1, etc. - you have this as an inout right?) and multiply by the maximum excavation distance to get the maximum horizontal offset from the excavation surface.
Take the perimeter excavations shapes and offset them by the resulting maximum offset using PolyCurve.OffsetMany. Typically I discard all but the largest of these (List.MaximumItemByKey, Surface.Patch, and Surface.Area), but depending on your excavation method you may need to maintain things.
Raise the elevation of the offset polycurves by the maximum excavation distance (step 4), and loft the offset curves into a solid. This is the ‘worst case’ shape for excavation, but it extends above the topography.
In theory you can take the solid union of the excavation shapes and the topography solid, but that often results in geometry errors as @GavinCrump mentioned due to the conversion of mesh topography to solids, or even Toposolid topography from Revit’s geometry engine to anything else (yes, I have seen cases where Rhino and AutoCAD fail there too). So instead of trying for boolean operations we move into an all VASA solution, and convert the excavation solids into a single VASA model, and union that with the topography.
Now just count the number of filled voxels (CountFilled) and multiply that by the volume of a voxel. The resulting number is a reasonable extraction for the amount of earth to pull out of the site.
As long as you aren’t expecting an analysis which gets to the level of ‘how many grains of sand’ then this same method can also be used for quantification of variable soil types (voxel model for each strata of soil), cut/fill minimization (fill is offset the same but shifted down instead of up), road planning, and (so far) everything I have been asked to review in the context of earthwork efforts.
Hi,
Paragraph 3 is really not easy to understand
(the principle of vasa is to match a shape with a smaller object (cube, triangle))???
(a bit like integration with strips, but in 3D)
There is a node called something like ‘VoxelModel.ByTrianglesAsNineNumbers’. It takes a flat list of XYZ values in the sequence of the points which make up the triangle. 3 points, 3 values per point, 9 values total.
So if you take the topography
Isolate the top faces (which will be triangles)
for each triangle, extract the points in order
For each point, extract the X, Y, and Z values and put each into a flat list
That flat list goes into the VASA node.
Works with Dynamo core and therefore every Dynamo type - Civil 3D, Revit, Alias, Forma, etc..
Thank you, I don’t have the right method for retrieving the triangles, I think.
The face seems to be composed of four triangles (is this face a polysurface?)
It’s definitely not flat.
Hard to say without being able to see the context - does the geometry of the surface you’re passing look like the topo? Does DisplayVoxels produce something which looks like that?
If I recall correctly I was pulling the Toposolid’s top face as a mesh somehow ( HostObjectUtils.GetTopFaces? SlabShapeEditor? Something in the TopoSolid class?)