Thursday, April 25, 2013

Spatial Element Offset Normal To Surface

Finite element model of a mouse (2D elements). Left: Original mesh; Middle: Offset mesh; Right: Original and offset mesh (via overlay)


Let's assume you wan to work with a whole body Finite Element (FE) model of an animal, e.g. with a mouse model. Quite often the origin of your model is a triangulated surface generated from imaging data. In some cases, what you want to do is to offset your triangulated surface in the direction normal to the surface. E.g. to create a skin layer. So how can you do that? Well it is actually quite simple. What you need are following steps:

1) Equivalence your surface mesh (remove duplicated nodes).
2) Calculate the smooth node normals:
  --Calculate the element (face) normals.
  --Add the element normal to every node that is shared by the element.
3) Normalize the normals at the nodes (unit vectors, pointing away from the surface).
4) Multiply the normal vectors with the desired offset.

The results of this procedure can be seen in the image above.

If anybody is interested in the code (written Pyton) I can send it via email.