Consider a single quadrilaterally-faced hexahedron. If given the co-ordinates of the vertices, $\mathbf{v}_i$, of a face in counter-clockwise orientation, I can compute the corresponding unit outward normal vector using a cross-product:


However, consider now an arbitrarily shaped volume which is discretised into a large number of quadrilaterally-faced hexahedra. Consider in particular a face shared by two adjacent hexahedra. If now given the co-ordinates of the vertices of the face in a certain orientation, the orientation will be clockwise for one hexahedron and counter-clockwise for the other.

If I do not know the orientation beforehand, how can I ensure that the unit normal is pointing outwards (assuming you know the co-ordinates of all vertices of all faces of all hexehedra)?


Your hexahedron is convex, so you can do the dot product of the normal vector that you found, and a vector from one of the vertices to some point inside the hexahedron. If the dot product is negative, then your normal vector points out.

If you already know a point inside the hexahedron, then you're in luck. Otherwise you would have to find this, which would pose challenges of its own.


you can computee the dot product between the normal and the vector:

[center of element, center of the current face].

If it's > 0, the normal is outwards to the element.

If not, it's inward and you just have to do : normal = -normal, to change that


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.