^{1}

^{*}

^{2}

^{1}

^{1}

This paper presents a new scheme of flaw searching in surface modeling based on Euler Characteristic. This scheme can be applied to surface construction or reconstruction in computer. It is referred to as Euler Accompanying Test (EAT) algorithm in this paper. Two propositions in algebraic topology are presented, which are the foundation of the EAT algorithm. As the modeling is the first step for rendering in the animation and visualization, or computer-aided design (CAD) in related applications, the flaws can bring some serious problems in the final image or product, such as an artificial sense in animation rendering or a mistaken product in industry. To verify the EAT progressive procedure, a three-dimensional (3D) stamp model is constructed. The modeling process is accompanied by the EAT procedure. The EAT scheme is verified as the flaws in the stamp model are found and modified.

Along with the development of surface construction and reconstruction, many researchers have realized that mesh models may be constructed initially with some flaws because of the complex geometrical and topological structures of surfaces, and the limitations of scanning technologies and modeling schemes [

Since modeling is the first step for rendering in the animation and visualization [

Another example is a case in fashion design, in which two adjoining cloth patches are not defined to fit together mistakenly. This problem may result in the problem that the edges between the two adjoining patches will not be stitched together in the following process.

The third example is that during interacting with computer, a viewer is interested in a mesh model and tries to take a close look at some parts of the model where there is a minute hole. The hole may be invisible when it is occluded or at a low resolution, but it may be seen when it is zoomed in and turned to be illuminated. The third example will be displayed in Section 4 of this paper.

For the above reasons, this paper presents a new scheme to globally search a mesh model for and locate the flaws. This new scheme is based on Euler characteristic, and named Euler Accompanying Test (shortened as EAT).

To give the theory foundation of algebraic topology, two propositions are presented for the EAT scheme in this paper. They can bridge the gap between the surface construction in computer and the theory of algebraic topology.

With the trivial amount of computing, the EAT scheme can assist in repairing and generating a topologically-correct model that has the same algebraic topological structure as that of its fitting target surface.

In this research, we also construct a new model of 3D PAMA stamp shown in

The first reason is that it is more efficient and tractable to search for, locate and correct a flaw during modeling than post-processing after the whole mesh model has been constructed. It is also why the new scheme is named Euler

Accompanying Test (EAT), which means the modeling process accompanied by flaw-locating with the EAT. We will detail it in Section 3. The second reason is that this stamp mesh model consists of not only triangle facets but also polygons with more than three edges. The popular 3D models of Stanford Bunny, Skeleton Hand, and Happy Buddha [

The rest of this paper is arranged as follows: Section 2 introduces related studies; Section 3 details the EAT algorithm and the related propositions; Section 4 presents the searching cases of EAT on the PAMA stamp model; Section 5 is for the final conclusions.

In studies of surface construction and reconstruction in animation [

Among the studies, [

The composite surfaces are usually polygon patches glued together [

The work of [

Few pentagons, hexagons and others are found in surface construction and reconstruction [

Because of the complex geometrical and topological structures of a target surface, the limitations of scanning technologies, and the deficiency of a modeling scheme, a composite surface may be constructed with tiny holes or gaps that the target surface does not have [

The papers [

With its complex geometrical and topological structures, a great number of the 3D data of points on the target surface are required to input for modeling. If the 3D data are acquired by laser-range scanning, they are unstructured point clouds and missing some information by under-sampling sometimes [

On the other hand, to make a composite surface hold fine local features, researchers of mesh model may add more sub-patches to some part of the composite surface with local refinement [

In [

In [

In this paper, the presented EAT algorithm is applied to testing the topological structure of a mesh model gradually and globally to find all the flaws of the model and to modify them before passing a verified model to the succeeding process. Even better, it can be used to detect new defects of the model after local refinement.

A complicated surface model usually has a great deal of geometric details, and thus may contain a large number of vertices, edges and facets. The EAT has to scan and traverse all the vertices, edges and facets of the model to compute the Euler characteristic of the model. And then it can be compared with the Euler characteristic of its target surface. The larger number of edges and facets the model contains, the more time the EAT computing requires.

In order that the code of the EAT is not left in the modeling program after verified, we adopt the strategy that a copy of the modeling program is prepared for flaw-searching, which is called the modeling companion, shown in

Each time a flaw is found in the model companion, the modeling companion is revised, and the modeling program should be revised and updated as well.

Since the EAT algorithm code is running only in the model companion, the modeling program is without the EAT code in itself and thus the verified modeling program will not be slowed down by the EAT at run time.

After the model has been verified completely with the EAT scheme and all the existing flaws of model have been corrected, the verified modeling program is assembled into the rendering pipeline, shown in

After the related modeling method has been validated, the method is integrated into CAD environments in industry or the surface reconstruction systems of animation, visualization and others, shown in

Since fault-testing with the EAT is at the modeling stage, we will focus on the layer at the top of

The EAT algorithm is the core of the EAT scheme. It is based on the following Definition 1, Proposition 1 and Proposition 2.

Definition 1 The Euler characteristic of a triangulated surface M is

χ ( M ) = n v − n e + n f , (1)

where n v is the total number of vertices of M, n e is the total number of edges of M, and n f is the total number of triangle facets of M [

It is obvious that the invariant of Euler characteristic is independent of the meshing of a surface. It can be shown in

With the algebraic topologies of surfaces [

Proposition 1 A compact surface has a numerical invariant called the Euler characteristic.

Proposition 2 Suppose that there are two compact surfaces, S 1 and S 2 . If their Euler characteristics are not identical, the topological structures of S 1 and

S 2 are not consistent with each other.

As the rigorous proofs of Proposition 1 and Proposition 2 are lengthy and require the homotopy theory, we do not give the proofs of Proposition 1 and Proposition 2, and readers can refer to the homotopy theory [

Before the exploration of EAT algorithm, we have to define three sets of vertices, edges and facets of a tested model, which most of modeling methods in surface construction and reconstruction apply to surface modeling. Here we re-organize them in a three-layer data structure, and register every vertex, edge and facet in Vertex list, Edge list and Facet list, respectively, in order to compute the Euler characteristic of the model at different modeling stages.

In surface modeling, the input is a set of points, which may be sampled on a target surface by sensors or scanned the outward surface of an object by a scanner. The set of points can be organized as the set of original vertices, V 0 . Each element of V 0 has three fields ( x i , y i , z i ) , which are three coordinates in an orthogonal coordinate system, respectively.

According to the spatial relationships of vertices and the order of the facets’ being drawn, we construct a three-layer data structure for the modeling companion accompanied with the EAT.

The data structure is shown in

container, which consists of three parts, these being Facet list F g , Edge list E g , and Vertex list V g .

· F g represents the Facet list. It is used to add Facet item to it when a new facet is registered.

· E g represents Edge list. It is used to add Edge item to it when a new edge is registered.

· V g represents Vertex list. It is used to add Vertex item to it when a new vertex is registered.

F g , E g , and V g are at the middle abstract layer of the three-layer data structure. At the lowest layer are three types of items: Facet item f ( f I D , f v L i s t , f c ) , Edge item e ( e I D , b v P o i n t e r , e v P o i n t e r , e c ) , and Vertex item v ( v I D , x C o o r d , y C o o r d , z C o o r d , v c ) .

· f ( f I D , f v L i s t , f c ) is Facet item, which consists of three fields: identification of facet f I D , facet vertex list f v L i s t , and facet counter f c . Each distinct facet has a unique f I D . Facet vertex list f v L i s t registers the vertex sequence of the facet item in the order of vertices’ being drawn. Facet counter f c is used to count the times of being drawn of the facet.

· e ( e I D , b v P o i n t e r , e v P o i n t e r , e c ) is Edge item, which is composed of four fields: identification of edge e I D , a pointer to the beginning vertex b v P o i n t e r , a pointer to the end vertex e v P o i n t e r , and edge counter e c . Each distinct edge has a unique e I D . Each edge is connected to two vertices: the beginning vertex to which is pointed by the pointer of b v P o i n t e r , and the end vertex towards which is pointed by the pointer of e v P o i n t e r . The number of facets connected to the edge is counted by the counter of e c during modeling.

· v ( v I D , x C o o r d , y C o o r d , z C o o r d , v c ) is Vertex item with five fields: identification of vertex v I D , X coordinate x C o o r d , Y coordinate y C o o r d , Z coordinate z C o o r d , and vertex counter v c . Every individual vertex has a unique v I D and three coordinate values ( x C o o r d , y C o o r d , z C o o r d ) in the modeling space. The number of edges connected to the vertex is counted by the counter of v c during modeling.

The EAT algorithm includes two different function parts. One function part is named the EAT testing algorithm (EAT-TA), shown in

The other function part is called the EAT statistic algorithm (EAT-SA), also shown in

1) EAT Testing Algorithm (EAT-TA)

To do exactly counting of the numbers of facets, edges and vertices of a tested surface model, the EAT-TA has to scan and traverse the model. As the modeling in surface construction and reconstruction is a dynamic and progressive process, the EAT-TA can take advantage of this process through each facet modeling accompanied by the EAT testing.

During a facet modeling, some vertices and edges may have not been registered while other vertices and edges may have been registered in the previous facet modeling. At this moment, the vertices and edges that have not been registered are referred to as new vertices, v n e w , and new edges, e n e w , respectively, which have not been added to Vertex list and Edge list. The vertices and edges that have been registered are called old vertices, v o l d , and old edges, e o l d , which already exist in Vertex list and Edge list, respectively, shown in

That is, a new vertex or new edge has to be registered first and then their counters increment. For an old vertex or old edge, it is not registered again, but its counter increments.

2) EAT Statistic Algorithm (EAT-SA)

The EAT-SA is for statistic computing of the numbers of vertices, edges, and facets.

The EAT-SA can be put at the end of the modeling companion for the fault-detecting of the whole model. It can be also inserted at any intermediate site in the modeling companion. In this paper, these intermediate sites are called test points.

In fact, it is more effective to set a test point at a site where we want to detect whether or not the modeling before this site holds any defect.

A intermediate test point can help search for and locate the defects in the

partial modeling just before this test point and correct them in the model companion and in the modeling program as well, shown in

When considering that there are numerous facets in a complicated surface model, there may exist a large number of defects in the whole unverified model [

As known before, a surface modeling is a progressive process, and the EAT-SA can be done at different stages as well. It means that it can be used to test an unfinished model in which some facets have been constructed and others have not been.

We can set a test point and make an EAT-SA calling just after the drawing of the unfinished model. The EAT algorithm can help check whether or not the partial model has the Euler characteristic equal to that of its corresponding part of the target surface. If yes, the partial model has been verified. If not, the EAT-TA can locate the faults that are indicated to correct.

After the previous partial model has been corrected and verified, the modeling is resumed. We call the test point that has just been verified the last verified point.

For newly modeling, a new test point can be set at a proper distance after the last verified point, and a new EAT-SA calling is inserted at this new test point. We call this new point the current test point.

As the facets before the last verified point have been verified without faults, new faults detected by the EAT-SA at the current test point exist in the facets between the last verified point and the current test point. For the model companion, these newly-detected facets are the new facets items that have been just added to Facet list. In this way, it is easy to locate the new faults.

Accompanied by the progressive EAT procedure, the newly modeling is always constructed on the foundation of the verified partial model.

If the results of EAT-SA at the current test point show that the Euler characteristic of the partial model is not identical to that of the corresponding part of the target surface, we have to know which facet modeling may cause the problem. In this situation, we can set 1 to the argument of outputting the information of vertex items and edge items of facets in the newly modeling after the last verified point, and set 0 to the arguments of the facet items before the last verified point. The setting of the arguments has been indicated in

At the modeling end of the target surface, we put the final EAT-SA at the end of model companion. The resulting numbers of total facets, edges and vertices of the model, and its Euler characteristic are outputted and displayed on the computer screen. We can compare the outputted Euler characteristic to that of the target surface. If they are not equal to each other, try to find the problem locations in the newly modeling after the last verified point and correct the related facets in the model companion and the modeling program as well. And perform the EAT algorithm again until all the faults are corrected. If two Euler characteristics are identical, the modeling has been verified. And the model can be used to represent the target surface upon the Euler characteristic invariant according to Proposition 1 and Proposition 2.

In the next section, some EAT applications will be presented, which can illustrate the progressive EAT procedure clearly.

In this section, the EAT algorithm is applied to test the stamp model, shown in

In this section, we present a partial stamp model that has a tiny triangle without filling. The triangle is so small that is almost invisible.

In this case, the modeling before the last verified point has been verified, shown in

At this time, we set a new current test point and test the part between the last verified point and the current test point.

After the image with the invisible empty triangle in

Let us modify the defect by filling in the empty triangle and test the model again. The results of this new test are shown in

The top second, third and fourth rows of

The bottom four rows of

In this section, we present the second case with a quad that was ignored before and is tested by EAT.

The modeling before the last verified point has been verified, shown in

After the last verified point, some facets are added to the modeling. A new current test point is set and the EAT is executed.

Let us take a closer look at the newly-added facets, shown in

Next, we modify the defect by filling in the empty quad and test the model again. The results of this test are shown in

three edges.

The top second, third, fourth and fifth rows of

The bottom four rows of

facets is 1826. The Euler characteristic is −1, which is the same as that of the corresponding compact surface with two inside holes, −1. This partial stamp model is verified at this stage.

In this section, we present the third case with a fault that is counter-intuitive and tested by EAT.

In this case, we still use the partial model stage in

In

In the geometrical sense, the pentagon bordered with five edges ({6891, 2650}, {2650, 2567}, {2567, 2566}, {2566, 6874}, and {6874, 6891}) is the same as the quad bordered with four edges ({6891, 2650}, {2650, 2567}, {2567, 6874}, and {6874, 6891}). In the topologic sense, they are, however, different. The former facet has five vertices, five edges and one facet; the latter facet consists of four vertices, four edges and one facet. And the edge of {2567, 6874}, which is the yellow one in

{2566, 6874}.

For one edge, {2567, 6874}, the results of the EAT are shown in

For the modeling of the neighborhood of this problem facet, two edges, {2567, 2566} and {2566, 6874}, have been added to Edge list, E_{g}. In the topologic sense, it means that there is a crack between the new Edge {2567, 6874} and two old Edges, {2567, 2566} and {2566, 6874}. That is, this model is corresponding to a compact surface with three inside holes.

We modify this fault by dividing Edge {2567, 6874} into two Edges, {2567, 2566} and {2566, 6874}, and test it with the EAT algorithm again. The results are shown in

4053, and three new edge items of eIDs 4054, 4055, and 4056. It means one of new edge items, the edge item of eID 4056 (that is Edge {2567, 6874}) does not meet with the old ones, the edge items of eIDs 3933 and 3935 (Edges {2567, 2566} and {2566, 6874}). There is a crack between them.

In

In Section 4.4, we will present the stamp model companion accompanied by the progressive EAT procedure at several steps until the whole model construction is finished and verified.

In this section, we present the construction process of the stamp model accompanied by the EAT procedure. Because of the limitation of this paper length, we only display four typical stages in this process. Of course, the real construction process of the stamp model has been tested and modified at far more than four stages because it has many details of the geometrical and topological structures.

1) Testing Fringe Ring and Middle Rows of Top Face

An unfinished model is shown in

In

2) Testing Half Top Face

The half top face of stamp model is shown in

Most facets in this unfinished model are quads. Several triangle facets are filled at corners, and several pentagons and hexagons are formed in some facets with curved borders. It is shown in the front view and side view of wire-frame images of

The tested results of the model in

3) Testing Top Face, Side Ring and Back Face

The top face, side ring and back face of stamp model are constructed at this stage, shown in

view, and side back view of wire-frame images, respectively.

The tested results of the partial model in

4) Testing the Whole Stamp Modeling

The whole stamp modeling is finished at this stage, shown in

The tested results of the finished stamp model in

For the EAT algorithm, there are more application cases than the above. Since we cannot present all of them, we only explain some more features here.

We first explain the meanings of three more indicators of the EAT algorithm in applications, these being the face counter fc, edge counter ec and vertex counter vc.

As known before, during testing, the EAT scans facets of a model one facet after another without any repeated facet. The facet counter fc value of the scanned facet is equal to 1. If its fv is greater than 1, the facet has a defect that must be modified. Because an edge in a simply connected surface model can be connected to two facets at most, the edge counter ec value of the edge is smaller than or equal to 2. If the ec value is greater than 2, the edge has a defect that must be modified or the tested surface model is not simply connected. The value of a vertex counter vc in a scanned facet can be a positive integer, which means there are vc number of edges connected to the vertex item.

In addition, for the model companion, one of the important features of the EAT algorithm is that the defect of a facet can be tested, found, and immediately modified at the stage of this facet modeling. In this way, a verified model can be always provided to the succeeding process, shown in

With the algebraic topology, the EAT algorithm opens a new test window for observing and examining surface modeling in surface construction and reconstruction. It computes the Euler characteristic of a model, and examines the topologic consistence of the model by comparing the Euler characteristic of the model with that of its target surface.

The EAT algorithm consists of two functions: EAT testing algorithm (EAT-TA) and statistic algorithm (EAT-SA). Both functions are short and flexible, so they are easily inserted in a model companion program. Even better, a clean and verified model can be provided without the EAT code left after the EAT-searching.

The EAT algorithm is adaptable and can be used to test different polygon facets of various surface models in surface construction and reconstruction. The EAT algorithm is independent of the metrics of facets. A facet much smaller than most of facets in a model can be identified.

In future, the EAT algorithm will be applied to test more forms of models that may have different values of Euler characteristics and different topologic structures. It can be sure that more potential of the EAT algorithm can be revealed.

This work has been supported by Hebei Project of Sponsoring High-Level Talents [grant number C2015003045], Doctoral Research Foundation of Hebei University of Science and Technology [grant number 201417], and Hebei Project of Sponsoring Introduced Overseas Researchers [grant number C201811].

The authors declare no conflicts of interest regarding the publication of this paper.

Liu, Y.K., Yue, Y., Zhang, D.W. and Li, C.H. (2020) Euler Characteristic Scheme of Globally Searching for Flaws in Surface Modeling. Advances in Pure Mathematics, 10, 57-85. https://doi.org/10.4236/apm.2020.102005