     generateTreeMesh(Mesh  MeshStruct   mesh 
        Mesh  MeshStruct   temp 
            tFaces      thetaFaces 
              height        diameter 
              trunkHProportion        trunkDProportion 
              topWeight        bottomWeight 
              shapeNoise)
   
    temp clear() 
    Mesh  Revolution(Mesh  sphereHFunc  Mesh  sphereRFunc)
       generateMesh(temp  1 f  0 5f   diameter  tFaces  thetaFaces) 
    for (    i   0  i   temp vertices size    i)
     
      vector3f  p   temp vertices[i] p 
            y   0 5f   0 49f   p y                                       
            y1   msys_powf(y  mix(0 5f  2 f  topWeight)) 
            y2   1 f   msys_powf(1 f   y  mix(0 5f  2 f  bottomWeight)) 
      p y   mix(y1  y2  y)   (1 f   trunkHProportion)   height 
     
    temp translate(0  trunkHProportion   height  0) 
    temp addNoise(shapeNoise) 
    temp computeNormals() 
    temp computeBaryCoord() 
    mesh add(temp) 
    mesh setColor(Material  treesColor) 

    temp clear() 
    Mesh  Revolution(Mesh  pipeHFunc  Mesh  pipeRFunc)
       generateMesh(temp  2 f   trunkHProportion   height  0 5f   trunkDProportion   diameter  1  thetaFaces) 
    temp addNoise(shapeNoise) 
    temp computeNormals() 
    temp computeBaryCoord() 
    temp setColor(Material  trunkColor) 
    mesh add(temp) 
   
