The reason of my question is that a lot of surveyors need a tool for calcultating accurate volumes, but don't have budget for a Civil3D licence. Which is also only used as a very expensive AutoCAD. So I thought about creating a tool that does the math in standard AutoCAD or BricsCAD (or even stand alone, since it is just math).
I found a lot of useful information here:
http://paulbourke.net/papers/triangulate/I think the best way to keep the surfaces together is creating 3D Faces, using the Delaunay method, and put the 3D Faces in a block. This way you can keep the surfaces seperated inside a drawing.
To create volume surfaces, two surfaces (basically two collections of 3D faces), need to be compared. The way Civil3D it does, is very practical, it creates new 3D faces between the crossing lines and the corners of each face get the difference in distance. The final calculation is always towards a zero base. Besides that, it is easy to show the cut and fill locations because all the faces below zero are cut volumes.
The last part of this, creating new triangles between overlapping 3D faces, is the most complicated I think. Of course I can start looping all faces of one surface to compare them with all the faces in a second surface, to see if they overlap. But it will not be an efficient method. Probably there are better ways.
Then you need to find the apparent intersection of the lines of the faces, to be able to create new triangles.
Then, with simple math, it is possible to find the volumes of every triangle in the volume surface.
In the images below you see two overlapping surfaces and a new created volume surface (red). That is how I would like to gain.