Digital Objects in Rhombic Dodecahedron Grid

: Rhombic dodecahedron is a space filling polyhedron which represents the close packing of spheres in 3D space and the Voronoi structures of the face centered cubic (FCC) lattice. In this paper, we describe a new coordinate system where every 3-integer coordinates grid point corresponds to a rhombic dodecahedron centroid. In order to illustrate the interest of the new coordinate system, we propose the characterization of 3D digital plane with its topological features, such as the interrelation between the thickness of the digital plane and the separability constraint we aim to obtain. We also present the characterization of 3D digital lines and study it as the intersection of multiple digital planes. Characterization of 3D digital sphere with relevant topological features is proposed as well along with the 48-symmetry appearing in the new coordinate system.


Introduction
The cubic grid Z 3 is the most frequently used grid for three-dimensional images. However, in recent times, non standard, three-dimensional grids received a lot of interest, particularly with applications in networks [35], image processing [15,27,36], computer vision [17], and many other fields. Among non standard grids we can cite face-centered cubic (FCC), body-centered cubic (BCC), honeycomb [8], and diamond grids [32].
Unconventional grids are steadily gaining popularity in medical image data processing, specially 3D image reconstruction. The use of optimal sampling grids are more efficient with regards to the number of voxels and lead to significantly fewer samples without decreasing the quality of the reconstruction [14,24,26,33]. In [9], authors proposed to repair 3D images by associating the FCC grid with the cubic grid and illustrated applications on two tasks related to the repaired image, boundary reconstruction and computation of its Euler characteristic.
In a more theoretical perspective, several researches discussed coordinate system on the 3D grids such as [23] for cubic grids, [28,29] for hexagonal and triangular grids, [11] for BCC grids and, [10,12,37] for FCC grids. Line tracing and representations of other 3D objects in generalized regular grids including BCC and Organization of the paper In Section 2, we present some preliminaries and basics as well as the rhombic dodecahedron grid and the existing Cartesian coordinate system [10] on it. In section 3, we detail our coordinate system and we present some of its properties. In Section 4, we define the digital planes, 3D lines, and spheres in this coordinate system and explore the required thickness for different models to ensure desired connectivity and separation of space. We conclude and present future perspectives in Section 5.

Preliminaries
In this section, we recall some of the basic terminologies and definitions relevant to our problem. We put forward the general definitions of digital plane, 3D digital line, and digital sphere, and the different topological models already established in literature for conventional cubic grid (CCG). We also talk about the formal notion of grids and coordinate systems and present the concept and importance of designing a rhombic dodecahedron grid.
We consider a 3D space. We call integer points the points that have integer coordinates on all the three axes. Let us denote d 2 as the Euclidean distance in the regular Cartesian space. The standard definitions of digital planes, 3D digital lines, and digital spheres are as follows.
Definition 1 (Digital Plane in CCG [2]). The digital plane P corresponding to the Euclidean plane ax + by + cz + d = 0, with the thickness of the digital plane as ρ, is the set of integer coordinate points p(x, y, z) verifying the following inequalities: This is also called analytical plane with the thickness ρ ensuring the required topological properties in terms of connectivity and separability. Originally, the thickness was used to characterize the connectivity of digital lines leading to so called naive and standard digital lines [34]. However, for higher dimensional objects, e.g. planes and spheres in 3D, the thickness characterizes the separation of space into two separate connected components (in 2D, separation and connectivity are equivalent for digital lines, but not in higher dimensions anymore).
Different values of ρ in this definition leads to different digitization models, e.g. 2-separating, 0-separating, etc. A digital object is l-separating if its complements are not l-connected. Hence, a digital plane is 2separating if the complementary half-spaces are not 2-connected. Note that, 0-, 1-, and 2-connectivity here refer to the classical 26-, 18-, 6-connectivity respectively for the cubic grid. Please consult [2,3] for more details on digital hyperplanes and hyperspheres in cubic grid.
Definition 2 (Digital Line in CCG [13]). I. Debled-Rennesson proposed a 3D digital line L with direction vector (a, b, c) and a ≥ b ≥ c definition as the set of points (x, y, z) from Z 3 verifying the following Diophantine inequalities: ρ and ρ ′ are called arithmetical thicknesses of the line L.
It is noteworthy that with this definition, a 3D digital line represents the intersection between two digital planes, each one being the orthogonal extrusion of a 2D digital line included in one of the coordinate planes.
The definitions for coefficients ordered in a different way are obtained by permuting x, y, z as well as the coefficients.
In [1,4], authors gave the analytical definition of the supercover 3D lines based on three 2D line projections (respectively in the planes xy, yz, and zx) or three 3D planes. Note that, the supercover of an object A corresponds to all the digital cells that are intersected by A. The authors proved that two planes are, generally, not enough and this is the major difference with Debled-Rennesson's definition 2. They stated that the intersection of three digital planes defines a digital line in CCG and create a symmetry that does not exist in the classical definition. In this paper, we follow the approach from [1] and use the correct number of digital planes to ensure exact digitization of the 3D line in RDG.
Several literatures describe incremental line drawing algorithms on FCC grid and other non-orthogonal regular grids. In [16], the authors proposed a line drawing algorithm on the FCC grid following the 3D cubic Bresenham algorithm. Very alike to the system we propose here, [16] also uses non-orthogonal basis vectors to traverse directional neighborhood while generating the discrete line. However, their coordinate system is spanned by the axes which are mutually at acute angles; whereas, we have two axes orthogonal to each other and the remaining axis at an obtuse angle with respect to the other two. This makes our system closer to the Cartesian coordinate system, and thus needs simpler transformations to switch between systems (see Section 2).
The line drawing approach we use in this paper, enables us to identify all voxels intersected by the real line and thus also produce the supercover of the line along with the thinner models, as required. The Bresenham line drawing approach as adopted in [16] chooses only the voxels closest to the real line and only maintaining minimal connectivity, thus producing a particular (naive) model of the digital line. [19] also explains similar techniques of line drawing as in [16]. They uses the same basis vectors for the FCC grid, and also give similar basis vectors for the BCC grid; and describes Bresenham like integer algorithm for line drawing suitable for ray-tracing purposes. In [20], the authors generalize the approach from [19] to arbitrary dimension and any regular grid. It utilizes the concept of generalized basis vectors according to the chosen neighborhood of voxels in a possibly non-orthogonal regular grid and uses the directional vectors in designing a generalized Bresenham line drawing algorithm.
Definition 3 (Digital Sphere in CCG [3]). The digital sphere S centered in c, of radius r and thickness ρ, is the set of integer coordinate points p verifying the following inequalities: ).  The thickness ρ of a digital sphere also specifies the separability property of the constructed object exactly similar to the definition of digital plane. To ensure topological minimality, we need to use more complex formulations as described in [5,6].
In this paper, we consider a grid based on rhombic dodecahedrons, which are space-filling polyhedrons similar to cubes. A rhombic dodecahedron has 12 face-connected neighbors and 6 strictly vertex-connected neighbors. A consistent coordinate system for the RDG will help us to utilize this grid in 3D with similar advantages as hexagonal grid gives over square grid in 2D, specially in the domain of imaging, tomography, etc. As rhombic dodecahedron space filling arrangement emulates the close sphere packing in space, RDG can be used for additive manufacturing using spherical material particle powder.
The main problem of the unit dodecahedron is that neither its vertices nor its centroids form an integer coordinate grid. It is however simple to get integer coordinates for either centroids or vertices or both using simple transformation as presented in [10], shown in Figure 1(a). In the mentioned paper [10], a combinatorial 3-coordinate system for cells in the face centered cubic grid is presented and some of its properties are detailed; authors made a rescaling with factor 2, in order to assign to each cell the Cartesian coordinates of its center and to have only integer coordinates for faces and edges. However, the main drawback of this system, which we addressed in [7], is that this coordinate system leads to two different and intricate grids, and any integer point in this space may either represent a centroid or a vertex. This will be a major cause of anomaly while doing transformation operations such as rotation, shear etc. and construction of different digital objects in this grid. Other approaches have been proposed such as using four coordinates with a linear dependency between the integer coordinates [18] which of course, does not allow a complete system where any four coordinates correspond to a grid point.

Rhombic Dodecahedron Grid
In this section, we discuss a non-orthogonal coordinate system called RDGCS (for Rhombic Dodecahedron Grid Coordinate System) to represent the rhombic dodecahedron close packing grid such that each integer point represents the centroid of a rhombic dodecahedron cell. The system proposed here is similar to the one proposed in [7]. There are however some minor differences. In [7], there was an extra rotation involved because the central rhombic dodecahedron of coordinates (0, 0, 0) was not oriented in the same way. The coordinate system presented in this paper is basic and the reader shouldn't have a problem adapting the proposed formulas for another grid orientation. We talk about the conversion of this new coordinate system to and from the Cartesian coordinate system (as described in [10]) and define the corresponding distance metric. We also show that there exists a 48-symmetry in RDG using this new coordinate system which can be utilized further to propose efficient algorithms for geometric object construction in this type of grid.

Non-Orthogonal Coordinate System
The coordinate system RDGCS we present here is a simpler version of the one proposed in [7]. We transform the well-known Cartesian space to obtain non-orthogonal grid vectors. Figure 2(a) shows the initial positioning of the rhombic dodecahedron centered at the origin with respect to the coordinate axes. All three axes are orthogonal to each other and pass through the vertices of the rhombic dodecahedron.
To obtain our new non-orthogonal RDGCS, we rotate the X-and Y-axes while bending the Z-axis away from the positive X-and Y-axes to make all three axes pass through the center of the faces of the rhombic dodecahedron ( Figure 2(b)). During this transformation, a scaling is also required to make the rhombic dodecahedron cells unit in size; we consider our cells to have unit distance between opposite faces and do not show any explicit scaling step to obtain the same. Notice that, to simplify the visualization, we have kept the rhombic dodecahedron fixed while transforming the coordinate axes.
The following lemma states the transformation needed for a point in the RDGCS to and from the Cartesian coordinate system.

Lemma 1. Coordinate conversion
-The transformation of a point p(x, y, z) from the Cartesian coordinate system to the new RDGCS is given by: The transformation of a point p(x, y, z) from the new RDGCS to the Cartesian coordinate system is given by, Proof. To obtain the new coordinates for a point p(x, y, z) we use a transformation to rotate the X-, Y-axes and to make the Z-axis non-orthogonal with respect to the XY-plane. This transformation can be calculated as follows.
To get the Cartesian coordinate values for a point p(x, y, z) in the new coordinate space, we need to do the reverse transformation. Therefore, we have to make the Z-axis orthogonal to the XY-plane. Following calculation can be used to obtain this transformation.
Lemma 2 (Euclidean Distance). Let p(x, y, z) and p ′ (x ′ , y ′ , z ′ ) be two points in the RDGCS. The Euclidean distance between p and p ′ is given by, Proof. The proof follows directly from Lemma 1.
We simplify the distance calculation by dropping the constant factor from the Euclidean distance as calculated in Lemma 2, and define our new distance which is to be used for further calculations.
Definition 4 (RDG Distance). Let p(x, y, z) and p ′ (x ′ , y ′ , z ′ ) be two points in the RDGCS. The RDG distance between p and p ′ is defined as, A rhombic dodecahedron has 12 face-connected neighbors and 6 strictly vertex-connected neighbor as shown in Figure 3. We make the following observations regarding the neighborhood of each rhombic dodecahedron cell.

48-Symmetry
The rhombic dodecahedron belongs to the octahedral symmetry group. It therefore has 24 rotational symmetries and 48 symmetries when considering transformations that combine reflection with rotation. Table 1 shows the 48 symmetric points corresponding to a point (x, y, z) in the orthogonal coordinate system.
In our case, we are interested in the 48-symmetry in the RDGCS. In order to generate the 48-symmetry in RDGCS, one should convert them in such a system. Let us take the point P(x, y, z) in the RDGCS, in order to obtain the 48-Symmetry in such a system, let us first transfer the point P in the orthogonal cubic coordinate system, this will gives us the point P ′ (x + y − z, y − x, z) (see Lemma 1). Let us now apply the 48-symmetry shown in Table 1 on the point P ′ . Let us take a concrete example: if we apply the symmetry on the first line second value of the Table 1 that gives us the symmetry (x, z, y) of the point (x, y, z) we obtain by applying this symmetry on our point P ′ the point (x + y − z, z, y − x). Now, we need to re-transform the point to RDGCS (See Lemma 1) which will gives us ( x+y−z−z+y−x 2 , x+y−z+z+y−x 2 , y − x) = (y − z, y, y − x). In the same manner, we do the computation for all the lines of the Table 1 and we obtain the 48-symmetry in the RDGCS of the point (x, y, z) as shown in Table 2. This symmetry can be utilized while constructing symmetrical geometric objects, e.g. spheres, cones, cylinders, etc., in this digital space.

Digital Objects: Definition and Topological Analysis
In this section, we define digital models of three primitive geometric objects, namely, digital plane, 3D digital line, and digital sphere. We define these using the proposed RDGCS and use the defined RDG distance to control the thickness of the objects resulting in different topological models.

Digital Plane in RDG
We define digital plane in the RDGCS using the classical definition. However, note that, the real plane in consideration here is given in the RDGCS and not in the Cartesian coordinate system.
Following we give the formulas for converting between plane equations from the RDGCS to the Cartesian coordinate system and reverse.

Proposition 2 (Cartesian to RDGCS Plane Equation)
. Let axc + byc + czc + d = 0 be a plane equation in the Cartesian coordinate system. The equation of the same plane in the RDGCS is given by:  We can control the topology of the digital plane by changing the value of ρ as mentioned in Proposition 3 below.
Proof. The proof for the supercover is the same as in [25] using the following plane equation in the Cartesian coordinate system: The coefficient values directly follow from Proposition 1.
It can also be proven by considering the thickness of the thickest directions we can have in the dodecahedron, i.e. the distance between opposite vertices or opposite faces as necessary. To obtain this, we consider the coordinates of the vertices and face centers of the rhombic dodecahedron. To determine the 0-separating minimal thickness, only vertex coordinates are considered; and for the 2-separating minimal thickness, only face center coordinates are considered. For supercover thickness, both have to be taken into account.
Next, we calculate their (vertices and/or face centers) individual distances to the Euclidean plane, and the final thickness is calculated considering the maximum of these distances. This ensures that the chosen thickness gives us an appropriate neighborhood around the real plane fulfilling the desired separability criteria, and in the case of the supercover this neighborhood contains centroids of all the rhombic dodecahdrons intersected by the real plane. A detailed calculation in the Cartesian coordinate system for the supercover model can be found in [25]. We use the same method for the other two models and use the values in RDGCS.
Note that, the 0-separating minimal plane, which is also known as the standard digitization, is the close to the supercover plane, which is also 0-separating, but not necessarily minimal. The 2-separating minimal plane is widely referred to as the naive digitization. Figure 4 presents the three different digitizations for the plane 3x − 18y − z = 0 in the dodecahedron non-orthogonal grid. Figure 4(a) shows the naive plane for the thickness defined by Equation 7. In Figure 4(b), we can see the standard plane obtained with Equation 6.
The additional dodecahedra compared to the naive digitization are highlighted in blue. In Figure 4(c), we present the thickest plane, i.e. the supercover plane which uses Equation 5 for the thickness. The additional dodecahedra compared to the two other digitizations are highlighted in red.

Digital Lines in 3D
A straight line in R 3 can be represented by the intersection of any two distinct planes passing through the line. This is because in R 3 , two non-parallel planes always intersect in a single line. However, in Z 3 , this is not true. Two non-parallel planes centered on the same continuous straight line result in an infinite number of different objects which can be a very larger set of voxels if their orientations are not chosen wisely. And even if we can fix the relative orientation of the digital planes (say, two orthogonal planes), we may still get more voxels than expected. The correct approach is to choose the set of planes according to the direction (vector) of the real line we want to digitize. The shape of the voxel in the chosen grid system also plays its role in choosing the necessary digital planes to be intersected.
For instance, in the cubic grid, as explained in [1], we may need as many as three digital planes. In [25], the proposed solutions with three digital planes in RDG did, however, not cover all directions. In this paper, we show that according to the orientation of the rhombic dodecahedron voxel with respect to the direction of the line to be digitized, we may need as many as four different digital planes to define a line in the RDG. The proof of the same follows from the observation depicted in [1].
According to the direction of the real line, if we change the orientation of the rhombic dodecahedron cell, we get five different view points. We show these different views in Figure 5. Note that, following [1], we need intersection of as many digital planes as the number of parallel pairs of edges on the boundary of each such view. Collinear edges on the boundary are considered as one; they appears in Figure 5(b), (d), and (e). Therefore, in only one of these five views ( Figure 5(b)), it suffices to get the correct intersection for the digital line using just two digital planes. Three of the views (Figure 5(c, d, e)) need at least three different planes to get the correct intersection, and one of the five views ( Figure 5(f)) requires four planes.  = 0, (c) a = b = c, (d) 0 < b < a and b = c, (e) 0 ≤ |c| < a and a = b, (f) To get the corresponding plane equations for each of the different views, we identify the parallel pairs of edges on the boundary of the views. The plane equations are then obtained by choosing planes passing through the real line (which is to be digitized) and having its normal parallel to each such edge pairs on the boundary. The calculations are straight forward in the Cartesian coordinate system when we know the equation of the real line and the edge vectors of the rhombic dodecahedron view. Therefore, we do that first and obtain the set of plane equations for each of the five views.
The plane equations in the Cartesian coordinate system, with (a, b, c) in the Cartesian coordinate system as well, are given by: The planes equation in RDGCS, with (a, b, c) in RDGCS as well, are given by: To transform the plane equation from the Cartesian one to the RDGCS, we use Lemma 1 and the conversion formulas from Section 4.1. While generating the digital line, we take the intersection of the naive digitization of the planes. This ensures an appropriate tubular neighborhood around the real line which includes centroids of all the rhombic dodecahedrons intersected by the real line and nothing extra. The approach is the same as in [1].
We have implemented two algorithms in Mathematica to compute the 3D lines in the dodecahedron grid. The first one (Algorithm 1) computes the tubular neighborhood corresponding to the line using the different views we presented and, for every integer coordinate point in a given window, tests whether the point is inside this neighborhood or not. The result in this case is the supercover digitization of the line and may not be the thinnest digitization. As all points inside the chosen 3D window is checked with a constant number of planes, this brute-force algorithm runs in cubic time.  16 The second algorithm (Algorithm 2) starts from a known integer point on the digital line and incrementally builds the line while testing a subset (according to the direction vector of the line) of the face or vertex connected neighbors. Only one neighbor is chosen at each step leading to a minimal face-connected (standard) or vertex-connected (naive) 3D digital line. This incremental algorithm runs in linear time, because at each step a constant number of neighbors are checked with a constant number of planes. Figure 6 presents an example of a 3D line with direction vector (a = 14, b = 7, c = 3) in the rhombic dodecahedron grid using different thicknesses and the RDGCS. The left one is the naive line constructed using Algorithm 2 by choosing vertex connected neighbors at Line 7. The middle one is the standard line constructed the same way but choosing only face connected neighbors; this is slightly thicker than the naive line. The additional dodecahedra have been highlighted in blue. The last one is the supercover of the line, i.e. all the dodecahedra that are intersected by the real line. The additional dodecahedra in this step are colored in red. The supercover is generated using Algorithm 1, but can also be generated using a slightly modified version of Algorithm 2 which considers all neighbors and maintains a queue of next points at each step.

Digital Sphere
We define a digital sphere in the proposed RDGCS using the same thickness notion as used while defining Andres Analytical Sphere (recollected in Definition 3). However, we use our RDG distance measure as defined in Definition 4.
Definition 6 (Digital Sphere in RDG). The set of Dodecahedron centroids belonging to the digitization of a Sphere centered on c of radius r and thickness ρ is given by: S (c,r) = {p ∈ Z 3 |r − ρ 2 ≤ d(c, p) < r + ρ 2 } To control the topology of the resulting sphere, we use one of the two following values for the thickness. Proof. The proof for the 2-separating value comes directly from the distance between a dodecahedron and its face neighbors which is 1 (leading to a thickness 1). The distance √ 2 between the dodecahedron and its vertex neighbors leads to the 0-separating thickness of √ 2.
The spheres presented in Figure 7 are obtained using a brute-force algorithm implemented in Mathematica (similar to Algorithm 1) that tests every integer coordinate point (i.e. dodecahedron centroid) in the bounding box with the sphere inequality using the 2−separating thickness 1. An optimization of this algorithm could be implemented using a 48 th of the bounding box (see blue regions in Figure 7) and build the rest of the sphere using the symmetries we have previously defined in Section 3.2.

Conclusions
In this paper, we have described a new coordinate system for the rhombic dodecahedron grid. The novelty of this system is that unlike the previous coordinate system [10], every single one of the integer coordinate points is the centroid of a rhombic dodecahedron. Using this system, we have proposed the characterization of 3D digital plane with its topological features and a characterization of 3D digital lines. We have also presented a characterization of 3D digital sphere, together with its 48 symmetries. In future, we want to