• No results found

Automatic Mesh Repair

N/A
N/A
Protected

Academic year: 2021

Share "Automatic Mesh Repair"

Copied!
124
0
0

Loading.... (view fulltext now)

Full text

(1)

Institutionen för systemteknik

Department of Electrical Engineering

Examensarbete

Automatic mesh repair

Examensarbete utfört i Informationskodning vid Tekniska högskolan vid Linköpings universitet

av

Agnes Larsson LiTH-ISY-EX--13/4720--SE

Linköping 2013

Department of Electrical Engineering Linköpings tekniska högskola

Linköpings universitet Linköpings universitet

(2)
(3)

Automatic mesh repair

Examensarbete utfört i Informationskodning

vid Tekniska högskolan vid Linköpings universitet

av

Agnes Larsson LiTH-ISY-EX--13/4720--SE

Handledare: Jens Ogniewski

isy, Linköpings universitet

Jimmie West

Configura

Examinator: Ingemar Ragnemalm

isy, Linköpings universitet

(4)
(5)

Avdelning, Institution Division, Department

Informationskodning

Department of Electrical Engineering SE-581 83 Linköping Datum Date 2013-09-30 Språk Language Svenska/Swedish Engelska/English   Rapporttyp Report category Licentiatavhandling Examensarbete C-uppsats D-uppsats Övrig rapport  

URL för elektronisk version

ISBN — ISRN

LiTH-ISY-EX--13/4720--SE Serietitel och serienummer Title of series, numbering

ISSN —

Titel Title

Automatisk reparering av 3D-modeller Automatic mesh repair

Författare Author

Agnes Larsson

Sammanfattning Abstract

To handle broken 3D models can be a very time consuming problem. Several methods aiming for automatic mesh repair have been presented in the recent years. This thesis gives an extensive evaluation of automatic mesh repair algorithms, presents a mesh repair pipeline and describes an implemented automatic mesh repair algorithm.

The presented pipeline for automatic mesh repair includes three main steps: octree gener-ation, surface reconstruction and ray casting. Ray casting is for removal of hidden objects. The pipeline also includes a pre processing step for removal of intersecting triangles and a post processing step for error detection.

The implemented algorithm presented in this thesis is a volumetric method for mesh repair. It generates an octree in which data from the input model is saved. Before creation of the output, the octree data will be patched to remove inconsistencies. The surface reconstruction is done with a method called Manifold Dual Contouring. First new vertices are created from the information saved in the octree. Then there is a possibility to cluster vertices together for decimation of the output. Thanks to a special Manifold criterion, the output is guaranteed to be manifold. Furthermore the output will have sharp and clear edges and corners thanks to the use of Singular Value Decomposition during determination of the positions of the new vertices.

Nyckelord

(6)
(7)

Abstract

To handle broken 3D models can be a very time consuming prob-lem. Several methods aiming for automatic mesh repair have been presented in the recent years. This thesis gives an extensive evalu-ation of automatic mesh repair algorithms, presents a mesh repair pipeline and describes an implemented automatic mesh repair algo-rithm.

The presented pipeline for automatic mesh repair includes three main steps: octree generation, surface reconstruction and ray cast-ing. Ray casting is for removal of hidden objects. The pipeline also includes a pre processing step for removal of intersecting triangles and a post processing step for error detection.

The implemented algorithm presented in this thesis is a volumetric method for mesh repair. It generates an octree in which data from the input model is saved. Before creation of the output, the octree data will be patched to remove inconsistencies. The surface recon-struction is done with a method called Manifold Dual Contouring. First new vertices are created from the information saved in the oc-tree. Then there is a possibility to cluster vertices together for dec-imation of the output. Thanks to a special Manifold criterion, the output is guaranteed to be manifold. Furthermore the output will have sharp and clear edges and corners thanks to the use of Singu-lar Value Decomposition during determination of the positions of the new vertices.

(8)
(9)

Acknowledgments

I would like to thank Jimmie West at Configura for always letting me ask questions, for all the valuable discussions on programming and the mesh repair topic and for reviewing this report. I would also like to thank Viktor Smedby, Jens Ogniewski and Joel Jansson for reviewing this report. Furthermore, I want to thank Ingemar Ragnemalm for supporting me during this master thesis project.

Linköping, September 2013 Agnes Larsson

(10)
(11)

Contents

List of Figures x

List of Tables xii

1 Introduction 1 1.1 Problem . . . 1 1.2 Goal . . . 1 1.3 Limitations . . . 2 1.4 Time plan . . . 2 1.5 Contributions . . . 2 1.6 Configura . . . 3 1.6.1 CET . . . 3 1.6.2 CM . . . 4 1.7 Technical specification . . . 4 1.8 Structure . . . 4 1.9 Abbreviations . . . 4 2 Background 7 2.1 Computer graphics . . . 7 2.2 Relevant concepts . . . 8

2.2.1 A mesh repair overview . . . 8

2.2.2 Remeshing . . . 8 2.2.3 Grids . . . 9 2.2.4 Isosurface . . . 10 2.3 Mesh repair . . . 11 2.3.1 Mesh errors . . . 11 2.3.2 Surface-based methods . . . 13 vii

(12)

viii CONTENTS

2.3.3 Volume-based methods . . . 15

3 Evaluation and related work 19 3.1 Related work . . . 20

3.1.1 Surface-based methods . . . 21

3.1.2 Volume-based methods . . . 23

3.1.3 A combination between the surface-based and volume based approaches . . . 30

3.1.4 Contouring methods . . . 31

3.1.5 Methods based on expanding objects inside the input model . . . 36

3.1.6 Previous thesis workers at Configura working with the same problem . . . 41

3.2 Prestudy conclusion . . . 42

4 Mesh repair system 45 4.1 The mesh repair pipeline . . . 45

4.2 The implemented system . . . 46

4.2.1 System information . . . 47

5 Robust repair of polygonal models 49 5.1 Scan-conversion . . . 49

5.2 Sign generation . . . 50

5.3 Surface reconstruction . . . 53

6 Manifold dual contouring 55 7 Singular value decomposition with Jacobi rotations 59 7.1 Singular value decomposition . . . 59

7.1.1 Eigenvalue decomposition . . . 60

7.2 Jacobi rotations . . . 61

8 Implementation 63 8.1 Patching . . . 63

8.1.1 Detection of problem areas . . . 63

8.1.2 Patching of problem areas . . . 64

8.2 Manifold dual contouring . . . 68

8.2.1 Vertex Clustering . . . 69

(13)

9 Results 77

9.1 Repairing results . . . 77

9.1.1 Overall results . . . 77

9.1.2 Results for the new patch method . . . 79

9.1.3 Singular value decomposition results . . . 80

9.1.4 Vertex clustering results . . . 80

9.2 Performance . . . 81

10 Discussion 91 10.1 Patching . . . 92

10.2 Manifold dual contouring . . . 92

10.2.1 Singular value decomposition . . . 92

10.2.2 Vertex clustering . . . 93

10.3 Time and memory complexity . . . 94

11 Conclusion and future work 95 11.1 Conclusion . . . 95

11.1.1 Automatic mesh repair evaluation . . . 95

11.1.2 The mesh repair pipeline . . . 96

11.1.3 Implemented automatic mesh repair method 96 11.2 Future work . . . 97

11.2.1 Removal of unseen objects . . . 97

11.2.2 Error detection . . . 97

11.2.3 Processing of several models at the same time 98 11.2.4 Reduce time and memory complexity . . . 98

11.2.5 Automatic calculation of octree depth . . . . 98

11.2.6 Possibility to have leaf nodes at different oc-tree depths . . . 99

11.2.7 Octree refinement . . . 99

Bibliography 101

(14)

x LIST OF FIGURES

List of Figures

2.1 A triangle mesh. . . 8 2.2 Octree . . . 10 2.3 T-junction . . . 12 2.4 Hanging triangles . . . 13

2.5 Different mesh errors . . . 14

2.6 Noise and aliasing . . . 15

3.1 Cutting and stitching . . . 22

3.2 A chair part healed at different depths in PolyMender. 25 3.3 Expanding cylinders . . . 27

3.4 Base cases of Marching Cubes . . . 32

3.5 Dual grid . . . 33

3.6 Dual Marching Cubes result . . . 34

3.7 Dual contouring . . . 35

3.8 Competing Fronts . . . 36

3.9 Testing of the Screened Poisson Surface Reconstruc-tion algorithm at different depths. . . 39

3.10 Carwing and growing from inside . . . 40

3.11 Topological simplification of isosurfaces result . . . . 41

3.12 The input model with a large hole. . . 44

3.13 Old patching result . . . 44

4.1 Mesh repair pipeline . . . 46

4.2 One voxel with eight corners, 12 edges and six faces. 48 5.1 The primal edges of an octree node are marked with red. . . 50

5.2 Quads . . . 51

(15)

LIST OF FIGURES xi

5.4 Results of Ju’s method . . . 53

6.1 Vertex clustering in 2D . . . 56

7.1 The Jacobi rotation matrix. . . 61

8.1 Edge boundary . . . 64

8.2 Split border cycle . . . 66

8.3 Splitting plane . . . 67

8.4 The input model with a hole. . . 68

8.5 City block paths . . . 68

8.6 Intersected edges update. . . 69

9.1 The input model with bad normals. . . 78

9.2 Healed with octree depth 7. . . 78

9.3 Healed with octree depth 8. . . 78

9.4 Healed in PolyMender with octree depth 8. . . 78

9.5 PolyMender results . . . 83

9.6 Healed with octree depth 10 in PolyMender. . . 83

9.7 Healed with octree depth 8, using the approach de-scribed in this thesis. . . 83

9.8 Healed with octree depth 9, using the approach de-scribed in this thesis. . . 83

9.9 The input chair back model. . . 84

9.10 The chair back healed with octree depth 9 in Poly-Mender. . . 84

9.11 The chair back healed with octree depth 9, using the approach described in this thesis. . . 84

9.12 The input model. . . 85

9.13 Healed with octree depth 3, using the approach de-scribed in this thesis. . . 85

9.14 Healed with octree depth 6, using the approach de-scribed in this thesis. . . 85

9.15 Healed with octree depth 8, using the approach de-scribed in this thesis. . . 85

9.16 Output triangles . . . 86

9.17 The sphere patched with the new method. . . 86

9.18 The sphere patched with the old method. . . 86

(16)

9.20 Healed without SVD, the approach described in this

thesis was used. . . 87

9.21 Healed with SVD, the approach described in this the-sis was used. . . 87

9.22 Healed in PolyMender. . . 87

9.23 Edge detail . . . 88

9.24 Detail of an edge. The model is healed with Poly-Mender. . . 88

9.25 The black rectangle marks were the edge detail is lo-cated on the 3D model. . . 88

9.26 The edge detail on the input model. . . 88

9.27 Processed without clustering. . . 89

9.28 Processed and decimated with error threshold 0.1. . 89

List of Tables

9.1 Vertex clustering results . . . 81

9.2 Total processing time . . . 81

9.3 Block processing time . . . 82

9.4 Total number of triangles . . . 82

(17)

1

Introduction

This report presents an extensive evaluation of the mesh repair area, a proposed mesh repair pipeline and an implemented automatic mesh repair algorithm.

1.1

Problem

Every day Configura handles a large amount of 3D-models, some which are incorrect. For example, the 3D-models may contain holes and incorrectly directed triangle normals. The incorrect 3D models make the work at Configura more complicated and time consum-ing. Therefore Configura needs a robust and automatic mesh repair algorithm. Mesh repair is a broad and complex area. There are lots of published mesh repair solutions, lots of them are not robust for all cases. How do the different algorithms work and what results do they give? A clear and detailed mesh repair pipeline is needed.

1.2

Goal

The goal of this thesis work is to develop and implement an au-tomatic mesh repair pipeline for polygonal 3D models. Different

(18)

2 1 Introduction

mesh repair approaches should also be evaluated. Errors that the algorithm preferably should handle are listed and described in sec-tion 2.3.1. The project should give an overview of the mesh repair research of today.

1.3

Limitations

The goal is not to develop a completely new algorithm. The aim is to evaluate already existing algorithms and construct a mesh repair pipeline from the evaluation. The pipeline may include new algo-rithms, but if already existing algorithms satisfy the constraints of the project, these algorithms will be used.

To make a working healing algorithm is of higher priority than mak-ing a fast algorithm, but a short processmak-ing time is, despite that, ap-preciated.

1.4

Time plan

The project is restricted to 20 weeks. Five weeks are used for re-search and evaluation. 12 weeks are used for implementation and the remaining three weeks are used for writing of the thesis thesis.

1.5

Contributions

The main contributions of this thesis work are an extensive eval-uation of the mesh repair area, a clear and extensive mesh repair pipeline that solves all the mesh errors that Configura wants to heal and a mesh repair software that can repair several broken models. Several mesh repair algorithms have been evaluated and the eval-uation has led to a carefully designed mesh repair pipeline. The pipeline is presented in chapter 4. This pipeline handles all errors presented in section 2.3.1. The developed mesh repair software han-dles all errors except from removal of unseen objects. However, time and memory complexity have to be reduced for handling of very complex 3D models.

(19)

1.6 Configura 3 No user interaction is needed during the processing of a mesh in the developed mesh repair algorithm. It is also possible to auto-matically repair models that consist of several sub models. With a sufficiently high octree depth the output will be manifold. Bad normals are corrected and there is a possibility to turn on triangle decimation, which will be performed during the mesh repair pro-cess. The triangle decimation can reduce the amount of triangles in the output model significantly.

Singular value decomposition is implemented in the mesh repair software for calculating positions of new vertices, this gives sharper and clearer edges in the output model.

The evaluation explains several different mesh repair approaches and discusses their drawbacks and benefits. The evaluation can be helpful for anyone trying to solve the automatic mesh repair prob-lem.

1.6

Configura

Configura is a globally operating Swedish company with headquar-ters in Linköping. Configura also has offices in Gothenburg, Swe-den, Grand Rapids, Michigan, USA, and Kuala Lumpur, Malaysia. Configura creates Parametric Graphical Configuration (PGC) soft-ware solutions and serves in commercial furniture, kitchen and bath, material handling and industrial machinery markets. Configura has two platforms: CET and the original platform Configura.

1.6.1

CET

CET designer is a software application for designing and rendering environments such as commercial furniture, offices and kitchens. CET designer is not only used by design people, it is also used by sales, marketing and customer service people. CET Designer can also calculate the environment cost. Another advantage is that CET Designer supports importation of drawings from AutoCAD.

(20)

4 1 Introduction

1.6.2

CM

CM is the programming language used for CET. CM stands for Con-figura Magic and is an object-oriented language that belongs to the Java/C#/C++ family of languages. CM is uniquely adapted to the PGC problem domain and has extensible syntax and support for in-cremental development. The programmer can change functionality and classes while the application is running. A garbage collector is used for removing sources for fatal programming mistakes.

1.7

Technical specification

The implemented mesh repair application and all tests are executed on an Intel Core i7 2.67 GHz CPU with a NVIDIA GeForce GTX 280 GPU and with 6 GB RAM.

1.8

Structure

This chapter described the goal and contributions of this thesis. It also gave information on the company Configura. The next chapter treats the mesh repair area by describing relevant concepts. Some computer graphics concepts are also reviewed. Chapter 3 includes evaluation and information on related work. After that follows a chapter that describes the existing mesh repair system and the planned mesh repair pipeline. The three following chapters de-scribe the methods used in the implemented mesh repair algorithm: the method described by Ju [Ju, 2004] for octree and sign generation, Manifold Dual Contouring and Singular Value Decomposition. Af-ter that follows a chapAf-ter that describes the actual implementation, and then the results of the implemented algorithm are presented. Finally follows a chapter for discussion and a chapter that addresses the conclusions and the future work ideas of this project.

1.9

Abbreviations

CPU Central Processing Unit

(21)

1.9 Abbreviations 5 GPU Graphics Processing Unit

DC Dual Contouring

MDC Manifold Dual Contouring QEF Quadratic Error Function SVD Singular Value Decomposition EVD Eigenvalue Decomposition DMC Dual Marching Cubes

(22)
(23)

2

Background

This chapter includes relevant background information. Section 2.1 describes some computer graphics concepts and section 2.2 de-scribes relevant mesh repair concepts. After these two sections fol-low sections that further describe the mesh repair problem. Meth-ods developed for solving this problem are described in chapter 3.

2.1

Computer graphics

This section reviews some basic concepts of computer graphics. Fur-ther relevant concepts are described in section 2.2.

A vertex is a corner point of a polygon. A polygon mesh is a set of polygons that form a shape. Triangles are the most common poly-gons used in computer graphic meshes, however quad meshes also exist. Figure 2.1 shows a polygon model and how its triangles are located. The word voxel is widely used in this thesis. A voxel can be seen as a pixel in 3D, i.e. a volume element.

The concept manifold is widely used in this thesis. A manifold poly-gon mesh means, in this thesis, that the mesh is watertight. If there is water inside the mesh, the water will be kept in the mesh if the mesh is manifold. Hermite Data is another concept that occurs

(24)

8 2 Background

quently in this thesis. Hermite Data consists of two vectors: a posi-tion of an intersecposi-tion point on an edge and the surface normal in that point.

Figure 2.1: A triangle mesh.

Polygonal models are the most common way to represent 3D mod-els [Attene et al., 2013]. Therefore this project focuses on polygonal models. Furthermore it focuses on polygonal models that use trian-gles as their building blocks.

2.2

Relevant concepts

This section describes concepts relevant for mesh repair, for exam-ple different tree structures. The concept of remeshing is also de-scribed and compared to the mesh repair concept.

2.2.1

A mesh repair overview

Mesh repair algorithms aim to, as the name tells, repair broken meshes. Typical errors that mesh repair algorithms can handle are for example holes and incorrect polygon normals. Since the mesh repair concept is the main topic of this thesis, nearly all chapters handles this subject. Background information about mesh repair is presented in section 2.3.

2.2.2

Remeshing

Remeshing is a technique for improving the mesh quality. Mesh quality refers, for example, to sampling-density, size and regularity. The goals of remeshing are in general mesh simplification (i.e. re-duce the number of polygons) and mesh quality improvement. In

(25)

2.2 Relevant concepts 9 remeshing algorithms the input, in general, is assumed to already be manifold. In mesh repair algorithms, however, this is not as-sumed. [Botsch et al., 2010]

2.2.3

Grids

Several mesh repair algorithms convert the input model to a volu-metric representation. This section describes different voluvolu-metric representations that can be used to implement and accelerate differ-ent mesh repair algorithms. However, some of them, especially the octree, are more common.

Uniform grid

In a uniform grid, all voxels in the grid are of equal size. [Holmlid, 2010] Unfortunately several troubles occurs due to that all nodes are of equal size. For example the grid may be too coarse with re-spect to the input object’s geometry. [Ericson, 2004].

A Cartesian grid is an uniform grid where the nodes are unit cubes. In 2D, the nodes are unit quads. The vertices of a Cartesian grid are integer points.

Tree data structures

This section gives an overview of tree data structures. Christer Eric-son describes different tree data structures in his book Real-time Collision Detection [Ericson, 2004]. In mesh repair, these struc-tures are used for making the processing time shorter. The tree sorts the data, which makes it easier to search for the data, i.e. the processing time is reduced. Octrees are the most common tree data structure in the mesh repair area.

BSP tree BSP tree stands for binary space-partitioning tree. It re-cursively divides the space into pairs of subspaces. The partitioning is made with dividing hyper planes with dimension (n - 1), where the space that is partitioned is of dimension n.

It is uncommon to use BSP-trees in the mesh repair area. However, Botsch et al. [Botsch et al., 2010] discuss a volumetric mesh repair algorithm from year 1997 that converts the input polygon soup into a BSP-tree.

(26)

10 2 Background

Octree An octree is a tree data structure where each composite node has eight children. The root node of an octree is usually the smallest axis-aligned voxel that completely encloses the world. All nodes, or voxels, of an octree are axis-aligned. Figure 2.2 [Timber-wolf, 2013] shows a typical octree structure.

Figure 2.2:The tree structure of an octree. [Timberwolf, 2013]

Adaptive grid The sampling of the implicit function to a grid can be done adaptively. I.e. a higher sampling rate is used only in the vicinity of the input surface. Only the octree voxels that are inter-sected by the surface will be refined. [Botsch et al., 2010]

Restricted octree In a restricted octree, adjacent voxels in the oc-tree cannot differ by more than one level of refinement. [Holmlid, 2010]

2.2.4

Isosurface

Let a set of points satisfy the following function: f(x,y,z) = c. The function f(x,y,z) is called the implicit function and c is called the

(27)

iso-2.3 Mesh repair 11 value. The surface, consisting of the set of points mentioned above, is called an isosurface. A point p lies on the surface if f(p) = c. If f(a) < c and f(b) > c, the points a and b lie on different sides of the sur-face. [Holmlid, 2010] The basic concept of implicit or volumetric representations of models is to mark each 3D point to lie either in-side, outside or on the isosurface. If the function f(p) is continuous, the isosurface is free from holes. It is common that f(p) is sampled in a voxel grid. [Botsch et al., 2010]

2.3

Mesh repair

The mesh repair algorithms can be classified as being either surface oriented or volumetric [Botsch et al., 2010]. These categories are explained below, in section 2.3.2 and 2.3.3. Examples of typical methods in these categories are mentioned in section 3.1. There also exist mesh repair algorithms that are a combination of surface-based and volume-surface-based methods. [Bischoff and Kobbelt, 2005] is an example of such a method. Surface-oriented methods are also called local approaches in the literature, and volumetric methods are also called global approaches in the literature.

Another group of methods are based on growing objects inside the input model. These methods often first convert the input model to a point cloud, and then an output surface is created from that point cloud. [Ju, 2009] In section 3.1, three methods of this group will be described.

2.3.1

Mesh errors

This section describes different mesh errors. Below follows a list of the mesh errors that Configura wants to be resolved. Figure 2.5 [Botsch et al., 2010] shows a number of mesh artifacts. Figure 2.3 shows a T-junction, which means that a vertex lies in the interior of an edge of another polygon. Figure 2.4 [Ju, 2004] shows a model with hanging triangles.

Repair

(28)

12 2 Background

position or isolated vertices

• Remove overlapping and intersecting triangles • Remove hanging triangles

• Remove T-junctions

• Remove degenerate triangles, a degenerate triangle is a trian-gle with zero area, i.e. a point or a line.

• Correct reversed normals Control, features and visual fidelity

• Fill in unwanted holes • Keep wanted holes

• Produce manifold (watertight) result • Removal of unseen features

• Preserve sharp corners and edges • Controllable time complexity

• Controllable output resolution / multiresolution Complexity

• Time complexity • Memory complexity

(29)

2.3 Mesh repair 13

Figure 2.4: Hanging triangles. [Ju, 2004]

Figure 2.6 [Attene et al., 2013] shows two problems that a 3D model can have: noise and feature chamfering or aliasing. Sharp corners and edges are not preserved. Several remeshing and contouring algorithms have restrictions on were the new vertices can be placed. For example a precalculated table may be used, as in the Marching Cubes algorithm. This leads to that sharp corners and edges are not preserved and the output surface consists therefore of aliasing artifacts. This gives an unsatisfactory visual result.

2.3.2

Surface-based methods

These methods try to resolve the inconsistencies by perturbing the input only slightly. No new mesh is created. Surface oriented algo-rithms often have problems when handling special cases, for exam-ple intersections. They operate directly on the input data. [Bischoff and Kobbelt, 2005] They search for errors on the input model, and once an error is found, the error is corrected by surgeries. [Ju, 2009] Surface-based methods are acting on local parts of the mesh. They modify the geometry in a small region around the artifacts. There-fore, surface-based repair algorithms preserve the polygonal mesh structure in regions that are not near the artifacts. Cutting and stitching [Gueziec et al., 2001] is an example of a local method. These methods, as mentioned above, only add few changes to the input’s topology. This leads to that only a few additional triangles are added. [Botsch et al., 2010]

However, surface oriented methods often get problems with robust-ness and speed when the input model has too many triangles.

(30)

Sur-14 2 Background

Figure 2.5:Different mesh errors. [Botsch et al., 2010]

face oriented methods generally are specified on one specific prob-lem, therefore it is hard to find a surface-based method that can treat all the different mesh artifact problems without a vast amount of time consumption. [Karlberg and Persson, 2011] Another draw-back with surface oriented methods is that they usually require that the input model already satisfies certain quality requirements. Oth-erwise the output may be invalid. Surface oriented algorithms are rarely completely automatic, in general user interaction and man-ual post-processing are needed. [Botsch et al., 2010]

(31)

2.3 Mesh repair 15

Figure 2.6: Left: Noise problems. Right: Feature chamfer-ing/aliasing. [Attene et al., 2013]

Usually, surface oriented methods try to resolve gaps and holes problems. The gaps and holes are detected, and then filled. Com-plex, or non-manifold, edges are also resolved by several surface oriented methods. [Ju, 2009]

According to Attene et al. [Attene et al., 2013], surface-based meth-ods are suitable to use when the input model only has few errors and when a very high robustness is not needed.

2.3.3

Volume-based methods

Volumetric algorithms convert the input model to a volumetric rep-resentation. Then, the output model is extracted from the volu-metric representation. [Botsch et al., 2010] In general, voluvolu-metric algorithms guarantee manifold meshes. They process a global re-sampling, i.e. they extract a completely new model. Techniques for extracting a new surface from the volumetric representation are for example Marching Cubes and Dual Contouring. [Bischoff and Kobbelt, 2005] A problem with volumetric methods is that they of-ten produce over-tessellated outputs. [Karlberg and Persson, 2011] Examples of volumetric representations used in model repair in-clude regular Cartesian grids, adaptive octrees, kd-trees, BSP-trees and Delaunay triangulations. Some of these concepts are described in section 2.2. BSP-trees seem not to be used in newer repair algo-rithms. Probably this is due to that it is hard to accomplish a robust and efficient computation of the combinatorial structure of the BSP tree. Usually volumetric algorithms are completely automatic. A drawback with volumetric algorithms is that the resampling of the

(32)

16 2 Background

model often introduces aliasing artifacts and loss of model features. [Botsch et al., 2010] According to a new survey (from 2013) [Attene et al., 2013], volumetric methods should be chosen if robustness is an important requirement.

Since volumetric methods in general handle a large amount of differ-ent errors, it is often more important to examine what requiremdiffer-ents the method has on the input model.

Some volumetric methods use flooding (inward or outward) for dis-cretizing an object into a grid (e.g. an octree or a uniform grid). However, flooding is limited to identify a single inside (for outward flooding) or outside (for inward flooding) region. Therefore, flood-ing techniques cannot detect multiple object components or cavities inside an object. A big drawback with flooding methods is, unfor-tunately, that they will fail to generate signs for inside and outside if there are holes or gaps in the model. Then these models can’t separate inside and outside. [Ju, 2009]

Volumetric methods that can handle gaps and holes are generally divided into two categories: the ones that rely on the orientation of the polygons, and the ones that do not. The latter is more suitable for repairing polygon soups, and the former is better on hole-filling when the polygons have a correct orientation. [Ju, 2009]

Orientation-dependent methods

Since these methods rely on the polygon normals, the polygons should be consistently oriented. I.e. these methods are not appro-priate for correcting inconsistent normals. However, if the polygons are consistently oriented, the orientations will give extra hints when determining the grid point signs. Therefore, the sign generation is more reliable for these methods. Methods in this category use the signed distance from a grid point to the polygons. The signed dis-tance is used for sign generation and smoothing. Algorithms in this category are bad at correcting normals, but good at filling holes. [Ju, 2009] Inconsistent normals are more common than holes on Configura, therefore these kind of algorithms are not considered as interesting.

(33)

2.3 Mesh repair 17

Orientation-independent methods

This kind of methods rely only on the location and connectivity of the vertices in the input model. Ju [Ju, 2009] suggests to divide these methods into two groups: global and local ones. The global methods calculate the sign at each grid point by tests involving the whole model or optimization on the whole grid. The local meth-ods only modify a small region on the grid. The small region is usually where gaps and holes are located. They leave the rest of the grid (with it’s inside/outside signs) unmodified. The method by Nooruddin and Turk [Nooruddin and Turk, 2003] and the method by Hornung and Kobbelt [Hornung and Kobbelt, 2006] are exam-ples of global methods. The method developed by Ju [Ju, 2004] and the method presented by Bischoff et al. [Bischoff et al., 2005] are examples of local methods.

(34)
(35)

3

Evaluation and related work

This chapter presents an evaluation of the mesh repair area. Dif-ferent related algorithms are described and evaluated. The chapter ends with a prestudy conclusion section. First, relevant concepts for the actual evaluation and analysis process are described.

Attene et al. [Attene et al., 2013] present a general strategy on what to do if a 3D model probably needs to be healed:

1. Determine the characteristics and defects of the input model 2. Determine which requirements you have on the input model 3. Decide if it is necessary to heal the input model

4. Check if there is an algorithm to heal the input directly 5. If there does not exist any direct repair algorithms, check if

several algorithms can be used for healing the input 6. If that is not possible, there is a gap in the state-of-the-art When analyzing repair algorithms, there are three important things that should be taken into consideration:

• What requirements do the repairing method have on the input model?

(36)

20 3 Evaluation and related work

• Which errors do the method heal?

• Which new errors are introduced by the method?

It is common that an algorithm works well - but only on a very lim-ited amount of errors. This is particularly true for surface-based methods. In this evaluation a greater emphasis has been placed on methods that handle a larger amount of mesh errors. Furthermore, it is, in this case, important to analyze how automatic the differen re-pair approaches are. In this analysis it is also interesting how many parameters that have to be set before processing. Parameters with a reasonable default value, however, will in general not make the algorithm less automatic. One repair algorithm that is deselected, partly due to that it needs user impact during the processing, is the method presented by Hetroy [Hetroy et al., 2011].

According to the requirements on the input model, several algo-rithms have been deselected due to too many requirements. If a repairing method requires that several errors are already resolved, that method is not interesting in this project since a very broad and general approach should be implemented. For example sev-eral methods require correct normals. Another method that was deselected is Atomic Volumes for Mesh Completion presented by Podolak and Rusinkiewicz [Podolak and Rusinkiewicz, 2005]. That method requires the input model to be free of degeneracies, self-intersections and singularities. If the input is not, the output is not guaranteed to be manifold.

3.1

Related work

This section presents works done in the area of mesh repair. Each method will first be described and then evaluated. The description typically tells how the method works and which theoretical benefits and drawbacks the method has. The evaluation of each method dis-cusses the method and its benefits and drawbacks. The evaluation also tells if the method seems to be interesting for this mesh repair project or not.

(37)

3.1 Related work 21

3.1.1

Surface-based methods

This section describes different surface-based mesh repair algorithms. However, this thesis focus more on the volume-based methods, since their features are better suited to the requirements of Configura.

Cutting and stitching

Gueziec et al. [Gueziec et al., 2001] present a cutting and stitching method for converting sets of polygons to manifold surfaces.

Method description The cutting algorithm detects areas with er-rors and cuts the input surface along the edges of the error area. Image A in figure 3.1 [Gueziec et al., 2001] shows a bad part of the input model, and image B in figure 3.1 shows where the input model will be cut. Image C shows the model after cutting. The stitching part of the method is needed since the cutting method may create areas with boundary edges. The stitching method joins two boundary edges. The stitching can be performed by either pinching or snapping. Pinching is described in image D, and snapping in im-age E. The pinching method zips the boundary, i.e. edges along the same boundary are pinched together. Only edges that were cut dur-ing the cut operation are seen as stitchable. The snappdur-ing method, however, allows to stich all edges. The snapping method zips to-gether edges that belongs to different boundaries.

Thanks to the stitching, the output is guaranteed to be manifold. However, more than one output manifold surface may be produced from an input surface. According to the authors, this method can handle all topological artifacts without user intervention. Further-more, this method requires no parameters [Attene et al., 2013].

Method evaluation That the method is automatic, without input parameters and that it guarantees a manifold output are two strong benefits. However, the method is not developed for repairing orien-tation errors. Bad normals are the most common error at Configura, and therefore this method is not interesting.

A more modern surface-based method for model repair

Guangshuai et al. [Guangshuai et al., 2009] present a surface-based method for mesh repair. Since it is surface oriented, the algorithm

(38)

22 3 Evaluation and related work

Figure 3.1: The different parts of cutting and stitching. A,B and C: cutting. D: pinching. E: snapping. [Gueziec et al., 2001] operates directly on the input data.

Method description The method includes five processes: 1. Consistent normal orientation

2. Hole filling on a surface

3. Manifolds mapping on a surface for resolving complex edges and singular vertices (by using pinching and snapping) 4. Gap bridging between surface patches

5. Mesh topology simplification

The authors state that one benefit with their algorithm is that it preserves the features of the original mesh. The algorithm can also handle several different mesh errors. According to the authors, this method handles the following mesh errors:

(39)

3.1 Related work 23 2. Repairs holes

3. Repairs gaps

4. Simplifies the mesh topology

5. Removes complex edges (i.e. edges with two or more neigh-bouring faces)

6. Removes singular vertices, see figure 2.5

Method Evaluation One drawback with this method is actually that the algorithm is surface oriented. According to Botsch et al. [Botsch et al., 2010] that probably means that the algorithm has problems with robustness and time complexity. However, the authors states that their method is robust. According to the time complexity, no processing time results are presented in the article. Another draw-back is that there were no possibilities to test software built on this method during the evaluation. Due to these drawbacks, the method is deselected.

3.1.2

Volume-based methods

Below follows descriptions of different volume-based mesh repair methods. Several volumetric methods demands that the input sur-face already has a correct sursur-face orientation. Since bad normals are one of the greatest problems for Configura, these methods are not considered as interesting. Examples of methods that demands a correct surface orientation in the input mesh are: [Guo et al., 2006], [Sagawa and Ikeuchi, 2008] and [Shen et al., 2004].

Volumetric repair on regular grids

Nooruddin and Turk proposed an early volumetric technique [Noorud-din and Turk, 2003] to resolve gaps, overlaps and intersections. It also resolves topological artifacts by using morphological operations.

Method description The method is based on a rectilinear voxel grid. Each voxel contains a value in the range from zero to one. If the value equals one, it means that the voxel is completely in-side the input model, and if it equals zero it means that the voxel is outside the model. Values between zero and one means that the current voxel is near the surface of the input model. The voxels in

(40)

24 3 Evaluation and related work

the grid are therefore classified as inside or outside. When all vox-els are classified, a volumetric representation has been generated. Then Marching Cubes is used to extract a new surface from this volumetric representation. Naturally, the surface is placed between the outside and inside voxels.

Unfortunately, the classification of inside and outside voxels in this method is usually not reliable. Another drawback is that the algo-rithm is not feature sensitive. [Botsch et al., 2010] An advantage with the method is that it has no requirements on the input model [Attene et al., 2013].

Method evaluation Due to the above mentioned drawbacks of this method, the method is not interesting for this mesh repair project. However, this method was one of the first volumetric repair meth-ods, and therefore it is important for the mesh repair development. Thanks to the conversion into a volumetric representation, this method can handle several mesh degeneracies.

Robust repair of polygonal models

This algorithm, presented by Ju [Ju, 2004], is an octree based volu-metric method that uses Dual Contouring [Ju et al., 2002] or March-ing cubes for creatMarch-ing the output model. Input to the algorithm are the input model and a parameter that states which maximum octree depth that should be used.

Method description The algorithm generates a completely new out-put model. The method includes three main parts: scan-conversion, sign generation and surface reconstruction. In the first part, the scan-conversion, an octree is created. Intersected octree leaf node edges are recorded during this part. In the sign-generation part, signs that are consistent with the intersected edges are generated. If there are inconsistent octree leaf nodes, a patching is performed before the sign generation. The signs tell if the octree node corners are inside or outside the input model. In the surface reconstruction part the new output model is created by contouring. The contour-ing concept is described in section 3.1.4 on page 31.

According to testing made during the thesis work, see below, and to Ju [Ju et al., 2002], this algorithm can handle the following mesh

(41)

3.1 Related work 25 errors:

1. T-junctions

2. Incompatible face orientation 3. Hanging triangles

4. Wanted holes are not removed

5. Time and memory complexity controllable 6. Degenerate triangles

7. Gaps and holes

Method evaluation Ju has developed a free software for testing this method, the software is called PolyMender. PolyMender can be downloaded at Ju’s homepage [Ju, 2013]. Different 3D models have been processed in PolyMender during the evaluation. Figure 3.2 shows the result of a test model that most of the free mesh repair applications have several issues with.

Figure 3.2: A chair part healed at different depths in Poly-Mender.

One great benefit with this method is that there was a possibility to test it and that the result often was good. The testing showed that this algorithm could handle several different errors, see the list above. Furthermore, the method has no requirements on the input model.

(42)

26 3 Evaluation and related work

One drawback with this method is that it cannot handle unseen features. Another drawback is that manifoldness is not guaranteed when Dual Contouring is used for creating the output model. How-ever, it is possible to change to another contouring method, like Manifold Dual Contouring [Schaefer et al., 2007]. One more draw-back is that it produces an over-tesselated output. During testing of PolyMender, it was tried to use a decimation algorithm as a post processing step. The result was satisfying. The decimation program that was used is called qSlim [Garland, 2013] . Another drawback is that this method can not handle overlapping or intersecting trian-gles.

Thanks to the good testing results, this method, together with Man-ifold Dual Contouring for avoiding manMan-ifold problems, is the one that is implemented in this project.

Volumetric repair on adaptive grids

The method described in the article Automatic restoration of poly-gon models by Bischoff et al. [Bischoff et al., 2005] is an example of a volumetric repair method on an adaptive grid.

Method description This method is octree based. Since the octree is adaptive, the octree will have a higher resolution where the input model has a high geometric complexity. The method has three in-puts: an unstructured set of triangles Ti (corresponding to the mesh

that should be repaired), a tolerance value  and a threshold value

ρ. The algorithm generates a new triangle mesh that approximates

the original input mesh at least up to the tolerance . If the original mesh has gaps or holes that are larger than  but smaller than ρ , these will be fixed. The algorithm proceeds in six steps:

1. Generate adaptive octree 2. Octree refinement

3. Morphological operations for fixing holes (expanding cylin-ders)

4. Calculate the connectivity of the mesh by using an extension of dual contouring

(43)

3.1 Related work 27 5. Calculate the vertex positions of the output mesh (surface

ge-ometry reconstruction) 6. Mesh optimization

The octree depth k is calculated from the tolerance value  and from the bounding box of the input model. See equation 3.1 and 3.2. Thanks to this determination of the octree depth, the size of the smallest leaf nodes is smaller than  and there is at least s layers of empty voxels along the faces of the octree root node.

M := max(|xi|, |yi|, |zi|) (3.1)

M is the input model’s maximum absolute coordinate value.

k − 1 < log2(M/ + s) + 1 ≤ k (3.2)

Holes in the input model are removed by expanding cylinders around the boundary edges, see figure 3.3. In this paper, a boundary edge is an edge that belongs to exactly one triangle. For generating the new output model, this method uses an extension of the dual contour-ing method presented by Ju et al. [Ju et al., 2002]. This extension guarantees manifold output meshes.

Figure 3.3:Hole filling with expanding cylinders.

According to the authors of this algorithm, it produces fewer trian-gles than the method by Tao Ju [Ju, 2004]. Another benefit stated

(44)

28 3 Evaluation and related work

by the authors is that the algorithm generates a manifold output. In a survey by Veleba and Felkel [Veleba and Felkel, 2007] one more benefit is stated for this method, namely that the algorithm does not give away the original model completely, since the vertex coor-dinates are kept from the input model to the output model. Accord-ing to Veleba and Felkel, givAccord-ing away the original model completely is the main disadvantage of the voxelization. Attene et al. [Attene et al., 2013] address one additional benefit, namely that the method does not have any requirements on the input model.

Drawbacks with this method is that it removes wanted features in the object and that it produces an over-tesselated output-mesh. This means that, as in [Ju, 2004], decimation is needed. Another draw-back is that there is no software to test this method. Furthermore, the method may introduce degeneracies [Attene et al., 2013].

According to the authors, this algorithm handles the following arti-facts:

1. Degenerate triangles

2. Incompatible face orientation 3. Non-manifold vertices and edges 4. Overlapping and penetrating polygons 5. Internal redundant geometry

6. Gaps and holes up to the maximum size ρ

Method evaluation This method is one of the most interesting meth-ods for this mesh repair project. It has several benefits and the results presented in the article are promising. It seems like this method and the method by Ju [Ju, 2004] are very promising. Since it was not possible to test this method, the method by Ju is preferred. However, it is a good idea to take inspiration from this method, es-pecially when optimizing the algorithm that will be implemented based on Ju’s method.

(45)

3.1 Related work 29

Robust reconstruction of watertight 3D models from

non-uniformly sampled point clouds without normal information

Hornung and Kobbelt [Hornung and Kobbelt, 2006] present a method for reconstructing a watertight 3D triangle mesh from an unori-ented point cloud.

Method description The method is volumetric. No information about local surface orientation is needed since an unsigned distance function is used. Another benefit with the use of an unsigned dis-tance function is that artifacts due to topological noise are avoided. According to the article, the reconstructed models are manifold and of low genus. The concept of genus is described in section 3.1.5. The input to the algorithm is a point cloud. The points in the cloud are samples of a surface. In the vicinity of the samples, a confidence map will be determined. The map shows the probability of the sur-face being in a specific part of the 3D space. The confidence values are computed as an unsigned distance function over all voxels in a volumetric grid. Given the grid of confidence, a minimal set of vox-els is calculated. This set represents a closed surface with maximum confidence, i.e. it is an approximation of the output surface.

The algorithm can handle non-uniformly sampled point clouds. That means that even if the point cloud has hole areas, i.e. areas with a very low density of points, the output will be manifold.

When the optimal approximation of the output surface is found, it has to be converted to a triangle mesh.

Method evaluation There exists several methods that solves the problem of converting point clouds to manifold meshes. This al-gorithm is one of them. Some of these may be used for mesh repair; however, it is probably better to use solutions that are adapted for the models that Configura wants to heal. Configura wants to heal broken 3D models, not reconstruct point clouds. There is a possibil-ity to convert the input model to a point cloud; however, that would probably lead to a loss of useful information.

(46)

30 3 Evaluation and related work

3.1.3

A combination between the surface-based and

volume based approaches

Bischoff and Kobbelt [Bischoff and Kobbelt, 2005] present a mesh repair method that combines the advantages of surface-based meth-ods and volumetric methmeth-ods.

Method description The method uses a voxel grid, but completely new mesh parts are only created in defective voxels. Therefore, the structure of the input model is preserved. Several surface-based methods introduce intersections while closing gaps, this method does not have this drawback [Attene et al., 2013]. However, it may introduce degeneracies, as several other methods also do.

The basic functions of this method can be described in three steps. First, regions with artifacts are identified. After that, new mesh parts are created by a volumetric reconstruction algorithm in these parts of the model. Finally, the reconstructed components are joined with the unchanged parts of the mesh.

Below follows a list of characteristics of this algorithm. However, it should be observed that this algorithm has not been tested during this project.

• Preserves the input structure

• Closes gaps up to a diameter that is defined by the user • Resolves intersections and overlaps

• Resolves bad orientation problems • The output is manifold

• The performance of this algorithm is better than pure volu-metric algorithms, since this algorithm does not reconstruct all parts of the input model

The method has two input parameters: gap width and an error-tolerance value. The output will stay within the error-error-tolerance to the input model. Two parameters make the algorithm less au-tomatic, which is a drawback. The gap width parameter may also imply that the algorithm has problems with repairing large holes.

(47)

3.1 Related work 31 It seems like this method is more adapted for gap closing than hole filling.

Method evaluation It is interesting to combine surface-based and volumetric methods. However, this method is not selected in this project, mainly due to that it seems to be reasonable to believe that this model cannot handle larger holes. Furthermore, several of the test models at Configura have problems with bad normals, and these errors are widely spread over the whole model, see for example figure 9.9 on page 84. Therefore, very large parts of the input model will have to be reconstructed and, if this method is used, then be joined together again. This may introduce new errors. This method is probably better to use when the errors are not that densely and continuously spread over the input model.

3.1.4

Contouring methods

Contouring is the conversion from a volumetric representation (e.g. an octree) to a triangle mesh [Holmlid, 2010]. Contouring can also be called iso-surfacing [Ju, 2009]. Several surface reconstruction methods have been presented. This section presents different con-touring methods, for example the classical method Marching Cubes.

Marching cubes

The Marching cubes algorithm, presented by [Lorensen and Cline, 1987], is a well-known contouring method.

Method description The method creates a new output mesh from an implicit function by marching, i.e. iterating, over a uniform voxel grid. The grid and the implicit function correspond to the input model. If all corners of a voxel have the same sign, the voxel is completely inside or outside the input surface. Then no triangles are generated. If the corners have different signs, triangles and ver-tices will be created according to the Marching Cubes triangulation table, see figure 3.4. Since a voxel has eight corners and since a corner can be either positive or negative (i.e. either inside or out-side), there are 28 possible configurations. However, many of these are equivalent to each other. There are only 15 unique cases, which can be seen in figure 3.4. The remaining 241 cases can be found by reflection, inversion or rotation [Botsch et al., 2010].

(48)

32 3 Evaluation and related work

After iteration over all voxels in the grid, a number of triangles have been created. The union of these triangles gives the final mesh.

Figure 3.4: The 15 base configurations of the Marching Cubes triangulation table. Depending on the corner signs, different triangles and vertices will be generated.

The original Marching Cubes algorithm has several issues. One dis-advantage is that it has problems with degenerate triangles. Sur-faces created by using Marching cubes may also have holes and topological inconsistencies. This is due to ambiguous faces. Some of the basic configurations described in figure 3.4 are ambiguous. [Newman and Hong, 2006] According to Kahzdan et al. [Kazhdan et al., 2007] the surface constructed by Marching Cubes always will be connected if a uniform grid is used. However, the result will be poor if the grid is adaptive since there will be holes in the output surface in areas where neighbouring voxel grids are at different tree levels.

Method evaluation Due to the drawbacks of Marching Cubes that were mentioned above, Marching cubes is not an interesting method for this project.

Dual marching cubes

The Dual Marching Cubes (DMC) algorithm developed by Scott Schaefer and Joe Warren [Schaefer and Warren, 2004] is an improve-ment of the original Marching Cubes algorithm. One improveimprove-ment is that DMC, in contrast to Marching cubes, also works on adaptive grids.

(49)

3.1 Related work 33

Method description The basic idea with DMC is to construct a new grid from the adaptive grid (an octree). Figure 3.5 shows how a new grid can be created from a quad tree. The new grid is called a dual grid. As can be seen in the figure, the cells of the dual grid are not always squares. And the same holds for the 3D case. However, the cells will be topologically equivalent to voxels since coinciding vertices and collapsed edges will be duplicated. Therefore, the stan-dard Marching cubes lookup table, presented in section 3.1.4, can be used when the output surface is generated. DMC can be imple-mented with three main parts: Creation of dual vertices, construc-tion of the dual grid and Marching Cubes. Each octree voxel has one dual vertex. During the dual grid construction the dual ver-tices corresponding to the eight voxels that shares one corner are bound together. This leads to that topological cubes are created. The corners of a topological cube are the dual vertices that corre-sponds to octree voxels that share one specific octree corner. Figure 3.5 [Holmlid, 2010] shows a 2D case. Each quad tree corner (black point) is encircled by a topological square. This means that four dual vertices are bounded together around the quadtree corner. It works in the same way in the 3D case, but with eight dual vertices in one topological cube. [Holmlid, 2010]

Figure 3.5: The connectivity of a dual grid constructed from a quadtree. The dual grid is red and the quadtree is black. [Holmlid, 2010]

There are several benefits with the DMC algorithm. One advantage is that there are no inter-cell dependencies, which reduces the al-gorithm complexity. This may also lead to a reduced process time. Another advantage is that the output is guaranteed to be manifold.

(50)

34 3 Evaluation and related work

A drawback with the algorithm is that polygons with a very small, or even zero, area may be created. Furthermore, one problem with the DMC algorithm is that topological holes may be generated. Note that a topological hole is not the same as a hole. The output is still manifold, but new "correct" holes will be introduced to the output surface. See for example figure 3.6 [Kazhdan et al., 2007].

Figure 3.6: A mesh reconstructed by using Dual Marching Cubes. Several topological holes have unfortunately been gen-erated. [Kazhdan et al., 2007]

Method evaluation This method risks to introduce two new errors: degenerated triangles and topological holes. Therefore, other con-touring methods are more suitable for this project.

Dual contouring

This section describes the dual contouring method proposed by Ju et al. [Ju et al., 2002].

Method description Dual Contouring includes two main steps: 1. A vertex is generated for each voxel in the octree that exhibits

a sign change. The position of the vertex will be the x that minimizes the quadratic error function in equation 3.3.

2. For each voxel edge that has different signs on its two corners, generate a quad that connects the four vertices (from 1.) cor-responding to the four voxels containing the edge. See figure 3.7.

(51)

3.1 Related work 35

E[x] =X

i

(ni(x − pi))2 (3.3)

Equation 3.3 shows a quadratic error function. ni is the unit normal

of the input model in the intersection point with the octree, and pi

is the intersection point.

Figure 3.7: Dual Contouring: A quad (pink), that connects the vertices (blue) of the four octree leaf voxels, is created.

Method evaluation Dual Contouring is a popular contouring al-gorithm. However, there exists a promising improvement of this method: Manifold dual contouring. The latter guarantees that the output is manifold and furthermore it decimates the output, there-fore Manifold dual contouring is more suitable for this project.

Manifold dual contouring

Schaefer et al. [Schaefer et al., 2007] present a contouring method called Manifold Dual Contouring (MDC). This method is described in chapter 6. Two great andvantages with MDC is that it guarantees a manifold output and that it decimates the model.

(52)

36 3 Evaluation and related work

3.1.5

Methods based on expanding objects inside the

input model

In this section three different methods will be presented.

Competing fronts for coarse-to-fine surface reconstruction

Sharf et al. [Sharf et al., 2006] present a method for reconstructing a surface from a point cloud. According to the article, the algorithm is robust to missing data in broken areas.

Method description The method uses a deformable object that grows inside the point cloud. See figure 3.8 [Sharf et al., 2006] for a visual-ization of the method. However, this method is mainly for surface reconstruction, not for mesh repair. The deformable object is

ini-Figure 3.8: Left: The broken input model. Two images in the middle: The deformable object grows inside the point cloud of the input model. Right: The reconstructed surface. [Sharf et al., 2006]

tialized as a small sphere inside the point cloud of the input model. The vertices of the sphere moves in outward normal direction to-ward the input point cloud. The movement is based on a distance map of the point cloud. The distance map is saved in an adaptive 3D grid. When a part of the deformable object needs to pass trough a narrow region, finer levels of the octree will be used thanks to its adaptive behaviour. A vertex will stop moving if it is close to a point in the point cloud or if the deformable object is about to pass through a sparse region of the point cloud, for example a re-gion where the input model has a hole. When several vertices have

(53)

3.1 Related work 37 stopped moving, the deformable object may be divided into several patches. Each such patch is called a front, and they will continue to move independently. New positions for all fronts’ vertices are computed in each iteration. First the coarse parts of the input mesh will be reconstructed, and then the finer parts.

The authors mention five elements that make this algorithm suc-cessful:

• Competing fronts • Smooth fronts • Outward movement • Adaptive dynamic mesh • Final fitting

The Competing fronts element relates to the coarse-to-fine evolve-ment of the fronts. First, all vertices of the deformable object move as one front. After a while, when some vertices have stopped, the front is split into several competing fronts. Thanks to this prop-erty, this method gives the possibility to reconstruct the surface in growing level-of-details. Fronts that are faster from the input point cloud will move faster than fronts that are near the point cloud. For avoiding overlaps and self-intersections, smooth fronts are used. A property of the fronts is that they always move in outward nor-mal direction. The movement is dependent of the unsigned dis-tance field, which lets the vertices move both up-hill and down-hill. Thanks to this property, a front can move from a narrow region to a broader one.

The Adaptive dynamic mesh element of the algorithm gives the output model, the reconstructed surface, a high quality. Thanks to this property, the resolution of the mesh will adapt to local charac-teristics of the input model.

When all vertices of the deformable object have stopped, i.e. when the evolution process is finished, it is time for the Final fitting. The final surface is reconstructed by using a Moving Least Square pro-jection. In regions with missing points in the point cloud, for

(54)

ex-38 3 Evaluation and related work

ample holes, the final surface is interpolated with a least-square-mesh. During the interpolation, the vertices from the Moving Least Square projection are used as constraints. Moving least squares is a method for reconstructing continuous functions from unorganized points. In computer graphics it is used for reconstructing a surface from a set of points. Least squared meshes are described in an arti-cle by Sorkine and Cohen-Or [Sorkine and Cohen-Or, 2004]. Least square meshes are meshes that approximate a set of control points in a least-squares manner.

Method evaluation According to the article [Sharf et al., 2006] this algorithm seems to be promising. It repairs holes and guarantees water-tightness. However, the main author, Andrei Sharf, wrote the following in an e-mail [Sharf, 2013] to the author of this thesis: "I myself would take the core algorithms from there but redesign the evolution technique and projection from scratch.". In the same e-mail, he also asked if the Poisson Reconstruction method had been tested. He said the following about that method: "It is supposed to be state-of-the-art. But it depends on the specific models you are working with.". The Poisson Reconstruction method gave unsatisfac-tory results, as can be seen in section 3.1.5. Therefore, this method was not considered as interesting for the mesh repair project either.

Screened poisson surface reconstruction

This method by Kazhdan and Hoppe [Kazhdan and Hoppe, 2013] is, according to Andrei Sharf [Sharf, 2013], the state-of-the-art method for reconstructing surfaces from point clouds. However, Sharf also stated that it depends on the input models.

Method description According to the authors of the Poisson recon-struction paper [Kazhdan and Hoppe, 2013], the Poisson surface re-construction creates manifold output surfaces from the input point cloud. This means that the input model that we want to heal can be converted to a point cloud, and then the Poisson reconstruction algorithm can reconstruct a new, watertight surface from the points. The points of the point cloud are used as interpolation constraints. This algorithm will not be described further, since the tests that was done during the evaluation gave bad results, see below.

(55)

3.1 Related work 39

Method evaluation The code of the Screened Poisson Surface Re-construction is available online [Microsoft, 2013]. Thus it was possi-ble to test the method during this thesis work on one of Configura’s test models. The result was not satisfying, as can be seen in figure 3.9. Probably this test model was not a model suitable for this al-gorithm. Therefore, Screened poisson surface reconstruction is not interesting for this mesh repair project. Furthermore, is is better to use a method that is adapted for broken polygonal meshes as input, not point clouds.

Figure 3.9:Testing of the Screened Poisson Surface Reconstruc-tion algorithm at different depths.

Topological simplification of isosurfaces in volumetric data using octrees

This section describes the method presented by Vanderhyde and Szymczak in 2007 [Vanderhyde and Szymczak, 2008].

Method description The method has one shrinking procedure and one growing procedure. Both procedures use the distance to the input surface. There is a choice whether to use the result of shrink-ing or the result of growshrink-ing. The choice can be done manually or automatically. The algorithm starts with one surface inside the iso-surface, and one surface outside the isosurface. The isosurface cor-responds to the input model. The surface inside the isosurface will be expanded, and the surface completely outside the isosurface will be contracted. The expansion and contraction is done on a voxel-by-voxel basis. This algorithm is a volumetric method that, according

(56)

40 3 Evaluation and related work

to the article, can patch holes and remove topological noise. Fur-thermore, the algorithm prevents topology changes on the surface. The volume is represented in an octree format, which improves the performance of the algorithm. The result of the algorithm is two surfaces.

This method builds on an earlier work [Szymczak and Vanderhyde, 2003] by the same authors. In the earlier work, a bounding box of the input model is determined. Then this bounding box is filled with voxels. Then voxels are carved from the boundary until the input surface is reached. A local check is also used for making sure that a voxel would not be removed if that would change the topol-ogy. What has been described above can be seen as if the input model was shrink-wrapped in plastic.

The new approach, presented in [Vanderhyde and Szymczak, 2008], also uses a growing approach that adds voxels until the input sur-face is reached. As in the earlier method, a local check is used every time a voxel is added. The check is to make sure that the topology will be unchanged when the voxel is added. This procedure can be described as if a balloon was inflated inside the input model. In fig-ure 3.10 [Vanderhyde and Szymczak, 2008] the results from carving and growing can be seen.

Figure 3.10: Left: The input model. Center: Results from the growing procedure. Right: Results from the carving procedure. [Vanderhyde and Szymczak, 2008]

After either the result from the carving or the result from the grow-ing has been chosen, the voxels of the result will be adjusted. This is to not limit the algorithm to only handle genus-0 models. The genus of a surface can in a simple way be explained as the

(57)

num-3.1 Related work 41 ber of holes in a surface. A sphere has for example genus 0, and a ring has genus 1. Therefore, the problems with the results in fig-ure 3.10 can be handled. Figfig-ure 3.11 [Vanderhyde and Szymczak, 2008] from the article shows how the handles can be opened, and thus the ugly patching on the right result model in figure 3.10 can be avoided.

Figure 3.11: Results for the Topological simplification of iso-surfaces method. In each image, one more handle is opened. [Vanderhyde and Szymczak, 2008]

Method evaluation Since no software for testing this method was found, the evaluation of this method is only based on theory and results from the authors of the article [Vanderhyde and Szymczak, 2008]. Since no other methods of this category have worked in a sat-isfactory manner, this method was deselected. However, the theory is still interesting. Another drawback is that the method requires user influence for each component in each input model. This is due to that each component needs a seed voxel, and that voxel has to be specified by the user. This will make it harder to process several models at the same time. Even though this only has to be done as a first step of the process, the user has to be active for every model, which is undesirable.

3.1.6

Previous thesis workers at Configura working

with the same problem

As a part of the evaluation procedure of this thesis work, the pre-vious thesis workers’ algorithm was evaluated. The prepre-vious the-sis workers at Configura, Magnus Karlberg and Daniel Persson, im-plemented Ju’s method [Ju, 2004] with Marching Cubes. However,

References

Related documents

Several DNA repair associated proteins, as well as the PI3-K/AKT signalling pathway that promotes cellular survival, have been studied.. The work in this thesis contributes

Industrial Emissions Directive, supplemented by horizontal legislation (e.g., Framework Directives on Waste and Water, Emissions Trading System, etc) and guidance on operating

I dag uppgår denna del av befolkningen till knappt 4 200 personer och år 2030 beräknas det finnas drygt 4 800 personer i Gällivare kommun som är 65 år eller äldre i

Detta projekt utvecklar policymixen för strategin Smart industri (Näringsdepartementet, 2016a). En av anledningarna till en stark avgränsning är att analysen bygger på djupa

DIN representerar Tyskland i ISO och CEN, och har en permanent plats i ISO:s råd. Det ger dem en bra position för att påverka strategiska frågor inom den internationella

Av 2012 års danska handlingsplan för Indien framgår att det finns en ambition att även ingå ett samförståndsavtal avseende högre utbildning vilket skulle främja utbildnings-,

In this multicenter prospective randomized study, an autologous full-thickness skin graft was used as an on-lay prosthesis and compared with conventional abdominal wall

The ambiguous space for recognition of doctoral supervision in the fine and performing arts Åsa Lindberg-Sand, Henrik Frisk &amp; Karin Johansson, Lund University.. In 2010, a