This function generates discretized triangle areas and normals.
function generateTriangles input Integer nTri "Number of the triangular areas"; input Real a1[nTri]; input Real a2[nTri]; input Real a3[nTri]; input Real b1[nTri]; input Real b2[nTri]; input Real b3[nTri]; input Real c1[nTri]; input Real c2[nTri]; input Real c3[nTri]; input Integer z[nTri] "Number of segments"; input Integer r[nTri] "Normal direction of the triangular areas"; output Real w1[nTri]; output Real w2[nTri]; output Real w3[nTri]; output Real v1[nTri]; output Real v2[nTri]; output Real v3[nTri]; output Real AD[nTri] "Area of the triangle"; output Real AEP[nTri] "Area of the parallelogram"; output Real n1[nTri] "Surface normal 1st component"; output Real n2[nTri] "Surface normal 2nd component"; output Real n3[nTri] "Surface normal 3rd component"; end generateTriangles;