(in preparation)

The traditional Finite Element approach discetizes a continous orthogonal domain into smaller elements of a specific shape. We consider unit cube complexes (first picture below) that may be produced by Deep Learning methods as in \ref{kallioras} ## Unit cube ordering in 3D space

Consider an axes aligned unit cube and that the $xz$ plane represents a traditional map where the four points of the horizon are defined by the common practice. There are six primal directions, north, south, east, west, top and bottom, towards each of which every cube’s face can be labeled according to the direction. Each of the labeled cube faces can be represented as a counterclockwise or clockwise list of its vertices regarding the cube’s interior. A counterclockwise listing is used when the interior is below, left of or behind the face and a clockwise listing is used when the interior is above, right or in front of the face (see the second figure above):

• The north face is $0321$
• The south face is $4567$
• The east face is $6512$
• The west face is $0473$
• The top face is $3762$
• The bottom face is $0154$

Every unit cube in 3D space has a centroid whose coordinates can be calculated as a simple function of the coordinates of the cube vertices:

The centroid can also be realized as the vector starting from $(0,0,0)$ towards $(x,y,z)$. Given two unit cubes $C_1$ and $C_2$ in 3D space there is a well defined ordering if we consider the relative positions of the cubes’ centroids: cube $C_2$ is bigger than cube $C_1$, i.e. $C_2$ is located (right / on top / in front) of $C_1$, if and only if $c_2=(x_2,y_2,x_2)>c_1=(x_1,y_1,x_1)$. The same reasoning applies also when we try to locate the immediate next of the unit cube $C$ with centroid $(x,y,z)$ along each of the $x$, $y$, $z$ axes: • the west cube is around $(x+1,y,z)$
• the top cube is around $(x,y+1,z)$
• the south cube is around $(x,y,z+1)$
• similarly for east, bottom and north

## Python Implementation

We are going to describe in detail the implementation of the above ideas in the Python programming language.

## A Python class for 3D points

A Python class for 3D points that supports various methods and implements the usual lexicographic ordering is the following: