### Overview

Roman Lygin has written a couple of very useful articles. They can be found here. This article is intended to summarize the relevant facts.

### Shapes

Each shape has an orientation value. Normally, this is one of the following: *forward* or *reversed*. The orientation fulfills 2 purposes:

*defines the topological entries behaviour with respect to the underlying geometry (if existing).

*allow to change the orientation of topological sub entries (see Inheritance).

### Faces

A face's orientation implies, how the face's normal is related to its geometric surface normal. If they point in the same direction, the face's orientation is *forward*, if they point in opposite directions, the face's orientation is *reversed*. A reversed oriented face in a sphere is a face on the inner surface of the sphere, a forward oriented face on a sphere is a face on the outer surface of the sphere. The normal of the geometric sphere entity is always pointing outside.

### Edges

An edge's orientation implies, how the edge's tangent at each point is related to its underlying geometric curve's tangent. If they point in the same direction, the edge's orientation is *forward*, if they point in the opposite direction, the edge's orientation is *reversed*.

### Wires

A wire does not have a underlying geometric entity, but an underlying topological entity (the list of edges). The orientation of a wire declares, how the wire's tangent is related to the underlying edge's tangent. So having a *reversed* wire, the edges are traversed in *reversed* direction.

### Vertices

the direction of a vertex implies, if it is the starting or the ending vertex of its parent edge. The starting vertex always has the *forward* orientation, the ending vertex does have the *reversed* orientation.

### Inheritance

Each shape modifies its parents orientation. It's not so much an inheritance but a cumulation. Just like the chain rule for addition:

- +(+x) = +x
- -(+x) = -x
- +(-x) = -x
- -(-x) = +x

with - and + corresponding to *reversed* and *forward* respectively.

Why is orientation cumulated this way and why does it make sense? What's an absolute orientation?

A reversed face implies, that we are on the opposite side of a geometric surface. This implies, that the surface normal is inverted. Whether a wire is an outer wire defining the inside of a face or is a inner wire defining a hole in the face is simply defined by it's orientation with respect to the surface normal. So inverting the surface normal implies that we also have to invert the wire orientation. Inverting the wire orientation implies that we also have to invert the edge direction. This chain of inversions and non-inversions ultimately sets the orientation, we have to interpret the geometric entities (curves and surfaces) in, which have an absolute orientation defined by their parametrization.