I am making a 3D model of the volume generated by two functions: one as the base (in intersection of the x-axis), and the other as the height of the volume.This is achieved by approximating the volume of small parts, drawing that mesh, then adding all of the meshes together. However, I cannot figure out how to add the meshes together.

Here is my mesh creator:

```
private TriangleMesh createVolume(double start, double end, double numSteps, PolynomialFunction base, PolynomialFunction height) {
TriangleMesh m = new TriangleMesh();
double stepSize = (end-start)/numSteps;
for(double i = start; i < end; i += stepSize) {
double x = i;
double x2 = x+stepSize;
double gx = height.value(x);
double gx2 = height.value(x2);
double fx = base.value(x);
double fx2 = base.value(x2);
TriangleMesh t = createVolumeSection(x,x2,gx,gx2,fx,fx2);
m.getPoints().addAll(t.getPoints());
m.getTexCoords().addAll(t.getTexCoords());
m.getFaces().addAll(t.getFaces());
}
return m;
}
private TriangleMesh createVolumeSection(double xVal, double x2Val, double gxVal, double gx2Val,
double fxVal, double fx2Val){
TriangleMesh m = new TriangleMesh();
float x = ((float)xVal) ;
float x2 = ((float)x2Val);
float gx = ((float)gxVal);
float gx2 = ((float)gx2Val);
float fx = ((float)fxVal);
float fx2 = ((float)fx2Val);
//create Points
m.getPoints().addAll(
x, 0, 0, // A = 0
x, 0, gx, // B = 1
x2, 0, 0, // C = 2
x2, 0, gx2, // D = 3
x, fx, 0, // E = 4
x, fx, gx, // F = 5
x2, fx2,0, // G = 6
x2, fx2,gx2 // H = 7
);
m.getTexCoords().addAll(0,0);
m.getFaces().addAll(
0 , 0 , 1 , 0 , 3 , 0 , // A-B-D
0 , 0 , 3 , 0 , 2 , 0 , // A-D-C
0 , 0 , 2 , 0 , 6 , 0 , // A-C-G
0 , 0 , 6 , 0 , 4 , 0 , // A-G-E
0 , 0 , 4 , 0 , 1 , 0 , // A-E-B
1 , 0 , 4 , 0 , 5 , 0 , // B-E-F
1 , 0 , 5 , 0 , 7 , 0 , // B-F-H
1 , 0 , 7 , 0 , 3 , 0 , // B-H-D
3 , 0 , 7 , 0 , 6 , 0 , // D-H-G
3 , 0 , 6 , 0 , 2 , 0 , // D-G-C
6 , 0 , 7 , 0 , 5 , 0 , // G-H-F
6 , 0 , 5 , 0 , 4 , 0 // G-F-E
);
return m ;
}
```

This is supposed to create a series of right-trapezoidal prisms, but it ends up only drawing the first mesh in the series.

Can anyone help?

Thank You in Advance.