Next Article in Journal
Shared Node and Its Improvement to the Theory Analysis and Solving Algorithm for the Loop Cutset
Previous Article in Journal
An Adversarial Search Method Based on an Iterative Optimal Strategy
Previous Article in Special Issue
A Computational Method for Subdivision Depth of Ternary Schemes
 
 
Font Type:
Arial Georgia Verdana
Font Size:
Aa Aa Aa
Line Spacing:
Column Width:
Background:
Article

Level Sets of Weak-Morse Functions for Triangular Mesh Slicing

1
Vicomtech Foundation, Basque Research and Technology Alliance (BRTA), Mikeletegi 57, 20009 San Sebastián, Spain
2
Laboratory of CAD CAM CAE, Universidad EAFIT, Cra 49 no 7-sur-50, Medellín 050022, Colombia
3
Matemáticas y Aplicaciones, Departamento de Ciencias Matemáticas, Universidad EAFIT, Medellín 050022, Colombia
*
Author to whom correspondence should be addressed.
Mathematics 2020, 8(9), 1624; https://doi.org/10.3390/math8091624
Submission received: 31 July 2020 / Revised: 6 September 2020 / Accepted: 14 September 2020 / Published: 19 September 2020
(This article belongs to the Special Issue Discrete and Computational Geometry)

Abstract

:
In the context of CAD CAM CAE (Computer-Aided Design, Manufacturing and Engineering) and Additive Manufacturing, the computation of level sets of closed 2-manifold triangular meshes (mesh slicing) is relevant for the generation of 3D printing patterns. Current slicing methods rely on the assumption that the function used to compute the level sets satisfies strong Morse conditions, rendering incorrect results when such a function is not a Morse one. To overcome this limitation, this manuscript presents an algorithm for the computation of mesh level sets under the presence of non-Morse degeneracies. To accomplish this, our method defines weak-Morse conditions, and presents a characterization of the possible types of degeneracies. This classification relies on the position of vertices, edges and faces in the neighborhood outside of the slicing plane. Finally, our algorithm produces oriented 1-manifold contours. Each contour orientation defines whether it belongs to a hole or to an external border. This definition is central for Additive Manufacturing purposes. We set up tests encompassing all known non-Morse degeneracies. Our algorithm successfully processes every generated case. Ongoing work addresses (a) a theoretical proof of completeness for our algorithm, (b) implementation of interval trees to improve the algorithm efficiency and, (c) integration into an Additive Manufacturing framework for industry applications.

1. Introduction

In the context of CAD CAM CAE (Computer-Aided Design, Manufacturing and Engineering) and Additive Manufacturing, the computation of closed 2-manifold level sets (mesh slices) is crucial for the generation of contours required in pattern filling. The filling of these patterns require correct classification and orientation of closed 1D contours, allowing the application of filling algorithms that rely on line/polygon boolean operations. The resulting fill patterns are used to generate the G-Code or CLI (Common Layer Interface) code required to 3D print an input model layer by layer, where each layer corresponds to a filled level set [1,2]. Other applications for mesh slicing include visual dimensional inspection, where computed level sets are used to assess 2D geometric features [3,4].
The problem of slicing closed 2-manifold meshes addresses the computation of level sets of a height function f : M R . The inverse f 1 of such a function at a given point c is known as a level set of f. The properties of the level set f 1 ( c ) (i.e., 0-, 1- or 2-manifoldness, or non-manifoldness at all) heavily depend on the critical points of f (in f 1 ( c ) ).
A critical point of f is a point x M such that its tangent gradient M f ( x ) is 0. In addition, a critical point x M is degenerate, if its tangent Hessian matrix H M f ( x ) is degenerate (i.e., if its matrix determinant is 0).
A function f : M R is a Morse (strong-Morse) function if all of its critical points are non-degenerate. The assumption of Morseness on f guarantees that the resulting level set f 1 is either (see Figure 1): (a) a single (0-manifold) point, (b) a 1-manifold closed contour, (c) a self-intersecting 1D closed contour or, (d) the disconnected union of any of the previously mentioned cases. As a consequence, the Morseness of f facilitates the computation of f 1 ( c ) as only closed oriented contours are generated (aside from the trivial 0-manifold points).
However, in most application cases f is a non-Morse function, with several degeneracies along the domain M . Therefore, f 1 ( c ) can produce other types of level sets, such as: non-oriented compact contours, 2-manifold regions, self-intersecting contours (with or without border) or a connected union between Morse and non-Morse cases. It is well-known that a slight rotation of the manifold may remove non-Morse conditions of the height (slicing) function. However, in CAD CAM CAE (and particularly in Additive Manufacturing), these non-Morse degeneracies are of special interest as any tilt to the original model changes the manufacturing feasibility of the workpiece.
In the current literature, most mesh slicing algorithms assume strong-Morseness on the slicing function f, or they do not correctly classify the different types of non-Morse cases that arise in real application cases. To organize the solution of this problem, this manuscript defines weak-Morse functions as functions with a finite set of points C R , such that f is only degenerate (non-Morse) at such points f 1 ( C ) M , satisfying Morseness elsewhere. Such a definition allows us to define a classification of different Morse and non-Morse cases in order to develop an algorithm that correctly reflects this classification, producing the correct level sets for each case. Such classification requires our algorithm the evaluation of each vertex, edge and triangle neighborhood, outside of the slicing plane c. Finally, closed contours are correctly oriented to differentiate body holes from external contours. This final step is crucial in Additive Manufacturing operations where pattern filling algorithms require this differentiation for correct line-polygon intersection operations.
The remainder of this manuscript is organized as follows: Section 2 discusses the relevant literature. Section 3 presents the proposed weak-Morse classification and the mesh slicing algorithm. Section 4 presents and discusses some test results. Finally, Section 5 presents the conclusions and introduces what remains for future work.

2. Literature Review

Mesh slicing and pattern filling are crucial steps in the Additive Manufacturing workflow. This section discusses some of the most relevant literature concerning the computation of 2-manifold level sets. For a more detailed review, the reader may refer to the surveys in References [1,2].

2.1. Parallel-Planes Mesh Slicing

Height functions f ( x ) = x z are the most common functions used for mesh slicing. These functions naturally produce parallel planar slices of M in the z-direction, and they can be generalized to any direction v R 3 by applying a 3D rotation to the input mesh. Standard triangle/plane intersection algorithms are used to compute the level sets of f [5,6,7,8,9,10,11,12], which in most cases are assumed to produce closed (and oriented) 2-manifold contours. Adaptive slicing algorithms introduce techniques to compute non-uniformly spaced slicing planes [13,14,15]. Adaptive techniques are relevant for avoiding surface aliasing, without having to rely on oversampling.
To reduce the complexity of slicing algorithms, Reference [16] introduces interval trees, which reduces the complexity of mesh slicing algorithms by testing subsets of mesh triangles in given z-intervals. For regularly spaced slicing planes, the complexity can be further reduced by sorting the mesh triangles in ascending z-order [17].
Other methods for surface slicing include point clouds [18], Bezier level sets [19], NURBS [13], implicit surfaces [20,21], Catmull-Clark solids [22] and slicing of graph-based lattice structures [23].
All of the aforementioned slicing algorithms limit their level set retrieval using only triangle/plane intersection information. This relies on the assumption of the slicing function f to be a Morse function. However, this assumption does not always hold true, specially for CAD models where sharp edges, planar faces and saddle points intersect the slicing plane. The non-Morseness of f requires additional evaluation of local vertex, edge and triangle neighborhoods, which do not necessarily lie on the slicing plane but are crucial for determining the type of slice degeneracy. Reference [24] addresses the problem of some non-Morse slicing functions by considering degenerate 2-manifold faces lying on the slicing plane. However, degenerate 1-manifold regions and saddle points are still not considered.

2.2. Non-Parallel-Planes Mesh Slicing

As discussed before, most slicing algorithms consider height maps as slicing functions. However, some approaches have been recently proposed to include other kind of slicing functions [1,2]. These functions vary the slicing direction through the surface, producing non-parallel slicing planes.
References [25,26] apply an error minimization algorithm, which segments the mesh model and produces a diferent slicing direction for each computed sub-mesh. Reference [27] maps surface normals to the unit sphere and solves an optimization problem inside this sphere. The optimization procedure results in a slicing function that produces non-parallel slicing planes.
Reference [28] defines a slicing function that travels along a parametric curve (which the authors name streamline). References [29,30] fit B-Spline surfaces to the mesh. Many non-planar slices of M are produced afterwards by offsetting the fitted B-Splines in the surface normal direction.
In terms of Morseness of the slicing function f, non-parallel-planes methods also arise the same problems of their parallel-plane methods counterparts. Computation of level sets still happens at a local triangle/plane intersection level, neglecting the information of local vertex, edge and triangle neighborhoods.

2.3. Conclusions of the Literature Review

Current mesh slicing algorithms rely on the assumption of Morseness of the slicing function f. However, non-Morse slicing functions are frequent in Computational Geometry applications and (particularly) in CAD applications, where input models present saddle points, sharp edges and planar faces that intersect the slicing plane. These non-Morse cases, produce incorrect slicing results when not correctly addressed. Furthermore, literature on discrete Morse theory has been already discussed by different authors [31,32,33]. Nevertheless, to the best of our knowledge, there is not a Morse-based mathematical description of the mesh slicing problem in the context of Engineering and Manufacturing applications.
To overcome these problems, this manuscript discusses and classifies the different types of plane/surface intersections that arise when computing level sets. To do so, we define weak-Morse functions, in which non-Morse degeneracies are allowed in a finite set of planar slices C R . Additional to the classic plane/triangle intersection algorithm, this classification requires our algorithm to evaluate vertex, edge, and triangle neighborhoods outside of the slicing plane. The resulting slices may produce not only closed 1-manifold contours, but also non-manifold (with or without boundary) self-intersecting contours, 0-manifold points and 2-manifold surfaces. In order to differentiate holes from external contours, the resulting closed contours are correctly oriented. The orientation of the closed contours is crucial in Additive Manufacturing operations where pattern filling algorithms require this specification for correct line/polygon boolean operations. Future work is intended to produce a theoretical proof of the completeness of the algorithm presented in this manuscript.

3. Methodology

The idea of mesh slicing considers a triangular discretization M = ( X , T ) of a continuous, closed 2-manifold M that is embedded in R 3 . M is a triangular mesh defined by a set of vertices X = { x 0 , x 1 , , x n } and a set of triangles T = { t 0 , t 1 , , t m } . The slicing of M requires to compute the level sets f 1 of a slicing function f : M R .
For a given slicing value c R , the level set f 1 ( c ) M produces an oriented 1-manifold contour if such a level set does not contain any critical points of f. However, when f 1 ( c ) contains one (or more) critical points of M, the resulting level set cannot be guaranteed to be 1-manifold closed contour. In fact, several cases arise depending on the nature of the critical point, and the resulting contour can either be: (a) a 0-manifold point, (b) a self-intersecting (non-manifold), closed, 1D oriented contour, (c) a non-manifold, 1D non-oriented contour (possibly with borders), and (d) a closed 2-manifold region. The nature of these critical points can be classified in terms of Morse theory, as illustrated in Figure 2. The mathematical and algorithmic details for the computation of the level sets of f are discussed in the following subsections.

3.1. Mathematical Description of the Problem

3.1.1. Strong-Morse Function

Let M be a closed and oriented 2-manifold embedded in R 3 , and consider a twice differentiable function f : M R . The function f, is a strong-Morse function if all critical points of f are non-degenerate. That is to say, f is a Morse function if:
x M , M f ( x ) 0 det ( H M f ( x ) ) 0 ,
where M and H M are the tangent gradient operator and tangent 2 × 2 Hessian matrix, respectively. These tangent operators are defined in the tangent planes T x M of M . The function f is known as the slicing function, and the inverse f 1 : R P ( M ) defines the level sets of f.

3.1.2. Weak-Morse Function

We define a weak-Morse function, as a function f that satisfies the Morse criterion everywhere, except in a finite set of slice values C R , that is:
c C , x f 1 ( c ) , M f ( x ) = 0 det ( H M f ( x ) ) = 0 .
Since the set C is allowed to be the empty set, any strong-Morse function is also a weak-Morse one.
It is worth noting that in the discrete domain (e.g., in the case of triangle meshes), weak-Morse and non-Morse are equivalent definitions. However, in the continuous domain these two definitions are not the same. As an example, consider the surface S M , defined as x , y ( a , a ) (with a R ), and the non-Morse function z = f ( x , y ) defined as follows (see Figure 3):
f ( x , y ) = x 5 cos 1 x x 0 0 x = 0 .
The function f C 2 ( S ) has infinite critical values and, since for all x , y S , f 2 x y = f 2 y 2 = 0 , the Hessian matrix H M f ( x , y , z ) is singular everywhere in S. As a consequence, the non-Morse function f does not satisfy weak-Morse conditions on M S .
In particular, this manuscript considers the function f as the height function f ( x ) = x z , which maps each point x M to its corresponding z-value (see Figure 1). In this case, the level sets of f are parallel planar slices of M .

3.1.3. Level Set Types

Let M R 3 be a closed, oriented and differentiable 2-manifold, and the slicing function f : M R , f C 2 ( M ) . For a given c R , this subsection defines a classification of the level set f 1 ( c ) based on the characteristics of the critical points of f (in f 1 ( c ) ).
Without loss of generality, the following classification assumes that f 1 ( c ) is connected. In the case that f 1 ( c ) is disconnected, each connected component of such a level set can be treated separately. Furthermore, such a classification is applied locally (i.e., in a small neighborhood N ε ( x ) M around a point x M ), allowing more than one type instances at the same level set f 1 ( c ) .
Without further ado, we identify the following level set types (see Figure 2):
  • Closed 1-manifold contour: f 1 ( c ) contains no critical points:
    0 M f ( f 1 ( c ) )
    In this case f 1 ( c ) defines a simple, oriented, closed curve (1-manifold homeomorphic to the unit circle).
  • 0-manifold point: f 1 ( c ) contains a strict local minimum (or maximum) f ( x ) = c :
    ε > 0 , y N ε ( x ) \ x , f ( x ) < f ( y )
    where, N ε ( x ) M is a small neighborhood around the point x. Notice that for a local minimum (or maximum), f 1 ( c ) N ε ( x ) = { x } . The level set f 1 ( c ) corresponds to a 0-manifold isolated point x M .
  • Non-degenerate saddle: f 1 ( c ) contains a non-degenerate saddle point f ( x ) = c :
    M f ( x ) = 0 det ( H M f ( x ) ) 0 ,
    in which, for a small neighborhood, N ε ( x ) M :
    f 1 ( c ) N ε ( x ) \ { x } is homeomorphic to i = 0 3 ( i , i + 1 ) .
    This contour locally produces a self intersecting (non-manifold), 1D curve with the shape of an “X” (see Figure 2).
  • Degenerate saddle: f 1 ( c ) contains degenerate saddle point f ( x ) = c :
    M f ( x ) = 0 det ( H M f ( x ) ) = 0
    then for a small neighborhood N ε ( x ) M :
    f 1 ( c ) N ε ( x ) \ { x } is homeomorphic to i = 0 2 k 1 ( i , i + 1 ) , k > 2 .
    Similar to the non-degenerate saddle, the degenerate saddle produces a self-intersecting curve with 2 k ( k > 2 ) 1-manifold branches (see Figure 2).
  • Degenerate 1D region: f 1 ( c ) contains a local minimum (or maximum) along a 1D path:
    x f 1 ( c ) , ε > 0 , c = min ( f ( N ε ( x ) ) )
    and
    f 1 ( c ) N ε ( x ) is homeomorphic to R .
    This region defines a non-manifold 1D compact region, possibly with non-empty boundaries.
  • Degenerate 2-Manifold region: f 1 ( c ) contains a critical 2-manifold region:
    x f 1 ( c ) , ε > 0 , y N ε ( x ) f ( y ) = c .
    The region N ε ( x ) f 1 ( c ) is locally homeomorphic to R 2 . The definition of locally homeomorphic permits the existence of holes in the region f 1 ( c ) .

3.1.4. Contours Orientation

Since the slicing function is the height function f ( x ) = x z , each contour f 1 ( c ) naturally lies in a 2D linear space (i.e., planar slice). The orientation of each contour is defined as follows (see Figure 2):
  • Closed 1-manifold: The orientation of f 1 ( c ) on the slicing plane is defined by the projection of the surface normal vector, that is:
    n X Y ( x ) = Proj X Y ( n ( x ) ) ,
    where n ( x ) R 3 is the vector normal to M at x, and n X Y ( x ) R 2 is the corresponding projection on the slicing plane.
  • 0-manifold point: Not oriented.
  • Non-degenerate saddle: The orientation of the non-degenerate saddle point f ( x ) = c is equally defined by the projection to the surface normal vector:
    n X Y ( y ) = Proj X Y ( n ( y ) )
    for all y N ε ( x ) \ { x } .
  • Degenerate saddle: Exactly the same as the non-degenerate saddle case.
  • Degenerate 1D region: Not oriented.
  • Degenerate 2-manifold region: Not oriented in the slicing plane. However, the boundary f 1 ( c ) is an oriented, closed 1-manifold embedded in R 2 .

3.2. Slicing Algorithm

Let M = ( X , T ) be a triangular 2-manifold mesh with set of vertices X = { x 0 , x 1 , , x n } , and set of triangles T = { t 1 , t 2 , , t m } . M is a discrete piecewise linear representation of M . The slicing function f ( x ) = z ( x ) is therefore defined on M as f = { z ( x 0 ) , z ( x 1 ) , , z ( x n ) } .
For a given c R , a level set (planar slice) f 1 ( c ) = ( S O , P , S N O , F ) of M is composed by the following discrete sets:
  • S O = { s 0 , s 1 , } R 2 is the set of all closed and oriented polylines on the slicing plane. The set S O includes closed 1-manifolds and saddle points with its adjacent neighborhoods
  • P = { p 0 , p 1 , } X is the 0-manifold set of all local minima/maxima vertices in M that lie on the slicing plane.
  • S N O = { e 0 , e 1 , } E is the set of all non-oriented (and possibly with border) contours on the slicing. S N O includes all degenerate 1D regions of M.
  • F = { f 0 , f 1 , } T is the set of all 2-manifold regions (triangles) in M that lie on the slicing plane.
The different types of level sets f 1 ( c ) on M are defined as follows (see Figure 2):
  • Degenerate 2-manifold region: Let t = ( x i , x j , x k ) T . t F if:
    z ( x i ) = c , z ( x j ) = c , z ( x k ) = c .
  • Degenerate 1D region: Let ( x i , x j ) E , such that z ( x i ) = z ( x j ) = c . ( x i , x j ) S N O is a degenerate 1D region if:
    ( x o p p z ( x i , x j ) c ) ( x o p p z ( x j , x i ) c ) > 0
    where x o p p z ( x i , x j ) is the z-coordinate of the vertex that is opposite to the oriented edge ( x i , x j ) .
  • Degenerate and non-degenerate saddle: Let x i X , z ( x i ) = c . x i S O is a saddle point if:
    | A ( x i ) | = 2 m , m > 1 with A ( x i ) = { t j N X T ( x i ) | t j f 1 ( c ) } ,
    where N X T : X P ( T ) maps each vertex x i to the set of all triangles t j that are incident to it. Therefore, A ( x i ) is the set of all triangles that intersect the slicing plane and | A ( x i ) | is the number of segments in the triangle/plane intersections in such a set.
  • 0-manifold point: Let x i X , z ( x i ) = c . x i P is a local minimum (or maximum) if:
    ( x j N X X ( x i ) , f ( x j ) c < 0 ) ( x j N X X ( x i ) , f ( x j ) c > 0 ) ,
    where N X X : X P ( X ) maps each vertex x i X to the set of all vertices x j X that are adjacent to it.
  • Closed 1-manifold: Let t T , t f 1 ( c ) . The edge ( p 1 , p 2 ) S O if:
    p i = α x j + ( 1 α ) x j , ( x j , x k ) f 1 ( c )
    with 0 α 1 and ( x j , x k ) E being one of the triangle t edges that intersect the plane z ( x ) = c . It is worth noting that p i R 3 not necessarily belongs to the vertex set X.
For the discrete case, the list is defined in reverse order, considering the most degenerate (non-Morse) cases first and the non-degenerate (Morse) cases at the end. The given order defines the priority of the slicing Algorithm when finding weak-Morse degeneracies.
Algorithm 1 presents the slicing algorithm according to the presented classification, as follows: (1) The computation of the degenerate faces is performed in lines 1–6. (2) The computation of degenerate 1D edges is performed in lines 7–15, where x o p p ( x i , x j ) is the vertex that is opposite to the oriented edge ( x i , x j ) . (3) The computation of critical 0-manifold points is performed in lines 16–30, where each vertex is tested as a local minimum (or maximum). (4) Finally, lines 31–40 perform the computation of closed and oriented contours, including degenerate and non-degenerate saddle points. Line 33 checks for triangle/plane intersection, and line 34 computes explicitly such an intersection. Finally, line 35 compares the orientation between the computed edge ( p 0 , p f ) and the current triangle t T , swapping the edge orientation if required at line 36.
The orientation of the closed 1D contours (in R 2 ) is defined such that a counter-clockwise polyline represents an external contour, while a clockwise polyline represents an internal hole.
Algorithm 1 Slice triangular mesh.
Require: M = ( X , T ) , c R
Ensure: S = ( S O , P , S N O , F )
1: for t T do
2:   ( x i , x j , x k ) t
3:  if z ( x i ) = c z ( x j ) = c z ( x k ) = c then
4:   push(F,t)
5:  end if
6: end for
7: for ( x i , x j ) E do
8:  if z ( x i ) = c z ( x j ) = c then
9:    a x o p p ( x i , x j )
10:    b x o p p ( x j , x j )
11:   if ( z ( a ) c ) ( z ( b ) c ) > 0 then
12:    push( S N O , ( x i , x j ) )
13:   end if
14:  end if
15: end for
16: for x i X do
17:  is_min ← TRUE
18:  is_max ← TRUE
19:  for x j N X X ( x i ) do
20:   if z ( x j ) c 0 then
21:    is_max ← FALSE
22:   end if
23:   if z ( x j ) c 0 then
24:    is_min ← FALSE
25:   end if
26:  end for
27:  if is_min ∨ is_max then
28:   push(P, x i )
29:  end if
30: end for
31: for t T do
32:   ( x i , x j , x k ) t
33:  if max ( z ( x i ) , z ( x j ) , z ( x k ) ) c min ( z ( x i ) , z ( x j ) , z ( x k ) ) c then
34:    ( p 0 , p f ) intersection ( t , plane z ( x ) = c )
35:   if ( n X Y ( p 0 , p f ) ) · Proj X Y ( n ( t ) ) < 0 then
36:    swap( p 0 , p f )
37:   end if
38:   push( S O , ( p 0 , p f ) )
39:  end if
40: end for
41: return S = ( S O , P , S N O , F )

4. Results

This section presents graphical results for the resulting slices of different closed 2-manifold meshes. These test datasets have been been generated explicitly to show different weak-Morse degeneracies that usually arise in CAD CAM CAE applications. On the one hand, Section 4.1 presents the slicing results on different weak-Morse datasets. On the other hand, Section 4.2 presents an application case in the context of Additive Manufacturing.

4.1. Weak-Morse Slicing

This section presents the slicing results for different weak-Morse datasets. As already stated above, these simple datasets have been manually designed and generated in order to provoke and illustrate all the different weak-Morse cases that have been already discussed in previous sections. In addition, benchmark datasets have been used to illustrate the application of our implementation. Figure 4 presents the slicing results for the Upright Torus dataset already introduced in Figure 1. In this case, the function f is a strong-Morse one, containing a non-degenerate saddle point on the slicing plane. The resulting slices are the oriented contours S O . Note that despite the self-intersection in Figure 4b, our algorithm correctly computes the orientation of the contour.
Figure 5 shows the Double Torus dataset. This dataset presents a degenerate, non-Morse saddle point ( m = 4 , see Figure 2). Similar to the Upright Torus dataset, the resulting level set is an oriented polyline that self-intersects 2 m 1 times at such saddle point. The orientation of the polyline is always preserved according to the input mesh M orientation.
Figure 6 illustrates some cases where degenerate 1D regions arise. On the one hand, Figure 6a plots a Lying Torus and the planar slice at a non-Morse (degenerate) region. Figure 6b plots the corresponding S N O 1D region. Despite of being closed and non-self intersecting, S N O has no orientation. This fact is consistent with the mesh M, as S N O has no internal or external region. As a contrast, Figure 6c plots the resulting level set computed using a naive strong-Morse approach. The resulting level set is filled to illustrate the fact that a naive approach assumes oriented contours and does not discriminate the possible degeneracies. This filling is relevant since in Additive Manufacturing, the fabricated workpiece would end (incorrectly) with such a cover at the top.
On the other hand, Figure 6d plots a Grid dataset. The resulting level set f 1 ( c ) at the top of the Grid is a non-Manifold 1D region S N O (see Figure 6e). In this case, S N O is not closed (i.e., it has borders), and since it is non-manifold, our slicing algorithm S N O into 1-manifold subset. Again, this 1D contour is non-oriented as there is no external or internal 2D region associated to the contour. In addition, Figure 6f plots the resulting level set computed by the naive strong-Morse approach. Again, the result is filled illustrating the orientated polyline produced by the algorithm and 3D printing of such a workpiece would end with a top cover.
Figure 7 plots a Cylinder dataset with a slicing occuring at the Cylinder top. The resulting level set is a 2-manifold region F composed by the set of all mesh triangles that intersect the slicing plane. A contour can be extracted from F by computing all of its boundary edges and its orientation can be computed from the information of the triangles incident to such boundary (as illustrated in Figure 7b).
Figure 8 presents the Internal Torus dataset. This dataset is generated by a box with a torus hole in the inside. The torus hole naturally produces a saddle point of an internal (oriented) contour hole S O , which is correctly computed by our slicing algorithm (see Figure 8a). Furthermore, our algorithm is capable of differentiating internal holes from external contours in 2-manifold regions F, as illustrated in Figure 8b.
As already mentioned in the previous section, the current weak-Morse classifications works locally. As a consequence, it is not uncommon (specially in CAD datasets) to find multiple weak-Morse degeneracies of different types on the same level set f 1 ( c ) . Furthermore, these degeneracies can be connected. As an example, the Peg Cube dataset (Figure 9a) presents an oriented contour S O extracted from a region with no critical points, connected to a non-oriented contour S N O extracted from a degenerate 1D critical region, both from the same connected level set (see Figure 9b).
Figure 9c plots the Chamfered Cylinder dataset. In this case, the level set contains an oriented contour S O from a non-degenerate region and a face F extracted from a degenerate 2-manifold region (see Figure 9d. It is worth nothing that both contours S O and F share a polyline section, each with its own orientation (which is consistent with the orientation of its owner polyline). This guarantees that both contours are closed and oriented consistently, according to the orientation of the input mesh M.
Finally, Figure 9e presents the Platform Grid dataset. The level set f 1 ( c ) at the top of this dataset contains both a non-oriented polyline S N O from a degenerate 1D region, connected to a 2-manifold region F (with its respective oriented boundary contour F ). The level set results are presented in Figure 9f.
All of these cases are easily managed by our algorithm due to the data structure used f 1 ( c ) = ( S O , P , S N O , F ) , which handles each type of Morse/non-Morse case separately.

4.2. Applications in Additive Manufacturing

As already illustrated in the previous subsection, our level set computation algorithm allows to easily back track the normals of M from each level set f 1 ( c ) . Using this information, it is possible to produce a filling pattern for f 1 ( M ) . This subsection applies the presented mesh slicing algorithm to real-life CAD datasets. Afterwards, a fill pattern is computed for each level set f 1 ( c ) using a line-polygon intersection algorithm [34].
Figure 10 presents the resulting mesh slices and their corresponding fill patterns. CAD workpiece. The datasets have been extracted from the National Design Repository [35]. The resulting filling patterns can be used to produce 3D printing routines that accurately fabricate the original CAD models, even in the presence of non-Morse level sets. Future work aims to explore this topic in detail.

5. Conclusions

This manuscript develops a mathematical and algorithmic classification of the level sets of closed 2-manifold triangular meshes. These level sets are classified in terms of weak-Morse functions, where Morse and non-Morse degeneracies arise. This classification relies on the position of vertices, edges and triangles in the neighborhood outside of the slicing plane. The test results show that the presence of such degeneracies on the slicing function f results on level sets that are not only oriented, 1-manifold closed contours, but also self-intersecting (non-manifold) contours, 0-manifold points, non-oriented contours, and even 2-manifold level sets. Our algorithm correctly computes and classifies each resulting contour, and produces its orientation (if it exists) in concordance with the input mesh M. Furthermore, our algorithm correctly handles different degeneracies that arise simultaneously at the same level set. Finally, the presented slicing algorithm enables consistent line-polygon operations (even in weak-Morse cases), allowing the computation of filling patterns that are relevant in the context of Additive Manufacturing.
Future work addresses—(a) A theoretical proof of the completeness of the proposed weak-Morse classification and the slicing algorithm. Such a proof would guarantee the correctness of every (Morse and non-Morse) level set for any given 2-manifold model. (b) The implementation of the interval tree data structure [16,17] to speed-up the computation times. Such a speed-up could prove valuable for large CAD datasets (i.e., with high triangle count). (c) The integration of the proposed slicing algorithm into an Additive Manufacturing framework, enabling the fabrication of complex models with problematic non-Morse degeneracies.

Author Contributions

Conceptualization, D.M.-P., O.R.-S. and C.C.; Investigation, D.M.-P. and O.R.-S.; Methodology, D.M.-P., O.R.-S., C.C., A.M. and J.P.; Software, D.M.-P.; Supervision, O.R.-S., C.C., A.M. and J.P.; Visualization, D.M.-P., O.R.-S., A.M. and J.P.; Writing–original draft, D.M.-P., O.R.-S., C.C., A.M. and J.P. All authors have read and agreed to the published version of the manuscript.

Funding

This research received no external funding.

Conflicts of Interest

The authors declare no conflict of interest.

Abbreviations

The following abbreviations are used in this manuscript:
M A closed 2-manifold embedded in R 3 .
fA scalar function f : M R . In this manuscript, f ( x ) = z ( x ) is the height function, named also as the slicing function.
f 1 Level sets of the function f. f 1 : R P ( M ) .
c R Scalar that defines the slicing plane. f 1 ( c ) is the slicing plane at z ( x ) = c .
T x M For any x M , T x M is the tangent plane ( e 1 , e 2 ) of M at x.
M Gradient operator defined on the surface (tangent planes) of M . M = T x M .
H M 2 × 2 Hessian matrix defined on the surface (tangent planes) of M . H M = H T x M .
strong-MorseA strong-Morse (or simply Morse) function f, is a function in which all of its critical points are non-degenerate. A critical point x M is degenerate if det ( H M f ( x ) ) = 0 .
weak-MorseDenomination used exclusively for the purpose of this manuscript. f is weak-Morse if there exists a finite set of values C R (each corresponding to a cross cut of M ) where f ( f 1 ( C ) ) is degenerate (i.e., non-Morse). f satisfies Morse criteria elsewhere.
n ( x ) Vector normal to the tangent plane T x M . n R 3 .
n X Y ( x ) Projection of the vector n ( x ) onto the slicing plane. n X Y ( x ) R 2 .
N ε ( x ) Small neighborhood in M around the point x M . N ε ( x ) = { y M | x y < ε }
M2-manifold triangular mesh M = ( X , T ) , which is a piecewise linear discretization of M . X = { x 0 , x 2 , , x n } M is the set of mesh vertices (geometry), and T = t 0 , t 1 , t m is the set of mesh triangles (topology).
ESet of bidirectional edges that belong to the graph of the mesh M. ( x i , x j ) E if for any k, ( x i , x j , x k ) T .
N X X ( x i ) Set of all vertices x j X that are adjacent to the vertex x i X . N X X : X P ( X ) .
N X T ( x i ) Set of all triangles t j T that are incident to the vertex x i X . N X T : X P ( T ) .
f Slicing function defined on the triangular mesh M. f = { z ( x 0 ) , z ( x 1 ) , , z ( x n ) } .
S O Set of all oriented and closed polylines in f 1 ( c ) for a given slice c of M. S O = { s 0 , s 1 , } R 2 .
P0-manifold set of all local minima/maxima vertices of M that lie on the slicing plane. P = { p 0 , p 1 , } X .
S N O Set of all non-oriented compact (i.e., possibly with borders) polylines in f 1 ( c ) for a given slice c of M. S O = { e 0 , e 1 , } E .
FSet of all 2-manifold regions (triangles) in M that lie on the slicing plane. F = { f 0 , f 1 , } T .

References

  1. Ding, D.; Pan, Z.; Cuiuri, D.; Li, H.; van Duin, S. Advanced Design for Additive Manufacturing: 3D Slicing and 2D Path Planning. In New Trends in 3D Printing; Shishkovsky, I.V., Ed.; IntechOpen: Rijeka, Croatia, 2016; Chapter 1. [Google Scholar] [CrossRef] [Green Version]
  2. Zhao, D.; Guo, W. Shape and Performance Controlled Advanced Design for Additive Manufacturing: A Review of Slicing and Path Planning. J. Manuf. Sci. Eng. 2019, 142, 010801. [Google Scholar] [CrossRef]
  3. Mejia-Parra, D.; Sánchez, J.R.; Ruiz-Salguero, O.; Alonso, M.; Izaguirre, A.; Gil, E.; Palomar, J.; Posada, J. In-Line Dimensional Inspection of Warm-Die Forged Revolution Workpieces Using 3D Mesh Reconstruction. Appl. Sci. 2019, 9, 1069. [Google Scholar] [CrossRef] [Green Version]
  4. Sánchez, J.R.; Segura, Á.; Barandiaran, I. Fast and accurate mesh registration applied to in-line dimensional inspection processes. Int. J. Interact. Des. Manuf. 2018, 12, 877–887. [Google Scholar] [CrossRef]
  5. Steuben, J.C.; Iliopoulos, A.P.; Michopoulos, J.G. Implicit slicing for functionally tailored additive manufacturing. Comput. Aided Des. 2016, 77, 107–119. [Google Scholar] [CrossRef]
  6. Jin, Y.; He, Y.; Fu, G.; Zhang, A.; Du, J. A non-retraction path planning approach for extrusion-based additive manufacturing. Robot. Comput. Integr. Manuf. 2017, 48, 132–144. [Google Scholar] [CrossRef]
  7. Jin, Y.; Du, J.; He, Y. Optimization of process planning for reducing material consumption in additive manufacturing. J. Manuf. Syst. 2017, 44, 65–78. [Google Scholar] [CrossRef]
  8. Nilsiam, Y.; Sanders, P.; Pearce, J.M. Slicer and process improvements for open-source GMAW-based metal 3-D printing. Addit. Manuf. 2017, 18, 110–120. [Google Scholar] [CrossRef] [Green Version]
  9. Budinoff, H.; McMains, S. Prediction and visualization of achievable orientation tolerances for additive manufacturing. In Proceedings of the 15th CIRP Conference on Computer Aided Tolerancing, CIRP CAT, Milan, Italy, 11–13 June 2018. [Google Scholar] [CrossRef]
  10. Campocasso, S.; Chalvin, M.; Reichler, A.K.; Gerbers, R.; Droder, K.; Hugel, V.; Dietrich, F. A framework for future CAM software dedicated to additive manufacturing by multi-axis deposition. In Proceedings of the 6th CIRP Global Web Conference—Envisaging the Future Manufacturing, Design, Technologies and Systems in Innovation Era (CIRPe2018), 23–25 October 2018; Available online: http://www.cirpe2018.org/ (accessed on 17 September 2020). [CrossRef]
  11. Michel, F.; Lockett, H.; Ding, J.; Martina, F.; Marinelli, G.; Williams, S. A modular path planning solution for Wire + Arc Additive Manufacturing. Robot. Comput. Integr. Manuf. 2019, 60, 1–11. [Google Scholar] [CrossRef]
  12. Roschli, A.; Gaul, K.T.; Boulger, A.M.; Post, B.K.; Chesser, P.C.; Love, L.J.; Blue, F.; Borish, M. Designing for Big Area Additive Manufacturing. Addit. Manuf. 2019, 25, 275–285. [Google Scholar] [CrossRef]
  13. Ma, W.; But, W.C.; He, P. NURBS-based adaptive slicing for efficient rapid prototyping. Comput. Aided Des. 2004, 36, 1309–1325. [Google Scholar] [CrossRef]
  14. Alexa, M.; Hildebrand, K.; Lefebvre, S. Optimal Discrete Slicing. ACM Trans. Graph. 2017, 36. [Google Scholar] [CrossRef] [Green Version]
  15. Mao, H.; Kwok, T.H.; Chen, Y.; Wang, C.C. Adaptive slicing based on efficient profile analysis. Comput. Aided Des. 2019, 107, 89–101. [Google Scholar] [CrossRef]
  16. Gregori, R.M.M.H.; Volpato, N.; Minetto, R.; Silva, M.V.G.D. Slicing Triangle Meshes: An Asymptotically Optimal Algorithm. In Proceedings of the 14th International Conference on Computational Science and Its Applications, Guimaraes, Portugal, 30 June–3 July 2014; pp. 252–255. [Google Scholar]
  17. Minetto, R.; Volpato, N.; Stolfi, J.; Gregori, R.M.; da Silva, M.V. An optimal algorithm for 3D triangle mesh slicing. Comput. Aided Des. 2017, 92, 1–10. [Google Scholar] [CrossRef]
  18. Xu, J.; Hou, W.; Sun, Y.; Lee, Y.S. PLSP based layered contour generation from point cloud for additive manufacturing. Robot. Comput. Integr. Manuf. 2018, 49, 1–12. [Google Scholar] [CrossRef]
  19. Gohari, H.; Barari, A.; Kishawy, H. Using Multistep Methods in Slicing 2 1/2 Dimensional Parametric Surfaces for Additive Manufacturing Applications. In Proceedings of the 2th IFAC Workshop on Intelligent Manufacturing Systems IMS 2016, Austin, TX, USA, 5–7 December 2016. [Google Scholar] [CrossRef]
  20. Song, Y.; Yang, Z.; Liu, Y.; Deng, J. Function representation based slicer for 3D printing. Comput. Aided Geom. Des. 2018, 62, 276–293. [Google Scholar] [CrossRef]
  21. Feng, J.; Fu, J.; Lin, Z.; Shang, C.; Niu, X. Layered infill area generation from triply periodic minimal surfaces for additive manufacturing. Comput. Aided Des. 2019, 107, 50–63. [Google Scholar] [CrossRef]
  22. Luu, T.H.; Altenhofen, C.; Ewald, T.; Stork, A.; Fellner, D. Efficient slicing of Catmull-Clark solids for 3D printed objects with functionally graded material. Comput. Graph. 2019, 82, 295–303. [Google Scholar] [CrossRef]
  23. Messner, M.C. A fast, efficient direct slicing method for slender member structures. Addit. Manuf. 2017, 18, 213–220. [Google Scholar] [CrossRef]
  24. Hu, J. Study on STL-Based Slicing Process for 3D Printing. In Proceedings of the 28th Annual International Solid Freeform Fabrication Symposium—An Additive Manufacturing Conference, Austin, TX, USA, 7–9 August 2017; pp. 885–895. [Google Scholar]
  25. Hildebrand, K.; Bickel, B.; Alexa, M. Orthogonal slicing for additive manufacturing. Comput. Graph. 2013, 37, 669–675. [Google Scholar] [CrossRef]
  26. Murtezaoglu, Y.; Plakhotnik, D.; Stautner, M.; Vaneker, T.; van Houten, F.J. Geometry-Based Process Planning for Multi-Axis Support-Free Additive Manufacturing. In Proceedings of the 6th CIRP Global Web Conference—Envisaging the Future Manufacturing, Design, Technologies and Systems in Innovation Era (CIRPe 2018), 23–25 October 2018; Available online: http://www.cirpe2018.org/ (accessed on 17 September 2020). [CrossRef]
  27. Ding, D.; Pan, Z.; Cuiuri, D.; Li, H.; Larkin, N.; van Duin, S. Automatic multi-direction slicing algorithms for wire based additive manufacturing. Robot. Comput. Integr. Manuf. 2016, 37, 139–150. [Google Scholar] [CrossRef]
  28. Ezair, B.; Fuhrmann, S.; Elber, G. Volumetric covering print-paths for additive manufacturing of 3D models. Comput. Aided Des. 2018, 100, 1–13. [Google Scholar] [CrossRef]
  29. Jin, Y.; Du, J.; He, Y.; Fu, G. Modeling and process planning for curved layer fused deposition. Int. J. Adv. Manuf. Technol. 2017, 91, 273–285. [Google Scholar] [CrossRef]
  30. Zhao, D.; Guo, W. Mixed-layer adaptive slicing for robotic Additive Manufacturing (AM) based on decomposing and regrouping. J. Intell. Manuf. 2019, 31, 985–1002. [Google Scholar] [CrossRef]
  31. Banchoff, T.F. Critical Points and Curvature for Embedded Polyhedral Surfaces. Am. Math. Mon. 1970, 77, 475–485. [Google Scholar] [CrossRef]
  32. Forman, R. Morse Theory for Cell Complexes. Adv. Math. 1998, 134, 90–145. [Google Scholar] [CrossRef] [Green Version]
  33. Fugacci, U.; Landi, C.; Varli, H. Critical sets of PL and discrete Morse theory: A correspondence. Comput. Graph. 2020, 90, 43–50. [Google Scholar] [CrossRef]
  34. Vatti, B.R. A Generic Solution to Polygon Clipping. Commun. ACM 1992, 35, 56–63. [Google Scholar] [CrossRef]
  35. Regli, W.C.; Foster, C.; Hayes, E.; Ip, C.Y.; McWherter, D.; Peabody, M.; Shapirsteyn, Y.; Zaychik, V. National Design Repository: A Status Report. In Proceedings of the International Joint Conferences on Artificial Intelligence (IJCAI) and AAAI/SIGMAN Workshop on AI in Manufacturing Systems, Seattle, WA, USA, 4–10 August 2001. [Google Scholar]
Figure 1. Type of level sets f 1 for a Morse function f. f is a slicing function defined on a closed 2-manifold M R 3 .
Figure 1. Type of level sets f 1 for a Morse function f. f is a slicing function defined on a closed 2-manifold M R 3 .
Mathematics 08 01624 g001
Figure 2. Type of level sets f 1 for a weak-Morse function f. Level sets computed on a discrete 2-manifold M = ( X , T ) .
Figure 2. Type of level sets f 1 for a weak-Morse function f. Level sets computed on a discrete 2-manifold M = ( X , T ) .
Mathematics 08 01624 g002
Figure 3. The surface z ( x , y ) = x 5 cos ( 1 x ) . An example of a non-Morse function that is not a weak-Morse one in a bounded region S R 3 . (a) The function z ( x ) = x 5 cos ( 1 x ) has infinite critical points in the interval ( a , a ) ; (b) Surface z ( x , y ) = x 5 cos ( 1 x ) . The Hessian of z ( x , y ) is singular everywhere in S.
Figure 3. The surface z ( x , y ) = x 5 cos ( 1 x ) . An example of a non-Morse function that is not a weak-Morse one in a bounded region S R 3 . (a) The function z ( x ) = x 5 cos ( 1 x ) has infinite critical points in the interval ( a , a ) ; (b) Surface z ( x , y ) = x 5 cos ( 1 x ) . The Hessian of z ( x , y ) is singular everywhere in S.
Mathematics 08 01624 g003
Figure 4. Upright Torus dataset (Figure 1). Morse level sets S O computed with our slicing algorithm. (a) Oriented contours with no critical points; (b) Oriented contour with non-degenerate saddle point.
Figure 4. Upright Torus dataset (Figure 1). Morse level sets S O computed with our slicing algorithm. (a) Oriented contours with no critical points; (b) Oriented contour with non-degenerate saddle point.
Mathematics 08 01624 g004
Figure 5. Double Torus dataset. Computation of non-Morse 1D level set S O . (a) Double Torus dataset; (b) Oriented contour with degenerate saddle point.
Figure 5. Double Torus dataset. Computation of non-Morse 1D level set S O . (a) Double Torus dataset; (b) Oriented contour with degenerate saddle point.
Mathematics 08 01624 g005
Figure 6. First column: Degenerate datasets Lying Torus and Grid used as input. Second column: correct level sets computed by our algorithm. Third column: Incorrect results produced by naive Morse slicer. (a) Lying Torus dataset; (b) Correct uppermost level set of Lying Tours, being a 0-width annulus S N O ; (c) Incorrect uppermost level set of Lying Torus, being a full disk; (d) Correct uppermost level set of Grid, being a set S N O of non-oriented polylines with borders; (e) Grid dataset; (f) Incorrect uppermost level set of Grid.
Figure 6. First column: Degenerate datasets Lying Torus and Grid used as input. Second column: correct level sets computed by our algorithm. Third column: Incorrect results produced by naive Morse slicer. (a) Lying Torus dataset; (b) Correct uppermost level set of Lying Tours, being a 0-width annulus S N O ; (c) Incorrect uppermost level set of Lying Torus, being a full disk; (d) Correct uppermost level set of Grid, being a set S N O of non-oriented polylines with borders; (e) Grid dataset; (f) Incorrect uppermost level set of Grid.
Mathematics 08 01624 g006
Figure 7. Cylinder dataset. Computation of a 2-manifold level set F and its oriented boundary contour f 1 ( c ) . (a) Cylinder dataset; (b) 2-manifold region F and its oriented contour f 1 ( c ) .
Figure 7. Cylinder dataset. Computation of a 2-manifold level set F and its oriented boundary contour f 1 ( c ) . (a) Cylinder dataset; (b) 2-manifold region F and its oriented contour f 1 ( c ) .
Mathematics 08 01624 g007
Figure 8. Internal Torus dataset. Our algorithm correctly handles contours, faces with holes, and internal saddle points. (a) Internal Torus dataset; (b) Oriented contour S O for an internal hole with a saddle point; (c) 2-manifold level set F with holes.
Figure 8. Internal Torus dataset. Our algorithm correctly handles contours, faces with holes, and internal saddle points. (a) Internal Torus dataset; (b) Oriented contour S O for an internal hole with a saddle point; (c) 2-manifold level set F with holes.
Mathematics 08 01624 g008
Figure 9. Level set f 1 results for: (a,b), an oriented contour S O (blue) connected to a non-oriented contour S N O (red), (c,d) an oriented contour S O connected to a 2-manifold region F and, (e,f) a non-oriented S N O contour connected to a 2-manifold region F.
Figure 9. Level set f 1 results for: (a,b), an oriented contour S O (blue) connected to a non-oriented contour S N O (red), (c,d) an oriented contour S O connected to a 2-manifold region F and, (e,f) a non-oriented S N O contour connected to a 2-manifold region F.
Mathematics 08 01624 g009aMathematics 08 01624 g009b
Figure 10. Mesh slicing of benchmark weak-Morse CAD datasets. Our algorithm computes the level sets (slices). As a test for our level sets, they are then fed to another algorithm (not part of this manuscript) which correctly generates the tool paths for Additive Manufacturing. Datasets from the National Design Repository [35].
Figure 10. Mesh slicing of benchmark weak-Morse CAD datasets. Our algorithm computes the level sets (slices). As a test for our level sets, they are then fed to another algorithm (not part of this manuscript) which correctly generates the tool paths for Additive Manufacturing. Datasets from the National Design Repository [35].
Mathematics 08 01624 g010

Share and Cite

MDPI and ACS Style

Mejia-Parra, D.; Ruiz-Salguero, O.; Cadavid, C.; Moreno, A.; Posada, J. Level Sets of Weak-Morse Functions for Triangular Mesh Slicing. Mathematics 2020, 8, 1624. https://doi.org/10.3390/math8091624

AMA Style

Mejia-Parra D, Ruiz-Salguero O, Cadavid C, Moreno A, Posada J. Level Sets of Weak-Morse Functions for Triangular Mesh Slicing. Mathematics. 2020; 8(9):1624. https://doi.org/10.3390/math8091624

Chicago/Turabian Style

Mejia-Parra, Daniel, Oscar Ruiz-Salguero, Carlos Cadavid, Aitor Moreno, and Jorge Posada. 2020. "Level Sets of Weak-Morse Functions for Triangular Mesh Slicing" Mathematics 8, no. 9: 1624. https://doi.org/10.3390/math8091624

APA Style

Mejia-Parra, D., Ruiz-Salguero, O., Cadavid, C., Moreno, A., & Posada, J. (2020). Level Sets of Weak-Morse Functions for Triangular Mesh Slicing. Mathematics, 8(9), 1624. https://doi.org/10.3390/math8091624

Note that from the first issue of 2016, this journal uses article numbers instead of page numbers. See further details here.

Article Metrics

Back to TopTop