Closed luchete80 closed 1 year ago
Element normals are ok:
Element Normal 3 [ 2.2832e-316 -12.27186e-316 ] Element Normal 3 [ 2.27541e-316 -12.2761e-316 ] Element Normal 3 [ 2.27965e-316 -12.27839e-316 ] Element Normal 3 [ 2.26526e-316 -12.26652e-316 ] Element Normal 3 [ 2.28741e-316 -12.28856e-316 ] Element Normal 3 [ 2.29085e-316 -12.29257e-316 ] Element Normal 3 [ 2.25901e-316 -12.26211e-316 ] Element Normal 3 [ 2.24651e-316 -12.24754e-316 ] Element Normal 3 [ 2.27484e-316 -12.27403e-316 ] Element Normal 3 [ 2.24422e-316 -12.24525e-316 ] Element Normal 3 [ 2.27713e-316 -12.28523e-316 ] Element Normal 3 [ 2.29544e-316 -12.29555e-316 ] Element Normal 3 [ 2.25832e-316 -12.25775e-316 ] Element Normal 3 [ 2.28615e-316 -12.28546e-316 ]
Error in centroid calculation:
void TriMesh::CalcCentroids(){
for (int e=0;e<element.Size();e++)
element[e]-> centroid = ( *node[element[e]->node[0]] + *node[element[e]->node[1]] + *node[element[e]->node[2]] ) / dimension;
}
Corrected to this:
void TriMesh::CalcCentroids(){
for (int e=0;e<element.Size();e++){
element[e]-> centroid = 0.;
for (int i=0;i<dimension;i++)
element[e]-> centroid += *node[element[e]->node[i]];
element[e]-> centroid/= dimension;
}
}
Normals have Z component in plane problem:;