7
$\begingroup$

I have a terrain, which is represented by one mesh with a lot of polygons as shown below:

alt text

This terrain will be cut by a plane at a certain level. So there are volumes of the terrains that are located above the plane ( cut volume), and volumes that are located below the plane ( fill volume).

The question is, how do I obtain the cut/ fill volume? My current approach is simply take one mesh at a time, and then form a tetrahedron with the plane, and compute the volume. But this is slow. Is there other better approach?

One approach that I have in mind, is to try to form Bezier surface for the terrain, and then try to use integration to compute the volume. But I don't know how to proceed with this. Any idea?

Edit: Terminology updated

  • 0
    @Rahul, terminology updated.2010-09-19

1 Answers 1

1

How close do you have to be?

Can you just find the center of the each triangle in space then divide the cutting plane into a 2d grid and do a series of rectangular volume calculations using the length and width of the grid section and the average height of the triangle midpoint above/below that grid section?

  • 0
    other than that the algorithm is data parallel and XNA is on the .net platform so you could use the task parallel library to try and speed things up.2010-09-19