An Envelope Operator for Full Convexity to Define Polyhedral Models in Digital Spaces

In a recent work, full convexity has been proposed as an alternative definition of digital convexity. It solves many problems related to its usual definitions, for instance: Fully convex sets are digitally convex in the usual sense, but are also connected and simply connected. However, full convexity is not a monotone property; hence, intersections of fully convex sets may be neither fully convex nor connected. This defect might forbid digital polyhedral models with fully convex faces and edges. This can be detrimental since classical standard and naive planes are fully convex. In this paper, we study several methods that builds a fully convex set from a digital set. One is particularly appealing and is based on an iterative process: This envelope operator solves in arbitrary dimension the problem of extending a digital set into a fully convex set, while leaving fully convex sets invariant. This extension naturally leads to digital polyhedra whose cells are fully convex. Then a relative envelope operator is proposed, which can be used to force digital planarity of fully convex sets. We provide experiments showing that our method produces coherent polyhedral models for any polyhedron in arbitrary dimension. Finally we study how we can speed up full convexity checks and envelope operations, with a worst-case complexity lowered by a factor 2d\documentclass[12pt]{minimal} \usepackage{amsmath} \usepackage{wasysym} \usepackage{amsfonts} \usepackage{amssymb} \usepackage{amsbsy} \usepackage{mathrsfs} \usepackage{upgreek} \setlength{\oddsidemargin}{-69pt} \begin{document}$$2^d$$\end{document} in Zd\documentclass[12pt]{minimal} \usepackage{amsmath} \usepackage{wasysym} \usepackage{amsfonts} \usepackage{amssymb} \usepackage{amsbsy} \usepackage{mathrsfs} \usepackage{upgreek} \setlength{\oddsidemargin}{-69pt} \begin{document}$${\mathbb {Z}}^d$$\end{document}.


Introduction
Convexity is a classical property in various domains of mathematics and computer science. It allows for instance guarantees for optimization, containment property via its separability with hyperplanes, and many convergence results in real or discrete analysis need convexity assumptions. While it has been primarily developed in R d , several extensions have been proposed in the past. Two main paths are possible for extending convexity: either going more abstract to adapt convexity to generic spaces or building more specialized versions This work has been partly funded by CoMeDiC ANR-15-CE40-0006 research grant.
for dedicated spaces like the digital space Z d for instance. Most general extensions of convexity rely on hull systems [13], K-convexity and simplicial convexity [14] or closure (hull) operators [1]. Those general extensions do not necessarily embed a geometric vision of convexity, so convex sets do not have a geometric structure in the same veins as in R d . More resembling extensions rely on anti-matroids notably with the anti-exchange property [18] or cellular extensions based on discrete hyperplanes [18,19]. They induce spaces of convex sets with more geometric interpretations, but also fail to be connected in some situations. Several extensions have also been proposed in the optimization community using convexity and digital convexity as certificates of optimality [15]. For digital spaces Z d , digital convexity was first defined as the intersection of real convex sets of R d with Z d (e.g., see survey [17]). Many works have then tried to enforce the connectedness of such sets, for instance by relying on digital lines [5,10] or extensions of digital functions [7,8]. Most works are limited to 2D and 3D extensions do not solve all geometric issues [9]. This paper considers the recently introduced notion of full convexity [11,12]. It extends digital convex sets while enforc-ing connectedness of fully convex sets. This notion is also computational in the sense that verifying full convexity is an easy task. Furthermore classical standard and naive planes are fully convex, so this convexity is appealing for building polyhedral models in any dimensions. However, since intersections of fully convex sets are not always fully convex, full convexity cannot be used directly for building faces and edges of polyhedra. Indeed the full convexity does not verify the monotonicity property of classical hull operators and thus fully convex hull is not a properly defined hull operator. This is a problem if we wish to build digital polyhedra in arbitrary dimension. In 3D, graceful lines and planes have been proposed in [3] to define edges consistent with triangular faces. It permits to fix varying arithmetical thickness between interior and boundary of digital triangles by construction but it is limited to 3D.
Our objective is to define polyhedral models in digital space Z d which are based on full convexity. Our proposal lets us freely choose the thickness of digital faces, is canonic in arbitrary dimension, and benefits from the nice properties of fully convex sets. Indeed, naive, standard or even thicker pieces of arithmetical planes can be reconstructed in the proposed unified framework. In the course of this construction, we define a fully convex envelope operator, which guarantees the properties of our new polyhedral models. This paper is an extension of [6] and adds several construction of fully convex sets, new properties and characterizations, and several algorithms and data structures to check full convexity or compute fully convex envelope, with significant speed-up.
We start by defining the fully convex envelope in Sect. 2. We propose a pre-hull operator without the monotonicity property, which builds a fully convex set containing any input digital sets. Our process is iterative, fully parallel at each iteration and ends after a finite number of iterations. It solely uses classical operators in the cubical complex C d associated to Z d . Our construction lets fully convex sets to be invariant sets. We also characterize the operator for general real sets. We then adapt this operation, in Sect. 3, to define a fully convex envelope relative to another fully convex set. Since thick enough digital planes are known to be fully convex, we can define fully convex subsets of digital planes in arbitrary dimension. We then study several models for building fully convex envelope and compare their behaviors in Sect. 4. The simultaneous use of a convex envelope and its relative extension are then used to build edges and faces for meshes with planar faces or meshes with non planar faces in Sect. 5. Experiments show that the induced polyhedral models are visually appealing and preserve the connectivity graphs between faces and edges of original models. Then we focus on implementation details in Sect. 6 to present an efficient implementation of the operators presented in the paper, all of them publicly available in an open-source library. We provide a discussion about efficient data structure and efficient computations to reduce worst-case complexity and to obtain important speedup comparatively to the previous implementation described in [12]. We then conclude the paper in Sect. 7 and present open questions for extending the present proposal.

Cubical Cell Complex
We consider the (cubical) cell complex C d induced by the lattice Z d , such that its 0-cells are the points of Z d , its 1-cells are the open unit segments joining two 0-cells at distance 1, its 2-cells are the open unit squares formed by these segments, …, and its d-cells are the d-dimensional unit hypercubes with vertices in Z d . We denote by C d k the set of its k-cells. We call complex/subcomplex any subset of cells of C d , e.g., any single cell is a subcomplex. A digital set is a subset of Z d .
The (topological) boundary ∂Y of a subset Y of R d is the set of points in its closure but not in its interior. The star of a cell σ in C d , denoted by Star (σ ), is the set of cells of C d whose boundary contains σ and it contains the cell σ itself. The closure Cl (σ ) of σ contains σ and all the cells in its boundary. In this paper, the boundary operator maps a k-cell to all its proper faces, that is k -cells, k < k and not only (k − 1)-cells.
We extend these definitions to any subcomplex K of C d by taking unions: In combinatorial topology, a subcomplex K with The body of a subcomplex K , i.e. the union of its cells in R d , is written K . We denote by Extr (K ) :=Cl (K ) ∩ Z d the extreme 0−cells identified to points in Z d .

Intersection Complex
If Y is any subset of the Euclidean space R d , we denote by C d k [Y ] the set of k-cells whose topological closure intersects Y , i.e., Note that c = Cl (c) for any cell c. The complex that is the It is worth to note that, for any complex K , Star , which coincides with the standard definition of star on subsets of C d or Z d . It should be noted that for a digital set X ⊂ Z d , we identify its points to the 0-dimensional cells of its star. So an equality of type K = X where K is a complex and X is a digital set means that the complex K only contains the 0-dimensional cells of Star (X ).

Star () inverse
There are at least two natural ways of defining an inverse operation to the Star () operator. We here present those two possibilities. We always call Skeleton or Skel () an inverse operator to Star ().
We can define a kind of inverse operation to the star using the dimensions of cells. For any complex K ⊂ C d , let: Then the (recursive) skeleton Skel (K ) R of the complex K is equal to Skel d (K ). The next Lemma is immediate from the definition: This notion of skeleton is a right inverse to Star (·) for open complexes: We can also define a kind of inverse operation to the star sandwiching K between another set K and Star K . For any complex K ⊂ C d , let: This (extended) version of the skeleton also provides characterizations for open sets mainly.

Lemma 4 For any complex K , K ⊆ Star (Skel (K ) E ) with equality when K is open and
otherwise. We also have Skel (K ) E = Skel (Star (K )) E .

Lemma 5
For any open complex K , Star (Skel (K ) E ) = K .
We now provide a proof that this second notion of skeleton can be rephrased in the general context of extreme cells [1] in closure space. Let us recall that a set function τ (.) is a closure operator if it satisfies: . We indeed notice that Star (.) is a closure operator on the sets of cells.

Lemma 6
For any complex K , Skel (K ) E is the set of extreme cells of K with respect to Star (.).
Proof Following [1], the set of extreme cells of any complex We can remark that p ∈ E (K ) ⇐⇒ ∀c ∈ K \{ p}, p / ∈ Star (c). Indeed, p ∈ E (K ) ⇐⇒ p ∈ K and p / ∈ Star (K \{ p}). But since Star (K \{ p}) = ∪ c∈K \{ p} Star (c), and since p does not belong to the union of all Star (), p is not in any Star ().
We can now prove that Skel (K ) E is E (K ). (⊃) Let us consider a complex K ⊂ K ⊂ Star K . Then Star K = Star (K ), such that Star ( p) ⊂ Star K . Hence there exists a collection of cells c q ∈ K such that Star ( p) ⊂ q Star c q and for each q, Star c q ∩ Star ( p) = ∅. But the star of c q and p intersect if and only if either c q = p or p ∈ ∂c q or c q ∈ ∂ p. In the first case, we have p ∈ K . If the third case exists then we have found some c ∈ K \{ p} with p ∈ Star (c). This is a contradiction. If only the second case exists then by using Lemma 1, we obtain a contradiction since in this case the set q Star c q is strictly included in Star ( p). So, we necessarily have p ∈ K for any such K . This implies p ∈ Skel (K ) E .
We can remark that, by definition of extreme cells, any point of a digital set X is an extreme cell of Star (X ), because 0-dimensional cells cannot be built using Star (.) on other cells than themselves. We can further see that E (Star (X )) is exactly X viewed as a set of 0-dimensional cells. Hence we get the following Lemma, Lemma 7 For any digital set X we have Skel (Star (X )) E = X.

Relations Between Skeletons
We know study the relations between the two previously defined notions of skeleton. In other words, on an open complex, the set of its extreme points and its skeleton coincide for the two definitions. They differ for non open complexes. Hence, in the sequel, we define the skeleton of K as We can thus summarize why, for open complexes, Skel () can be considered as a right inverse of Star ().

Skeleton of Star for Real Sets
We provide the following characterization for the Skeleton of the Star of real sets.

Lemma 12 Let us consider Y
Hence d ∈ Star (Y ). Moreover, the dimension of d is strictly lower than the dimension of c such that Star (c) ⊂ Star (d). Now, for any e ∈ C d , e ∈ Star (d) ⇒ d ∈ Cl (e). Since d ∩Y = ∅, we get that e∩Y = ∅ such that e ∈ Star (Y ). So Star (c) ⊂ Star (d) ⊂ Star (Y ). Hence c / ∈ Skel (Star (Y )), which is a contradiction. We can then conclude that c ∩Y = ∅ and that ∂c ∩ Y = ∅. (⇐) Let c ∈ C d with c ∩Y = ∅ and ∂c ∩Y = ∅. Then, c is in Star (Y ). Now Star (c) ⊂ Star (e) with e ∈ C d implies that e ∈ ∂c. Hence, c / ∈ Skel (Star (Y )) implies that there exists e ∈ ∂c with e ∈ Star (Y ). So e ∩ Y = ∅. Considering such a cell e with minimal dimension, this implies that e ∩ Y = ∅ which is a contradiction since ∂c ∩ Y = ∅.
In other words, a cell belongs to the Skeleton of the Star of a real set if and only if the cell intersects the set but the cell boundary does not intersect the set.

Full Convexity
For a set A ⊂ R d , its convex hull CvxH (A) is the intersection of all convex sets that contains A. Definition 1 (Full convexity [11,12] The following characterization will be useful: by definition of Star (·).

Fully Convex Envelope
Convex hull is one of the most fundamental tool in continuous geometry. We wish to design a digital analogue to the convex hull. The question is then how to build a fully convex set from an arbitrary digital subset of Z d . For instance can we build this fully convex envelope with intersections of fully convex set? We do have this rather straightforward property: However, intersections of fully convex sets are generally not fully convex. As a very simple example, just pick A = {(0, 0), (1, 1), (2, 1)} and B = {(0, 0), (1, 0), (2, 1)}, which are both fully convex. Then the set A ∩ B = {(0, 0), (2, 1)} is not fully convex, not even connected as seen below.

A B A∩ B
Therefore, we propose another way to build a fully convex set from an arbitrary digital set, which uses the cells intersected by the convex hull of this set, and which is defined through an iterative process.
Each iteration composes these operations, for X ⊂ R d :

FC(X ):=Extr (Skel (Star (CvxH (X ))))
First the Euclidean convex hull of the set is computed, letting Y = CvxH (X ), then its covering Star (Y ) by cells of the cellular grid is determined. The skeleton of these cells is their smallest subset such that Star (Skel (Star (Y ))) ⊃Y . Then for a complex K , Extr (K ) := Cl (K ) ∩ C d 0 , i.e., all the vertices of the cells of K . So finally FC(X ) is composed of the grid vertices of the skeleton cells. The last operation implies that FC(X ) ⊂ Z d . Refer to Fig. 1 for an illustration of FC operation and fully convex envelope computation.
Definition 2 (Fully convex envelope) For any integer n ≥ 0, the n-th convex envelope of X ⊂ R d is the n times composition of operation FC.
The fully convex envelope of X is the limit of FC n (X ) when n → ∞: We have to show that this process has a limit for every subset X .

Theorem 1 For any finite digital set X
It is an immediate consequence of Lemmas 15 and 16 below: The first one tells that FC is increasing, the second that X and FC(X ) have the same bounding box.

Lemma 15 For any X
. It follows that x ∈ Star (CvxH (X )) and, since Star (·) is idempotent, Star (x) ⊂ Star (CvxH (X )). The whole star of x belonging to the subcomplex K :=Star (CvxH (X )), the 0cell x belongs to the skeleton of K . Since all 0-cells of a subcomplex are extremal points, it is an extremal point of Skel (K ), which concludes.

Lemma 16
For any finite X ⊂ Z d , X and FC(X ) have the same bounding box.
Obviously, it is also the lowest point of the bounding box of CvxH (X ). Let K :=Star (CvxH (X )). Since ∀x ∈ CvxH (X ) , p i ≤ x i , any cell c of K that lie below point q along some coordinate axis j has a twin cell e ∈ K in its boundary, such that e is closed along coordinate j and e j = p j . Continuing the argument along every coordinate axis k where e is below point p, we know that there is a digital point z ∈ K in the boundary of c, such that z is not below p. Point z being a 0-cell it follows that z ∈ Skel (K ) while all m-cells incident to z, m > 0, are not in Skel (K ).
We have just shown that no cells of Skel (K ) can be lower than p. The reasoning is the same for the uppermost point.
A first observation is that operation FC does not modify fully convex sets, so the fully convex envelope of a fully convex set X is X itself.
Reciprocally, non fully convex sets are modified through operation FC.
To avoid ambiguities, we pick one, say b, with lowest dimension.
Let z ∈ b ∩ Z d be a grid vertex of this cell (which may be b itself). Then z / ∈ X . Otherwise, Star (z) ⊂ Star (X ), hence the cell b, which belongs to Star (z) (through the equivalence z ⊂ b ⇔ b ∈ Star (z)), would thus belong to Star (X ), a contradiction with the hypothesis.
We have b ∈ Star (CvxH (X )). Furthermore b belongs to the skeleton of Star (CvxH (X )), since it is a cell of Star (CvxH (X )) with lowest dimension in the closure of c. Finally grid vertex z is an extremal point of b, so belongs to FC(X ). We conclude since z / ∈ X holds.
Note that the lemma also indicates where operation FC add digital points. Indeed, they are the vertices of the cells touched by the convex hull but not by the digital set itself. Lemmas 17 and 18 lead immediately to a characterization of fully convex sets: It also induces the most important property of the fully convex envelope operation: It always outputs fully convex sets. Fig. 1 Illustration of FC operation and fully convex envelope construction. Left: input digital set X and its convex hull, middle: Star (CvxH (X )) (gray and thick black) and its skeleton (thick black), right: extremal points of the skeleton, i.e., FC(X ). Here X is digitally 0-convex but not fully convex. FC(X ) is not even digitally 0-convex, while FC(FC(X )) is fully convex and is therefore the Proof By Theorem 1, FC * (X ) exists and there exists some n such that FC * (X ) = FC n (X ). Hence, FC(FC n (X )) = FC n (X ). By Theorem 2, FC n (X ) is fully convex, and so is FC * (X ).
The operator FC * (.) is thus increasing and idempotent. It however fails to be monotone because Skel (.) is not a monotone operator with respect to inclusion. So, it is not a hull operator [1]. Nevertheless, it induces a preorder R FC * , i.e., a reflexive and transitive binary relation, on digital sets using It induces equivalent classes among the set of digital sets. It has its own topology through its associated Alexandrov topology.

Algorithmic Aspects
We now look at the algorithmic aspects of computing FC * .
Since the computation of FC * is done in a loop, we compute the complexity for each iteration. At the beginning of iteration k the points set is FC k−1 (X ). Using Quickhull, the convex hull can be computed in O(n f r /r ) [4] with n the number of input points, r the number of processed points and f r the maximum number of facets of r vertices ( Here, n is the number of points in FC k−1 (X ). As described in [11]

Relative Fully Convex Envelope
We now specialize operator FC in order to stay into a given fully convex set. This creates fully convex sets relative to a given fully convex set. Given Y ⊂ Z d a fully convex set and X ⊂ Y , the FC operator relative to Y is defined as As previously, FC n |Y (X ) :=FC |Y •· · ·•FC |Y (X ), composed n times. The fully convex envelope of X relative to Y is obtained at the limit: As seen in Fig. 2, the relative fully convex envelope extends sets only using points of the fully convex set Y . So when considering two naive lines X and Y having disconnected intersection, both subsets FC * |Y (X ∩ Y ) and FC * |X (X ∩ Y ) are fully convex, hence are connected intersections.
Theorem 4 For any finite X ⊂ Z d and any fully convex set Y ⊂ Z d , the digital set FC * |Y (X ∩ Y ) is fully convex and is included in Y . Proof Let X = X ∩ Y . To see that FC * |Y X is well defined, we rely on previous properties of FC * (). By construction, since FC() is increasing, so is FC |Y (). Moreover Lemma 16 readily extends to say that X and FC |Y X have the same bounding box. It is also true that if X is fully convex then FC |Y X = X ∩ Y and so FC * |Y X = X . Let us now see why Lemma 18 also extends to this situation. We hence suppose that X is not fully convex. Let us then consider any cell Hence at least one point in Y is added by FC |Y (). This implies that X FC |Y X . We can thus mimic Theorem 1 and Theorem 2 to get that FC * |Y X exists and is fully convex. It is included in Y by construction.
Arithmetical planes with thickness at least as thick as naive planes are fully convex [11,Theorem 7]. Hence the set Y can be chosen to be either a naive or a standard plane. Then the fully convex hull of X relative to Y is a fully convex subset of Y containing X ∩ Y . Hence, FC * |Y (X ) is a simply connected piece of the arithmetical plane Y . To compute FC * |Y (.), we only have to incorporate the intersection with Y at each iteration. This is directly linked to the complexity of deciding if a point p is in Y . If Y is a digital plane then this complexity is constant but in general it can be up to the order of O(log( Y )).

Specific Fully Convex Sets
In this section, we study a variety of digital sets and examine their full convexity properties.

Fully Convex Sets Using Minkowski's Sum
The closed positive unit hypercube H + in R d is the set Considering Minkowski's sum between a convex X and a closed unit hypercube H + , for instance, we have that CvxH X ⊕ H + = CvxH (X ) ⊕ CvxH H + , or equivalently that Y = X ⊕ H + is a convex set in R d . We can prove that Y ∩ Z d is a fully convex set.

Lemma 19
Let X be a real closed convex set, then X ⊕ H + ∩ Z d is a fully convex set.
Proof Let us denote by Y the set X ⊕ H + and by Z the set In any cases, the cell e which implies that c is in Star (Y in ) must intersect Y in . It could be c or a cell on its boundary. So for this cell e there are two cases, (i) either it is included in Y in , or (ii) it is not and its intersection with Y in is not empty.
In case (i) since Y in is closed, the 0-cell on the boundary of e also belong to Y in . Hence e is in Star (Z ). In case (ii), let So we have Star (Y in ) ⊂ Star (Z ) and since the converse is always true, we get the equality of those sets meaning that Z is fully convex.
Let us remark that the main argument is that if x ∈ R d , then {x} ⊕ H + ∩ Z d = ∅. This implies that the result is also true for H − and for super set of the unit hypercubes such that the 2-hypercube [−1, 1] d .

Fully Convex Sets from Star
We now show that for a convex set Y ⊂ R d , Extr (Star (Y )) is fully convex. This implies that Extr (Star (CvxH (X ))) is fully convex for any real set X . In general, this fully convex set can be thicker than FC * (X ).
The converse is false when a cell boundary intersects Y but the cell does not. Let us also introduced the dilated We note that c ∩ Y = ∅ implies that either (i) c is fully included in Y or (ii) c intersects both Y and its complimentary.
In case (i), since Y is closed, c ⊂ Y . So in particular all 0-dimensional cells of ∂c belong to Y . Hence all 0-dimensional cells in the boundary of c belong to Y ⊕ . This implies, using Lemma 20, that Extr (Star (Y )) and The characterization given in Lemma 21 implies that Extr (Star (Y )) is obtained by a simple Minkowski's sum with the 2-hypercube. This implies the following.

Lemma 22 Let Y ⊂ R d a closed convex set. Then Extr (Star (Y )) is fully convex.
Proof With the characterization given by Lemma 21 and Lemma 19 applied to the 2-hypercube [−1, 1] d , we derive the full convexity of Extr (Star (Y )).

Projection of Fully Convex Sets Along an Axis
We here study the stability of fully convex sets with respect to orthogonal projections along axis in R d . We denote by P j the orthogonal projector associated to the j-th axis, which consists in omitting the j-th coordinates for all points of Z d . By direct extension, those projectors are defined for cells in C d . P j are called axis projectors. Those projectors share the property that the image of a cell c ∈ C d is a cell in C d−1 and those projections are the only projections for which this property is true. Moreover, the image of a point in Z d by any axis projector is a point in Z d−1 .
Lemma 23 Let X be a full convex set in Z d and any axis projector P j , then P j (X ) is a full convex set in Z d−1 .
Proof For the real set Y = CvxH (X ), its star is composed of cells intersected by Y and of cells for which only their topological boundaries intersect Y (but the cell itself do not). We therefore study the behavior of those two disjoint subsets of cells, respectively, in case (i) and in case (ii). Case (i). Since X is a digital set in Z d thenX j = P j (X ) is a digital set in Z d−1 . We consider a cell c ∈ C d−1 intersected by CvxH X j , the convex hull ofX j . The inverse image is an infinite open convex set. To the real set P −1 j (c) we associate the set of cells C c = {e ∈ C d , e ∩P −1 j (c) = ∅}. Let us denote by K the intersection P −1 j (c) ∩ CvxH (X ), which is a non empty open convex set K . We consider the set of cells K c = Star (K ) ∩ C c . Since X is a fully convex set, every cell in Star (CvxH (X )) is in Star (X ). This is in particular true for all cells in K c such that every cell in K c is in Star (X ). So for each e ∈ K c , we associate a point z e in X such that e is in Star (z e ). The projection of e is, by definition, c and the projection of z e is a pointẑ e inX j . We can remark that c is in Star ẑ e ⊂ Star X j .
Case (ii). Now if we consider a cell c such that c ∩ CvxH X j = ∅. Then, c belongs to Star CvxH X j if and only if there exists c ∈ ∂c such that c ∩CvxH X j = ∅. Applying the same construction that the one of the first case, we can have a point z e in X such that its projectionẑ e contains c in its star. But, since c ∈ ∂c, Lemma 1 implies that Star (c) ⊂ Star c . So, since Star c ⊂ Star ẑ e we have Star (c) ⊂ Star ẑ e ⊂ Star X j .
We hence have proved that Star CvxH X j ⊂ Star X j . Since Star (.) is increasing andX j ⊂ CvxH X j , the converse is true. Hence, Star X j = Star CvxH X j which means thatX j is fully convex.
One could wonder if asking every axis-aligned slices of a digital object to be fully convex is a stronger property than just asking the projections to be fully convex. As for the projections, we also have the implication: It has been proved in [12] that for fully convex, their slices along any canonical axis are all fully convex. However, as shown in Fig. 3, the reciprocal property is generally false. The problem lies in the empty slices: An empty slice is indeed fully convex by definition of convexity of empty sets. The reciprocal property for the projections is still an open question.
Open Problem 1 Let X be a set in Z d such that for all j, P j (X ) is full convex. Is X a fully convex set ? Fig. 3 A non fully convex set whose slices are all fully convex

Discussion on Fully Convex Sets
We have presented several ways to build a fully convex set from an arbitrary digital set X . Indeed we can use the envelope operator FC * (X ), any asymmetric Minkowski sum such as (CvxH (X ) ⊕ H + ) ∩ Z d , or directly compute Extr (Star (CvxH (X ))) (which is equivalent to a symmetric Minkowski sum). This is illustrated in Fig. 4. Clearly these operators are not equivalent and we list on Table 1 their respective pros and cons.
We denote by Z := f (X ) for an operation f . Operation (CvxH (X ) ⊕ H + ) ∩ Z d is the fastest to compute, but the resulting digital set Z is an asymmetric expansion of X in an arbitrary direction, with a quite large number of points in Z \X . Operation Extr (Star (CvxH (X ))) is a little bit slower to compute, yet remains symmetric. However the set Z \X is really large (and the worse it is in higher dimension). Both operations are not really envelope operators since they modify input sets even when they are fully convex.
On the contrary, the envelope operation FC * (X ) is generally slower to compute, since it requires sometimes several iterations of convex hull computations. However, the set Z \ X is the smallest among all three operations. The set X is expanded symmetrically. It leaves fully convex sets invariant. Note also that the number of iterations of operator FC(·) is upper bounded by # (Z \ X ), and this upper bounded is greatly overestimated in general. Overall the envelope operator FC * (·) is much more interesting, since it has nice theoretical properties while being still computable in a reasonable amount of time.

Digital Polyhedron
We now present digital models for Euclidean polyhedra based on envelopes. A polyhedron P is a collection of finite convex sets called cells, such that each cell σ is characterized by a finite number of points V (σ ) called vertices. Cell σ is a face of cell σ if V (σ ) ⊂ V (σ ). The vertices V of the polyhedron are the union of the vertices of all cells. Generally an abstract dimension is attached to cells, 0 for vertices, 1 for edges, 2 for faces, etc., and must be consistent with the face relation. We take an interest here in polyhedra with maximal dimension d − 1, i.e., surfaces, whose (d − 1)-cells are called facets. Figure 5, left, shows two polyhedra in 3D space: a quadrangulated surface Q with nonplanar facets and a triangulated surface T with planar facets.
Assuming each vertex of P to be a point of Z d , the (generic) digital polyhedron P * associated to P is the collection of digital cells that are subsets of Z d such that: if σ is a cell of P, then σ * is a cell of P * with σ * :=FC * (V (σ )). Such a digital polyhedron is illustrated in Fig. 5, top row.
When vertices of facets are coplanar, we can build a digital polyhedron whose facets are pieces of arithmetic planes.   nar points, let us denote by P 1 (T ) the median standard plane (resp. P ∞ (T ) the median naive plane) defined by T . The standard (resp. naive) digital polyhedron P * 1 (resp. P * ∞ ) is the collection of digital cells subsets of Z d , defined as follows. For p ∈ {1, ∞}, if σ is a facet of P, then σ * p is a cell of P * p with σ * p :=FC * |P p (V (σ )) (V (σ )). For any cell τ that is not a facet, then it has as many geometric realizations as incident facets σ and each pair (τ, σ ) is digitized as (τ, σ ) * p :=FC * |σ * p (V (τ )). Cell pairs have the same role as half-edges in winged-edge data structures and more generally darts in combinatorial maps. Note that other thicknesses could be chosen for a digital polyhedron but naive and standard are the most common ones. A standard (resp. naive) digital polyhedron associated to a triangulated mesh is illustrated in Fig. 5, middle row (resp. bottom row). They require less digital points than the generic digital points, while keeping their separation properties. We also display in Fig. 6 clipped and zoomed versions of these three polyhedral models. One can see that these models are surfacic (they are hollow) and that their thickness depends on the chosen model. To better understand the three defined polyhedra, let us consider a single triangle and its edges and vertices: Its three digital models are displayed in Fig. 7. All induced cells are fully convex, but we notice that standard cells are thinner while naive cells are even thinner. What might be surprising is that relative fully convex envelope may create larger subset than expected, especially for the naive triangle example. One should keep in mind that expanding a set inside a naive plane to become fully convex is a very restrictive transform: Edges have to expand more within naive plane P ∞ than within standard plane P 1 . Of course, this is quite an extreme example and edges are narrower in most cases.
The following property is quite straightforward, but shows that every digital polyhedron covers well the cells of its associated Euclidean polyhedron, and that the inclusion/face property between cells is satisfied in the digital domain. Digitizing a polyhedron at different gridstep h is just a matter of embedding every real vertex point q as a digital vertex q * = round(q/h) (see Fig. 5).

Implementation Details
From the different definitions of full convexity and fully convex envelope, it is clear that several operations like Star (·), CvxH (·), Skel (·) must be implemented in a careful way to be efficient and dimension independent. We present in this section several improvements we have made that makes these computations much more efficient than a naive implementation. They involve an implementation of a convex hull algorithm, a new characterization of fully convex sets, a careful choice of a data structure to represent lattice points and cells and a trick to count lattice points within a polytope.

Convex Hull Computation
The most common algorithm for computing the convex hull of a given set of points is the classical quickhull algorithm [4]. The most famous dD implementation is Qhull. 1 However this program represents point coordinates with floating-point numbers and may return erroneous and approximate convex hulls when points are not in general position. This is a considerable issue when dealing with lattice points, where co-sphericities are extremely common. Another common dD implementation is CGAL, 2 which has the advantage of offering kernels with guaranteed results, at the price of slower computations. Another drawback is that it always outputs a triangulation, so co-sphericities are arbitrarily triangulated. Note also that there exists GPU implementations of quickhull [16]. They are up to ten times faster than Qhull, but for ten millions of points. For sets with less than 500K points, the GPU program is much slower. Note also that these GPU implementations are limited to 2D and 3D.
We propose thus a new implementation of quickhull algorithm dedicated to lattice points (or rational points), as a DGtal package. 3 Lattice points may have fixed-sized integer coordinates (int32, int64) or even arbitrary size integer coordinates (using GMP library 4 ). In order to have correct geometric computations (inside/outside tests and determinant computations to get the normal vector), the user can choose also the type of integer numbers for the geometric computations. The table below shows the maximum width of the bounding box containing all lattice points in order to get exact convex-hull-computations in all cases when choosing int64 both for coordinates and geometry computations. When the width exceeds this bound (which depends on the dimension), GMP arbitrary size integers must be used, with an approximate 25 times slow-down factor.
generic faces T * = 1193 standard faces T * 1 = 985 naive faces T * = 567 Fig. 7 A generic digital triangle T * with its darker edges and black vertices ( p, q, r ) (left); corresponding standard digital triangle T * 1 which lies in the median standard plane P 1 ( p, q, r ) (middle); corresponding naive digital triangle T * ∞ which lies in the median naive plane P ∞ ( p, q, r ) (right) Experiments show that our implementation is as fast as qhull but with correct results, and is generally two times faster than CGAL version. See the package documentation 5 for more details.

Full Convexity Test and Operator FC(·) with One Convex Hull Computation
The morphological characterization of full convexity induces an algorithm for checking full convexity that requires up to 2 d − 1 convex hull computations. Let us recall how it works. We introduce a discrete analog of Minkowski sums of unit axis-aligned edges, squares, cubes, etc. Let I d = {1, 2, . . . , d} be the set of directions of the space. Let U ∅ (Z ):=Z , and, for α ⊂ I d and i ∈ α, we define recursively U α (Z ):=U α\i (Z ) ∪ e i (U α\i (Z )). Note that e i (Z ) is simply the set Z translated by the i-th axis unit vector. The previous definition is consistent since it does not depend on the order of the sequence i ∈ α.
Then [12,Theorem 6] states: There are 2 d different subsets of I d , and since the last d-convexity check is not necessary (see Lemma 4 of [12]), this characterization induces an algorithm that must compute 2 d − 1 convex hull and enumerate the lattice points within.
In fact, one computation is enough. We will achieve this through Theorem 5. Now let us recall the definition of mapping Z : C d → Z d which associates to any cell σ , the digital vertex of σ with highest coordinates. Its restriction to C d α is denoted by Z α . It was shown in [12,Lemma 8] that Z α is 5 https://dgtal-team.github.io/doc-nightly/moduleQuickHull.html. a bijection for any α ⊂ I d . Since we use α = I d in the remaining of the proof, we omit it in the notations. Hence Z is a bijection from d-cells to lattice points.
We say that a cell c ∈ C d is surrounded by a set of d-cells D ⊂ C d d whenever the d-dimensional cells of Star (c) form a subset of D, and we write c ≺ D.

Theorem 5 It holds that Star
Proof Let us remind that H + is the unit hypercube with lowest point 0. We recall [12,Lemma 9] (specialized for α = I d ): We recall now [12,Lemma 11] which implies CvxH (X ) ⊕ H + = CvxH U I d (X ) . Applying [12,Lemma 9] and this property on Y = CvxH (X ) gives: which tells that CvxH U I d (X ) ∩Z d corresponds one-to-one with the d-cells touched by CvxH (X ). It remains thus to be shown that Star (CvxH (X ) Clearly the d-cells of these two sets are the same. Pick any k-cell c in C d , k < d.
If c ∈ C d [CvxH (X )], soc ∩ CvxH (X ) = ∅. But for any e ∈ Star (c),ē ⊃c so we also haveē ∩ CvxH (X ) = ∅. Letting E be the d-cells of Star (c). Then every cell of E touches CvxH (X ), Conversely, let c be any k-cell such that surrounding c. Let us denote e 1 , . . . , e n the cells of E (a finite set with n:=2 d−k elements). Since each cell e i touches CvxH (X ), then there exists for each one a point x i ∈ē i with x i ∈ CvxH (X ). By convexity, CvxH {x i } i=1,...,n ⊂ CvxH (X ). But c is at the center of its surrounding d-cells (e i ), so according to Lemma 24 (in Appendix), we have CvxH {x i } i=1,...,n ∩c = ∅. We have just found a common real point between CvxH (X ) andc, so c ∈ C d [CvxH (X )].
Since Lemma 13 tells that a digital set X is fully convex iff Star (X ) = Star (CvxH (X )), then Theorem 5 above states that Star (CvxH (X )) can be computed directly from CvxH U I d (X ) ∩ Z d , which involves only one convex hull computation and lattice point enumeration within the polytope. This theorem also shows that Star (CvxH (X )) in operator FC(·) also requires only one convex hull computation.

A Row-Oriented Data Structure for Sets of Lattice Points
The idea here is to notice that the lattice points within a polytope form an interval of consecutive points along any axis. And more generally lattice sets representing digital shapes are not composed of randomly distributed points and can be compactly and efficiently represented with intervals. Therefore we represent a set of integers N as an interval sequence J (N ) of k integral pairs (a i , b i ) such that: Given an axis direction j, we define the row representation of a set of lattice points X as an associative map M j (X ) from lattice points to interval sequences (i.e., dictionary), as follows: If x ∈ Z d , we denote byx j the projected point of Z d−1 with omitted coordinate x j . For p ∈ Z d−1 , let X j p = {x ∈ X ,x j = p}. It is clear that every point x of X j p can be identified by exactly one integer, its j-th coordinate x j . We define thus the set of integers N (X j p ) as {x j , x ∈ X j p }. Then the value of M j (X )( p) is defined as the interval sequence J (N (X j p )). Testing if a point q belongs to X is equivalent to check if q j ∈ M j (X )(q j ), i.e., q j ∈ J (N (X ĵ q j )). This data structure is implemented as the class LatticeSetByIntervals 6 in DGtal. A few further remarks on the row representation of a lattice set: • its worst-case space complexity is the same as the usual set data structure; • per row, a sequence of intervals is more compact to store than a set of points except when there is only one or two points on the row (and the higher the dimension the more compact is the row representation); 6 https://dgtal-team.github.io/doc-nightly/classDGtal_1_ 1LatticeSetByIntervals.html.
• if the lattice set is digitally convex, each row stores at most one interval; • no data is associated to an empty row in the associative container; • checking if a point belongs to a row representation is at least as fast as checking if a point belongs to the usual set data structure (faster on average); • counting the number of points is much faster (amounts to count b i − a i + 1 for each interval); • usual set operations (inclusion, intersection, union, etc) are much faster in practice in row representation, and worst-cases are the same; • a set of lattice cells can easily be represented as a set of lattice points through the Khalimsky coordinates of the cells, and their induced row representation is also efficient; • any set of lattice cells defined by the intersection with a polytope also induces a row representation with one interval per row; • Operations Star (·), Skel (·) and Extr (Skel (·)) are also efficiently implemented in row representation; • the best choice for direction j is generally the direction of the set where it is the most elongated.

Enumerating Lattice Points within a Polytope
Although Barvinok's theory [2] leads to theoretically faster algorithms for enumerating lattice points within a polytope, it is not straightforward to implement. We are aware of only one complete implementation, LattE, 7 and it cannot directly be interfaced with C/C++ libraries. Their command line interface is unfortunately slow and it is yet not clear for what size of data that kind of approach can be faster than naive enumeration within the bounding box of the polytope.
We choose to optimize the naive enumeration within the bounding box of the polytope. The idea is to examine the intersection of axis-aligned rays with the polytope, to extract the interval of lattice points that is common to the ray and the polytope.
More precisely, the convex hull computation builds a finite polytope P with m facets, defined as m inequalities n i · x ≤ μ i , for x a lattice point of Z d . Let B be the tight bounding box of P and let j be the axis direction where B is the most elongated. Let B j :=P j (B) be the projection of B along direction j, hence a rectangular domain of Z d−1 . Let also r and s be the minimal and maximal coordinates of B along j. For every point p ∈ B j , with q:=( p 1 , . . . , p j−1 , r , p j , . . . , p d−1 ), we compute the intersection of the row along j containing p with the polytope P as follows: In future works, we would like to study more precisely the iterative process of FC * (.), in order to localize where fullconvexity defects reside. This could further accelerate the operator by providing more practical bounds on the number of iterations. Incremental quickhull should also be considered. A more general goal is to extend the envelope process to a true convex-hull operator. The difficulty is to ensure the monotone property. In case of success, full convexity would then be a digital analogue to convexity for digital spaces.
Author Contributions These authors contributed equally to this work.
Funding This work has been partly funded by Agence Nationale de la Recherche, CoMeDiC ANR-15-CE40-0006 research grant.

Conflict of interest
The authors have no competing interests as defined by Springer, or other interests that might be perceived to influence the results and/or discussion reported in this paper.
Ethical Approval Not applicable.

A Useful Results
We relate convexity and intersections with the cubical grid complex. The following property is useful to demonstrate that we can get a fast implementation of Star (CvxH (·)). On each subproblem D i , it is possible to build a point y i on cellc i that is a convex combination of points x 2i+1 and x 2i+2 . Then y is a convex combination of points y 1 and y 2 , and belongs toc. Since c is a 0-cell here, we have y = c computation gives y j = 0. Along every direction m = j, cells c and σ 1 , σ 2 are open, so 0 ≤ x m 1 ≤ 1, 0 ≤ x m 2 ≤ 1. It follows that 0 ≤ y m ≤ 1 since y is a convex combination of these points. We have just shown that y ∈c, which concludes for this case.

Lemma 24
Let us assume that the property holds for a given d − k, 1 ≤ d − k < d, and let us show that it is true d − k + 1. The proof is illustrated in Fig. 8. Pick j a direction where c is closed. Let D 1 (resp. D 2 ) be the d-cells surrounding c having positive (resp. negative) j-th coordinate. Let also c 1 (resp. c 2 ) be the d − k-cell such that Star (c 1 ) = D 1 (resp. Star (c 2 ) = D 2 ). Then by induction we have a point y 1 ∈c 1 and a point y 2 ∈c 2 that both belong to CvxH {x i } i=1,...,n . The same reasoning as above is made to compute a coefficient λ = −y j 2 y j 1 −y j 2 . One can check that, denoting y:=λy 1 +(1−λ)y 2 , we have that: y j = 0, y m = 0 for every direction m where c 1 or c 2 (or c) is closed (by induction), and 0 ≤ y m ≤ 1 for every direction m where c 1 or c 2 (or c) is open. We have just shown y ∈c and also y ∈ CvxH {x i } i=1,...,n since CvxH ({y 1 , y 2 }) ⊂ CvxH {x i } i=1,...,n by convexity.