Volume between terrainmodells.

Here's the place for discussion related to coding in FreeCAD, C++ or Python. Design, interfaces and structures.
Post Reply
APOS80
Posts: 2
Joined: Sat Feb 24, 2018 9:10 am

Volume between terrainmodells.

Post by APOS80 »

I got the math and a idea on how to calculate the volume between two terrainmodells. But for now I haven’t looked into howto get it into freecad.

I have a function that takes the coordinates of a 3D triangle and the point of interest(xy) and finds the height of that point in the plane the triangle coordinates describe.

So the idea is to have two terrainmodells and place a grid over them with a point distance that fits your agenda. Then calculate the hight for that point in each modell, that gives you a hight. The hight is then multiplied to an area, think of it like pillars between the models.

The problem though is the edges of the models and it probably needs to be calculated parallel.
User avatar
microelly2
Veteran
Posts: 4691
Joined: Tue Nov 12, 2013 4:06 pm
Contact:

Re: Volume between terrainmodells.

Post by microelly2 »

Hello and welcome to the forum.
You are right. If you have two terrains you can transform them to elevation grids and then calculate the volume difference data.
I think we can reuse your ideas here in the Civil engineering threads


https://forum.freecadweb.org/viewtopic.php?f=8&t=22277
https://forum.freecadweb.org/viewtopic.php?f=8&t=6973

to build streets through hills such questions have to be answered.
at the moment we are working on methods to map a 2D path to a 3D terrain.
adding and subtraction material is the next step.
User avatar
Joel_graff
Veteran
Posts: 1949
Joined: Fri Apr 28, 2017 4:23 pm
Contact:

Re: Volume between terrainmodells.

Post by Joel_graff »

microelly2 wrote: Sun Feb 25, 2018 10:39 pm I think we can reuse your ideas here in the Civil engineering threads
Absolutely. Earthwork calculations are a big part of most any civil engineering project, so the ability to accurately compute volumes between two terrains is key. At the moment, I'm trying to get a refactor done of the sketcher tools I'm creating for the Transportation workbench. If I can get it done (hopefully in the next week or so) we can start on the projection issue. That may be optimistic, though.

Volume calculation is several steps away for the Transportation wb, but it will be a critical component eventually.
FreeCAD Trails workbench for transportation engineering: https://www.github.com/joelgraff/freecad.trails

pivy_trackers 2D coin3D library: https://www.github.com/joelgraff/pivy_trackers
APOS80
Posts: 2
Joined: Sat Feb 24, 2018 9:10 am

Re: Volume between terrainmodells.

Post by APOS80 »

If freecad could be extended with a functional language ,like Haskell, there would be easier to do parallel computation.
User avatar
microelly2
Veteran
Posts: 4691
Joined: Tue Nov 12, 2013 4:06 pm
Contact:

Re: Volume between terrainmodells.

Post by microelly2 »

APOS80 wrote: Sun Mar 11, 2018 7:50 pm If freecad could be extended with a functional language ,like Haskell, there would be easier to do parallel computation.
There is a way to use FreeCAD as a webserver and then there can be a data exchange with a fast "calculator" too.
Post Reply