mesh simplification of complex vrml models652656/fulltext01.pdf · 2013. 10. 1. ·...

56
Department of Science and Technology Institutionen för teknik och naturvetenskap Linköpings Universitet Linköpings Universitet SE-601 74 Norrköping, Sweden 601 74 Norrköping Examensarbete LITH-ITN-MT-EX--05/020--SE Mesh simplification of complex VRML models Rebecca Lagerkvist 2005-02-24

Upload: others

Post on 29-Oct-2020

1 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: Mesh simplification of complex VRML models652656/FULLTEXT01.pdf · 2013. 10. 1. · LITH-ITN-MT-EX--05/020--SE Mesh simplification of complex VRML models Examensarbete utfört i medieteknik

Department of Science and Technology Institutionen för teknik och naturvetenskap Linköpings Universitet Linköpings Universitet SE-601 74 Norrköping, Sweden 601 74 Norrköping

ExamensarbeteLITH-ITN-MT-EX--05/020--SE

Mesh simplification of complexVRML modelsRebecca Lagerkvist

2005-02-24

Page 2: Mesh simplification of complex VRML models652656/FULLTEXT01.pdf · 2013. 10. 1. · LITH-ITN-MT-EX--05/020--SE Mesh simplification of complex VRML models Examensarbete utfört i medieteknik

LITH-ITN-MT-EX--05/020--SE

Mesh simplification of complexVRML models

Examensarbete utfört i medieteknikvid Linköpings Tekniska Högskola, Campus

Norrköping

Rebecca Lagerkvist

Handledare Pär KlingstamExaminator Stefan Gustavson

Norrköping 2005-02-24

Page 3: Mesh simplification of complex VRML models652656/FULLTEXT01.pdf · 2013. 10. 1. · LITH-ITN-MT-EX--05/020--SE Mesh simplification of complex VRML models Examensarbete utfört i medieteknik

RapporttypReport category

Examensarbete B-uppsats C-uppsats D-uppsats

_ ________________

SpråkLanguage

Svenska/Swedish Engelska/English

_ ________________

TitelTitle

FörfattareAuthor

SammanfattningAbstract

ISBN_____________________________________________________ISRN_________________________________________________________________Serietitel och serienummer ISSNTitle of series, numbering ___________________________________

NyckelordKeyword

DatumDate

URL för elektronisk version

Avdelning, InstitutionDivision, Department

Institutionen för teknik och naturvetenskap

Department of Science and Technology

2005-02-24

x

x

LITH-ITN-MT-EX--05/020--SE

http://www.ep.liu.se/exjobb/itn/2005/mt/020/

Mesh simplification of complex VRML models

Rebecca Lagerkvist

In a large part of their work Volvo Cars uses digital models - in the design process,geometry simulation, safety tests, presentation material etc. The modelsmay be used for many purposes but they are normally only produced in one levelof detail. In general, the level that suits the most extreme demands. High resolutionmodels challenge rendering performances, transmission bandwidth andstorage capacities. At Volvo Cars there is time, money and energy to be savedby adapting the the model’s level of detail to their area of usage.The aim of this thesis is to investigate if the Volvo Cars models can be reducedto containing less than 20% of its original triangles without compromisingtoo much in quality. In the thesis, the mesh simplification field is researchedand the simplification algorithm judged to best suit the needs of Volvo Cars isimplemented in a C++ program. The program is used to test and analyze theVolvo Cars’ models.The results show that it is possible to take away more than 80% of the themodel’s polygons hardly without affecting the appearance.

mesh simplification, polygon reduction, Volvo Cars, Visualization, Computer Graphics

Page 4: Mesh simplification of complex VRML models652656/FULLTEXT01.pdf · 2013. 10. 1. · LITH-ITN-MT-EX--05/020--SE Mesh simplification of complex VRML models Examensarbete utfört i medieteknik

Upphovsrätt

Detta dokument hålls tillgängligt på Internet – eller dess framtida ersättare –under en längre tid från publiceringsdatum under förutsättning att inga extra-ordinära omständigheter uppstår.

Tillgång till dokumentet innebär tillstånd för var och en att läsa, ladda ner,skriva ut enstaka kopior för enskilt bruk och att använda det oförändrat förickekommersiell forskning och för undervisning. Överföring av upphovsrättenvid en senare tidpunkt kan inte upphäva detta tillstånd. All annan användning avdokumentet kräver upphovsmannens medgivande. För att garantera äktheten,säkerheten och tillgängligheten finns det lösningar av teknisk och administrativart.

Upphovsmannens ideella rätt innefattar rätt att bli nämnd som upphovsman iden omfattning som god sed kräver vid användning av dokumentet på ovanbeskrivna sätt samt skydd mot att dokumentet ändras eller presenteras i sådanform eller i sådant sammanhang som är kränkande för upphovsmannens litteräraeller konstnärliga anseende eller egenart.

För ytterligare information om Linköping University Electronic Press seförlagets hemsida http://www.ep.liu.se/

Copyright

The publishers will keep this document online on the Internet - or its possiblereplacement - for a considerable time from the date of publication barringexceptional circumstances.

The online availability of the document implies a permanent permission foranyone to read, to download, to print out single copies for your own use and touse it unchanged for any non-commercial research and educational purpose.Subsequent transfers of copyright cannot revoke this permission. All other usesof the document are conditional on the consent of the copyright owner. Thepublisher has taken technical and administrative measures to assure authenticity,security and accessibility.

According to intellectual property law the author has the right to bementioned when his/her work is accessed as described above and to be protectedagainst infringement.

For additional information about the Linköping University Electronic Pressand its procedures for publication and for assurance of document integrity,please refer to its WWW home page: http://www.ep.liu.se/

© Rebecca Lagerkvist

Page 5: Mesh simplification of complex VRML models652656/FULLTEXT01.pdf · 2013. 10. 1. · LITH-ITN-MT-EX--05/020--SE Mesh simplification of complex VRML models Examensarbete utfört i medieteknik

Abstract

In a large part of their work Volvo Cars uses digital models - in the design pro-cess, geometry simulation, safety tests, presentation material etc. The modelsmay be used for many purposes but they are normally only produced in one levelof detail. In general, the level that suits the most extreme demands. High res-olution models challenge rendering performances, transmission bandwidth andstorage capacities. At Volvo Cars there is time, money and energy to be savedby adapting the the model’s level of detail to their area of usage.

The aim of this thesis is to investigate if the Volvo Cars models can be re-duced to containing less than 20% of its original triangles without compromisingtoo much in quality. In the thesis, the mesh simplification field is researchedand the simplification algorithm judged to best suit the needs of Volvo Cars isimplemented in a C++ program. The program is used to test and analyze theVolvo Cars’ models.

The results show that it is possible to take away more than 80% of the themodel’s polygons hardly without affecting the appearance.

Page 6: Mesh simplification of complex VRML models652656/FULLTEXT01.pdf · 2013. 10. 1. · LITH-ITN-MT-EX--05/020--SE Mesh simplification of complex VRML models Examensarbete utfört i medieteknik

Preface

The Master Thesis was conducted at Volvo Car Cooperation, Torslanda, andwas initiated by Robert Jacobsson - Teamleader Geometry Simulation. Thethesis is the final examination of the Master of Media Technology program atLinkoping University1.

I would like to express my gratitude to the following people who helped methrough and made this thesis possible:

- Robert Jacobsson for initiating this project and for seeing a solution whereother people saw a problem.

- Johan Segeborn for putting much effort and energy into the project.

- Par Klingstam for giving the work the academic touch it needed.

- Hakan Pettersson for being there when I could not support another VisualStudio link error.

- Sven Ruden and Jan Hallqvist for feed-back on the test results.

- Stefan Gustavsson for his unlimited competence within computer graphicsand that he never stopped believing in me.

- Bjorn Andersson for well thought through feed-back on the report.

- Michael Hemph for his great knowledge of C++.

- Olle Hellgren and our soon-to-be-born for their support.

Rebecca LagerkvistGoteborg, March 6, 2005

1Civilingenjorsutbildningen i Medieteknik (180 poang)

1

Page 7: Mesh simplification of complex VRML models652656/FULLTEXT01.pdf · 2013. 10. 1. · LITH-ITN-MT-EX--05/020--SE Mesh simplification of complex VRML models Examensarbete utfört i medieteknik

Contents

1 Overview 61.1 Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 61.2 Research approach . . . . . . . . . . . . . . . . . . . . . . . . . . 7

1.2.1 Aim . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 71.2.2 Scope . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 71.2.3 Method . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8

2 Terminology 10

3 Frame of reference 143.1 What mesh simplification is not . . . . . . . . . . . . . . . . . . . 143.2 What mesh simplification is . . . . . . . . . . . . . . . . . . . . . 153.3 Geometry-based methods of mesh simplification . . . . . . . . . . 16

3.3.1 Vertex decimation . . . . . . . . . . . . . . . . . . . . . . 163.3.2 Vertex clustering . . . . . . . . . . . . . . . . . . . . . . . 173.3.3 Edge contraction . . . . . . . . . . . . . . . . . . . . . . . 173.3.4 Simplification envelopes . . . . . . . . . . . . . . . . . . . 18

3.4 Image-based methods of mesh simplification . . . . . . . . . . . . 183.5 Major features of the mesh simplification algorithms . . . . . . . 203.6 VRML - Virtual Reality Modeling Language . . . . . . . . . . . . 20

3.6.1 General description . . . . . . . . . . . . . . . . . . . . . . 213.6.2 VRML as a scene graph . . . . . . . . . . . . . . . . . . . 213.6.3 How geometry is described in VRML . . . . . . . . . . . . 213.6.4 The Volvo Cars VRML models . . . . . . . . . . . . . . . 22

4 Results - research and development 244.1 Researching the mesh simplification field . . . . . . . . . . . . . . 24

4.1.1 Requirements for the mesh simplification algorithm . . . . 244.1.2 Choosing an algorithm . . . . . . . . . . . . . . . . . . . . 254.1.3 Mesh simplification algorithm of choice . . . . . . . . . . 28

4.2 Development of the application . . . . . . . . . . . . . . . . . . . 314.2.1 Part one . . . . . . . . . . . . . . . . . . . . . . . . . . . . 324.2.2 Part two . . . . . . . . . . . . . . . . . . . . . . . . . . . . 334.2.3 Part three . . . . . . . . . . . . . . . . . . . . . . . . . . . 33

2

Page 8: Mesh simplification of complex VRML models652656/FULLTEXT01.pdf · 2013. 10. 1. · LITH-ITN-MT-EX--05/020--SE Mesh simplification of complex VRML models Examensarbete utfört i medieteknik

5 Results - testings 345.1 The size of the file . . . . . . . . . . . . . . . . . . . . . . . . . . 345.2 Result of the testings . . . . . . . . . . . . . . . . . . . . . . . . . 35

5.2.1 The bracket model . . . . . . . . . . . . . . . . . . . . . . 355.2.2 The robot model . . . . . . . . . . . . . . . . . . . . . . . 365.2.3 Late testings . . . . . . . . . . . . . . . . . . . . . . . . . 39

6 Conclusion 436.1 Evaluating the algorithm chosen . . . . . . . . . . . . . . . . . . 436.2 Evaluating the application created . . . . . . . . . . . . . . . . . 446.3 Evaluating the results of the testing . . . . . . . . . . . . . . . . 45

7 Future work 467.1 Geometric error measure . . . . . . . . . . . . . . . . . . . . . . . 467.2 Hidden surface removal . . . . . . . . . . . . . . . . . . . . . . . 467.3 Replacement of complex shapes . . . . . . . . . . . . . . . . . . . 47

A VRML syntax 49

B Open Source packages 51B.1 The VRML parser . . . . . . . . . . . . . . . . . . . . . . . . . . 51B.2 The Qslim package . . . . . . . . . . . . . . . . . . . . . . . . . . 51

3

Page 9: Mesh simplification of complex VRML models652656/FULLTEXT01.pdf · 2013. 10. 1. · LITH-ITN-MT-EX--05/020--SE Mesh simplification of complex VRML models Examensarbete utfört i medieteknik

List of Figures

1.1 Method . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9

2.1 Shaded and wire frame polygon mesh . . . . . . . . . . . . . . . 112.2 Manifold 3D Surface . . . . . . . . . . . . . . . . . . . . . . . . . 122.3 Non manifold 3D surface . . . . . . . . . . . . . . . . . . . . . . 122.4 Moebius strip . . . . . . . . . . . . . . . . . . . . . . . . . . . . 132.5 Convex polygon . . . . . . . . . . . . . . . . . . . . . . . . . . . . 132.6 Concave polygon . . . . . . . . . . . . . . . . . . . . . . . . . . . 13

3.1 Same model different resolution . . . . . . . . . . . . . . . . . . . 153.2 Two planes with different resolution but the same accuracy. . . 153.3 Vertex Decimation . . . . . . . . . . . . . . . . . . . . . . . . . . 173.4 Vertex Clustering . . . . . . . . . . . . . . . . . . . . . . . . . . . 173.5 Edge Contraction . . . . . . . . . . . . . . . . . . . . . . . . . . . 183.6 Image-Driven Simplification . . . . . . . . . . . . . . . . . . . . . 193.7 Comparison Image-Driven/Geometry Driven . . . . . . . . . . . 20

4.1 Disconnected surfaces . . . . . . . . . . . . . . . . . . . . . . . . 254.2 Standard edge contraction . . . . . . . . . . . . . . . . . . . . . . 284.3 Non-edge contraction . . . . . . . . . . . . . . . . . . . . . . . . . 294.4 Geometric interpretation of quadratic error metrics. . . . . . . . 304.5 Overview of the C++ program . . . . . . . . . . . . . . . . . . . 31

5.1 Bracket - original model . . . . . . . . . . . . . . . . . . . . . . . 355.2 Bracket - simplification 12% . . . . . . . . . . . . . . . . . . . . . 365.3 Bracket - adjusted simplification 12% . . . . . . . . . . . . . . . . 365.4 Robot - original . . . . . . . . . . . . . . . . . . . . . . . . . . . . 375.5 Robot - details of original . . . . . . . . . . . . . . . . . . . . . . 385.6 Robot - simplification 25% . . . . . . . . . . . . . . . . . . . . . . 395.7 Robot - adjusted simplification 25% . . . . . . . . . . . . . . . . 405.8 Volvo V70 original shaded . . . . . . . . . . . . . . . . . . . . . . 415.9 Volvo V70 original wire frame . . . . . . . . . . . . . . . . . . . . 415.10 Volvo V70 simplified shaded . . . . . . . . . . . . . . . . . . . . . 425.11 Volvo V70 simplified wire frame . . . . . . . . . . . . . . . . . . . 42

4

Page 10: Mesh simplification of complex VRML models652656/FULLTEXT01.pdf · 2013. 10. 1. · LITH-ITN-MT-EX--05/020--SE Mesh simplification of complex VRML models Examensarbete utfört i medieteknik

5

A.1 A piece of VRML code . . . . . . . . . . . . . . . . . . . . . . . . 50

Page 11: Mesh simplification of complex VRML models652656/FULLTEXT01.pdf · 2013. 10. 1. · LITH-ITN-MT-EX--05/020--SE Mesh simplification of complex VRML models Examensarbete utfört i medieteknik

Chapter 1

Overview

1.1 Introduction

In a large part of their work Volvo Cars uses digital models - in the designprocess, geometry simulation, safety tests, presentation material etc.

The digital models are either produced at Volvo Cars or by one of their sup-pliers. The models may be used for many purposes but they are normally onlyproduced in one level of detail. In general, the level that suits the most extremedemands like those of collision detection simulation. Few other applications de-mand such level of detail but since there is only one version of the model thesame high resolution is used no matter what the purpose is.

High resolution models challenge rendering performances, transmission band-width and storage capacities. To work with excessive resolution wastes money.It slows the work process and demands extra resources.

At Volvo Cars there are no routines around the simplification of digitalmodels. There is no software that automatically reduce the level of detail.When simplification is needed it is done manually by adjusting the settings inthe Computer Aided Engineering (CAE) programs. This is laborious work andthe result is not always satisfactory.

For documentation and presentation purposes it is often needed to exportthe models from the CAE-programs to a file format that can be opened in theprogram Cosmo Player1 on a standard PC. The standard CAE-programs atVolvo Cars are RobCad and Catia ran on UNIX. The only export option fromthese programs are the Virtual Reality Modeling Language (VRML). The highlevel of detail of the models and the properties of the VRML format makes thefiles extremely large. Most of the time too large to be opened in Cosmo Playeron standard hardware.

Consequently, the VRML exports are not used and instead the presentationmaterials contain print-screen pictures of the models. Using static 2D picturesimply that the interactivity is lost, there is no possibility of making animations

1Volvo Cars standard Virtual Reality Modeling Language (VRML) browser

6

Page 12: Mesh simplification of complex VRML models652656/FULLTEXT01.pdf · 2013. 10. 1. · LITH-ITN-MT-EX--05/020--SE Mesh simplification of complex VRML models Examensarbete utfört i medieteknik

CHAPTER 1. OVERVIEW 7

or to show different views of the object. To make it possible to use VRML thelevel of detail of the models must be lowered. Ideally, to containing less than20% of the original polygons without losing too much in visual quality.

Presentation material is important at Volvo Cars. It is the link betweenseparate work groups like design, simulation and testing. The clearer the com-munication between these groups the better the work flow in the entire VolvoCars organization.

Volvo Cars needs to analyze their digital model work. There is an obviousneed to lower the level of detail of the 3D models. Primarily, to be able to useVRML in presentation material but in a broader perspective also to ease thework of everyone concerned with the models.

It is important to find out if the models carry redundant information. Ifthat is the case they can be simplified without losing precision and the approxi-mations would be good enough even for a wider use than presentation material.

1.2 Research approach

1.2.1 Aim

The primary goal of the thesis is to examine if the Volvo Cars’ 3D digital modelscould be reduced to containing less than 20% of its original polygons using a meshsimplification algorithm. To reach this goal the thesis focuses the development ofa C++ program performing mesh simplification based on an existing algorithm.To accomplish the goal, three main research questions have been put forth. Thequestions are to be answered by the thesis.

Q1 Which of the presently existing mesh simplification algorithms conformsthe most to the needs of Volvo Cars?

Q2 What features do a mesh simplification program able to reduce the Volvocars’ 3D digital models need to have?

Q3 If it is not possible to reduce the Volvo Cars’ 3D models by more than a80% using the mesh simplification program constructed, what character-istics must be added?

1.2.2 Scope

The building of software is a never ending process and it will always be possibleto make improvements. To limit the extent, the thesis work has been boundedto comprise the following:

- Literature study The literature study has been limited to include meshsimplification in the sense of how to reduce the number of polygons in ageneric mesh. The study will not be directed towards specific cases suchas multilayer meshes or hidden surface removal.

Page 13: Mesh simplification of complex VRML models652656/FULLTEXT01.pdf · 2013. 10. 1. · LITH-ITN-MT-EX--05/020--SE Mesh simplification of complex VRML models Examensarbete utfört i medieteknik

CHAPTER 1. OVERVIEW 8

- Application development The application will be confined to accepting alimited input. It will only be developed to allow the VRML syntax thatis most common to the Volvo Cars’ digital models.

As far as possible the application will be based on Open Source material.Even if the code available is not optimized for the purpose of this thesisit will be taken advantage of. Reusing other peoples code is the onlypossible solution in order to develop such an extensive program as themesh simplification application within the time span of the thesis.

The mesh simplification program will not include a Graphic User Interface(GUI).

- Testing The major tests will be performed on smaller models (100 000-30000 polygons). Working with large models is very time consuming. Inorder to speed up the iteration process (see section ?? on page ??) it hasbeen judge wise not to include larger models in the testing until perhapsthe very last iteration cycle.

1.2.3 Method

The work of the thesis can roughly be divided into three parts:

- Conceptualization

- Iterative development

- Final analysis

The first part of the thesis, the conceptualization, would be to define how the aimof the thesis - to examine if the Volvo Cars’ 3D digital models could be reducedto containing less than 20% of its original polygons using a mesh simplificationalgorithm - could be transformed into practical act.

To examine if the Volvo Cars’ models could be reduced, a tool to performthe testing with is needed. The primer work of this thesis was therefore tocreate such a tool. Hence, the conceptualization consisted in trying to give aconcrete form to how the mesh simplification algorithm could be implemented.The conceptualization would be done primarily through researching the field ofmesh simplification software. To look at existing software - both commercialand open source - in order to create an idea of what the difficulties and actualproblems with developing one would be. A classical literature study, with theaim of finding theories that apply to the research questions of section 1.2.1,would also be a part of the initial phase.

The conceptualization phase was to be keept short. The thesis is an edu-cational project which means that there is little experience brought into it. Todesign software on an abstract basis demands a lot of know-how, more thanwas available in this project. Hence, the ambition was to early move into thedevelopment phase and there build the software by trial and error.

Page 14: Mesh simplification of complex VRML models652656/FULLTEXT01.pdf · 2013. 10. 1. · LITH-ITN-MT-EX--05/020--SE Mesh simplification of complex VRML models Examensarbete utfört i medieteknik

CHAPTER 1. OVERVIEW 9

To successfully build something by trial and error there must be several trials.The development phase was therefor made iterative. What the developmentphase was to consist in can be seen in Fig. 1.1 on page 9.

Figure 1.1: The thesis’ three phases. The development phase is shaded in gray.

The thought was to have outer and inner loops. The inner loop wouldconsist of programming, testing and validation and would be repeated moreoften than the two outer loops. In the beginning of the development phase theiterations would mostly follow the upper outer loop and go through literaturestudy, modeling and back to the inner loop. As the project advanced the ideawas that the work would move on to the path of the lower outer loop and focusmore on documentation. Nevertheless, if needed it would be possible to go backand do more literature studies even rather late in the development.

The project was planned according to Fig. 1.1 to make it possible to bringin new knowledge even during the development phase.

The testings of the inner loops would follow a simple methodology. Sincecomputer graphics is much about what looks good is good the only validationwould be to look at the models to see if their appearance seemed okay. The testsmerely would consist in running the Volvo Cars’ models through the programcreated and examine the outcome, if there would be an outcome.

Once the development phase would be over all the testing and programmingwould be ended and the results analyzed and put into the documentation.

Page 15: Mesh simplification of complex VRML models652656/FULLTEXT01.pdf · 2013. 10. 1. · LITH-ITN-MT-EX--05/020--SE Mesh simplification of complex VRML models Examensarbete utfört i medieteknik

Chapter 2

Terminology

The following terminology will be used through out this master thesis reportwithout further explanation.

Rendering

Rendering is the action of drawing the 3D computer graphics model on to the2D screen. The following terminology can be associated with rendering.

Frames per second

Rendering speed is often measured in frames per second and it refers to howmany pictures of the model that can be drawn on the screen per second.

GPU rendering vs. CPU rendering

To render large models could be a time consuming process. Over the years thespeed of rendering has been improved mainly be the introduction of hardwarerendering performed on the GPU (Graphics Processing Unit) instead of the CPU(Central Processing Unit). The GPU:s have many parallel processors optimizedfor rendering purposes. Using the GPU’s processors correctly can speed uprendering by hundreds or even thousands of frames per seconds.

To use GPU rendering the program performing the rendering must supportit. Both OpenGL and DirectX, the most widespread graphic programmingpackages, support GPU rendering.

Wireframe

When a model is rendered in wire frame no surfaces properties are being shown.This is illustrated in Fig. 2.1 on page 11.

10

Page 16: Mesh simplification of complex VRML models652656/FULLTEXT01.pdf · 2013. 10. 1. · LITH-ITN-MT-EX--05/020--SE Mesh simplification of complex VRML models Examensarbete utfört i medieteknik

CHAPTER 2. TERMINOLOGY 11

Polygon Mesh

A polygon mesh is assumed to be a collection of vertices in three dimensionalspace, and an associated collection of polygons composed of those vertices. Thepolygons could be seen as the building blocks of the model (see Fig 2.1 on page11). A simplification algorithm is intended to simplify a polygonal mesh byreducing the number of polygons in the mesh, while retaining as much fidelityto the model as possible. The following terminology could be associated with apolygon mesh.

Figure 2.1: 3D computer graphics model. In the model to the right, which isrendered in wire frame, the triangles constituting the model can clearly be seen.

Vertices and coordinates

In this thesis report the term vertices will be used for x, y and z-values thatconstitutes the points which are linked together to form the polygons.

The term coordinates refer to the integer numbers telling how the verticeswill be connected into polygons. This terminology is not standard in all litera-ture and it might be that the two terms are used differently elsewhere.

Polygons and triangles

In this thesis report the term polygon refer the shapes that are formed whenthe vertices are linked together. There is no limit to how many vertices eachpolygon may have. As said, the polygons constitute the mesh.

Triangles are virtually the same thing as polygons with the only differencethat triangles can only have three vertices.

Page 17: Mesh simplification of complex VRML models652656/FULLTEXT01.pdf · 2013. 10. 1. · LITH-ITN-MT-EX--05/020--SE Mesh simplification of complex VRML models Examensarbete utfört i medieteknik

CHAPTER 2. TERMINOLOGY 12

Tessellated

A tessellated surface is a surface described by polygons as opposed to a surfacedefined mathematically through NURBS or implicit functions.

Manifold

A manifold polygon mesh consists of a collection of edges, vertices and trianglesconnected such that each edge is shared by at most two triangles. In a manifoldwithout boundaries, each edge is shared by exactly two triangles.

Figure 2.2: Manifold 3D Surface

Non-manifold

A non-manifold polygon mesh consists of a collection of edges, vertices and tri-angles connected such that each edge may be shared by more than two triangles.The triangles may also intersect each other arbitrarily.

Figure 2.3: Non manifold 3D surface

Orientable

A surface is said to be orientable if all the of the face normals of a mesh may beoriented consistently. It is easier to understand the concept of orientable fromthe concept of non-orientable (see next paragraph).

Non-orientable

The most common example of a non-orientable surface is the moebius strip (Fig.2.4 on page 13). It has only one surface and only one edge. Sliding a surfacenormal along its surface the direction of the surface normal will have changed

Page 18: Mesh simplification of complex VRML models652656/FULLTEXT01.pdf · 2013. 10. 1. · LITH-ITN-MT-EX--05/020--SE Mesh simplification of complex VRML models Examensarbete utfört i medieteknik

CHAPTER 2. TERMINOLOGY 13

with an 180 degrees when it reaches the point it started from. This is whatmakes the surface non-orientable.

Figure 2.4: Moebius strip

Topology

The topology of a mesh deals with the dependencies between its polygons. Sim-plified it could be said that the topology of a models tells how many holes thereare in the model.

Convex polygons

A planar polygon is said to be convex if it contains all the line segment con-necting any pair of its points. Circling a convex polygon all the turns aroundthe corners will be in the same directions.

Figure 2.5: Convex polygon

Concave polygons

A concave polygon is a polygon that is not convex. It must have at least foursides and one internal angle that is greater than 180◦.

Figure 2.6: Concave polygon

Page 19: Mesh simplification of complex VRML models652656/FULLTEXT01.pdf · 2013. 10. 1. · LITH-ITN-MT-EX--05/020--SE Mesh simplification of complex VRML models Examensarbete utfört i medieteknik

Chapter 3

Frame of reference

3.1 What mesh simplification is not

Before digging deeper into mesh simplification it is necessary to put clear somethings that are often misconceived.

When speaking about mesh simplification one speaks about the reductionof the complexity of the 3D computer graphics model itself to a lower level ofdetail approximation of the original one.

Reducing the entire 3D model should not be confounded with reducing thecomplexity of the rendered image of the model. Today’s 3D model viewers areusually very efficient when transforming a 3D model to a 2D image seen on thescreen. Level of detail is adjusted according to the distance from which themodel is looked at, the z-buffer makes sure that objects hidden behind otherobjects are never drawn on the screen etc. These techniques are concerned withthe mapping of the model from 3D to 2D. They are dependent on knowing inwhich direction the model is viewed upon and they do nothing to the actualmodel, only to the picture of it drawn on the screen. The computer still needsto handle equal amount of data every time a calculation is performed on themodel.

It is also important to keep clear the difference between reducing the modeland compressing the file containing the model. There are many efficient tech-niques to compress the 3D model files. To illustrate, if a 3D model containsmany of the same objects it is enough to describe the geometry of the first ob-ject and then refer back to that one for the rest of them. However, when shownon a screen the model is still drawn with the same amount of polygons as beforethe compression. The model is not reduced the file is compressed.

The new standard file format for 3D computer models at Volvo Cars isJupiter (.jt). Jupiter is a light format, the files are small, because intelligentalgorithms of compression are used. However, when drawing the .jt-models onthe screen they will be just as heavy as any other model containing the samenumber of polygons.

14

Page 20: Mesh simplification of complex VRML models652656/FULLTEXT01.pdf · 2013. 10. 1. · LITH-ITN-MT-EX--05/020--SE Mesh simplification of complex VRML models Examensarbete utfört i medieteknik

CHAPTER 3. FRAME OF REFERENCE 15

3.2 What mesh simplification is

Many computer graphics application require complex, highly detailed modelsto serve their purposes. Collision detection simulation, for example, sometimesdemands the models to be made to an accuracy of millimeters and representedin very high resolution. Sometimes the resolution is as high that the human eyecease to see the difference between the original model and the approximation(see Fig. 3.1 on page 15). Since the computational cost of using a model is

Figure 3.1: Little difference can be seen between the original circles (the secondrendered in wire frame) to the left and the approximations, containing only 0,5per cent of the polygons, to the right.

directly related to complexity is it often desirable to use an approximations inplace of the excessively detailed originals. It must be possible to adapt the levelof detail to the fit the usage of the model.

Reducing complexity of the computer graphics models can be done throughmesh simplification. Mesh simplification is the taking away of triangles from themesh . The more triangles a mesh has the higher the resolution. High resolutionis not directly proportional to high accuracy. Take the example of Fig 3.2 onpage 15. The plane to the right is by no means better described than the plane

Figure 3.2: Two planes with different resolution but the same accuracy.

to the left. Even though the plane to the right would be simplified and trianglestaken away until it only consisted of the two triangles of the plane to the leftthe definition of the plane would not be less exact. There is no loss in accuracybecause before the simplification there was a redundancy in information. Thusthere can be mesh simplification without decreasing the accuracy. The normalcase is however that the taking away of triangles creates a coarser approximationof the original model.

Page 21: Mesh simplification of complex VRML models652656/FULLTEXT01.pdf · 2013. 10. 1. · LITH-ITN-MT-EX--05/020--SE Mesh simplification of complex VRML models Examensarbete utfört i medieteknik

CHAPTER 3. FRAME OF REFERENCE 16

Over the last 10 to 15 years there have been a large number of publishedarticles on the subject of mesh simplification. Every method consists of twoparts - how to decide which triangles to remove and how to remove them.Deciding which triangles to remove is called calculating the cost of reductionor simplification and removing the triangles is simply called simplification orreduction.

Roughly the different methods presented can be divided into two categoriesbased on the manner in which the cost is calculated - Geometry-based andImage-based. Infinitely more research has been put into the Geometry-basedfield than into the Image-based which appeared just recently.

3.3 Geometry-based methods of mesh simplifi-cation

Common to so called geometry-based simplification processes is the use of a ge-ometric 3D distance measure between the original and the simplified model toguide the simplification process. Minimizing this distance is equivalent to min-imizing the error of the approximation. Consequently, the goal of the geometrybased methods is geometric fidelity. In reality there are very few applications inwhich geometric fidelity is of much importance. Normally it is more interestingthat the approximation is visually similar to the original.

Nevertheless, research has been confined to geometry based methods. It wasnot until July 2000 when Lindstrom and Turk released their article on Image-Driven Simplification [10] that anything different appeared (see section 3.4 onpage 18).

Even though visual similarity might be more interesting than geometric fi-delity it is not said that the geometry-based methods are not useful.

Geometry-based methods have been the subject of research since the sev-enties. Down below, an overview of what is judged to be the most importantcategories of these methods is presented. However, due to the abundance ofpublications within this field the list is bound to be incomplete.

3.3.1 Vertex decimation

Initially described by Schroeder et al. [4]. The method iteratively selects avertex for removal, remove all adjacent triangles, and re-triangulates the result-ing hole (see Fig. 3.3 on page 17). The first algorithm presented by Schroederin 1992 carefully preserved topology, which is restricting for multi resolutionrendering systems. However, in 1997 Schroeder presented a supplement to hisarticle [9] describing a vertex decimation technique that did not maintain thetopology of the models and could handle non-manifold surfaces, something thatthe first one could not. The cost of removing triangles or as Schroeder calls it -the error (e) - is based on the triangle’s area (a):

ei =√

ai

Page 22: Mesh simplification of complex VRML models652656/FULLTEXT01.pdf · 2013. 10. 1. · LITH-ITN-MT-EX--05/020--SE Mesh simplification of complex VRML models Examensarbete utfört i medieteknik

CHAPTER 3. FRAME OF REFERENCE 17

This error measure has the effect of removing small, isolated triangles first.Schroeder’s decimation technique has O(n) time complexity which makes it

suitable for large models. It also preserves high-frequency information such assharp edges and corners.

Figure 3.3: Vertex Decimation - The triangles are taken away and the hole isre-triangulated.

3.3.2 Vertex clustering

Algorithm initially described by Rossignac and Borrel [5]. A bounding box isplaced around the original model and it is divided into a grid. Within each cell,the cell’s vertices are clustered together into a single vertex, and the model’striangles are updated accordingly (see Fig. 3.4 on page 17). Instead of anuniform grid an adaptive structure such as an octree1 can be used. The processof vertex clustering can be very fast but it can also make drastic topologicalchanges to the mesh. The size of the grid provide an error bound. The errorbound gives a measurement of the geometric difference between the originalmodel and the approximation yielded.

Figure 3.4: Vertex Clustering - model is divided into a grid and the verticeswithin the same cell is clustered to one.

3.3.3 Edge contraction

An edge of a triangle is contracted into a single point. The triangles supportedby that edge become degenerate and are removed during the contraction (see

1Octree - It is a hierarchical representation of 3D objects, designed to use less memorythan representing every voxel of the object explicitly. Octrees are based on subdividing thefull voxel space containing the represented object into 8 octets by planes perpendicular to thethree coordinate axes.

Page 23: Mesh simplification of complex VRML models652656/FULLTEXT01.pdf · 2013. 10. 1. · LITH-ITN-MT-EX--05/020--SE Mesh simplification of complex VRML models Examensarbete utfört i medieteknik

CHAPTER 3. FRAME OF REFERENCE 18

Fig. 3.5 on page 18). The process is continued iteratively. Several researchershave made use of this method in their algorithms and the biggest differencebetween them lies in how the edge to be contracted is chosen. Examples ofedge contracting algorithms have been presented by Hoppe [6] and Ronfardand Rossignac [7]. Garland and Heckbert later developed the edge contractiontechnique even further [2]. They called it pair contraction and their algorithmis capable of joining disconnected surfaces.

Figure 3.5: Edge Contraction - The two triangles charing one edge in the middleare taken away

3.3.4 Simplification envelopes

Cohen et al [8] has described this simplification technique. The mesh is encapsu-lated between an inner and an outer surface. The surfaces define the boundariesthat the mesh must be contained within during the simplification process. Thereare a number of assumptions that the simplification surface has to fulfill whichrestricts the use of the algorithm. There is a local as well as a global versionto the algorithm. Both algorithms try to construct new triangles from existingvertices by combining them so that the new triangles fit within the boundingenvelopes. The local algorithm provides a fast method for generating approxi-mations of large input meshes while as the complexity of the global algorithmis at least O(n2) which makes it unfit to apply on large models. An advantageof the global algorithm is that the bounding envelopes supply an error bound.

The simplification envelop algorithm can only handle manifold surfaces.

3.4 Image-based methods of mesh simplification

The notion of Image-Based or Image-Driven simplification was recently putforward by Peter Lindstrom and Greg Turk. With their article Image-DrivenSimplification [10] they introduced a new concept of controlling the simplifica-tion process. Instead of using the geometric 3D distance measured between theoriginal model and the approximation Lindstrom and Turk guided their algo-rithm through measuring the difference between pictures of the original modeland the approximated model. Turk and Lindstrom were the first to introducesuch an approach and so far they seem to be the only ones researching it.

Page 24: Mesh simplification of complex VRML models652656/FULLTEXT01.pdf · 2013. 10. 1. · LITH-ITN-MT-EX--05/020--SE Mesh simplification of complex VRML models Examensarbete utfört i medieteknik

CHAPTER 3. FRAME OF REFERENCE 19

As many geometry-based methods Lindstrom’s and Turk’s uses the edgecollapse operator to make incremental changes to the model. To evaluate whichedge to collapse, i.e the cost of taking it away, they use an image metric - afunction that give a measure of the distance between two images. Lindstromand Turk use the root mean square (RMS) error to evaluate the differencebetween the pixels in two images. Since it is virtually impossible to capture theentire appearance of an object in a single image the object is capture from 20different directions (see Fig. 3.6 on page 19) The corresponding images of theoriginal and the approximation are compared in order to evaluate which edgesto collapse in the following iteration.

Figure 3.6: Image-Driven Simplification is guided by the comparison betweenimages of the original model and the approximated one. In the test accountedfor in their article [10] Turk and Lindstrom used 20 images from different angles.

Image-driven simplification removes detail that has little effect on renderedimages of a model. When some part of a model is invisible in all views it willbe drastically simplified. This feature is highly usable to CAE-models that areto be reduced for visualization purposes since they usually contain many layersof objects. To take away hidden interior objects is otherwise a difficult task.

The biggest drawback of the image-driven algorithm of Turk and Lindstromis that it is slow. In their article Turk and Lindstrom compare with the Garlandand Heckbert algorithm (see section 4.1.3 on page 28) and the image-driven oneshows many times slower Fig. 3.7 on page 20 shows a model of a donut reducedto 512 triangles. The result of the two algorithm is similar but the processingtime different. The Turk and Lindstrom algorithm took almost five times aslong (5.33 seconds compared to 1.04).

To the image-driven algorithm’s defense it should be said that when com-paring it with a geometry-based algorithm plus an algorithm that takes awayinterior objects the time difference probably would not be that large.

Page 25: Mesh simplification of complex VRML models652656/FULLTEXT01.pdf · 2013. 10. 1. · LITH-ITN-MT-EX--05/020--SE Mesh simplification of complex VRML models Examensarbete utfört i medieteknik

CHAPTER 3. FRAME OF REFERENCE 20

Figure 3.7: To the left the Qslim algorithm by Garland and Heckbert, in themiddle Image-driven by Turk and Lindstrom and to the right the original model.

3.5 Major features of the mesh simplification al-gorithms

This section will summon up the major features of the above described meshsimplification algorithms. The features are put into a table in order to makeit easy to compare the different methods. Even though they were presentedtogether in section 3.3 the Pair Contraction algorithm of Michael Garland andPaul Heckbert is put separate from the Edge Contraction algorithms. Thisreason is that the Pair Contraction algorithm contains one crucial feature thatEdge Contraction algorithms do not have.

The heading Error measurement in the below table refers to if there is ameasure of the geometric difference between the original model and the approx-imation produced by the algorithm. If the quality can be told by a geometricmeasure.

The heading fast refers to if the algorithm is reasonably fast. A No in thiscolumn means that one of the significant features of the algorithm is that it isslow.

If the table says Depends the answer can be both Yes and No dependingon which algorithm within that category of algorithms that is referred to. Forexample, there are Edge Contraction algorithms that can handle arbitrary inputand there are those who cannot.

3.6 VRML - Virtual Reality Modeling Language

VRML is the format of the export of the Volvo Cars’ CAE-program. In orderto build an application that take VRML as an input one must understand itssyntax. To easier understand this chapter it is recommended to take a look atthe schematic picture of the VRML syntax in the Appendix A.1 on page 50.

Page 26: Mesh simplification of complex VRML models652656/FULLTEXT01.pdf · 2013. 10. 1. · LITH-ITN-MT-EX--05/020--SE Mesh simplification of complex VRML models Examensarbete utfört i medieteknik

CHAPTER 3. FRAME OF REFERENCE 21

Table 3.1: The table shows the major features of the mesh simplification algo-rithms examinedMethod Takes

arbitraryinput

Joins dis-connectedsurfaces

Errormeasure-ment

Maintainstopology

Fast

Vertex Decimation Yes No No No YesVertex Clustering Depends Yes Yes No YesEdge Contraction Depends No No Depends YesPair Contraction Yes Yes No No YesSimplification en-velops

No Yes Depends No Depends

Imaged-Driven Yes Yes No No No

3.6.1 General description

The Virtual Reality Modeling Language (VRML) is a textual language describ-ing 3D scenes. VRML differs from other programming language like C/C++in that instead of describing how the computer should act through a seriesof commands, it describes how a 3D scene should look. At the highest levelof abstraction, VRML is just a way for objects to read and write themselves.VRML defines a set objects useful for doing 3D graphics. These objects arecalled nodes. The basic node categories are: Shape, Camera/Light, Property,Transformation, Grouping and WWW. Within each categories there are severalsubtypes defined. To illustrate, a Transformation node can be of the subtypeTransform, Rotation or Translation. Each containing different property fields.

3.6.2 VRML as a scene graph

The nodes in the VRML world are organized in a hierarchical structure calledscene graph. The scene graph decides the ordering of the nodes. It also has anotion of state which implies that nodes higher up in the hierarchy can affectnodes that are lower down. A scene graph has many advantages for 3D graphicspurposes.

3.6.3 How geometry is described in VRML

The basic building blocks in VRML are shapes described by nodes and theiraccompanying fields and field values. The basic node type that defines thegeometry of an VRML-object is the Shape node. The Shape node typicallycontains a geometry and a appearance field. The geometry field describes the3D-structure while as the appearance defines the surface properties. The surfaceproperties are based on the material that could be either a color or a texture.The fields of a node could be defined either by values directly or by anothernode.

Page 27: Mesh simplification of complex VRML models652656/FULLTEXT01.pdf · 2013. 10. 1. · LITH-ITN-MT-EX--05/020--SE Mesh simplification of complex VRML models Examensarbete utfört i medieteknik

CHAPTER 3. FRAME OF REFERENCE 22

Predefined primitives

VRML provides several predefined primitive geometry nodes that can be usedto define the objects. Such primitives are Box, Cone, Cylinder and Sphere.These objects cannot be simplified directly since the vertices and coordinates ofthe objects are not explicitly defined.

Vertices and coordinates

Except for the case with the predefined primitives the geometry of an object isdescribed through vertices and coordinates. Each vertex sets a point in space- i.e. the x-, y- and z-values. The coordinates tell how the vertices are linkedtogether into triangles, quadratics or shapes with more corners. However, ren-dering systems can only handle triangles and if the vertices are not defined assuch there must be splitting before the object can be rendered.

The IndexedFaceSet node can be used as the value of the geometry field inthe Shape node (see Appendix A.1 on page 50). Then the vertices are declaredin the coord field and the coordinates in the coordIndex field.

There are many variations to the VRML syntax. Nevertheless, the meshsimplification application will only accept input where the geometry is describedin the IndexedFaceSet node.

Normals

Normals in VRML are unit vectors used to direct the lighting and shading ofthe object. The normals are specified in the normal field of the Shape node.Typically the normal field value is specified by the Normal node. If the normalfield is empty the normals are automatically computed for each triangle or coor-dinate in the triangle set and the normalIndex and normalPerVertex fields areignored. Otherwise, if the field is not empty, the normalIndex field specifies thex-, y- and z-values of the normals and the normalPerVertex field tells whetherthe normals should be used for each face or each coordinate.

3.6.4 The Volvo Cars VRML models

The Volvo Cars 3D VRML models that will be used in the tests later on havethe following properties.

- The models constitute many smaller objects linked together by the scenegraph.

- The size of the files is in general very large and could easily contain millionsof polygons.

- There is nothing known about the how the models are exported fromthe CAE-programs and thus it is better assumed that the structure ofthe mesh is arbitrary, i.e. it can be manifold, non-manifold, orientable,non-orientable etc.

Page 28: Mesh simplification of complex VRML models652656/FULLTEXT01.pdf · 2013. 10. 1. · LITH-ITN-MT-EX--05/020--SE Mesh simplification of complex VRML models Examensarbete utfört i medieteknik

CHAPTER 3. FRAME OF REFERENCE 23

- The models contain no textures but the different parts are of differentcolors.

- The SCALE property in VRML implies that the objects will not necessar-ily have the same size as the vertices of the triangles tell since they can bedeclared to one size and then in the rendering process scaled to another.

- The vertices and coordinates are declared in the IndexedFaceSet node.

Page 29: Mesh simplification of complex VRML models652656/FULLTEXT01.pdf · 2013. 10. 1. · LITH-ITN-MT-EX--05/020--SE Mesh simplification of complex VRML models Examensarbete utfört i medieteknik

Chapter 4

Results - research anddevelopment

The chapter presents the results of the research and development phase of thethesis. The results shown in this chapter give the answers to research questionone - Which of the presently existing mesh simplification algorithms conformsthe most to the needs of Volvo Cars? - and two - What features do a meshsimplification program able to reduce the Volvo cars’ 3D digital models need tohave?.

4.1 Researching the mesh simplification field

At Volvo Cars the 3D models are considered to be the originals while as thereal, physical objects are the copies. Quality of the digital material is thereforeimportant. To pick a mesh simplification algorithm that manages to reduce theresolution without compromising too much on quality is naturally the aim ofthe selection process.

It is also important to look at the constitution of the polygon mesh in VolvoCars’ models. Since nothing is known about the export functions of the CAE-programs used at Volvo Cars it is better assumed that it is arbitrary, i.e mani-fold, non-manifold, orientable, non-orientable etc. Thus the algorithm must becapable of handling such input.

The following section summarizes the perquisites that a mesh simplificationalgorithm should fulfill in order to function on the Volvo Cars digital models. Tounderstand some of the requirements it is recommended to keep the propertiesof the Volvo Cars’ models in mind. These are stated in section 3.6.4 on page22.

4.1.1 Requirements for the mesh simplification algorithm

- The algorithm should be capable of handling arbitrary input.

24

Page 30: Mesh simplification of complex VRML models652656/FULLTEXT01.pdf · 2013. 10. 1. · LITH-ITN-MT-EX--05/020--SE Mesh simplification of complex VRML models Examensarbete utfört i medieteknik

CHAPTER 4. RESULTS - RESEARCH AND DEVELOPMENT 25

- It is preferable that the algorithm can close disconnected surfaces (see Fig.4.1 on page 25).

Figure 4.1: The original model to the left is simplified with an algorithm thatdisallows the joining of disconnected surfaces (middle) and with one that allowsit (right).

- The algorithm should be able to handle large models.

- It is preferable that the algorithm is reasonably fast.

- The algorithm should not cause any flipping over of triangles. A flipped-over triangle will not reflect light properly and appear as black in therendered model.

- It is preferable if the algorithm has a built-in handling of hidden objects.

- The algorithm should be fairly straightforward to implement.

- It is preferable that the algorithm produces a geometric measure of howmuch the approximation differs from the original model.

- The manner in which triangles are taken away should be intelligent andrelate to the purpose of mesh simplification.

4.1.2 Choosing an algorithm

The requirements stated in the previous section automatically exclude somesimplification algorithms. Which ones to leave out can be deduced by lookingat the major features of the various algorithms.

To make it easier for the reader the table from section 3.5 on page 20 isincluded again. However, if there is a need for instructions on how to read thetable the reader must turn back to 3.5.

Note that there is a difference between the Error measurement of the tableand the Error metrics that is mentioned further on. Error metrics refers towhat guides the algorithm. How it is decided which triangles to take away. Er-ror measurement refers to if the algorithm produces a geometric measurementtelling how much the approximated model differs from the original. An Errormeasurement is interesting to have since it makes it possible to set boundaryvalues in terms of a geometric measure. It is possible to say that the model

Page 31: Mesh simplification of complex VRML models652656/FULLTEXT01.pdf · 2013. 10. 1. · LITH-ITN-MT-EX--05/020--SE Mesh simplification of complex VRML models Examensarbete utfört i medieteknik

CHAPTER 4. RESULTS - RESEARCH AND DEVELOPMENT 26

Table 4.1: The table shows the major features of the mesh simplification algo-rithms examined

Method Takesarbitraryinput

Joins dis-connectedsurfaces

Errormeasure-ment

Maintainstopology

Fast

Vertex Decimation Yes No No No YesVertex Clustering Depends Yes Yes No YesEdge Contraction Depends No No Depends YesPair Contraction Yes Yes No No YesSimplification en-velops

No No Depends Yes Depends

Imaged-Driven Yes Yes No No No

should be reduced until the the boundary value of 5 millimeters difference be-tween the original and the approximation is reached instead of just stating that50% of the faces should be taken away.

Every algorithm has Error Metrics but not all provide an Error measure-ment.

The table tells that the Simplification envelops algorithm does not fulfill therequirement of arbitrary input. Arbitrary input is an important claim and notaccepting it strongly speaks against the Simplification envelop algorithm.

The Pair Contraction algorithm is an improvement of the the Edge Contrac-tion algorithms. As can be seen from the table the Pair Contraction algorithmcomplete more requirements than the Edge Contraction algorithms since it canjoin disconnected surfaces. In this case the Edge Contraction algorithms do nothave any other advantage over the Pair Contraction and they are thus excludedin favor of Pair Contraction.

This leaves four algorithms Vertex Decimation, Vertex Clustering, Pair Con-traction and Image-Driven.

The error metrics of Vertex Decimation does not seem convincing. Thetriangles are taken away in oder of area going from small to large. Even thoughit is plausible that taking away small triangles causes less harm than taken awaylarge, there is no guarantee. It would be more interesting if the error metricswas based on the difference between the original and the approximation.

Vertex Clustering is known to be a fast and sloppy algorithm. Sloppy in thesense that it can make drastic changes to the mesh. It does not have a thoughtthrough methodology on how to decide which triangles to take away. Instead allthe vertices within a grid cell are clustered together no matter what the cost ofsuch an operation might be. Since it is important that the approximated modeldiffer as little as possible from their originals the rather unscientific approachof the Vertex Clustering algorithm is unappealing.

There are three major arguments that decide between the Image-Driven andthe Pair Contraction algorithms. The first argument can be found in the table.

Page 32: Mesh simplification of complex VRML models652656/FULLTEXT01.pdf · 2013. 10. 1. · LITH-ITN-MT-EX--05/020--SE Mesh simplification of complex VRML models Examensarbete utfört i medieteknik

CHAPTER 4. RESULTS - RESEARCH AND DEVELOPMENT 27

The Image Driven algorithm is slow. As stated in the requirements in section3.6.4 the input models are usually very large making the speed of the algorithman issue. This obviously speaks against the Image-Driven algorithm. On theother hand, there is no claim that the application should be capable of workingin real-time and thus the time-argument is not strong enough to solely excludethis algorithm.

The advantage of the Image-Driven algorithm over the Pair Contraction isthat it has an built-in handling of hidden objects. Looking at the structure ofmany of the Volvo Cars’ models (see section 5.2.2 on page 36) it becomes clearthat such a feature could be very useful. However, one would want to havethe choice of turning the hidden surface handler on and off since there mightbe cases where the interior of a model should be maintained. With the Image-Driven algorithm that would be impossible. It is also perfectly possible to adda hidden surface handler to any mesh simplification algorithm. Consequently,the built-in handling of hidden objects cannot be used as an argument for theImage-Driven algorithm.

The third argument is the most important one. As described, the Image-Driven algorithm is guided by the visual comparison between the original andthe approximated model. This is a excellent technique if it can be secured thatit is only the visual that matters. With the Volvo Cars application there is nosuch warranty. If the mesh simplification application was to be used only onpresentation material a visual comparison could be enough. However, there is apossibility that Volvo Cars would want to extend the use of mesh simplificationand apply it on all their models. Even the ones used for geometry simulationand hence collision detection. In such a case geometry becomes more importantthan appearance and guiding the algorithm by what looks good would not besufficient.

Judging by the above described arguments the algorithm that seems to bestfit the requirements is the Garland and Heckbert Pair Contraction [2]. Thealgorithm takes arbitrary input, joins disconnected surfaces, does not maintaintopology and it is reasonably fast. The one major feature missing is the geo-metric error measure. It is however perfectly possibly to add such a quality tothe algorithm. Garland himself has published a paper [1] on how this could bedone.

The Garland and Heckbert algorithm is guided by an error metrics thatcarefully measures how much the mesh would change if a certain triangle istaken away. It is actually this error metrics that gives the algorithm its cred-ibility and it is probably the reason to why the algorithm has reached such asuccess within the computer graphics community. The error metrics of otheralgorithm such as the one of Vertex Clustering or the one of Vertex Decimationare not adapted to the actual purpose as the Pair Contraction’s is. Garlandand Heckbert has looked at what is really important in the context - a mini-mized difference between original and approximation - and let their algorithmbe guided accordingly.

The Garland and Heckbert algorithm is presented in detail in the next sec-tion.

Page 33: Mesh simplification of complex VRML models652656/FULLTEXT01.pdf · 2013. 10. 1. · LITH-ITN-MT-EX--05/020--SE Mesh simplification of complex VRML models Examensarbete utfört i medieteknik

CHAPTER 4. RESULTS - RESEARCH AND DEVELOPMENT 28

4.1.3 Mesh simplification algorithm of choice

Garland and Heckbert first presented their algorithm in an article[2] - Surfacesimplification using error metrics - published on SIGGRAPH in 1997. Sincethen there has been some improvements made to it [3]. Primarily for the han-dling of colors and textures. However, the part of the algorithm used in thistheses work is entirely from the 1997 article.

The essence of the Garland and Heckbert algorithm is here presented.

Pair contraction

The Michael Garland and Paul S. Heckbert surface simplification algorithm isbased on the iterative contraction of vertex pairs. A pair contraction written(v1,v2) → ~v, moves the vertices v1 and v2 to the new position ~v, connects alltheir incident edges to v1, and deletes the vertex v2. If (v1,v2) is an edge, thenone or more faces will be removed (see Fig. 4.2 on page 28) . Otherwise, twopreviously separate sections of the model will be joined at ~v (see Fig. 4.3 onpage 29). Using pair contraction instead of edge contraction makes it possibleto merge individual components into a single object.

The algorithm is based on the assumption that, in a good approximation,points do not move far from their original positions. A pair is valid for contrac-tion if either:

1. (v1,v2) is an edge

2. ||v1 − v2|| < t, where t is a threshold parameter

Using a threshold of t = 0 gives a simple edge contraction algorithm (see Fig.4.2 on page 28). Higher thresholds allow non-connected vertices to be paired(see Fig. 4.3 on page 29). If the threshold is too high, widely separated portionsof the model can be connected and it could create O(n2) pairs. The set of

Figure 4.2: Standard edge contraction (t = 0) The edge shared between the twoshaded triangles is contracted into a single point. The shaded triangles becomedegenerate and are removed.

valid pairs is chosen at initialization time. When the contraction (v1,v2) → ~vis performed every occurrence of v2 in a valid pair is replaced by v1, andduplicated pairs are removed.

Page 34: Mesh simplification of complex VRML models652656/FULLTEXT01.pdf · 2013. 10. 1. · LITH-ITN-MT-EX--05/020--SE Mesh simplification of complex VRML models Examensarbete utfört i medieteknik

CHAPTER 4. RESULTS - RESEARCH AND DEVELOPMENT 29

Figure 4.3: Non-edge contraction (t > 0) When the threshold t > 0 non-edgepairs can be contracted and unconnected regions joined together.

Defining the cost of a contraction

In order to select which contraction to perform Garland and Heckbert haveintroduced the notion of cost. To define the cost, they attempt to characterizethe error at each vertex. In the original model, each vertex is the solution ofthe intersection of a set of planes of the triangles that meet at the vertex. A setof plane can be associated with each vertex and the error can be defined as thesum of squared distances to its planes:

∆v = ∆([vxvyvz1]T ) =∑

p∈planes(v)

(pT v)2 (4.1)

where p = [a b c d]T represents the plane defined by the equation (ax + by +cz + d) = 0 where a2 + b2 + c2 = 1. The error metric described above can berewritten in the quadratic form:

∆v =∑

p∈planes(v)

(vT p)(pT v)

=∑

p∈planes(v)

vT (ppT )v

= vT (∑

p∈planes(v)

KP)v (4.2)

where KP is the matrix:

KP = ppT =

a2 ab ac adab b2 bc bdac bc c2 cdad bd cd d2

(4.3)

KP can be used to find the squared distance of any point in space to the planep.

The sum of all Kp can be represented with Q which then represents theentire set of planes for each vertex. The error at vertex v = [vxvyvz1]T can thenbe expressed as the quadratic form:

∆(v) = vTQv (4.4)

Page 35: Mesh simplification of complex VRML models652656/FULLTEXT01.pdf · 2013. 10. 1. · LITH-ITN-MT-EX--05/020--SE Mesh simplification of complex VRML models Examensarbete utfört i medieteknik

CHAPTER 4. RESULTS - RESEARCH AND DEVELOPMENT 30

For every contraction (v1,v2) → ~v a new matrix Q containing the approxima-tions of the error at the new vertex ~v must be derived. Garland and Heckberthave chosen to use the simple additive rule Q = Q1 + Q2.

Selecting ~v

Before the contraction (v1,v2) → ~v can be performed a new position for ~v mustbe chosen. The easy solution would be to select either v1,v2 or (v1 + v2)/2 de-pending on which of them that has the lowest value of ∆(~v). However, Garlandand Heckbert go farther than that and chooses the ~v that minimizes ∆(~v). Theerror function ∆ is quadratic and finding its minimum is thus a linear problem.~v is found by solving ∂∆/∂x = ∂∆/∂y = ∂∆/∂z = 0 which is the same assolving for ~v in following system of equations:

q11 q12 q13 q14q12 q22 q23 q24q13 q23 q33 q340 0 0 1

~v =

0001

(4.5)

Assuming that the Q matrix is invertible gives the following solution to equation4.5:

~v =

q11 q12 q13 q14q12 q22 q23 q24q13 q23 q33 q340 0 0 1

−1

0001

(4.6)

If Q is not invertible, the algorithm seeks the optimal vertex along the edgev1v2. If that also fails ~v is chosen from the endpoints and the midpoints.

Geometric interpretation of the cost

The level surface ∆(v) = ε, i.e. the set of all points whose error with respect toQ is ε, represents a quadratic surface. Geometrically these are almost alwaysellipsoids with ~v as the center of the ellipsoid (see Fig. 4.4 on 30).

Figure 4.4: Geometric interpretation of quadratic error metrics.

Page 36: Mesh simplification of complex VRML models652656/FULLTEXT01.pdf · 2013. 10. 1. · LITH-ITN-MT-EX--05/020--SE Mesh simplification of complex VRML models Examensarbete utfört i medieteknik

CHAPTER 4. RESULTS - RESEARCH AND DEVELOPMENT 31

4.2 Development of the application

The primary aim of the thesis is to examine if the Volvo Cars’ 3D digital modelscould be reduced to containing less than 20% of its original polygons using a meshsimplification algorithm. The method (see section 1.1 on page 9) chosen to reachthis aim was to create a C++ program that would take the Volvo Cars’ VRMLmodels as an input and give simplified approximations of these as an output.The basis of the C++ program would be the implementation of an existingmesh simplification algorithm.

Section 4.1 on page 24 gives an account of which algorithm that was selectedand why. As seen, the choice fell on Michael Garland’s and Paul Heckbert’s PairContraction simplification with Quadratic error measure [2]. The theory of thealgorithm is fully presented in section 4.1.3 on page 28.

The first program created consisted of the three parts visualized in Fig. 4.5on page 31. Part one takes care of the user input from the DOS-prompt andthe parsing of the VRML file with the original model. To parse a file meansto read it and to extract information from it. The file is read and the modelis stored in the memory as a scene graph structure. (Section 3.6 on page 20tells more about this structure.) Part one then runs a loop that extracts the

Figure 4.5: The C++ program created for the mesh simplification applicationconsists of three parts and the user interface.

vertices and coordinates from the first node in scene graph. The polygons aresplit into triangles and the information is sent on to Part two where the actualsimplification takes place. Once the vertices and coordinates are simplified todesired percentage they are sent on to Part three where they are reinserted intothe three structure. The program then moves back to Part one and the nextnode in the hierarchy is approached. The loop goes on until all nodes has beensimplified. Once finished Part three writes the new VRML structure to a file.This is the basis of the program. To yield better results the program has beenaltered slightly during testing. The next chapter accounts for these changes.

The specifics about each part of the application are accounted for in thethree following sections.

Page 37: Mesh simplification of complex VRML models652656/FULLTEXT01.pdf · 2013. 10. 1. · LITH-ITN-MT-EX--05/020--SE Mesh simplification of complex VRML models Examensarbete utfört i medieteknik

CHAPTER 4. RESULTS - RESEARCH AND DEVELOPMENT 32

4.2.1 Part one

For Part one of the program there were three major problems that had to besolved and the essence of those will be accounted for here.

Node by node vs. entire model

The VRML-model is simplified node by node and not the entire model at thesame time. This means than an object in the VRML scene graph is extracted,simplified and reinserted into the hierarchy before the next object is approached.

There are advantages and disadvantages with this method. An advantage isthat there is no limit to what size the entire model may have since it is dividedinto parts and the algorithm only treats a little at the time.

Simplifying only the vertices and coordinates of the same node does notchange their surface properties (since they are the same for all of them) andthus there is no need to send that information along. It also preserves theinternal order of the objects and does not break the VRML scene graph apart.

Simplifying node by node also makes it possible to improve the speed of theapplication by creating parallel threads in the program so that nodes are readfrom the VRML-file, simplified and reinserted simultaneously.

The main disadvantage with node by node simplification appear when thepolygons are unevenly distributed in the model. If the entire model is simplifiedat the same time, polygons will be taken away primarily from the denser part ofthe model because the cost of removing them there is lower. When the modelis reduced in parts every node will be reduced to the same extent (50%, 70%,90% etc) no matter if it belongs to the dense part or not. This is a majordisadvantage and could lower the quality considerately.

Which information to extract

The only information that is extracted from the VRML node and sent onto thenext part of the program are the vertices (the x, y and z values of each point) andthe coordinates (the information about how the vertices are connected together).The VRML-model is reduced node by node and thus the information aboutthe surface properties does not need to be extracted and connected to eachtriangle. All the triangles that are reduced at the same time have the samesurface properties and after simplification is performed they are put back intotheir original node where their surface properties are described.

Not even the normals are taken out and connected to the triangles. Insteadthey are taken away for each node in the VRML-model. It is not necessary toset the normals explicitly in VRML. If the the normals are not set the VRML-viewer will calculate new normals for each triangle.

How to split the polygons

In VRML a polygon can easily consist of more than 20 vertices. Since the Gar-land and Heckbert algorithm (see section 4.1.3 on 28) only can handle triangles

Page 38: Mesh simplification of complex VRML models652656/FULLTEXT01.pdf · 2013. 10. 1. · LITH-ITN-MT-EX--05/020--SE Mesh simplification of complex VRML models Examensarbete utfört i medieteknik

CHAPTER 4. RESULTS - RESEARCH AND DEVELOPMENT 33

the VRML polygons must be split before sent onto simplification.From VRML1.3 and onward there is support for non-convex polygons. Nev-

ertheless, the use of them is not recommended and in this application it has beenassumed that all polygons are convex. Only dealing with convex polygons makesplitting easier. From the sixth vertex of a polygon and onward the splittingcan be done according to the following algorithm:

setCoordIndex(6thvertex, i, i + 1,−1)

To familiarize yourself with the VRML syntax please have a look at Fig A.1 onpage 50

There are two exceptional cases for polygons with four and five vertices. Inlarger polygons the first five vertices are treated according to the algorithm offive polygons and the rest according to the above described algorithm.

4.2.2 Part two

In Part two the actual simplification takes place. The code is an implementa-tion of the Garland’s and Heckbert’s mesh simplification algorithm described insection 4.1.3 on page 28.

The code uses functions from the Qslim packages which is an Open Sourcesoftware put together by Garland himself. Appendix B tells more about theQslim package. The flow of the code in Part two can be summarized as follows:

- Compute the Q matrices for all the initial vertices

- Select all valid pairs

- Compute the optimal contraction target ~v for each valid pair (v1,v2). Theerror ~vT (Q1 + Q2)~v of this target vertex becomes the cost of contractingthat pair.

- Place all the pairs in a heap ordered by cost with the minimum cost pairon the top.

- Iteratively remove the pair (v1,v2) of least cost from the heap, contractthis pair, and update the cost of the pairs involving v1.

Once the vertices and coordinates been simplified they are sent on to Part three.

4.2.3 Part three

The work of Part three is actually quite simple. No major difficulties wereencountered and not big problems were needed to be solved. The work of Partthree is to delete the old vertices and coordinates from the VRML node andto insert the new ones. This was achieved simply by calling functions from theCyber97VRML library. To print the VRML scene graph back to the file theprint function of Cyber97VRML was used.

Page 39: Mesh simplification of complex VRML models652656/FULLTEXT01.pdf · 2013. 10. 1. · LITH-ITN-MT-EX--05/020--SE Mesh simplification of complex VRML models Examensarbete utfört i medieteknik

Chapter 5

Results - testings

The previous chapter accounted for the choice of mesh simplification algorithmand how if was implemented. Now it is the time to use the application createdin order to fulfill the aim of the thesis - to examine if the Volvo Cars’ 3D digitalmodels could be reduced to containing less than 20% of its original polygons usinga mesh simplification algorithm.

The results where produced in several sets. When Garland’s Qslim pack-aged had been linked to the VRML parser and the in between interface wasfunctioning satisfactory the first round of testing was performed. Then followedimprovements of the application and thereafter new tests.

The expectation was to be able to take away more than 80% of the polygonsfrom the original models without creating major degeneracies in the approxi-mations.

The tests were performed on models that are used in the simulation processat Volvo Cars.

In this chapter the testing and analysis of two different models will be ac-counted for. The models have distinct characteristics but are both representativefor what the Volvo Cars’ models might look like.

5.1 The size of the file

It is important to realize that the size of the file containing a 3D-model is notdirectly proportional to the number of triangles the model contains. (This facthas been discussed previously in section 3.1 on page 14.) A file of size 25 Mb canactually contain a lighter model than a file of 20Mb. It depends very much onhow compressed the writing of the file is. When splitting the polygons of morethan three vertices into triangles the VRML file becomes bigger in size becauseexpressing the polygons as triangles is a less compressed way of writing.

At Volvo Cars the size of the models is always measured in the size of thethe file which is misleading.

34

Page 40: Mesh simplification of complex VRML models652656/FULLTEXT01.pdf · 2013. 10. 1. · LITH-ITN-MT-EX--05/020--SE Mesh simplification of complex VRML models Examensarbete utfört i medieteknik

CHAPTER 5. RESULTS - TESTINGS 35

5.2 Result of the testings

For the first tests small models of some 100 000 polygons were used. Simplifyinglarger models (some millions of polygons) is very time consuming and in thebeginning quick feed back is important.

5.2.1 The bracket model

The first object tested was a model of a so called bracket which is a small partof the outer front of the car.

At the first testings the results were not at all satisfactory. A simplificationof merely 50% already created problems and taking away more than 80% of theoriginal polygon showed unthinkable. The first conclusion drawn was that themodel was not as high resolutioned as thought from the beginning and couldtherefore not be simplified as much. It seemed curious however that this smallmodel would contain as many polygons if it was not of high resolution. Anapplication was created that counted the polygons of each node in the VRML-models. When printing this information very interesting facts were discovered.

It proved that the polygons were unevenly distributed throughout the model.Some parts were as simplified as they could possibly be while as others were ofextreme resolution. In this particular case the parts modeled in a very a highresolution was rather small and thus difficult to discover merely by looking atthe model rendered in wire frame. This is illustrated in Fig. 5.1 on page 35,the two small holds in the upper corners of the model actually constitute 88%of the total number of polygons in the entire model.

Figure 5.1: Original model (91 638 polygons) with the high resolution hold tothe right. The hold almost appear not to be rendered in wire frame due to theexcessiveness in polygons.

Simplifying the model in Fig. 5.1 applying the same amount of reductionto the entire model produced a very poor result which can be seen in Fig. 5.2on page 36. 88% of the polygons are taken away and the appearance of theapproximation created is far from the original. Especially disturbing are thelarge holes created when simplifying already low resolution parts of the model.

Page 41: Mesh simplification of complex VRML models652656/FULLTEXT01.pdf · 2013. 10. 1. · LITH-ITN-MT-EX--05/020--SE Mesh simplification of complex VRML models Examensarbete utfört i medieteknik

CHAPTER 5. RESULTS - TESTINGS 36

Figure 5.2: Approximation containing only 12% of the original polygons. Everycomponent is reduced to the same extent leaving the holds with superfluouspolygons and the rest of the model with too few of them.

Setting the parameters differently so that only the high resolution holds weresimplified while the rest of the model was left untouched generated a completelydifferent result. Achieving the same amount of simplification (88% of the originalpolygons taken away) the approximation produced this time, to be seen in Fig.5.3 on page 36, is hard to tell from the original model from Fig. 5.1.

Figure 5.3: Approximation containing only 12% of the original polygons. Theholds are reduced to only containing 0.5% of the original polygons while therest of the model is maintained intact.

The result shown in Fig. 5.3 is indeed satisfactory. However, to reach such anoutcome the model had to be analyzed and the parameters of the simplificationalgorithm set according to the structure. Since this is not an automatizedprocedure it would be time consuming to do it for every single model.

5.2.2 The robot model

The next object to be examined is a model of an industrial robot. Before robotscan be used in production it must be decided how they should move and whatthey should do. This is done through geometry simulation using the digitalmodels.

Page 42: Mesh simplification of complex VRML models652656/FULLTEXT01.pdf · 2013. 10. 1. · LITH-ITN-MT-EX--05/020--SE Mesh simplification of complex VRML models Examensarbete utfört i medieteknik

CHAPTER 5. RESULTS - TESTINGS 37

Analyzing the model

Not every model has unevenly distributed polygons. The robot model in Fig.5.4 on page 37 has no such defects. Its polygons are perfectly spread over themodel and the resolution is well balanced. Consequently there is not much to cutfrom. However, there may still be a need to reduce the number of polygons. Toreach a good result one might be forced to look outside the scope of traditionalmesh simplification. Analyzing the model might give some clues to alternativesolutions.

Figure 5.4: The polygons of this robot are evenly distributed over the modeland the resolution is already rather low.

The model contains many small items especially around the hook as couldbe seen in Fig. 5.5 on page 38. In the same figure it can also be seen that thegray tube holders on the top of the robot have an advanced shape. They arenot plain cylinders but they have more the shape of two cones merged together.To describe such shapes demand more polygons than to describe cylinders.

Examining the body of the robot it is discovered that it is hollow. In Fig.5.5 a cylindrical part is displayed and it shows clearly that not only the outsideof the tube is modeled but also the inside. This kind of modeling demandsalmost twice as many polygons than if the objects would have been made solidor only as a surface. The visual appearance of the outside of the model doesnot depend on whether it is modeled as hollow or solid nor does it matter forapplications such as collision detection.

Page 43: Mesh simplification of complex VRML models652656/FULLTEXT01.pdf · 2013. 10. 1. · LITH-ITN-MT-EX--05/020--SE Mesh simplification of complex VRML models Examensarbete utfört i medieteknik

CHAPTER 5. RESULTS - TESTINGS 38

Figure 5.5: Details of the robot displayed in Fig. 5.4 on page 37.

Test results

Simplifying the Robot model from Fig 5.4 by taking away 75% of its polygonsyields a rather dreadful result illustrated in Fig 5.6 on page 39.

The tube holders are badly damaged and look like a bird’s nest. The backside of the robot has lost its shape. The small gray tubes that run on the bodyof the robot have at some places been replaced by one large triangle instead ofcylindrical tubes. Some of the small objects around the hook look more or lessthe same while as others have disappeared completely. It is still possible to tellwhat the model represents but the approximation does not look professional.

Since simplifying the robot model straight off without any adjustments didnot yield a very good result the implementation was improved in order to makeit possible to adjust the simplification to fit the robot model.

The first thing that was thought of was to simplify separate objects withinthe model differently depending on their size. The robot model contains manysmall items. Normally the robots are shown in the context of a robot cell wherethere are several robots and other objects. In such a context the small itemscannot be seen.

The parameters were set so that the small items of the robot model werecompletely taken away and the rest of the model simplified. The simplificationwas set to produce the same amount of total simplification as in the previoustest - 75% of the polygons taken away. However, since the small items werereduced harder the larger objects were not as heavily simplified.

The approximated model displayed in Fig. 5.7 on page 40 shows the resultof the test with a heavier reduction of small items. The main body of therobot is satisfactory maintained and the approximation of the tub holders isnot as bad as in Fig. 5.6, but not completely acceptable either. There are stillsome degeneracies in them that are visually unappealing. However, the overallappearance is much better.

Taking away small objects showed to be an interesting approach for someapplications - especially presentation material since it only needs to look good

Page 44: Mesh simplification of complex VRML models652656/FULLTEXT01.pdf · 2013. 10. 1. · LITH-ITN-MT-EX--05/020--SE Mesh simplification of complex VRML models Examensarbete utfört i medieteknik

CHAPTER 5. RESULTS - TESTINGS 39

Figure 5.6: The robot from Fig. 5.4 has been simplified and have had 75% ofits polygons taken away.

and not always geometrically correct.To yield even better results for the robot model and others similar models

it would be interesting to test some other methods. One approach would be totry and eliminate the polygons that cannot bee seen from the outside such asthe ones inside the cylinder from Fig. 5.5. Implementing such a method wouldprobably make it possible to take away 30-40% of the polygons without any lossin visual appearance. It will not be mesh simplification in its true sense butserves well in order to reduce the number of polygons in the models.

Another interesting approach would be the replacement of objects with simi-lar but simpler ones. Taking the tube holders of the robot model as one example.The hollow objects on the top of them (see Fig. 5.5) could be replaced by cylin-ders of the same size demanding fewer polygons. Seen from a distance such aswoop would not affect the visual appearance much. In the same model therods, modeled as narrow cylinders, could be represented as boxes which do notdemand as many polygons.

5.2.3 Late testings

As the very last test a larger model of a Volvo V70 body was tested. The modelcontained 294 400 triangles and the file 28 Mb. With Volvo measures this isstill not a large file but compared with the other files tested it was considerablybig. Fig. 5.8 on page 41 shows the model rendered with surface properties andFig. 5.9 on page 41 shows the same model but rendered in wire frame.

Page 45: Mesh simplification of complex VRML models652656/FULLTEXT01.pdf · 2013. 10. 1. · LITH-ITN-MT-EX--05/020--SE Mesh simplification of complex VRML models Examensarbete utfört i medieteknik

CHAPTER 5. RESULTS - TESTINGS 40

Figure 5.7: The robot from Fig. 5.4 has been to containing only 25% of itsoriginal polygons. The small objects have been reduced harder than the largeones.

In the wire frame model in Fig. 5.9 it can clearly be seen that some partsappear denser that others. These sections are modeled in a higher resolution.It is the high resolution parts that primarily should be simplified.

At the first attempt the model was simplified node by node as described insection 4.2.1 on page 32. Even though there were several trials with differentsettings of the parameters the results obtained were not satisfactory. As littleas a simplification of 50% caused problems.

As a last try the C++ program was changed so that the entire model wasreduced at once instead of node by node. The change yielded much betterresults. The model in Fig. 5.10 on page 42 is simplified to containing 17% ofthe original model’s polygons. The result is satisfactory. However, looking atthe model closely one can see that there are small holes in the mesh. Somewere there in the original model as well but others are new. Especially thosein the horizontal line on the doors. These small holes are not acceptable inan application such as collision detection. The holes are probably due to badconnections between the different objects in the model which make simplificationmore difficult.

The wire frame rendering of the approximated model, to be viewed in 5.11on page 42, shows that the dense parts of the model still is of high resolution.Playing around with the parameters, in order to avoid the problem with thesmall holes in the mesh, would probably make it possible to simplify the modelsome 10% more.

Page 46: Mesh simplification of complex VRML models652656/FULLTEXT01.pdf · 2013. 10. 1. · LITH-ITN-MT-EX--05/020--SE Mesh simplification of complex VRML models Examensarbete utfört i medieteknik

CHAPTER 5. RESULTS - TESTINGS 41

Figure 5.8: Volvo V70 original shaded. The model contains 294 400 triangles.The file is 28 Mb.

Figure 5.9: Volvo V70 original wire frame. The denser parts are parts withhigher resolution.

The two models - the original in Fig. 5.8 and the approximation in Fig.5.10 - do not have the exact same color. This is due to in changing the C++program to test for full-model-simplification no implementation for colors wasmade.

Page 47: Mesh simplification of complex VRML models652656/FULLTEXT01.pdf · 2013. 10. 1. · LITH-ITN-MT-EX--05/020--SE Mesh simplification of complex VRML models Examensarbete utfört i medieteknik

CHAPTER 5. RESULTS - TESTINGS 42

Figure 5.10: Volvo V70 simplified shaded. The models is reduced to containing17% of the original polygons.

Figure 5.11: Volvo V70 simplified wire frame. As seen the high resolution partsare still rather dense. Nevertheless, simplifying more yields degeneracies in otherparts of the mesh.

Page 48: Mesh simplification of complex VRML models652656/FULLTEXT01.pdf · 2013. 10. 1. · LITH-ITN-MT-EX--05/020--SE Mesh simplification of complex VRML models Examensarbete utfört i medieteknik

Chapter 6

Conclusion

The primer aim of this thesis was to examine if the Volvo Cars’ 3D digitalmodels could be reduced to containing less than 20% of its original polygonsusing a mesh simplification algorithm. To reach this goal the thesis focused thedevelopment of a C++ program performing mesh simplification based on anexisting algorithm. To accomplish the goal, three main research questions, thatwas to be answered by the thesis, were put forth. The questions were:

Q1 Which of the presently existing mesh simplification algorithms conformsthe most to the needs of Volvo Cars?

Q2 What features do a mesh simplification program able to reduce the Volvocars’ 3D digital models need to have?

Q3 If it is not possible to reduce the Volvo Cars’ 3D models by a more than80% using the mesh simplification program constructed, what character-istics must be added?

The primer aim of the thesis has been achieved. The Results chapter accounts foran analysis of Volvo Cars models reduced using a mesh simplification algorithmimplemented in a C++ program created for this thesis.

The three research questions have been studied and the three following sec-tions will summarize their answers.

6.1 Evaluating the algorithm chosen

To start with the mesh simplification was surveyed and the six algorithms thatseemed most interesting were selected. Details about the algorithms are pre-sented in section 3.3 on page 16 and section 3.4 on page 18.

Out of the methods described the Garland and Heckbert Quadratic errormetrics algorithm (see section 4.1.3 on page 28) was considered to be the mostsuitable one. The reasons of the choice are stated in section 4.1.2 on page25. Garland and Heckbert’s fulfilled all but one of the requirements put forth

43

Page 49: Mesh simplification of complex VRML models652656/FULLTEXT01.pdf · 2013. 10. 1. · LITH-ITN-MT-EX--05/020--SE Mesh simplification of complex VRML models Examensarbete utfört i medieteknik

CHAPTER 6. CONCLUSION 44

in section 4.1.1 on page 24. The one claim that was not accomplished wasthe one about the built-in handling of hidden objects. The requirements saidthat it would be preferable to have such a function since one of the problemswith CAE-exported models is that they usually contain many layers of surfaces.Section 7.2 in chapter 7 explains how a hidden surface algorithm could be addedto the Garland and Heckbert algorithm.

The Garland and Heckbert algorithm showed to be a good choice primarilyfor the following reasons:

- The algorithm could handle the input from every model it was tested on.Garland and Heckbert claim that their algorithm can handle any arbitraryinput and so far it showed true.

- When there was enough resolution to start from the algorithm producedgood results (see Fig. 5.3 on page 36 and Fig. 5.7 on page 40)

- There was no flipping over of faces.

- There was never any problem with the size of the input not even whenmodels containing more than a million triangles were tested.

- The algorithms in itself does not provide any obstacle for the improve-ments found necessary after analyzing the result (see section 6.3 on page45)

6.2 Evaluating the application created

The program created in this thesis focused the implementation of the the Gar-land and Heckbert algorithm. The program is a good basis and it apparentlyserves its purpose of simplifying models. The following improvements are sug-gested for the existing C++ program in order to increase its performance andusability.

- The VRML parser is too slow to handle large models within reasonabletime when the application is ran on standard hardware. It is foremost thereading from file that constitute the bottle neck. One suggestion wouldbe to skip the Cyber97VRML package and create a new parser optimizedfor the purpose.

- Multi-threading should be added to the program so that all three partsof the application (see section 4.2 on page 31) could run simultaneously.This would increase the speed of the application.

- To make it easier for the user a GUI should be added to the application.

- As the last testings showed better results can sometimes be obtained ifthe entire model is simplified at the same time (see section 5.2.3 on page39). The program should be expanded to fully handle this option. Asfor today the program only consider surfaces properties surface propertieswhen the model is simplified node by node (see section 4.2.1 on page 32).

Page 50: Mesh simplification of complex VRML models652656/FULLTEXT01.pdf · 2013. 10. 1. · LITH-ITN-MT-EX--05/020--SE Mesh simplification of complex VRML models Examensarbete utfört i medieteknik

CHAPTER 6. CONCLUSION 45

6.3 Evaluating the results of the testing

The results (see chapter 5 on page 34) showed that it is possible to take awaymore than 80% of the model’s polygons without compromising too much inquality. Nevertheless, with some model the following features should be addedto the application in order to achieve the desired simplification. These featuresare:

- Geometric error measure.

- Hidden surface removal.

- Replacement of complex shapes with geometrically similar but not as poly-gon demanding ones.

In the next chapter it will be explained what these features consists in and howthey could be added to the application.

Page 51: Mesh simplification of complex VRML models652656/FULLTEXT01.pdf · 2013. 10. 1. · LITH-ITN-MT-EX--05/020--SE Mesh simplification of complex VRML models Examensarbete utfört i medieteknik

Chapter 7

Future work

7.1 Geometric error measure

Section 5.2.1 on page 35 that analyzes the simplification of the bracket modelconcludes that better results are achieved if not all parts of the models are re-duced to the same extent. To optimize the parameter settings for each modelis a tedious process and demands too much of the user. It must be done auto-matically.

Looking at the model tested in section 5.2.1 one can see that its polygons areunevenly distributed. The mission is to adjust the program to reduce the highresolutioned parts to greater extent and the less dense parts to a lower extent.

A geometric error measure tells how much the approximated model differsfrom the original. Introducing such a measure to the algorithm would makeit possible to set the boundary of the simplification in millimeters instead ofnumber of polygons taken away. As an alternative to letting the program con-tinue the simplification until 80% of the polygons are taken away the processcould continue until the approximation differs at the most 2 millimeter from theoriginal. Such a method would imply that more polygons automatically wouldbe taken away from the denser part of the model since it will take longer beforethe geometry changes there.

There are various theories on how to apply geometric error measure to amesh simplification algorithm. The most interesting article found in the researchfor this thesis was one by Steve Zelinka and Michael Garland[1]. Their errormeasure works as an add-on to Garland’s simplification algorithm used in thisthesis and should be fairly straightforward to implement. Steve Zelinka evenoffers free source code for the purpose.

7.2 Hidden surface removal

Section 5.2.2 on page 37 discusses the hidden surface problem. The robot modelanalyzed in that section contains surfaces that never shows (see Fig. 5.5 on page

46

Page 52: Mesh simplification of complex VRML models652656/FULLTEXT01.pdf · 2013. 10. 1. · LITH-ITN-MT-EX--05/020--SE Mesh simplification of complex VRML models Examensarbete utfört i medieteknik

CHAPTER 7. FUTURE WORK 47

38). Taking away the polygons of these surfaces would reduce the number ofpolygons substantially without affecting the appearance of the model.

The problem with hidden surfaces could probably be solved in various ways.One would be to take the idea that Lindstrom and Turk used for their Image-Driven algorithm (see section 3.4 on page 18) and transform it into a hiddensurface algorithm. Instead of using the different-angle pictures of the object (seeFig. 3.6 on page 19) to measure the difference between the original model andthe approximation the images could be used to find out which polygons thatcannot be seen from the outside. It is possible to program the GPU so thatit tells which polygons that were never drawn when the pictures of the modelwere rendered out.

7.3 Replacement of complex shapes

The research of this thesis did not give rise to any ideas of how complex shapescould be replaced by similar but simpler ones. One solution could be to look atsome sort of image-based technique where the shapes of the objects are comparedto standard shapes like cylinders and boxes. Another technique would be tocreate bounding boxes around the objects and compare these with standardshapes.

Page 53: Mesh simplification of complex VRML models652656/FULLTEXT01.pdf · 2013. 10. 1. · LITH-ITN-MT-EX--05/020--SE Mesh simplification of complex VRML models Examensarbete utfört i medieteknik

Bibliography

[1] S. Zelinka and M. Garland. Permission Grids: Practical, Error-BoundedSimplification. ACM Transaction on Graphics. April 2002 To be down-loaded from http://graphics.cs.uiuc.edu/ garland

[2] Michael Garland and Paul Heckbert. Surface Simplification using quadricerror metrics. SIGGRAPH 97 Proc., pages 209-216, 1997 To be downloadedfrom http://graphics.cs.uiuc.edu/ garland

[3] M. Garland and P. Heckbert. Simplifying Surfaces with Color and Textureusing Quadratic Error Metrics. IEEE Visualization 98 Proc. 1998

[4] William J. Schroeder, Jonathan A. Zarge and William E. Lorensen. Dec-imation of triangle meshes. Computer Graphics (SIGGRAPH ’92 Proc.),26(2):65-70 July 1992

[5] Jarek Rossignac and Paul Borrel. Multi-resolution 3D approximations forrendering complex scenes. Modeling in Computer Graphics: Methods andApplications, pages 455-465, 1993

[6] Hugues Hoppe, Progressive meshes. In SIGGRAPH ’96 Proc., pages 99-108,Aug. 1996

[7] Remi Ronfard and Jarek Rossignac. Full-range approximation of triangu-lated polyhedra. Computer Graphics Forum, 15(3), Aug. 1996 Proc. Euro-graphics ’96

[8] Jonathan Cohen et al. Simplification envelopes. SIGGRAPH ’96 Proc.pages 119-128 Aug. 1996

[9] William J. Schroeder. A topology modifying progressive decimation algo-rithm 8th conference on Visualization ’97 Proc. Oct 1997

[10] Peter Lindstrom and Greg Turk. Image-Driven Simplification ACM Trans-action on Graphics Vol. 19, No. 3, pages 204-241 July 2000 To be down-loaded from http://www.gvu.gatech.edu/people/faculty/greg.turk/

[11] K. Rule 3D Graphics File Formats

48

Page 54: Mesh simplification of complex VRML models652656/FULLTEXT01.pdf · 2013. 10. 1. · LITH-ITN-MT-EX--05/020--SE Mesh simplification of complex VRML models Examensarbete utfört i medieteknik

Appendix A

VRML syntax

The scematic picture in Fig. A.1 on page 50 shows a piece of VRML code.Nodes and fields are boxed and numbered in order to make it easier to interpretthe VRML syntax. The following paragraph explains the key words of the codeshown in the picture.

The Shape node (1) contains the two fields appearance and geometry (2).The geometry field is defined by the IndexedFaceSet node (3) which containsthe two fields coord and coordIndex (4) that define the vertices and coordinates.The appearance field (2) value is set by the Appearance node (5) in of whichmaterial field (6) the surface properties are set.

49

Page 55: Mesh simplification of complex VRML models652656/FULLTEXT01.pdf · 2013. 10. 1. · LITH-ITN-MT-EX--05/020--SE Mesh simplification of complex VRML models Examensarbete utfört i medieteknik

APPENDIX A. VRML SYNTAX 50

Figure A.1: Schematic picture of VRML syntax

Page 56: Mesh simplification of complex VRML models652656/FULLTEXT01.pdf · 2013. 10. 1. · LITH-ITN-MT-EX--05/020--SE Mesh simplification of complex VRML models Examensarbete utfört i medieteknik

Appendix B

Open Source packages

B.1 The VRML parser

The VRML parser is based on the CyberVRML97 library1 for C++ whichis an Open Source software. The library allows to read and write VRMLfiles, set and get the scene graph information, draw the geometries and con-vert from the VRML file format to X3D. For the CyberVRML97 library tocompile the OpenGL 1.1 library and the GLUT 3.x library must be installed.The CyberVRML97 also demands the xercesc package to be included. TheCyberVRML97 library comes with little documentation.

B.2 The Qslim package

The Qslim Package2 was developed by Michael Garland, assistant professor inthe Department of Computer Science at the University of Illinois. The Qslimpackage is based on the experimental software that Garland produced to testHeckbert’s and his mesh simplification algorithm picked as the algorithm ofchoice (see section 4.1.3 on page 28) in this Master thesis. Since built forGarland’s personal purposes the code is not easily interpreted. Basically, itcomes without documentation and it is not to be considered industrially safe.The code compiles on the Unix as well as Windows systems but it requires theOpenGL and the XForms libraries.

1Downloaded from http://cybergarage.org/vrml/cv97/cv97cc2Downloaded from http://graphics.cs.uiuc.edu/ garland

51