visualization of cad models - semantic scholar...master thesis in computing science, 20 credits...

80
Master thesis in Computing Science, 20 credits Visualization of CAD Models - NURBS vs. Subdivision David Jonsson <[email protected]> 8th July 2005

Upload: others

Post on 12-Jul-2020

2 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: Visualization of CAD Models - Semantic Scholar...Master thesis in Computing Science, 20 credits Visualization of CAD Models-NURBS vs. Subdivision David Jonsson

Master thesis in Computing Science, 20 credits

Visualization of CAD Models-

NURBS vs. Subdivision

David Jonsson<[email protected] >

8th July 2005

Page 2: Visualization of CAD Models - Semantic Scholar...Master thesis in Computing Science, 20 credits Visualization of CAD Models-NURBS vs. Subdivision David Jonsson

This work was supported byAcademics in Companies- a project, who’s pur-pose is to contribute to the development of small and medium sized enterprises inVästerbotten and Norrbotten County of Sweden. The projectAcademics in Compa-niesoffers the businesses in the regions the possibility to havedevelopment projectscarried out by students, recent graduates, and researchersfrom the universities andcolleges of higher learning throughout the country. The projects are made availablethrough a database on the Internet;examensjobb.nu .

Funders areEU’s structural fonds, VästbottenandNorrbotten County Admin-istration, together with participating municipalities and companies.

ReferencingTo reference this master’s thesis the following BIBTEX entry might be helpful.

@Mastersthesis{jonsson:visualizationofcad,author = "David Jonsson",title = "Visualization of CAD models - NURBS vs. Subdivision ",school = "University of Umeå",year = "2005",month = jul # "~8",url = "http://www.cs.umu.se/~c99djn/thesis/",note = "UMNAD 583/2005"

}

Page 3: Visualization of CAD Models - Semantic Scholar...Master thesis in Computing Science, 20 credits Visualization of CAD Models-NURBS vs. Subdivision David Jonsson

Abstract

3D models today are used in many areas, e.g. computer-aided geomet-ric design, animation, and computer games. The areas have differentdemands; computer-aided geometric design must have exact models,cartoons must look good and games must have real-time feedback.

Computer-aided design software commonly uses trimmed NURBS asprimitives, which have some support in low level graphic visualiza-tion libraries such as OpenGL. Animators prefer subdivision surfacesbecause of their greater flexibility and ability to avoid gaps. However,subdivision surfaces have today limited API support.

Mathematically, NURBS is the standard way to represent smooth sur-faces. However, NURBS has problems with gaps along borders andthey cannot represent surfaces of arbitrary topology. On the otherhand, subdivision surfaces have problems with standardization, sincethere are multiple choices of schemes to use. This report shows thatsubdivision surfaces are superior to trimmed NURBS for modelingand visualization of composite surfaces.

Page 4: Visualization of CAD Models - Semantic Scholar...Master thesis in Computing Science, 20 credits Visualization of CAD Models-NURBS vs. Subdivision David Jonsson
Page 5: Visualization of CAD Models - Semantic Scholar...Master thesis in Computing Science, 20 credits Visualization of CAD Models-NURBS vs. Subdivision David Jonsson

Contents

1 Introduction 11.1 Background . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11.2 Aim . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 31.3 Prerequisites . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 31.4 Thesis Outline . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3

2 Representation of Surfaces 52.1 Continuity conditions . . . . . . . . . . . . . . . . . . . . . . . . 52.2 Common parametric curves . . . . . . . . . . . . . . . . . . . . . 6

2.2.1 Bézier curves . . . . . . . . . . . . . . . . . . . . . . . . 72.2.2 Hermite spline curves . . . . . . . . . . . . . . . . . . . 72.2.3 B-spline curves . . . . . . . . . . . . . . . . . . . . . . . 7

2.3 NURBS . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 82.3.1 Rational curves . . . . . . . . . . . . . . . . . . . . . . . 92.3.2 Knot vectors . . . . . . . . . . . . . . . . . . . . . . . . 102.3.3 Building NURBS from lines and arcs . . . . . . . . . . . 112.3.4 NURBS surfaces . . . . . . . . . . . . . . . . . . . . . . 132.3.5 Trimming NURBS surfaces . . . . . . . . . . . . . . . . 13

2.4 Subdivision surfaces . . . . . . . . . . . . . . . . . . . . . . . . 142.4.1 Basics . . . . . . . . . . . . . . . . . . . . . . . . . . . . 142.4.2 Overview . . . . . . . . . . . . . . . . . . . . . . . . . . 152.4.3 Loop surfaces . . . . . . . . . . . . . . . . . . . . . . . . 162.4.4 Catmull-Clark surfaces . . . . . . . . . . . . . . . . . . . 172.4.5 Doo-Sabin surfaces . . . . . . . . . . . . . . . . . . . . . 182.4.6 NURSSes . . . . . . . . . . . . . . . . . . . . . . . . . . 192.4.7 Building quadratic NURSSes from lines and arcs . . . . . 23

2.5 T-Splines and T-NURCCs . . . . . . . . . . . . . . . . . . . . . . 23

3 Visualization 253.1 NURBS . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 263.2 Subdivision . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 26

3.2.1 Forward differentiating . . . . . . . . . . . . . . . . . . . 273.2.2 Subdivision by tabulation . . . . . . . . . . . . . . . . . . 273.2.3 GPU subdivision . . . . . . . . . . . . . . . . . . . . . . 29

3.3 Repairing borders . . . . . . . . . . . . . . . . . . . . . . . . . . 30

v

Page 6: Visualization of CAD Models - Semantic Scholar...Master thesis in Computing Science, 20 credits Visualization of CAD Models-NURBS vs. Subdivision David Jonsson

vi CONTENTS

4 Case Study - StairCon 334.1 Overview . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 334.2 Staircase construction . . . . . . . . . . . . . . . . . . . . . . . . 344.3 Building cappings . . . . . . . . . . . . . . . . . . . . . . . . . . 374.4 Capping integration . . . . . . . . . . . . . . . . . . . . . . . . . 38

4.4.1 File format . . . . . . . . . . . . . . . . . . . . . . . . . 384.4.2 Generation . . . . . . . . . . . . . . . . . . . . . . . . . 384.4.3 Importing geometry . . . . . . . . . . . . . . . . . . . . 41

5 Smooth Surface Implementation 455.1 Trimmed NURBS surfaces . . . . . . . . . . . . . . . . . . . . . 455.2 NURSS surface . . . . . . . . . . . . . . . . . . . . . . . . . . . 45

6 Discussion 496.1 Storage and loading . . . . . . . . . . . . . . . . . . . . . . . . . 496.2 Visualization . . . . . . . . . . . . . . . . . . . . . . . . . . . . 506.3 Back end support . . . . . . . . . . . . . . . . . . . . . . . . . . 506.4 StairCon . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 516.5 Conclusions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 516.6 Future work . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 52

7 Acknowledgements 53

A File Formats/Exchange Protocols 55A.1 Formats . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 55

A.1.1 StL . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 55A.1.2 DXF . . . . . . . . . . . . . . . . . . . . . . . . . . . . 56A.1.3 DWFTM . . . . . . . . . . . . . . . . . . . . . . . . . . 56A.1.4 3DS . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 57A.1.5 VRML . . . . . . . . . . . . . . . . . . . . . . . . . . . 57A.1.6 IGES . . . . . . . . . . . . . . . . . . . . . . . . . . . . 58A.1.7 STEP . . . . . . . . . . . . . . . . . . . . . . . . . . . . 58A.1.8 VDA-FS . . . . . . . . . . . . . . . . . . . . . . . . . . 60A.1.9 X . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 60A.1.10 COLLADA . . . . . . . . . . . . . . . . . . . . . . . . . 61A.1.11 3DM . . . . . . . . . . . . . . . . . . . . . . . . . . . . 61

A.2 Smooth surfaces . . . . . . . . . . . . . . . . . . . . . . . . . . . 61A.3 Compatibility . . . . . . . . . . . . . . . . . . . . . . . . . . . . 61A.4 Summary . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 61

Glossary 63

References 65

Page 7: Visualization of CAD Models - Semantic Scholar...Master thesis in Computing Science, 20 credits Visualization of CAD Models-NURBS vs. Subdivision David Jonsson

List of Figures

1.1 Spline interpolation . . . . . . . . . . . . . . . . . . . . . . . . . 2

2.1 Continuity conditions . . . . . . . . . . . . . . . . . . . . . . . . 52.2 Smooth curves . . . . . . . . . . . . . . . . . . . . . . . . . . . 72.3 B-spline definition . . . . . . . . . . . . . . . . . . . . . . . . . 82.4 Rational curves . . . . . . . . . . . . . . . . . . . . . . . . . . . 92.5 Influence of the knot vector . . . . . . . . . . . . . . . . . . . . . 102.6 NURBS curve . . . . . . . . . . . . . . . . . . . . . . . . . . . . 122.7 NURBS surface equation . . . . . . . . . . . . . . . . . . . . . . 132.8 Step by step curve subdivision . . . . . . . . . . . . . . . . . . . 142.9 Face splitting . . . . . . . . . . . . . . . . . . . . . . . . . . . . 152.10 Loop subdivision . . . . . . . . . . . . . . . . . . . . . . . . . . 172.11 Catmull-Clark subdivision masks . . . . . . . . . . . . . . . . . .182.12 Catmull-Clark subdivision in action . . . . . . . . . . . . . . .. 192.13 Doo-Sabin subdivision . . . . . . . . . . . . . . . . . . . . . . . 202.14 Quadratic NURSS scheme . . . . . . . . . . . . . . . . . . . . . 212.15 Sharp edges in NURSSes . . . . . . . . . . . . . . . . . . . . . . 222.16 Problematic geometry for NURBS . . . . . . . . . . . . . . . . . 222.17 T-mesh definition . . . . . . . . . . . . . . . . . . . . . . . . . . 232.18 T-splines and T-NURCCs groupings . . . . . . . . . . . . . . . . 242.19 NURBS vs. T-splines . . . . . . . . . . . . . . . . . . . . . . . . 24

3.1 Forward differentiating cubic triangles . . . . . . . . . . . .. . . 283.2 Fat borders . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 303.3 Fat borders vertex program . . . . . . . . . . . . . . . . . . . . . 31

4.1 StairCon user views . . . . . . . . . . . . . . . . . . . . . . . . . 334.2 Basic staircase models . . . . . . . . . . . . . . . . . . . . . . . 344.3 Modified staircase models . . . . . . . . . . . . . . . . . . . . . 344.4 Premanufactured stair parts . . . . . . . . . . . . . . . . . . . . . 354.5 Handrail systems . . . . . . . . . . . . . . . . . . . . . . . . . . 354.6 CNC manufacturing . . . . . . . . . . . . . . . . . . . . . . . . . 364.7 DXF and generated part . . . . . . . . . . . . . . . . . . . . . . . 394.8 Part generation . . . . . . . . . . . . . . . . . . . . . . . . . . . 404.9 StL geometry import . . . . . . . . . . . . . . . . . . . . . . . . 414.10 Cappings in StairCon . . . . . . . . . . . . . . . . . . . . . . . . 42

vii

Page 8: Visualization of CAD Models - Semantic Scholar...Master thesis in Computing Science, 20 credits Visualization of CAD Models-NURBS vs. Subdivision David Jonsson

viii LIST OF FIGURES

5.1 NURBS capping model . . . . . . . . . . . . . . . . . . . . . . . 465.2 NURSS capping model . . . . . . . . . . . . . . . . . . . . . . . 47

A.1 ASCII StL file specification . . . . . . . . . . . . . . . . . . . . . 56A.2 STEP . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 58

Page 9: Visualization of CAD Models - Semantic Scholar...Master thesis in Computing Science, 20 credits Visualization of CAD Models-NURBS vs. Subdivision David Jonsson

List of Tables

2.1 Knot vector groupings . . . . . . . . . . . . . . . . . . . . . . . 102.2 Subdivision scheme classification . . . . . . . . . . . . . . . . . 15

3.1 Memory transfer rates . . . . . . . . . . . . . . . . . . . . . . . . 253.2 Adaptive vs. uniform GPU tesselation. . . . . . . . . . . . . . . .29

A.1 DXF file format sectioning . . . . . . . . . . . . . . . . . . . . . 56A.2 STEP implementation standards . . . . . . . . . . . . . . . . . . 58A.3 STEP Application Protocols . . . . . . . . . . . . . . . . . . . . 59

ix

Page 10: Visualization of CAD Models - Semantic Scholar...Master thesis in Computing Science, 20 credits Visualization of CAD Models-NURBS vs. Subdivision David Jonsson
Page 11: Visualization of CAD Models - Semantic Scholar...Master thesis in Computing Science, 20 credits Visualization of CAD Models-NURBS vs. Subdivision David Jonsson

1Introduction

The development within computer graphics has virtually exploded the last decade.Graphic processors have outperformed expectations of Moores law1 and 3D sceneryis more of an expectation than a feature.

1.1 Background

A spline is originally a long and flexible lath of wood that is fixed in a number ofpoints. The lath minimizes the energy required for bending it around the fixationpoints, which are set by lead weights called ducks (see figure1.1). Shipbuildersused splines to mark out ship hulls centuries ago. Spline devices are used to bendwood for musical instruments such as violins and pianos. TheWright brothers alsoused one to shape their wings [77]. A mathematical formula called B-spline func-tion named after the wooden stick was later introduced by Schönberg in 1946. Amore rapid development started in the 1960s in areas such as curve fitting, surfacesand finite element analysis (FEA) [8].

Smooth curves for design and construction have thus been around for manyyears and has shown to be of great importance. Computer-aided design (CAD)programs usually represent their data at least partly with smooth curves or sur-faces. The mechanical industry has since long taken benefit of interchange betweendifferent CAD and FEA programs with Bézier, B-spline and NURBS curves andsurfaces. There have been a couple of efforts to organize theinterchange; VDA-FSis an interchange format with intentions originally to interchange smooth surfaces,IGES is the predecessor that also contains measures and the most up to date isSTEP, which contains everything from geometry to PDM and PLMdata [67, 79].All these have in common that they support the previous mentioned representa-tions. They can be seen as a de facto standard for smooth curves and surfaces inCAD.

On the contrary, animators and game developers have more frequently beenusing triangular meshes and subdivision surfaces to represent their models the

1A formulation of Moores law refers to the transistor doubling within integrated circuits that wereto be seen every 18 month. It is nevertheless quite popular used to point out the rapid development forgraphics adapters regarding computation power per Euro that doubles approximately every 6 monthsince the mid-1990’s [22, 53].

1

Page 12: Visualization of CAD Models - Semantic Scholar...Master thesis in Computing Science, 20 credits Visualization of CAD Models-NURBS vs. Subdivision David Jonsson

2 CHAPTER 1. INTRODUCTION

Figure 1.1: Spline interpolation by using lead weights called ducks [23].

last decade. The German automobile producers and their 900 subcontractors usearound 110 different CAD systems [56]. Transferring CAD data by using polyg-onal meshes may result in numerical errors. However, this isnot the problem foranimators and game producers. They have a smaller organization and are moredriven to produce results that look good, and are effectively visualized. Subdivi-sion surfaces is a representation type that intersects representation with polygonalmeshes and parametric surfaces. They have been around since1978 but had theirbreakthrough around 1997 with the animated movieGeri’s game[19]. There aretoday several subdivision surface schemes available [14, 21, 38, 64, 63].

Most areas benefit from reuse of previous work. The more information a repre-sentation contains, the easier it is to reuse it. 25 years agoevery drawing was madeby hand and ”reuse” was to copy an old drawing by hand. Nowadays most draw-ings are represented in digital formats. 3D models are sometimes more expensiveto construct than 2D models, or in another case are 2D drawings already availablefor ”reuse”. Even though it might be more expensive to construct 3D models, theremight be savings later on. For instance, steel deliverers for the construction in-dustry offers better prices when the engineers are drawing in 3D because they getexact measurements for all steel details. The benefits of using exact 3D models in astaircase CAD might be that out of stock items can be producedwith CNC directlyfrom data contained within the program. In this case, 2D drawings made out oflines and arcs are available from two sides. It is possible tomerge the two sides toproduce a 3D model automatically.

Page 13: Visualization of CAD Models - Semantic Scholar...Master thesis in Computing Science, 20 credits Visualization of CAD Models-NURBS vs. Subdivision David Jonsson

1.2. AIM 3

1.2 Aim

The aim of this report is to show how it is possible to represent a 3D model and howto visualize it with current and future hardware. Two different methods are investi-gated, the use of trimmed NURBS and the use of subdivision surfaces. The goal isto investigate the use of piecewise smooth surfaces to support future developmentof StairCon.

1.3 Prerequisites

The intended audience of this report is primary techniciansinterested in how tovisualize piecewise smooth 3D models. This report deals with computer graphics,therefore basic knowledge is assumed. Mathematical material related to parametriccurves introduced in this report is held on a limited level. CAD and computergraphics software engineers are primary targeted. Prerequisites in CAD are notmandatory but recommended.

1.4 Thesis Outline

The rest of the report is organized as follows:

Chapter 2 presents representations for smooth surfaces with splines, subdivision,and T-meshes.

Chapter 3 takes the representation chapter into a more practical viewpoint wherevisualization of NURBS and subdivision schemes are presented.

Chapter 4 consists of a case study of a CAD system for stairs called StairConwhere piecewise smooth surfaces and other visualization techniques couldbe used.

Chapter 5 presents the results of a prototype implementation of a piecewise smoothsurface representation for CAD models. This chapter is an extension of chap-ter 4.

Chapter 6 discusses the content, concludes and presents future work.

Appendix A presents and groups some common file formats related to CAD and3D graphics.

Page 14: Visualization of CAD Models - Semantic Scholar...Master thesis in Computing Science, 20 credits Visualization of CAD Models-NURBS vs. Subdivision David Jonsson
Page 15: Visualization of CAD Models - Semantic Scholar...Master thesis in Computing Science, 20 credits Visualization of CAD Models-NURBS vs. Subdivision David Jonsson

2Representation of Surfaces

CAD programs have their own needs and features implemented.These featuresare reflected in the storage and interchange of data. Logic tightly connected toa program might be impossible to interchange but technical problems are mostlypossible to resolve by allowing information to be pruned in the transfers. Smoothsurfaces belong to the technical category as an entity whichalways is possible torepresent as polygons. Smooth surfaces are a generalization of curves, thereforethe same basics apply to both curves and surfaces.

2.1 Continuity conditions

C0

C1

C2

Cubic Uniform B-Spline

Cubic Non-Uniform B-Spline

Cubic Non-Uniform B-Spline

Figure 2.1: Continuity conditions. Second order continuity(top), first order conti-nuity(middle) and zero order continuity(bottom)

5

Page 16: Visualization of CAD Models - Semantic Scholar...Master thesis in Computing Science, 20 credits Visualization of CAD Models-NURBS vs. Subdivision David Jonsson

6 CHAPTER 2. REPRESENTATION OFSURFACES

Parametric curves and surfaces are defined by data points called control points.The curves pass through or are influenced by the control points. Continuity con-ditions are used to ensure smooth transitions between curvesegments. Parametriccontinuity (denoted byCi) specifies that both the direction and size of thei:thderivative is the same in the curve joint for the incoming andoutgoing curve. Geo-metric continuity (denoted byGi) only requires that the direction of the derivativeis the same. LetP0 andP1 be two polynomial curves of degree equal to or morethan2. Then the following applies:

P0(u) = P1(u) =⇒ C0, G0

P ′0(u) = P ′

1(u), C0 =⇒ C1, G1

P ′′0 (u) = P ′′

1 (u), C1 =⇒ C2, G2

P0(u) = P1(u) =⇒ G0

P ′0(u) = k′ · P ′

1(u), k′ > 0, G0 =⇒ G1

P ′′0 (u) = k′′ · P ′′

1 (u), k′′ > 0, G1 =⇒ G2

The classesC0 andG0 describe the continuity of a non-derivated polynomial,i.e. a point. The parametric and geometric criterias are thesame for degree0,thus are the continuity criterias fulfilled when the curve segments have a commonendpoint. For higher order continuity the stronger parametric continuity is morefrequent.

Usually C2 continuity is required for applications such as car bodies and forsetting up animation paths for camera motion. The impact of the first three conti-nuity conditions are illustrated in figure 2.1. At least a cubic polynomial is neededto achieveC2 continuity. Higher orders than cubic polynomials are not commonlyused because they tend to oscillate about the control pointsand they are also harderto compute. Further readings are found in [59, 54, 29].

2.2 Common parametric curves

Products such as car bodies, ship hulls, athletic shoes and stair cappings are someexamples of applications where free form is needed and analytic curves comesshorthanded. The need for synthetic curves in design ariseswhen adaption to anexisting set of data points or changes to an existing analytic curve is desired. Thereare three different but equivalent methods to specify a spline representation:

• by specifying the set of boundary conditions that are imposed on the spline,i.e. state start and endpoint and the tangent in the start andendpoint.

• by specifying the matrix that characterizes the spline.

• by specifying the blending functions (also called basis function) that de-termine how specified geometric constraints on the curve arecombined tocalculate positions along the curve path.

Page 17: Visualization of CAD Models - Semantic Scholar...Master thesis in Computing Science, 20 credits Visualization of CAD Models-NURBS vs. Subdivision David Jonsson

2.2. COMMON PARAMETRIC CURVES 7

Control point 1

Origin end pointControl point 2

Destination end point

(a) Bézier curve.

Tangent in origin

Tangent in destination

Origin end point

Destination end point

(b) Hermite curve.

Figure 2.2: Smooth curves.

2.2.1 Bézier curves

Bézier curves were developed by Pierre Bézier and has its origins in the automobileindustry for use in the design of Renault automobile bodies [59]. A Bézier curvecan be fitted to any number of control points, but cubic (with 4control points) is themost common one (see figure 2.2). Each control point affects the curve globally,which is the main drawback. Cubic Bézier curves are defined bythe positions ofthe curves’ end points together with two more points, usually not on the curve, toindirectly define the tangents at the end points. OpenGLs’ curves and surfaces arebuilt upon Bézier curves [78].

2.2.2 Hermite spline curves

Hermite splines are named after the French mathematician Charles Hermite [29].It is an interpolating piecewise cubic polynomial with a specified tangent at eachcontrol point (see figure 2.2). The tangents in intermediateintervals are thereforeshared between two segments. Hermite curves are useful in applications where it iseasy to specify the tangents. They may therefore be hard to draw by hand is insteadmore suitable for applications where splines are generated[29].

2.2.3 B-spline curves

The term B-spline is short for basis spline and was coined by Isaac Jacob Schön-berg from Romania in 1946. In 1973 the theory of B-spline was applied to a curvedefinition by Gordon and Risenfeld. A B-Spline consists of one or more poly-nomial curves glued together, i.e. it is said to be piecewisepolynomial curve.B-spline curves are a generalization of Bézier curves whereeach polynomial pieceis a Bézier curve [59].

Page 18: Visualization of CAD Models - Semantic Scholar...Master thesis in Computing Science, 20 credits Visualization of CAD Models-NURBS vs. Subdivision David Jonsson

8 CHAPTER 2. REPRESENTATION OFSURFACES

Non-rational B-spline Rational B-spline

P (u) =n+1∑i=1

BiNi,k(u)

P (u) = projEuclidiann+1∑i=1

Bhi Ni,k(u)

=

n+1Pi=1

BihiNi,k(u)

n+1Pi=1

hiNi,k(u)

Ni,k(u) =(u−bui)Ni,k−1(u)

bui+k−1−bui+

(bui+k−u)Ni+k,k−1(u)bui+k−bui+1

,

Ni,1(u) =

{1 if ui ≤ u ≤ ui+1

0 otherwise.

umin ≤ u ≤ umax

2 ≤ k ≤ n + 1P (u) Point on the curve along the control points.Ni,k Basis function.B Control polygon coordinate in Euclidean coordinates.k Order of the curve. The degree isk − 1.n + 1 Number of control points.U Knot vector.U = {ui|ui ≤ ui+1}, |U | = n + k + 1

Figure 2.3: Definition of non-uniform rational and non-rational B-splines.

2.3 NURBS

NU Non-Uniform Knot vectors with (possibly) uneven spaces.R Rational Use of weights.BS B-Spline Basis-functions, piecewise local curves.

Non-Uniform Rational B-Spline (NURBS) curves are a generalization of B-Spline curves. The definition and differences of non-uniform rational and non-rational B-splines are found in figure 2.3. The name might indicate that there arefour main combinations of B-Splines. B-Splines are usuallysaid to be rational ornon-rational and (open) uniform, or (open) non-uniform. A closed curve is lessusual.

Page 19: Visualization of CAD Models - Semantic Scholar...Master thesis in Computing Science, 20 credits Visualization of CAD Models-NURBS vs. Subdivision David Jonsson

2.3. NURBS 9

Projection line

y axis

Projection line

Projection line

Projection line ( ω = 1 )

x axis

z axis

ω = 0.25 ω = 1.0 ω = 3.0

Elliptical arc Parabolic arc Hyperbolic arc

Figure 2.4: Influence of weights on rational curves.

2.3.1 Rational curves

Rational curves use homogeneous coordinates that are projected back into Eu-clidean space when they are to be displayed. Figure 2.4 illustrates a three dimen-sional rational curve projected back on a two dimensional plane. The homogeneouscoordinate, h, can be seen of as a force that pulls the curve towards the control point(x and z). Rational curves are very important because they provide the possibilityof an exact representation of conics such as circles and ellipsoids. Bézier and splinecurves can be of rational nature.

Page 20: Visualization of CAD Models - Semantic Scholar...Master thesis in Computing Science, 20 credits Visualization of CAD Models-NURBS vs. Subdivision David Jonsson

10 CHAPTER 2. REPRESENTATION OFSURFACES

Table 2.1: Knot vector groupings.Uniform Non-uniform

Clamped [0,0,0,1,2,3,4,5,6,6,6]Periodic [0,1,2,3,4,5,6,7,8,9,10]Closed [0,1,2,3,4,5,6,6,8,9,10,11]

0

3

7

5

(a) Clamped uniform knot vec-tor.

0

3

7

5

(b) Periodic uniform knot vec-tor.

0/8

3

5

7

(c) Closed non-uniform knot vec-tor.

Figure 2.5: Influence of the knot vector on third order curves. There should alsobe noticed that a cusp is visualized in figure 2.5c. Their knotvectors are found intable 2.1.

2.3.2 Knot vectors

In figure 2.3 the basis functions,Ni,k(u), are defined by the knot vector. Theirpurpose is to blend the control points, thereby they are alsocalled blending func-tions. Knot vectors consist of a non-decreasing series of numbers. A position ona NURBS curve is influenced by the closest control points. Between each pair ofadjacent control points is a polynomial defined by intervalsin the knot vector.

There are three types of knot vectors: clamped, periodic, and closed, whereeach type can be uniform or non-uniform. A clamped knot vector indicates that thefirst and last value in the knot vector are repeated as many times as the order,k, ofthe curve. This results in a converge towards the end points of the control polygon.Clamped knot vectors are the most common ones. A periodic knot vector has lessthank repeated knots at the ends. A curve with a periodic knot vector does notreach the control points at the ends. A closed curve wraps thecontrol polygon andthe knot vector and therefore results in a closed curve.

Literature on the subject tends to define the different typesof knot vectors withother terms. Open and periodic are used inAn Introduction to NURBS[59], pe-riodic, non-periodic, clamped, and unclamped are used inThe NURBS Book[54],uniform, clamped, and closed are used inDesign mentor[65], and clamped are

Page 21: Visualization of CAD Models - Semantic Scholar...Master thesis in Computing Science, 20 credits Visualization of CAD Models-NURBS vs. Subdivision David Jonsson

2.3. NURBS 11

used byNURBS Toolbox for MatLab[70]. Open and non-periodic are synony-mouses to clamped and unclamped refers to periodic. A clamped uniform, an openuniform, and a closed uniform curve are shown in figure 2.5.

There are mainly two types of intervals used between each knot. The seriesof knots are either increased by 0 or 1 or the whole knot vectoris normalized tobe between 0 and 1. Both ways of defining knots vectors gives the same result,but the normalized knot vector is more frequently used in implementations andthe 0-1 increasing series is more frequently used in literature. Knots are used tocreate sharp edges, change curve continuity and define how the endpoints relateto the curve. Mostly uniform and non-uniform clamped knot vectors are used, forinstanceNURBS toolbox for MatLabonly allows clamped knot vectors [70].

NURBS are defined on the intervalu, u ∈ [umin, umax]. If u is unique in the

knot vector, then the pointP (u) on the curve at positionu isC |bU |−(n+1) continuouswhere |U | is the number of knots and(n + 1) is the number of control points,otherwise the continuity is reduced for every repeated knot. Equivalently, a cubicB-spline curve of orderk = 4 is of degreek−1 = 3 and isCk−2 = C2 everywhere.Two additional knots inu would results inC2−2 = C0 atP (u).

2.3.3 Building NURBS from lines and arcs

A common way of constructing CAD models is the use of analyticcurves and lines.Lines can be expressed with Bézier curves and therefore alsowith NURBS. Arcsare more complex, therefore Rational Bézier curves are needed to represent them.Rational Bézier curves cannot be used when connected segments of arcs and linesare to be displayed as a continuous curve NURBS meets all these requirements.The following example shows how to construct a 90 degree curve followed by astraight line. A more extensive explanation on how to createarcs is available in[54].

A 90 degreearc as a part of a second degree curve can be created by settingup a start point,B0, and an endpoint,B2. The tangents inB0 andB2 are thenintersected to get positionB1. Now we have an Euclidean control polygon:

B0 = [0 , 0],B1 = [0 , 2],B2 = [2 , 2].

Next the coordinates are transformed to homogeneous coordinates.B1 is lo-cated in the middle of the arc and is therefore the coordinatethat influence thecurvature. The homogeneous weight,h1, in B1 equals cosine of half the openingangle, i.e. in our caseh1 equalscos(45◦) = 1/

√2. It should be noted that by us-

ing this formula it is possible to create an arc with an opening angle less than 180degrees. Wider angles are created by gluing segments together in the same manneras the line and the arc connected in this example. A circle, for instance, is createdusing three 120 degree arcs or four 90 degree arcs. Now the Euclidean components

Page 22: Visualization of CAD Models - Semantic Scholar...Master thesis in Computing Science, 20 credits Visualization of CAD Models-NURBS vs. Subdivision David Jonsson

12 CHAPTER 2. REPRESENTATION OFSURFACES

−0.5 0 0.5 1 1.5 2 2.5 3 3.5−0.5

0

0.5

1

1.5

2

2.5

Figure 2.6: NURBS curve with a 90 degree arc joined with a linein a sharp edge.

of B1 need to be transformed by multiplying all components inB1 with h1. Wefinally have our homogeneous coordinate:

BH1 = (x2h2, y2h2, z2h2, h2) = (0, 2/

√2, 0, 1/

√2).

The homogeneous coordinates forB0 andB2 are the same as their Euclideancoordinates because the weights equals one. A clamped knot vector is suitable fora stand alone 90 degree arc. A second degree curve has three repeated knots at thestart, three at the end and a total of six. This ends up in the knot vector:

U = [0, 0, 0, 1, 1, 1].

A line expressed as a second degree curve is constructed by settingthree points

B2 = [2 , 2],B3 = [2.5 , 1.5],B4 = [3 , 1],

Page 23: Visualization of CAD Models - Semantic Scholar...Master thesis in Computing Science, 20 credits Visualization of CAD Models-NURBS vs. Subdivision David Jonsson

2.3. NURBS 13

P (u, v) = projEuclidiann+1∑i=1

m+1∑j=1

Bhi,jNi,k(u)Mj,l(v) =

n+1Pi=1

m+1Pj=1

Bi,jhi,jNi,k(u)Mj,l(v)

n+1Pi=1

Pm+1

j=1hi,jNi,k(u)Mj,l(v)

Figure 2.7: Definition of NURBS surfaces.

on a straight line with their homogeneous weights set to one,in this case the sameclamped knot vectorU is used. It should be noticed that the knot vector values canbe scaled or transposed without changing the resulting curve. Next, the segmentsneed to be joined by combining the knot vectors. Each repeated knot value,ui,reduces the continuity inP (ui) by one. Locally we wantC0 in B2 to separate thesegments. A repeated knot in our case results in:

Ck−2−1 = C3−2−1 = C0

There are in total five control points, therefore the quadratic curve needs eightknot values. Joining the segments is done by repeating the knot value connected tothe basis function (see figure 2.3) that includesB2. Repeating the knot value inu3

andu4 yield:U = [0, 0, 0, 1, 1, 2, 2, 2]

with the control polygon:

BH1...6 =

xihi

yihi

zihi

hi

=

0 0 2 2.5 3

0 2 · 1/√

2 2 1.5 10 0 0 0 0

1 1/√

2 1 1 1

.

The resulting curve is visualized in figure 2.6.

2.3.4 NURBS surfaces

All NURBS curves are easily extended to a surface representation. Control pointsare defined in a rectangular grid and two knot vectors are used, one along eachedge direction of the rectangle. The surface equation is found in figure 2.7.

2.3.5 Trimming NURBS surfaces

NURBS surfaces are used in just about every design applications. These sur-faces are rectangular sheets and therefore not especially flexible, especially when it

Page 24: Visualization of CAD Models - Semantic Scholar...Master thesis in Computing Science, 20 credits Visualization of CAD Models-NURBS vs. Subdivision David Jonsson

14 CHAPTER 2. REPRESENTATION OFSURFACES

comes to representing a surface with a hole or complex local geometry. The handleof a car door needs local refinement but the surface of the dooritself might onlyneed a few points even though the surface is many times larger. The solution tothis problem is to introduce trimming of the surface. Trimming can be visualizedas cutting with a pair of scissors in a rubber surface (the NURBS surface). Therubber surface is stretched by changing the control points.Trimming curves aretypically specified in the parametric space, u and v, of the surface [29].

2.4 Subdivision surfaces

Compared to NURBS, subdivision surfaces is a relatively newmethod of repre-senting surfaces when it comes to implementation within computer graphics appli-cations. The origin can be traced back as far back as the late 40s and early 50swhen G. de Rham used corner cutting to describe smooth curves[80]. Publicationsof Catmull and Clark [14] and Doo and Sabin [21] from 1978 laidthe ground-work for subdivision surface modeling. The area was developing rather slow until1995, when new research related to smoothness and a couple ofnew subdivisionschemes were presented.Geri’s game, a short animated movie from 1997, createdwith Pixar’s Renderman, can be seen as a technology break-through for subdivi-sion [19]. ABug’s lifeandToy Story 2are just two examples of cartoons producedafter Geri’s gameproving the technology breakthrough for animation [80]. Sub-division surfaces have now proven to be a useful modeling tool and are now partof all standard modeling packages (e.g. 3D Studio MAX [20], Maya [2], Light-wave [46], modo[40]) and they are also gaining ground in CAGDapplications (e.g.SolidWorks [68], Catia [32]). An alternative way of creating and using subdivisionsurfaces is to use surface fitting, a method that can use an existing triangel meshmodel to generate an approximation of the original CAD model[31, 75].

2.4.1 Basics

Figure 2.8: Subdivision of a curve. The curve to the left is refined by insertingnew points between the old points and the process is then repeated until the curveis accurate enough.

The basic idea of subdivision can be summarized by:

Page 25: Visualization of CAD Models - Semantic Scholar...Master thesis in Computing Science, 20 credits Visualization of CAD Models-NURBS vs. Subdivision David Jonsson

2.4. SUBDIVISION SURFACES 15

Table 2.2: Subdivision scheme classification [80].Vertex splitDoo-Sabin, Midedge(C1)Biquartic (C2)

Edge splitTriangular meshes Quadrilateral meshes

Approximating Loop(C2) Catmull-Clark(C2)Interpolating Mod. Butterfly(C1) Kobbelt(C1)

Subdivision defines a smooth curve or surface as the limit of ase-quence of successive refinements[80].

One reason why subdivision schemes are interesting is that they bridge the gapbetween discrete surfaces (e.g. triangle meshes) and continuous surfaces (e.g. acollection of Bézier patches) [1]. Subdivision is performed by applying a set ofrules to a mesh with connected vertices. The set of rules is commonly called sub-division mask and specifies weighted influcences of verticessurronding the vertexto be generate or the one to be moved. Some of the properties wanted in these rulesare efficiency, compact support, local definition, simplicity and continuity.

2.4.2 Overview

Figure 2.9: Illustration of edge splitting (top) and vertexsplitting (bottom). Ver-tices of the original mesh are called even vertices and generated vertices are calledodd vertices.

Page 26: Visualization of CAD Models - Semantic Scholar...Master thesis in Computing Science, 20 credits Visualization of CAD Models-NURBS vs. Subdivision David Jonsson

16 CHAPTER 2. REPRESENTATION OFSURFACES

Depending on each application area, different properties of each subdivisionscheme needs to be considered. The aim of this section is to categorize some of themore common schemes and to provide the reader with an overview. Most schemesare possible to classify with the following properties:

• Type of refinement rule (face split or vertex split).

• Type of generated mesh (triangular or quadrilateral).

• Whether the scheme is approximating or interpolating.

• Smoothness of the limit surfaces for regular meshes.

Some of the more common schemes together with their properties are listed intable 2.2. Subdivision schemes are usually based on spline surfaces [21, 14, 38].A regular mesh is a mesh that converges to the base surface. The most commonschemes define their mesh with identical polygons [21, 14, 38], but there are ex-ceptions. An example of a triangle quad mixing subdivision is found in [60].

There are three possible primitives to use when specifying aregular mesh withidentical faces; triangles, quadrilaterals and hexagons.Triangle and quad basedmeshes are the ones practically used. The number of connecting edges to a vertex iscalled valence of the vertex. Regular meshes with identicalpolygons have equallyvalenced vertices, triangular surfaces have valence 6 vertices and quadrilateralshave valence 4 vertices. Regular subdivision rules are usedas a basis and thenadditional rules have to be specified for extraordinary vertices or faces that cannotbe part of a regular mesh.

Two main approaches are used to produce new faces; edge splitand vertexsplit (see figure 2.9). Schemes using the first method are referred to as primal andschemes using the second as dual. Edge splitting schemes produces a mesh whereall polygons are of the same type and each quadrilateral or triangular face is splitinto four new faces.

Approximating schemes changes the original control mesh and the resultingsurface approximates the original mesh, meanwhile interpolating schemes onlyadd new vertices and therefore keep the original control mesh. An advantage ofinterpolating schemes is therefore that a point on the control mesh will still be apoint on the limit surface and algorithms may be simplified. Interpolation schemeson the contrary, might introduce unwanted artefacts and they also converge slowerto the limit surface.

2.4.3 Loop surfaces

The Loop scheme is an approximating face splitting scheme for triangular meshesbased on trivariate (box-) spline presented by Charles Loop[38]. Loop surfaces isone of the most implemented schemes [10, 18, 7, 75].

Subdividing a face is done as shown in figure 2.9. The positions of the odd ver-tices are generated by applying the top left mask in figure 2.10. The numbers are

Page 27: Visualization of CAD Models - Semantic Scholar...Master thesis in Computing Science, 20 credits Visualization of CAD Models-NURBS vs. Subdivision David Jonsson

2.4. SUBDIVISION SURFACES 17

1

2

1

2

1

8

3

4

1

8

1

8

3

8

3

8

3

8

β

ββ

β

ββ

1-κβ

Masks for odd vertices Mask for even vertices

Interior

Crease and boundary

Figure 2.10: Loop subdivision.β can be chosen to be either1k (5

8 − (38 + 1

4cos2πk )2)

(original choice of Loop), or, fork > 3, β = 38k ) as proposed by Warren. For

k = 3, β = 316 can be used [80].

weights that are multiplied to the control points of the meshto be subdivided. Alleven vertices are then modified according to the upper right mask. Extraordinaryvertices that either are a part of a boundary or a crease needsto be handled sepa-rately with the two bottom rules. These rules produce a cubicspline curve alongthe boundaries without influence from interior nodes and will therefore be possibleto mix with NURBS.

A minor continuity problem for vertices neighboring an extraordinary vertexcan be resolved with additional rules. An extension to increase the continuity ofvertices near boundaries and creases presented in [80]. Theextended rule-set statesthat an interior odd vertex next to an extraordinary vertex is handled by a specialmask and is thus changed to another type of extraordinary vertex.

2.4.4 Catmull-Clark surfaces

The Catmull-Clark subdivision scheme is by far the most famous one due to it’ssuccess within the animation industry.Geri’s gamewas produced using a modifiedversion of Catmull-Clark which supported semi-soft edges [19]. Catmull-Clarksurfaces is based on the tensor product bi-cubic spline. Each polygon is subdividedby generating two types of odd vertices; face vertices and edge vertices (see figure

Page 28: Visualization of CAD Models - Semantic Scholar...Master thesis in Computing Science, 20 credits Visualization of CAD Models-NURBS vs. Subdivision David Jonsson

18 CHAPTER 2. REPRESENTATION OFSURFACES

βκ

Interior

Crease and boundary

1

2

1

2

1

8

3

4

1

8

γκ

βκ

βκ

βκ

γκ

γκ

1

16

1

16

1

16

1

16

3

8

3

8

1

4

1

4

1

4

1

4

Mask for a face vertex

Mask for an edge vertex

Mask for a boundary odd vertex

Masks for odd vertices Mask for even vertices

1-β-γ

Figure 2.11: Catmull-Clark subdivision. Catmull and Clarksuggestedβ = 32k and

γ = 14k for rules at extraordinary vertices [80].

2.11). The rules are defined to work with quadrilateral meshes or polygonal meshesthat can be reduced to quadrilaterals, but meshes with higher order polygons caneasily be supported by using the polygon midpoint as face point (illustrated infigure 2.12). Creases and boundaries are handled with a special rule set and theirpoints are therefore considered as extraordinary vertices.

2.4.5 Doo-Sabin surfaces

Doo-Sabin subdivision extends tensor product bi-quadratic splines. The subdivi-sion masks are presented in figure 2.13a. The idea is to shrinkthe polygons andconnect the separated vertices (see figure 2.13b). After oneiteration are onlyquadrilaterals produced and the amount of other polygons remain constant. Onlyone rule is needed for the interior but extraordinary pointsstill need to be handledseparately. The limit curve of the boundaries is a quadraticspline. The boundaryvertices can also be handled by replicating the boundary edge, i.e. creating quadri-laterals with two pairs of coinciding vertices. The same subdivision mask is usedover the whole surface except for the extra boundary vertices, which instead arediscarded [80].

Page 29: Visualization of CAD Models - Semantic Scholar...Master thesis in Computing Science, 20 credits Visualization of CAD Models-NURBS vs. Subdivision David Jonsson

2.4. SUBDIVISION SURFACES 19

f 1

2

ƒ1

1

ƒ1

n

e1

1e1

2

e1

3

e 0

3

e0

2

v 0

v 1

e0

n

e0

1

Figure 2.12: Catmull-Clark subdivision in action. Even vertices are denoted by v,face vertices by f and edge vertices by e [80].

2.4.6 NURSSes

Doo-Sabin and Catmull-Clark surfaces generalizes uniformquadratic and cubicB-spline surfaces. They allow vertices to have other valences than four and cantherefore handle geometry as one piece instead of several B-spline surfaces stitchedtogether. Figure 2.16 illustrates vertices that are extraordinary for a B-spline or aNURBS surface. Such geometry can only be represented by partitioning the modelinto a collection of individual NURBS patches. NURBS still have the advantageover the previous subdivision schemes because of the possibility to achieve discon-tinuities and more flexibility by changing the knot vector. Hoppe et al. presentedtagged edges to achieve creases, corners and darts Loop surfaces by using specialmasks to solve this problem [31]. A model similar to the one used by Hoppe et al.to illustrate sharp edges for Loop surfaces demonstrates the abilities of NURSSesin figure 2.15. A similar model was also used in the original paper describingNURSSes [64]. None Uniform Recursive Subdivision Surfaces(NURSSes) is amore general solution to fill the gap between quadratic/cubic NURBS and subdivi-sion without using special masks (see figure 2.14). It might just as well be calledNone Uniform Rational Subdivision Surface because it is a simple matter to ap-ply the rules to rational coordinates and then project back to Euclidean coordinates[64]. NURSSes contain two separate extensions, one for Doo-Sabin and one forCatmull-Clark surfaces. A NURSS extended Doo-Sabin surface is a generalizationof a quadratic NURBS surface, and a NURSS extension of Catmull-Clark subdi-vision is a generalization of a cubic NURBS surface. Doo-Sabin NURSSes are of

Page 30: Visualization of CAD Models - Semantic Scholar...Master thesis in Computing Science, 20 credits Visualization of CAD Models-NURBS vs. Subdivision David Jonsson

20 CHAPTER 2. REPRESENTATION OFSURFACES

α1

α2

α0

ακ-1α

k-2

Mask for interior vertices

Mask for boundary vertices

1

4

3

4

(a) Subdivision masks.

v 1

1

v 0

v 1

2

v 1

3

v 2

v 2

1

v 3

1

v n

1

v n

v 3

(b) Doo-Sabin in action.

Figure 2.13: Doo-Sabin subdivision. The coefficients are defined by the formulas

α0 = 14 + 5

4k andαi = (3+2cos(2iπ/k))4k for i = 1 . . . k − 1. Another choice of

coefficients was proposed by Catmull and Clark:α0 = 12 + 1

4k , α1 = αk−1 =18 + 1

4k , andαi = 14k for i = 1 . . . k − 2 [80].

Page 31: Visualization of CAD Models - Semantic Scholar...Master thesis in Computing Science, 20 credits Visualization of CAD Models-NURBS vs. Subdivision David Jonsson

2.4. SUBDIVISION SURFACES 21

d0

i-1,i

d0

i-1,i-2

d0

i,i-1 d0

i,i+1

d0

i+1,i

d0

i+1,i+2

-1

i,i-1

_d

0

i,i-1

_d

1

i,i+1

_d

0

i,i+1

_d

i

_p

p i

p i+1p i-1

(a) Subdivision of a pentagon.

Pi = V +Pi

2 + (d0i+1,i+2d

0i+3,i+2 + d0

i−1,i−2d0i−3,i−2)×

−nPi+nP

j=1

(1+2cos( 2π|i−j|n

))Pj

8nP

k=1

d0k−1,k

d0k+1,k

d0i,i+1 = d

−1i,i−1 = d0

i,i+1/2

d0i,i−1 = d

1i,i+1 = d0

i,i−1/2

where

V =

nPk=1

d0k−1,k

d0k+1,k

Pk

nPk=1

d0k−1,k

d0k+1,k

(b) Subdivision rules.

Figure 2.14: Quadratic NURSS subdivision scheme. Other rules ford0i,i+1 and

d0i,i−1 with the same limit surface are available in [64].

Page 32: Visualization of CAD Models - Semantic Scholar...Master thesis in Computing Science, 20 credits Visualization of CAD Models-NURBS vs. Subdivision David Jonsson

22 CHAPTER 2. REPRESENTATION OFSURFACES

(a) Round edge (b) Cusp with sharp incoming edges

Figure 2.15: Dodecahedrons with thorns and some sharp edgesmodeled withquadratic NURSSes. All weights are set to one, except the ones marked. Theyare set to zero.

special interest here, since they offer the possibility to create circular objects ofarbitrary type with a less complicated scheme than cubic NURSSes [64].

Figure 2.16: Extraordinary vertices for NURBS surfaces, one of valence 3 andone of valence 6. Such geometry needs a patchwork of NURBS surfaces. Effort isneeded to preserve continuity between the patches but subdivision surfaces handlesthis geometry in a natural way [80].

Page 33: Visualization of CAD Models - Semantic Scholar...Master thesis in Computing Science, 20 credits Visualization of CAD Models-NURBS vs. Subdivision David Jonsson

2.5. T-SPLINES AND T-NURCCS 23

d1

d2

d2

d3

d4

d0

d5d

6

d7

d8

e0

e1

e2

e3

e4

e5

e7

e6

e8

e9

t3

t1

t2

t4

t5

s1

s2

s3

s4

s5

P1

P3

P2

F

(a) T-mesh illustration

Each edge in the T-mesh is labeled with aknot interval constrained by the followingrules:Rule 1: The sum of knot intervals on oppos-ing edges of any face must be equal. Thus,for face F,d2 + d6 = d7 and e6 + e7 =e8 + e9.Rule 2: If a T-junction on one edge of aface can be connected to a T-junction on anopposing edge of the face (thereby splittingthe face into two faces) without violatingRule 1, that edge must be included in theT-mesh.

(b) T-mesh constraints

Figure 2.17: T-mesh definition [63].

2.4.7 Building quadratic NURSSes from lines and arcs

The previous section described how to create models with NURBS. Discontinuitiesfor NURSSes are achieved in a quite similar way, but knots areintroduced bysetting all outgoing weights from the crease to zero (see figure 2.15).

2.5 T-Splines and T-NURCCs

T-splines and T-NURCCs are surfaces with T-junctions in thecontrol net. T-junctions allow a rectangle in the control mesh to be locallyrefined and also al-low merging of adjacent NURBS surfaces with different knot vectors. The lattermotivated the creation of T-splines [63]. The problem with mathematical gapsbetween two adjacent NURBS patches with different knot vectors is thereby elim-inated by using T-junctions along the borders without propagating the refinementalong a whole column or row of the control mesh. A superset of T-splines calledT-NURCCs, Non-Uniform Rational Catmull-Clark surfaces with T-junctions, han-dles both T-splines and Catmull-Clark subdivisions. T-NURCCs is a modified cu-bic NURSS augmented with T-junctions and a restriction on the knot vectors. TheNURSS knot values (weights) can be arbitrary, while NURCCs require an equalknot spacing of each opposite side within a rectangular cell[63].

Both T-splines and T-NURCCs therefore provide the possibility to increase therefinement in areas with high curvature meanwhile still keeping down the numberof control points. A study on simplification and local refinement shows on majorsavings [62]. A 3D model represented with NURBS, and with T-splines are shownin figure 2.19.

The number of triangles during tessellation is then held back while the same

Page 34: Visualization of CAD Models - Semantic Scholar...Master thesis in Computing Science, 20 credits Visualization of CAD Models-NURBS vs. Subdivision David Jonsson

24 CHAPTER 2. REPRESENTATION OFSURFACES

Figure 2.18: T-splines and T-NURCCs groupings.

Figure 2.19: NURBS vs. T-splines [62].

visual results are maintained. Furthermore, cubic NURSSeshave a complicatednon-stationary refinement scheme, i.e. a changing basis function, whereas NUR-CCs have stationary refinement rules, that offers better conditions for fast algo-rithms. T-meshes also applies to quadratic surfaces even though this far all studiesuse cubic surfaces.

Page 35: Visualization of CAD Models - Semantic Scholar...Master thesis in Computing Science, 20 credits Visualization of CAD Models-NURBS vs. Subdivision David Jonsson

3Visualization

There are in general three different ways of rendering surfaces; ray tracing, scan-line generation and polygon tessellation. Due to recent advances in graphics hard-ware, algorithms based on polygon tessellation are in general much faster andtherefore the most common [27, 34, 44]. Smooth surfaces suchas NURBS, NURSSesand T-splines have in common that they provide a compact representation of asmooth surface. The following description of smooth surfaces referring to a cubicNURBS surface is found in theOpenGL Programming Guide[78]:

”Saving the 16 control points for a surface requires much less storagethan saving 1000 triangles together with normal vector information ateach vertex. In addition, the 1000 triangles only approximate the truesurface, but the control points accurately describe the real surface.”.

Although the statement is vague, it serves the purpose to give an idea of the pos-sibilities with smooth surfaces. Benefits for deformation and animation are alsopossible, since propagating a small change over a major partof the triangle mesh itis possible to move just one or two control points. It also is possible to delegate thetessellation to the graphic adapter when modifying and transferring the geometryby transferring control points all they way instead of usinga triangle mesh with1000 triangles, especially as future systems will do more work in parallel. Xbox360, for instance, has three processor cores with two hyper threads each [43].

Even if the graphics bus does not set the limitation of geometric transfers, thegeometry must be handled either on the CPU or GPU. When looking at memorytransfer rates (see table 3.1), it is easy to see that effective GPU tessellation algo-rithms have the qualification to unload the main processor and even do the sametasks more effectively.

Table 3.1: Memory transfer rates [53].Component Bandwidth

NVidia GeForce 6800 GPU memory interface 35GB/sPCI Express Bus (x16) 8GB/sCPU Memory interface (800MHz FSB) 6.4GB/s

25

Page 36: Visualization of CAD Models - Semantic Scholar...Master thesis in Computing Science, 20 credits Visualization of CAD Models-NURBS vs. Subdivision David Jonsson

26 CHAPTER 3. VISUALIZATION

3.1 NURBS

The OpenGL utility library is using a variant of the method described inReal timerendering of trimmed surfacesby Rockwood et al. [58]. The method is restrictedto individual surfaces and does not use connectivity information. Later work intro-duces the notion of super-surfaces [36], that clusters several patches with knownconnectivity. The method is intended for multiprocessor systems with shared mem-ory, where the super surfaces are rendered individually andthen sewn back to-gether. Recent work presents tessellation with a guaranteed maximum error [27, 6],something that is needed to close gaps between independent surfaces [5, 34]. Clos-ing gaps and tessellate NURBS without complicated seam graphs opens possibil-ities for real time deformation and incremental rendering [25, 15]. Deformationalso implies the possibility of adaptive tessellation and thus high quality rendering.

Currently both OpenGL and DirectX (from version 8.0) support parameterizedcurves and surfaces [78, 41]. They have been implemented in microcode on someSGI machines, but more commonly these operations are performed on the CPUby the driver [39, 35]. OpenGL’s rendering pipeline sooner or later translates theNURBS to polygons. The surface might be of the same precisionas a polygonmesh, but with the NURBS it is a simple matter to change the LODdepending onhardware performance. Bézier curves and surfaces are the only smooth primitivessupported by the OpenGL base library. The GL Utility (GLU) library uses Béziersurfaces to extend OpenGL with other smooth primitives. TheGLU NURBS inter-face encapsulates a lot of complicated code. It renders NURBS curves and surfacesas Bézier curves and surfaces, but some features such as trimming results in theuse of planar primitives [78]. OpenGL Utility library uses two types of trimmingcurves; a closed line strip and a closed curve. They are both specified in parametricspace of the surface. The line is specified in 2D and the curve is specified eitherin 2D or rational 3D coordinates. Implementation of triangulation for NURBS sur-faces is straight forward, but trimmed NURBS are quite complicated and thereforeseldom implemented in hardware [78].

3.2 Subdivision

There are mainly two reasons for implementing smooth surfaces, the first is whenthe limit surface is of interest, or secondly, when subdivision is used as a decom-pression algorithm for either facial animation, adaptive visualization or just decom-pression of large models/large amounts of small models. Animators and engineersare both striving for the limit surface while game developers are more interested inusing subdivision for the second reason. Finite element analysis (FEA) is anotherarea where a coarse mesh is of interest and further refinementin critical areas maybe necessary.

Page 37: Visualization of CAD Models - Semantic Scholar...Master thesis in Computing Science, 20 credits Visualization of CAD Models-NURBS vs. Subdivision David Jonsson

3.2. SUBDIVISION 27

3.2.1 Forward differentiating

Pixar’s Renderman uses forward differentiating to render avariant of Catmull-Clark surfaces [19]. The algorithm core is illustrated in figure 3.1. The samemethod can also be modified to work for the Doo-Sabin and Loop schemes. Ananalyzed and optimized implementation of Loop subdivisionis found in [7]. Asmall and constant amount of memory independent of the subdivision depth isused. The idea of forward differentiating is to use one variable for every termin the polynomial in each direction and do an incremental evaluation. By low-level parallelization of computations, the critical computation cost can theoreticallybe reduced to three floating point operations in parallel. Experimental results areshowing a minimum of four instructions after eight levels ofsubdivision. Thealgorithm core in addition only uses 23 register variables and is quite simple, whichmakes it well suited for hardware implementation. The downside is that it doesnot handle cracks. As the paper describes the problem: ”However, to avoid gapsbetween adjacent patches all patches of an object should be rendered at the sametarget resolution.” [7].

3.2.2 Subdivision by tabulation

Loop subdivision has been implemented on the Play Station 2 (PS2) by Brickhillby using a precomputed subdivision matrix [10]. The main processor of the PS2 isa 300MHz MIPS R5900. Fast access to RAM is limited but there are two vectorco-processors available to support SIMD algorithms [74]. The approach is calledVALENTETM and expresses subdivision as a linear combination of the controlmesh. It is then possible to evaluate each face directly instead of using a recur-sive implementation. They put an upper limit of 4 subdivision levels. This depthproduces 256 triangles and 153 vertices from each face subdivided at a maximumlevel. Cracks between faces with different levels of subdivision are thereafter han-dled by sewing the faces with a triangular saw tooth pattern.The report lacks athorough presentation on performance, although they reported that the algorithmswere proven practical for use in a console game and simple enough to be imple-mented in future hardware.

The same method is also implemented for Catmull-Clark surfaces by Bolz andSchröder [9]. They provide more information about their implementation, that isavailable online [61]. A model with 6144 quads is subdividedfour steps producing1572864 quads on a 1.7 GHz P4 in 125ms by using this approach. An overviewon the subject is also provided inReal Time Rendering[1]. This method and theprevious approach uses the fact that the subdivided mesh canbe expressed as alinear combination of the control mesh. Comparing the both,this algorithm isnumerically more stable but slower [9].

Page 38: Visualization of CAD Models - Semantic Scholar...Master thesis in Computing Science, 20 credits Visualization of CAD Models-NURBS vs. Subdivision David Jonsson

28 CHAPTER 3. VISUALIZATION

Outer

loop

Inner

loop

(a) Tessellation of a single triangle.

render_forward_differences(r,∆4,0 ∆3,0 ∆2,0 ∆1,0 ∆0,0

∆3,1 ∆2,1 ∆1,1 ∆0,1

∆2,2 ∆1,2 ∆0,2

∆1,3 ∆0,3

∆0,4)

for (i = 0; i < 2r; i + +)l0 = ∆0,0; l1 = ∆0,1; l2 = ∆0,2; l3 = ∆0,3;

∆0,0+ = ∆1,0; ∆1,0+ = ∆2,0; ∆2,0+ = ∆3,0; ∆3,0+ = ∆4,0;∆0,1+ = ∆1,1; ∆1,1+ = ∆2,1; ∆2,1+ = ∆3,1;∆0,2+ = ∆1,2; ∆1,2+ = ∆2,2;∆0,3+ = ∆1,3;

r0 = ∆0,0; r1 = ∆0,1; r2 = ∆0,2; r3 = ∆0,3;

glBegin(GL_TRIANGLE_STRIP);for(j = 0; j < 2r − i; j + +)

glVertex3fv(l0); glVertex3fv(r0);l0+ = l1; l1+ = l2; l2+ = l3; l3+ = ∆0,4;r0+ = r1; r1+ = r2; r2+ = r3; r3+ = ∆0,4;

glVertex3fv(l0);glEnd();

(b) r is the level of subdivision and∆ are triangle coordinates and derivatives.

Figure 3.1: Central procedure of a forward differentiatingalgorithm for Loop sub-division evaluation [7].

Page 39: Visualization of CAD Models - Semantic Scholar...Master thesis in Computing Science, 20 credits Visualization of CAD Models-NURBS vs. Subdivision David Jonsson

3.2. SUBDIVISION 29

Table 3.2: Adaptive vs. uniform GPU tesselation.Max depth Uniform subdivision Adaptive subdivision

Triangles fps Triangles fps0 2584 273.5 2584 273.51 10336 120 10348 102.52 41344 46.15 24374 37.23 165376 17.60 35326 17.24 661504 4.96 39770 9.705 2646016 0.87 40962 7.166 10584064 0.29 40978 6.74

3.2.3 GPU subdivision

Uniform subdivision divides the whole mesh, even flat sections. A result is unnec-essary amount of primitives, but sewing borders is not required. Adaptive subdivi-sion only tessellates the areas needed. Thus, the preprocessing time is increased infavour of memory and vertex processing savings during during the first step. Fur-thermore, the amount of primitives that are subject for subdivision is reduced eachstep. Hence, the time spent subdividing the mesh is exchanged or outperformed bypreprocessing time.

So far we have seen that uniform subdivision is possible to implement effi-ciently (see section 3.2.1) and there has also been efforts to do adaptive tesselationon the CPU (see section 3.2.2). Adaptive Catmull-Clark subdivision has recentlybeen implemented by using vertex shaders and texture memory. The implementa-tion is available online [11]. Test results on a Athlon 64 4000+ with a NVidia 6200are shown in table 3.2. Adaptive is shown in this case to be faster than the uniformsubdivision after three steps. Visual results of uniform and adaptive tesselation arenot exactly the same. Visual results are better for an adaptive algorithm when errorestimation is used together with a deeper subdivision. On the other side, a uniformsubdivision produces better results when the subdivision is shallow and at the samelevel. The algorithm is divided into the following steps [53, 11]:

1. Break down the mesh into patches with face and face neighboring vertices.

2. Send patches to the GPU as a texture map.

3. Perform a flatness test on the patches.

4. Pack flatness test results into one bit true/false information.

5. Send flatness test result back to the CPU using glReadPixels.

6. The CPU decides and tells the GPU which faces to subdivide.

Page 40: Visualization of CAD Models - Semantic Scholar...Master thesis in Computing Science, 20 credits Visualization of CAD Models-NURBS vs. Subdivision David Jonsson

30 CHAPTER 3. VISUALIZATION

accuracy

speed

Figure 3.2: Two neighbouring patches are tesselated different along the border(left). Three alternatives show how to construct a fat border for the top corner ofthe left patch and how to trade accuracy (left) for speed (right) [5].

7. Repeat until we are satisfied.

The patches built in the first step contains redundant information to structurethe data and thereby use memory efficiently and contiguously. The idea to useredundant information is also used by Peters et al. [66]. They present a moregeneral subdivision kernel that handles the most common subdivision schemes, e.g.Catmull-Clark, Doo-Sabin and Loop. Semi-smooth creases and global boundariesare also handled by the kernel.

3.3 Repairing borders

Subdivision surfaces are able to handle a whole object as onesurface, but still, bothtrimmed NURBS and subdivision surfaces have in common that cracks may arisebetween two separate surfaces. There currently are three documented approaches:

• To repair the tessellated model before it is visualized as apre-processing step[34].

• To maintaining aseam graphthat keeps track on surface connections. Thecommon borders are then tessellated together and repaired runtime [36, 10].

• To do tessellation every frame and a view dependentfat border is producedby a vertex shader [5, 26].

Page 41: Visualization of CAD Models - Semantic Scholar...Master thesis in Computing Science, 20 credits Visualization of CAD Models-NURBS vs. Subdivision David Jonsson

3.3. REPAIRING BORDERS 31

!!ARVvp1.0PARAM mvp[] ={state.matrix.mvp};PARAM mv[] ={state.matrix.modelview[0]};PARAM param =program.local[0];TEMP view, length, pos;# compute per vertex lighting...# compute view directionMUL view, {-1, -1, -1, 0},mv[2];DP3 length, view, view; RSQlength, length.x;

MUL view, length, view;# move in view planeXPD pos, view,vertex.texcoord[0];DP3 length, pos, pos;RSQ length, length.x;MUL pos, length, pos;MAD pos, pos, param,vertex.position;#move away from viewerMAD pos, view, param, pos;transform and project vertex...END

Figure 3.3: Vertex program to render fat borders. The tangent vectors are stored astexture coordinates and the approximation error is given aslocal program parame-ter [26].

The first approach, to generate polygons and repair the model, can be solvedby tessellating trimmed NURBS patches with a guaranteed maximum error. Theedges are then stitched together if they are close enough, i.e. less than the guaran-teed error [34]. The approach has been further developed into adaptive tessellationand view-dependent LOD through seam graphs [27]. A seam graph maintains astructure of neighboring surface patches. Another real time approach to view de-pendent seam graphs have also been implemented in software for the PS2 [10].

Fat borders is a third interesting alternative. The surfaces are tessellated with aknown error. A border as wide as two errors is centered with its face towards theviewer and pushed back perpendicular to the viewer (see figure 3.3). The rastercan be considered as a display where the black squares are pixels that shows upas gaps. The minimum width of this border is two pixels at the given distance,since the distance to the curves in this view plane is one pixel. When lookingthrough a crack, only the border behind the two neighboring patches is seen. Theintersection between the patches can be considerd as small enough to avoid shadingartifacts, but borders of two neighbouring patches with different colors can overlapand produce other artifacts. Fat borders are possible to implement as a vertexshader program (see figure 3.3).

All that is required is knowledge of the approximation erroror the gap size.Distace changes in the view plane scale the fat borders to fillthe gaps completely,therefore re-tessellation is not needed and static models are possible. Deformablemodels with dynamic neighbourhood demands either re-tessellation or changes tothe fat borders for patches that do not meet the requirement.This can be handled asan iterative process allowing flaws in the model while doing load balancing until all

Page 42: Visualization of CAD Models - Semantic Scholar...Master thesis in Computing Science, 20 credits Visualization of CAD Models-NURBS vs. Subdivision David Jonsson

32 CHAPTER 3. VISUALIZATION

patches are corrected. It is done to achieve high enough frame rates. This methodallows tessellation of a car model made of 8036 trimmed NURBSon a Pentium 4,1.8GHz with 512 MB memory and an ATI Radeon 9700 Pro without any visibleartefacts in about 10 frames per second [5]. Yet another solution is to use a T-mesh (see section 2.5 on page 23). The inner part of the mesh can be adaptivelytessellated but all borders must be tessellated at the same level to close the gaps.

Page 43: Visualization of CAD Models - Semantic Scholar...Master thesis in Computing Science, 20 credits Visualization of CAD Models-NURBS vs. Subdivision David Jonsson

4Case Study - StairCon

StairCon is a CAD software for design, 3D visualization, dimensioning, stress test-ing, cost estimation and production of wooden parts for stairs.

The development started 1996 and has since then occupied on average approx-imately 3 full-time programmers. It started off as a small project with no big inten-tions and developed to a real product later on. About 60% of all wooden stairs inthe Nordic countries are constructed and manufactured withStairCon.

The goal with this chapter is to provide the reader with motivation and possibleapplication areas of the previous chapters. It should be noticed that the implemen-tations done in StairCon does not use such features today to the extent presented inthis report.

4.1 Overview

The user interface uses three main views, a top, side and 3D view of the stair(see figure 4.1). The top and side view can be used to manipulate objects such asbalusters, steps, string parts, handrails, and also abstracts such as holes, cuts, andhelp lines. There is also a production view with the purpose to present all woodenparts needed to construct the stair. The side view shows a flatside of the stair, nomatter if it is turned or straight. The user always works witha 2D model but theresulting changes may be in three dimensions. A staircase isbuilt up from eight

(a) Plan view of a L-stair withwalls.

(b) The elevation view of a L-stair.

(c) The 3D view of a L-stairwith walls.

Figure 4.1: StairCon user views.

33

Page 44: Visualization of CAD Models - Semantic Scholar...Master thesis in Computing Science, 20 credits Visualization of CAD Models-NURBS vs. Subdivision David Jonsson

34 CHAPTER 4. CASE STUDY - STAIRCON

Figure 4.2: Creating a stair is done by giving measurements to a basic model.

Figure 4.3: A basic staircase model can be modified in a flexible manner.

simple staircase structures that can flexibly be modified andextended with morestairs, stairwells and floors (see figure 4.2 and 4.3).

4.2 Staircase construction

There are two production methods currently used for stairs;full scale drawingsand CNC manufacturing. The full scale drawing method uses 1:1 scaled printoutsof the stair parts, that are glued directly onto the wood. This method is used by

Page 45: Visualization of CAD Models - Semantic Scholar...Master thesis in Computing Science, 20 credits Visualization of CAD Models-NURBS vs. Subdivision David Jonsson

4.2. STAIRCASE CONSTRUCTION 35

(a) Post to post top. (b) Wrought iron de-tail.

(c) Side capping.

Figure 4.4: Premanufactured stair parts. 3D models of theseparts are hard togenerate. Images 4.4a and 4.4c courtesy ofL.J. Smith Stair Systems[37]. Image4.4b courtesy ofStair Supplies[71].

(a) Post to post handrail. Image courtesyof Coffman Stairs, LLC[16].

(b) Over the post handrail. Image cour-tesy ofStaircase & Millwork Co.[72].

Figure 4.5: Handrail systems.

Page 46: Visualization of CAD Models - Semantic Scholar...Master thesis in Computing Science, 20 credits Visualization of CAD Models-NURBS vs. Subdivision David Jonsson

36 CHAPTER 4. CASE STUDY - STAIRCON

Figure 4.6: CNC manufacturing of a handrail. Image courtesyof Consultec SystemAB [17].

small staircase producers. The other method, CNC, is usual way to produce stairs.Figure 4.6 shows a CNC milling machine in action creating a handrail part. Thismethod is a cheaper way to produce more complex stairs. A CNC machine is quitean investment for a small engineering firm, that only draws a couple of stairs on ayearly basis. They usually buy the production from CNC machine owners.

The two methods have in common that wrought iron, glass, and wooden pre-manufactured parts, or in other words mass produced more complex part, may beused. The reason is simply because they are cheaper to buy than to manufacture.The staircase itself seldom has standard measures, therefore only some parts canbe premanufactured and the rest is work for a carpenter or a CNC operator. Theengineers must then adopt the blueprints to fit the premanufactured parts into theconstruction. This is a laborious work since a small change can propagate and af-fect almost the whole staircase. One of the basic motivations of using ComputerAided Design software should be that it is easy to change details in the design tosee if it looks or works better. A supporting example is when acalculated bend onthe handrail is replaced with a premanufactured easing (curved handrail part). Ifthe radius differs, then the connecting parts adopt at leastin one end, which maymodify the next handrail connection and so on.

This example motivates implementation of automatic recalculation in the userinterface. Recalculation of the handrail is enough to support Post to Post handrails

Page 47: Visualization of CAD Models - Semantic Scholar...Master thesis in Computing Science, 20 credits Visualization of CAD Models-NURBS vs. Subdivision David Jonsson

4.3. BUILDING CAPPINGS 37

with goosenecks (see figure 4.5a). This method is the most common way of build-ing wooden staircases in the Nordic countries. Over the posthandrails (see figure4.5b) requires a bit more, because they are generally built with more complex pre-manufactured parts. Post to post handrails with a gooseneckare also put togetherwith premanufactured parts but the CAD system integration is simpler and it ispossible to achieve the same results with reasonable effortin StairCon without im-provements.

Over the post handrails are more common in the U.S., U.K., andJapan asopposed to the Nordic countries. Partly, this has to do with legislation. The handrailmust for instance begin before the first step in the U.S. whichmakes an over thepost staircase design suitable to solve this problem in a neat way.

4.3 Building cappings

Geometric components in the system such as balusters and posts, have a relativelysimple 3D structure. The point is that it is possible to use simple text file scriptingto draw these structures or generate them from within the program. A handrailhas a relatively simple structure too, i.e. a contour of the profile and a curve thatfollows the profile.

A problem that shows up here is that the handrail parts located just over thepost, from now on called cappings, usually have a more complex geometry. Spiralstaircases are an exception where the same handrail profile goes all the way. Theposts are in this case just connected from below directly into the handrail.

Cappings for over the post handrails are a bit harder to manage but someare still possible to construct by using the contour from above together with thehandrail profile. The profile is simply rotated around the contour and the cappinghas now a 3D appearance.

The 2D contours are built up from a series of points where it isspecified if a lineor an arc should be drawn in between. Half the handrail profileis then circulatedaround the contour with an exception from the lines where thehandrail connectionsare located. This method is a fast way of creating many 3D models automaticallyfor over the post cappings. The process is illustrated in figure 4.8.

The mesh must thereafter be normalized, so the empty space isfilled in thosepoints where the crossover length is longer than the profile width. It can also behandled by drawing a convex polygon to close up the model.

Some cases are caught in the previous method but models of some cappingsmust at least be modified to look like the premanufactured parts. The same prob-lem also relates to wrought iron balusters, side cappings, and some post to postcappings (see figure 4.4).

Page 48: Visualization of CAD Models - Semantic Scholar...Master thesis in Computing Science, 20 credits Visualization of CAD Models-NURBS vs. Subdivision David Jonsson

38 CHAPTER 4. CASE STUDY - STAIRCON

4.4 Capping integration

The main objective is to support the ability to combine premanufactured and Stair-Con designed parts by using meta data combined with a 3D file format. Highquality visualization of the stairs is considered as a bonusand a sales argument.Costs for visualization should therefore be kept economically feasible.

4.4.1 File format

The file format should be human readable and be an open file format supported byas many CAD vendors as possible. StL is a primitive file formatbut it has massivesupport from CAD software vendors (see section A.1.1).

The simplicity of the file format makes it a good choice economically. If theneeds are growing it is possible to extend the system with another format or simplyconvert the old files. The main drawback is the complexity of generating vertexbased normals, because no connectivity information is provided in the StL file.Vertex normals are really important since they allow a modelwith fewer polygonsto maintain the same visual quality. The common method for creating smooth andsharp edges when importing StL files is to compare the angles of neighboring facenormals around each vertex. If the angle between two faces isless than a limitangle, then a common normal is used which is interpolated between the two faces.

Because no connectivity information is provided, the complexity is at best thesame as sorting all vertices, i.e.O(n log n).

The limit angle for face smoothing in import filters is given by the user for StLfiles. A maximum distance for merging two vertices is often also used, since noconnectivity information is provided.

A fast implementation and minimum maintenance requires a relatively simplefile format or a library. Another opening is when a more complex file format canbe motivated by know-how investment for other projects.

4.4.2 Generation

The generation of the cappings has been designed as a stand-alone program butwith the code base from StairCon. It is possible to generate new cappings, analyzeand debug this program separate and later on to integrate it with StairCon. Theprogram generates StL files, a file format that almost every CAD program handles.This makes it possible for third party companies to provide Consultec with handrailprofiles and contours of their premanufactured parts with StL as their verificationtool. The generation program subdivides the mesh into quadrilaterals where onedirections follows the contour and the other the profile. Lines are kept straightand arcs are subdivided by giving a maximum distance betweeneach arc and theapproximating line (see figure 4.8a).

The previous section mentioned problems with generating models for wroughtiron components, side cappings, etc. These components can also be imported

Page 49: Visualization of CAD Models - Semantic Scholar...Master thesis in Computing Science, 20 credits Visualization of CAD Models-NURBS vs. Subdivision David Jonsson

4.4. CAPPING INTEGRATION 39

(a) DXF drawing with contour from top of capping and a handrail profile.

(b) Generated geometry imported and rendered in 3D Studio MAX with an added texture and shadows.

Figure 4.7: Handrail part generation. The models are generated and saved in theStL file format and thereafter rendered with 3D Studio MAX.

Page 50: Visualization of CAD Models - Semantic Scholar...Master thesis in Computing Science, 20 credits Visualization of CAD Models-NURBS vs. Subdivision David Jonsson

40 CHAPTER 4. CASE STUDY - STAIRCON

Handrail profileMaximum distance

Top contour

(a) Top view with contour normals, and arc subdivision

(b) Generated geometry imported and rendered in 3D Studio MAX with an added texture and shadows.

Figure 4.8: Handrail part generation. The models are generated and saved in theStL file format and thereafter rendered with 3D Studio MAX.

Page 51: Visualization of CAD Models - Semantic Scholar...Master thesis in Computing Science, 20 credits Visualization of CAD Models-NURBS vs. Subdivision David Jonsson

4.4. CAPPING INTEGRATION 41

Figure 4.9: Wrought iron balusters imported from an StL file.

through the same interface with the presumption that 3D models are available,but this far have only 2D DXF drawings of staircase details been provided by partsvendors (see figure 4.7a).

4.4.3 Importing geometry

A short description of meta data is ”data about data” or ”information about infor-mation”. In it’s simplest form is meta data used as an extra piece of informationdescribing the actual data. Meta data is used to import the models into StairConand can be summarized as follows:

• Type of model (90 degree capping, volute, end capping, baluster).

• Rotation of models.

• Scaling (inches / mm).

• Material. This refers to the type of wood used for a detail andis defined byOpenGL as a texture.

• Surface finish. OpenGL defines this as a material.

Page 52: Visualization of CAD Models - Semantic Scholar...Master thesis in Computing Science, 20 credits Visualization of CAD Models-NURBS vs. Subdivision David Jonsson

42 CHAPTER 4. CASE STUDY - STAIRCON

(a) 90 degree capping

(b) End cappings

Figure 4.10: Cappings in StairCon.

Page 53: Visualization of CAD Models - Semantic Scholar...Master thesis in Computing Science, 20 credits Visualization of CAD Models-NURBS vs. Subdivision David Jonsson

4.4. CAPPING INTEGRATION 43

The meta data makes it possible to reuse the same model as longas the geome-try is the same, resulting in maintenance savings. Screen shots of generated modelsintegrated in the system for over the post handrails are shown in figure 4.10. Gen-eral geometry that is hard to generate such as the wrought iron balusters in figure4.4b is also imported with StL (see figure 4.9).

Page 54: Visualization of CAD Models - Semantic Scholar...Master thesis in Computing Science, 20 credits Visualization of CAD Models-NURBS vs. Subdivision David Jonsson
Page 55: Visualization of CAD Models - Semantic Scholar...Master thesis in Computing Science, 20 credits Visualization of CAD Models-NURBS vs. Subdivision David Jonsson

5Smooth Surface Implementation

The previous chapters presented different methods and aspects of smooth surfaces.This chapter will present two minor implementations to support the report. CADmodels need to have sharp edges co-insisting with smooth surfaces. The goal withthis section is to show the possibilities of representing and visualizing the modelsgenerated in the case study. Two methods of surface representation have beenimplemented:

• Quadratic trimmed NURBS surfaces

• Quadratic NURSSes

5.1 Trimmed NURBS surfaces

The model used in this section is a 90 degree capping generated with the samemethod as the one used in the previous chapter. The model is then converted toa NURBS representation by using one NURBS surface as the body. TrimmedNURBS are then used to make lids for the holes at top and bottomof the model.

These NURBS are tessellated with the OpenGL GLU library. Theresultingmodel has a problem with cracks along the patch borders due todifferent levelsof tessellation along the edges (see figure 5.1). The GLU API makes it straightforward to implement rendering of trimmed NURBS.

5.2 NURSS surface

The same model as in the previous section has also been used tocreate a singlequadratic NURSS surface. A polygon mesh was generated to fillthe gap at the topand bottom. A mesh was relatively simple to generate but problems were expe-rienced when subdividing the mesh, but a reasonable result was finally achieved.The main problem was that quadratic NURSSes possibly generate concave faces.

The surface can be evaluated with one pass. The biggest problem with subdivi-sion surfaces in general is cache problems. Their loose structure results in a meshwhere two adjacent faces possibly are located on two different cache blocks. An

45

Page 56: Visualization of CAD Models - Semantic Scholar...Master thesis in Computing Science, 20 credits Visualization of CAD Models-NURBS vs. Subdivision David Jonsson

46 CHAPTER 5. SMOOTH SURFACE IMPLEMENTATION

Figure 5.1: Capping made with one regular NURBS surface and two trimmed.Each trimmed NURBS surface has one trimming curve. A crack between thepatches can be seen at the top.

Page 57: Visualization of CAD Models - Semantic Scholar...Master thesis in Computing Science, 20 credits Visualization of CAD Models-NURBS vs. Subdivision David Jonsson

5.2. NURSSSURFACE 47

Figure 5.2: Capping made with a single NURSS surface after three levels of sub-division.

efficient implementation relies on a solution to this problem. The faces in NUR-CCs are all squares after the first level of subdivision and uses a stationary scheme.Thus, it is easier to make an efficient implementation even though the rules areslightly more complicated. Two existing GPU implementations of Catmull-Clarksubdivision is an evidence of these arguments, where the onefrom Peters et al. [66]says that their solution is easily adapted to other refinement schemes [53]. NUR-CCs would be the choice of a production implementation, since the Catmull-Clarksubset is implemented for GPUs and supported by modeling packages [53].

Page 58: Visualization of CAD Models - Semantic Scholar...Master thesis in Computing Science, 20 credits Visualization of CAD Models-NURBS vs. Subdivision David Jonsson
Page 59: Visualization of CAD Models - Semantic Scholar...Master thesis in Computing Science, 20 credits Visualization of CAD Models-NURBS vs. Subdivision David Jonsson

6Discussion

There are today two main ways of representing smooth surfaces: subdivision sur-faces and NURBS. The subdivision scheme discussed here is quadratic NURSSes,since it is the only scheme that generalizes from quadratic NURBS. Three issuesregarding these representations are to be discussed: storage and loading, visualiza-tion, and back end support.

6.1 Storage and loading

NURBS, subdivision surfaces and polygon meshes have different storage require-ments. The NURSS representation requires twice as much, andpolygon meshrequires four times as much storage space as a NURBS representation. Lets havea closer look: A NURBS representation of the 90 degree capping model used inthe previous chapter uses 591 four dimensional control points and 104 knot val-ues with a grand total of2468 floating point values. The NURSS make use of thesame control net, additional connection information, and weights for every outgo-ing edge. A NURSS model requires4728 floats plus additional connection info.The same model represented with a triangle mesh uses9216 floats when guaran-teeing a maximum deviation of1 mm from the original model. Additional meshinformation, such as vertex normals require either that thedata is stored togetherwith the vertices or that the data is pre-processed during loading. Furthermore, theamount of control points for the triangle mesh grows withO(n2) in sections withcurves in two directions. Consequently, NURBS and NURSS models loads fasterand makes it possible to calculate vertex normals through the implicit structure ofthe control net. NURSSes provides the possibility of arbitrary topology at the costof approximately twice the storage requirement compared tothe trimmed NURBSrepresentation. T-meshes increases connection info in favour of less control pointsif local control is needed or connections with intersectingpatches. Thus, storageof models with piecewise smooth surfaces makes it possible to save disk space.

49

Page 60: Visualization of CAD Models - Semantic Scholar...Master thesis in Computing Science, 20 credits Visualization of CAD Models-NURBS vs. Subdivision David Jonsson

50 CHAPTER 6. DISCUSSION

6.2 Visualization

A natural question that arises in this context is whether subdivision surfaces thatgeneralizes NURBS could be handled as a new rendering primitive, i.e. be sup-ported in APIs, file formats and hardware. In that case, two challenges must bemet: To construct algorithms suitable for hardware implementation and to definean interface through which arbitrary control meshes can be transferred to the graph-ics subsystem.

Implementation of plain NURBS is straight forward. If they are extended withtrimming curves they are more complicated. Careful implementation of tessellationat intersecting borders or tessellating with a given maximum error in combinationwith fat borders makes it possible to avoid gaps. Water-tight surfaces is the largestadvantage of subdivision surfaces. Uniform tessellation of trimmed NURBS pro-duces as many triangles as NURSSes. View-dependent adaptive tessellation arepossible to use for both NURBS and various subdivision schemes, since B-splinecurves are the basis for both.

Currently, efforts related to both subdivision and parametric surfaces are shown:

• Subdivision surfaces generalizing from uniform B-spline surfaces are possi-ble to do on a GPU [53, 66].

• A trimmed NURBS and T-splines GPU implementation is going tobe pre-sented in August atSigGraph 2005. However, due to patent pending restric-tions the paper has not been made available yet [28].

6.3 Back end support

STEP is today widely used within the mechanical industry, but interchange andmore standardizations will probably bring software packages closer to each otherin other areas as well due to customer requirements.

There are currently no support in the presented file formats for subdivision,but intentions are presented in the ongoing COLLADA specification (see sectionA.1.10). This is probably because subdivision is a relatively young method com-pared to NURBS and also because of limited confidence from theCAD industry inthe past. Subdivision surfaces is also a quite wide concept,i.e. there are too manyschemes to maintain and there is no right or wrong when choosing schemes eventhough Loop and Catmull-Clark can be considered the most widespread schemes.Current work on COLLADA strives to supply the entertainmentindustry with astandard and is now under development.

On the other hand, NURBS curves and surfaces have an old history and arestrictly specified (there are only knots and control points). This might be a majorreasons why most CAGD and modeling packages support NURBS. This showsin the file formats where IGES has been supporting NURBS since1983. STEP,VFA-FS and 3DM also support NURBS.

Page 61: Visualization of CAD Models - Semantic Scholar...Master thesis in Computing Science, 20 credits Visualization of CAD Models-NURBS vs. Subdivision David Jonsson

6.4. STAIRCON 51

Support for NURBS and subdivision surfaces will probably grow when APIstogether with graphics hardware comes to the level where full support is reachedand makes it simple to implement through a given framework.

6.4 StairCon

StairCon is a construction program, not a visualization program. This requireseasily implemented visualization techniques. A construction engineer knows whatthe result is going to look like anyway. On the other hand; high quality visual re-sults sell software. The imported models currently used within StairCon are eitherusing an internal file format or StL. Implementation of subdivision surfaces in asmall scale CAD system may not be motivated today. More advanced 3D modelimports should be implemented when future APIs support subdivision surfaces, ex-ports from modeling packages are available, and part producers already have morecomplex models represented in 3D formats.

More advanced visualization or representation techniquesfor StairCon is ques-tionable, since computers are fast enough to handle a triangle mesh of high enoughprecision.

A simple and reasonable solution to implement smooth surfaces for importedmodels is to use fitting of Loop surfaces on triangle meshes [31, 75]. This methodhandles arbitrary surfaces with creases.

Another fast solution is to use the OpenNURBS library that includes read andwrite routines of their file format, 3DM, together with an OpenGL viewer with nocopyright restrictions.

3DM, COLLADA and STEP have shown to be the most interesting file formatsfor future development; 3DM since it is an open widely used format, COLLADAbecause it is a new project that aims to give the large entertainment industry with astandard and STEP because it is is the standard for CAD data exchange.

6.5 Conclusions

NURSSes are simpler to implement than trimmed NURBS, since they consist of asmall set of rules. Usage of trimmed NURBS in production applications requiresmore than to use the OpenGL API, since further effort is needed to close the gapsalong the borders. Error controlled surface trimming needsto be implementedtogether with fat borders. Rapid development will most probably offer an effectiveGPU subdivision implementation that generalizes NURBS together with API andfile format support in a near future. Still, real-time tessellation is not required forCAGD software. Their problem relates to a standardization of the surfaces.

NURSSes and their close relative, NURCCs, are simple enoughto implementwith reasonable effort, therefore they are most suitable representation for visual-ization of geometric models for CAD. They will probably havefuture support inAPIs and hardware. T-meshes will also be more common, especially in modeling

Page 62: Visualization of CAD Models - Semantic Scholar...Master thesis in Computing Science, 20 credits Visualization of CAD Models-NURBS vs. Subdivision David Jonsson

52 CHAPTER 6. DISCUSSION

software. If they increase in popularity they will probablymake their way to be anew standard for modeling together with NURCCs or as T-splines.

6.6 Future work

Computation power has grown compared to bus bandwidth in graphics adapters.A GeForce FX 5950 can sustain 2.66 operations per word off-chip bandwidth andthe GeForce 6800 can sustain nearly 6 [53]. An increasing amount of computationpower invites to development within computer graphics to include soft shadows,GPU ray tracing etc. Realistic lighting with soft shadows and ray tracing wouldincrease the depth feeling and visual quality of CAGD scenes.

Generation of texture coordinates to the geometry needs to be explored furthersince generated geometry does not automatically include texture coordinates. Atexture map could for instance be mapped to a sphere or a cylinder that is largerthan the model and then projected onto the surface.

When subdivision is explored to its extent, reverse subdivision is another areawhere faces in adaptive meshes can be merged to reduce computation costs.

Page 63: Visualization of CAD Models - Semantic Scholar...Master thesis in Computing Science, 20 credits Visualization of CAD Models-NURBS vs. Subdivision David Jonsson

7Acknowledgements

I would like to thank Niclas Börlin, my supervisor at theDepartment of ComputingScience, for his help during the completion of this report. I also want to thank Mat-tias Markström, my supervisor atConsultec, for his solid assistance during duringthe case study, Joakim Sundkvist atConsultecfor his initiatives and ideas, andMichael Guthe at the University of Bonn for his technical assistance.

A special thanks to Gunnar Söderman for his support and comments through-out the writing of this report, and to Per Johansson, who is responsible for theartistic part of the 2D illustrations.

Other people I would like to thank are Gustav Bratt, Helena Lindblom, JonasSalomonsson, and Ola Löfberg.

Finally, I would like to express my gratitude to my parents, Bo-Göran and In-grid, for their support throughout my education.

This work was supported byConsultec System ABandAcademics in Companies.

53

Page 64: Visualization of CAD Models - Semantic Scholar...Master thesis in Computing Science, 20 credits Visualization of CAD Models-NURBS vs. Subdivision David Jonsson
Page 65: Visualization of CAD Models - Semantic Scholar...Master thesis in Computing Science, 20 credits Visualization of CAD Models-NURBS vs. Subdivision David Jonsson

AFile Formats/Exchange Protocols

A file format used by an application does not contain all features of a program butit sets the limits of the features. It is always possible to introduce a new import orexport file format, but maintenance also grow with the numberof file formats. Acareful choice of file format can therefore greatly reduce costs.

This chapter will present some of the more common file formatsused for CADand 3D models.

A.1 Formats

Usability of a file format as an import or export filter is more amatter of featuresand a bit praxis rather than if a certain CAD program uses it. The imports andexports filters have generally two goals: to provide an interface between programs(as general as possible), and to provide an interface with a managed set of data tohide information for users on the receiving end.

There are translators available between common file formatswith the presump-tion that the elements can be translated, e.g. a cubic curve does not convert to aquadratic curve. Meta data might also be contained in file formats. For a 2D imagetaken with a digital camera, meta data might refer to the rotation of the images.

A.1.1 StL

Stereo-Lithography (StL) is a simple file format to specify triangle meshes. Everytriangle is specified with three points and a unit normal. Each triangle must sharetwo vertices with an adjacent triangle, i.e. two edges cannot coincide unless twovertices coincide. The order of the corners is specified, therefore the unit normalcan be considered as redundant information [13].

This file format has a strong position even though its lack of possibilities be-cause of the massive support. Almost every CAD system supports export to StL,e.g.AutoDesk Inventor, Catia v5, I-DEAS, Microstation, Maya, Solid Edge, Solid-Works, Unigraphics[48]. The complete StL file format syntax is available in figureA.1. It should be noticed that only one mesh can be stored in each file.

55

Page 66: Visualization of CAD Models - Semantic Scholar...Master thesis in Computing Science, 20 credits Visualization of CAD Models-NURBS vs. Subdivision David Jonsson

56 APPENDIX A. FILE FORMATS/EXCHANGE PROTOCOLS

solid name

facet normal ni nj nk

outer loop

vertex v1x v1y v1z

vertex v2x v2y v2z

vertex v3x v3y v3z

endloop

endfacet

endsolidname

Figure A.1: ASCII StL file specification

Table A.1: Sections within the DXF file format [4].Section Description

HEADER General information.CLASSES Information grouping.TABLES Tables with layers, line types, coordinate system, etc.BLOCKS Blocks drawing entities.ENTITIES Graphical objects.OBJECTS Non-graphical objects in the drawing.THUMBNAILIMAGE Preview image. This section is optional.

A.1.2 DXF

DXF is one of the most spread interchange formats available for CAD. AutoDeskowns the DXF file format and publishes regularly updates as their products areextended [4]. The data in a DXF file is grouped into the seven sections (see tableA.1). Much of the data can be left out andAutoDeskprovides examples of how toread and write simple DXF files in the DXF reference. This makes the DXF fileformat possible to implemented with reasonable effort. Compared to their nativeclosed DWG file format, it takes a lot more time to load, uses more storage spaceand even tough the format is published it still has implementation flaws due to thespecification.Open Design Allianceoffers more information on the issue in [51].

A.1.3 DWFTM

AutoDeskprovides yet another file format. Design Web Format (DWFTM ) is in-tended as a competitor to PDF. It loads faster, uses less diskspace and has capa-bilities comparable with PDF. Because it is an open file format with a viewer andActiveXcontrols are also available, DWFTM is an interesting alternative to PDF for

Page 67: Visualization of CAD Models - Semantic Scholar...Master thesis in Computing Science, 20 credits Visualization of CAD Models-NURBS vs. Subdivision David Jonsson

A.1. FORMATS 57

transmitting CAD drawings, but it should be considered as nomore than a presen-tation file format. PDF is currently the most widespread standard, but this formatmight get a few market shares thanks to the openness and the strength ofAutoDesk.

A.1.4 3DS

3DS is the native file format for3D Studio R1to R4, which was popular until1996 when its successor3D Studio MAXwas released [50]. 3DS is a closed fileformat, but a stable open source lib called Lib3DS with tightbounds to OpenGLis available under theGNU Lesser General Public License (LGPL)[24]. Lib3DShas a tight interface with OpenGL. 3DS is used by3D Studio, AutoCAD, and someCAD programs and there are also open source projects that uses 3DS files throughLib3DS, e.g.Open Scene Graph[52]. The file format uses blocks with an headercontaining an id tag and size which allows unrecognized blocks to be filtered [30].

A.1.5 VRML

The Virtual Reality Markup Language (VRML) is available in some applicationsbut there is a multitude of versions out there. It is fairly easy to implement anexporter by using shapes and simple constructs but a browseris quite complex.Recommended further readings areVRML 97 and Related specifications[76] andThe VRML 2.0 Sourcebook[45].

Versions

The first version of VRML, 1.0, was completed in May 1995. There were someambiguities discovered during the development of VRML 1.0 browsers, so a clar-ification called VRML 1.0c was released in January 1996. Static worlds are sup-ported in the first version with support for shape building, lighting, and texturing,etc. A proposal calledMoving Worldsarrived in January 1996, which was the plat-form for the VRML 2.0 standard that includes animations and interaction. VRML2.0 was released in august 1996. After some changes and language corrections itwas approved by the International Organization for Standards in December 1997:ISO/IEC-14772-1:1997.

VRML 97

Interactors and scripting were included in VRML 2.0/97 taking the format closertowards the definition of virtual reality1. Most of these new features have con-tributed to a format too complex to implement. OpenVRML is a LGPL open sourcelibrary for VRML 97 consisting of more than 70000 lines of code.

1I3 - Immersion, Interaction and Imagination. A definition coined by Burdea 1993 [12].

Page 68: Visualization of CAD Models - Semantic Scholar...Master thesis in Computing Science, 20 credits Visualization of CAD Models-NURBS vs. Subdivision David Jonsson

58 APPENDIX A. FILE FORMATS/EXCHANGE PROTOCOLS

Table A.2: STEP implementation standards [57].

Part Description

21 Clear-text encoding exch. str22 Standard data access interface23 C++ language binding (to 22)24 C language binding (to 22)27 Java language binding(to 22)28 XML rep for EXPRESS-schemata and data

A.1.6 IGES

Initial Graphics Exchange Specification (IGES) is an independent file format thatwas initiated 1979 and became in September 1981 an approved ANSI standard(ANSI standard Y14.26M). It enables an exchange of object databases amongCAD/CAM systems. IGES supports surface and solid modeling and NURBS hasbeen in the specification since 1983. IGES v4.0 was released 1989 and introducedentities for solid modelling. The IGES 4.0 release also extended the format todescribe nodal (e.g. temperature and displacement) and element (e.g. stress andstrain) results from FEA methods.

The standard has evolved over the years and the 5.3 version isthe latest stan-dard which was released in September 1996. Currently a pre-ANSI submissionreview, IGES 6.0 Volume II, for the final release, has been published as NISTIR6972, April 2003 [47, 79].

A.1.7 STEP

Design

Test planning, Measurement data,

Quality control

Kinematic simulation

Production plans

Bill of material

Geometry of assemblies

and composed structures

FEA

Product documentation

NC programming

Product data

Manufacturing resources

and Methodology plans

Figure A.2: STEP overview. Image courtesy of ProSTEP iViP Assoc. [55]

Page 69: Visualization of CAD Models - Semantic Scholar...Master thesis in Computing Science, 20 credits Visualization of CAD Models-NURBS vs. Subdivision David Jonsson

A.1. FORMATS 59

Table A.3: STEP Application Protocols [57].

Part Description

201 Explicit draughting202 Associative draughting203 Configuration controlled design204 Mechanical design using boundary representation207 Sheet metal die planning and design209 Composite & metal structural analysis & related design210 Electronic assembly, interconnection & packing design212 Electrotechnical design and installation214 Core data for automotive mech design processes215 Ship arrangement216 Ship moulded forms218 Ship structures224 Mechanical parts definition for process planing using using machining features.225 Building elements using explicit shape representation227 Plant spatial configuration232 Technical data packaging: core information & exchange

STandard for the Exchange of Product Data (STEP), is a collection of standardsthat contains a file format for 3D data exchange. A descriptive overview of theelements contained within STEP is provided in figure A.2. STEP can be groupedinto five main categories: description methods, implementation and conformancemethodology, common resources, abstract test suites, and application protocols.The common resources are generic resources that can be seen of as the buildingblocks of STEP. These can also be collected into reusable groups,ConformanceClasses, to structure common data over several Application Protocols (APs).

The file format implementation standard is specified in ISO 10303-21 and isone of the implementation methods for STEP (see table A.2). STEP is divided intoseveralApplication Protocols, APs, where each one is subject for an ISO standard-ization. APs that have reached such a stage that they are safeto implement arelisten in table A.3. Each AP is divided into a set of conformance classes that worksas subsets to provide a simpler interface for some applications. An abstract test suitis provided for an AP to provide STEP compatible software with quality assurance[57].

IGES is a predecessor and has therefore laid the foundation of the STEP 3Ddata exchange standard. In addition to the 3D data, STEP alsocontain ProductData Management (PDM) and Product Life cycle Management (PLM) documents.The exporter from native data to STEP is called a preprocessor and the translator orimporter from STEP to a native format is called post processor. This terminology

Page 70: Visualization of CAD Models - Semantic Scholar...Master thesis in Computing Science, 20 credits Visualization of CAD Models-NURBS vs. Subdivision David Jonsson

60 APPENDIX A. FILE FORMATS/EXCHANGE PROTOCOLS

is also used for IGES translators. There are primary two application protocolscommonly used for 3D data: AP203, and AP214, where the latteris a supersetof the first. AP203 is therefore simpler and more well proven regarding STEPconformance [33]. The advantages related to STEP usage are several [33]:

• System independence.

• Data continuity throughout the complete product life cycle.

• Redundancy-free product data representation.

• Higher quality of the product data through formal representation followingstandardized methods.

• Qualitative better product data exchange.

• Feasibility of long-term archiving.

These advantages of organizing more than just geometry, areespecially clearwhen you keep in mind that the German car manufacturer and their 900 subcon-tractors are using around 110 different CAD systems [56].

A.1.8 VDA-FS

The Vereinung Deutsche Automobilindustrie Flächen Schnittstelle (VDA-FS) isa standard for the transfer of free-form surface geometry data. It was developedby the CAD/CAM committee of theVerband der Automobilindustrie(VDA), anassociation of German automotive manufacturers includingBMW, Porsche, andVolkswagen.

VDA-FS has been compared to STEP in [33]. During the time of the reportwas STEP AP214 still under development and it was recommended to hold on toVDA-FS a bit longer as a result but in the long term to purely use STEP. Both IGESand STEP can be considered as replacements for VDA-FS.

A.1.9 X

Microsoft owns an open file format named .x after and connected toDirectX [42].The format satisfies most needs related to game development with support for ver-tex normals, materials, skinning and skeletons included. It is supported by ani-mation packages (e.g. 3D Studio MAX and Maya) but lacks support from CADvendors. Because it is an open file format that is delivered with DirectX it shouldbe considered as an industry standard with focus on basic geometry for games [50].

Page 71: Visualization of CAD Models - Semantic Scholar...Master thesis in Computing Science, 20 credits Visualization of CAD Models-NURBS vs. Subdivision David Jonsson

A.2. SMOOTH SURFACES 61

A.1.10 COLLADA

COLLADA is a COLLAborative Design Activity for establishing an open stan-dard Digital Asset schema for interactive 3D applications.The latest release is v1.3.0 arrived in May 2005. An open source SDK is also providedtogether withconformance testing tools. The COLLADA SDK is using the MIT license, allow-ing usage in commercial and non-commercial applications, without restrictions.The COLLADA schema is a result of a research project withinSony ComputerEntertainment USand is mainly targeting the gaming industry. It also includesseveral major third party companies (e.g.AutoDesk Inc., NVidia Corporation, ATItechnologies). Smooth surfaces are not yet included but theGoals and guidelineschapter in the specification is mentioning that they are hoping for future support ofboth NURBS and subdivision surfaces [69].

A.1.11 3DM

OpenNURBS is an initiative to transfer 3D geometry between CAD software.There is an open source implementation in C++ available to read and write NURBSto a file format called 3DM. It has been implemented in about 250 software pack-ages, e.g.Rhinoceros, Catia V5, SolidWorks, SolidEdge, Parasolids, most probablya result of neither copyright nor copyleft2 restrictions [3].

A.2 Smooth surfaces

VRML has a proposed extension for NURBS but can be consideredas a file formatwith no development. All CAD formats presented (i.e. IGES, STEP, and VDA-FS) support trimmed NURBS, OpenNURBS is dedicated to represent NURBS. Noopen file format presented here supports subdivision surfaces. They are restrictedto closed formats contained within modeling packages.

A.3 Compatibility

File formats can easily be translated from one to another as long as the featuresare the same. There are for instance IGES to STEP converters available [73] andmore sofisticated programs such as PolyTrans from Okino Computer Graphics cantranslate between most file formats through their native format [49].

A.4 Summary

During the study of the file formats a number of application areas have been iden-tified, namely:

2Copyleft is a general method for making a program or other work free, and requiring all modifiedand extended versions of the program to be free as well.

Page 72: Visualization of CAD Models - Semantic Scholar...Master thesis in Computing Science, 20 credits Visualization of CAD Models-NURBS vs. Subdivision David Jonsson

62 APPENDIX A. FILE FORMATS/EXCHANGE PROTOCOLS

• Development and testing (StL)

• Presentation (DWF)

• 3D data storage (DXF, VRML, 3DS, X, COLLADA)

• CAD data exchange (IGES, STEP, VDA-FS, 3DM)

StL is useful for development and testing. Surface area and positions can becalculated and compared between two software packages whena file format trans-lator is tested. If only 3D geometry is required and there areno major requirementsfor perfect smooth surfaces, it serves it’s purpose.

DWF has its place in the presentation area as a replacement for PDF.AutoDeskcan be seen as strong enough to promote this format.

3D data storage file formats are here referred to file format that can be used bysoftware packages for storage. These are excellent for 3D model imports.

CAD exchange is the most complex area where not only surface data butPDM/PLM data can also be included.

Because of changes in the area and possibility of interchange through plug-insand conversion software, this chapter can not be consideredas a complete coverageof the subject.

Page 73: Visualization of CAD Models - Semantic Scholar...Master thesis in Computing Science, 20 credits Visualization of CAD Models-NURBS vs. Subdivision David Jonsson

Glossary

Baluster A vertical pillar located between the handrail and the stair. Balusters aredecorative in-fills. They should be safely spaced to preventchildren fromgetting their head caught.

Capping The uppermost part of a post.

CAD Computer-Aided Design. The wide range of tools used to assist engineersin their design activities.

CAGD Computer-Aided Geometric Design. Computer based geometric modelingwhere surface representation is a central part.

CNC Computerized Numerical Control. Computer controlled machine tools. ACNC machine is used for repeated or complex part manufacturing. A CNCmachine used for wooden stairs usually have three to five axis/degrees offreedom. A five axis machine is needed to make curved handrails.

FEA Finite Element Analysis. The finite element method (FEM) is used for solv-ing partial differential equations approximately. FiniteElement Analysisrefers to the use of the FEM in engineering for analysis of physical systems.

Hyper threading Intel’s trademark of a parallel multi-threaded technology. Someparts of the processor is duplicated and reports itself as two processors to theoperating system.

LOD Level of detail. The displayed models in a scene are interchanged dependingon the distance to the viewer. Level of detail is common in video games toincrease speed by minimizing the polygon count.

Post A vertical pillar that provides the main support for the railsystem. A railsystem consists of the handrail, posts, and balusters.

PDM Product Data Management. A link between CAD data and a database de-scribing product information such as costs and reports.

PLM Product Life-cycle Management is a term to describe the entire life-cycleof a product from the concept and design phase, FEA, visualization, andmarketing to the disposal of the product.

SIMD Single Instruction Multiple Data. One instruction operates in parallel onmultiple data

63

Page 74: Visualization of CAD Models - Semantic Scholar...Master thesis in Computing Science, 20 credits Visualization of CAD Models-NURBS vs. Subdivision David Jonsson

64 GLOSSARY

Volute A spiral ending of a handrail.

Page 75: Visualization of CAD Models - Semantic Scholar...Master thesis in Computing Science, 20 credits Visualization of CAD Models-NURBS vs. Subdivision David Jonsson

References

[1] A KENINE-MÖLLER, TOMAS, AND HAINES, ERIC. Real Time Rendering,second ed. A.K. Peters Ltd., July 2002.

[2] A LIAS. Maya 6 features in detail. http://www.alias.com/eng/products-services/maya/file/maya6_features_in_detail.pdf (visited 2005-05-29).

[3] A SSOCIATES, R. M. . opennurbs. http://www.opennurbs.org/ (visited 2005-05-29).

[4] AUTODESK INC. Autodesk autocad dxf reference 2005, February 2004.

[5] BALÁZS, A., GUTHE, M., AND KLEIN , R. Fat borders: Gap filling forefficient view-dependent lod rendering. Tech. Rep. CG-2003-2, UniversitätBonn, June 2003.

[6] BALÁZS, A., GUTHE, M., AND KLEIN , R. Efficient trimmed nurbs tessel-lation. Journal of WSCG 12, 1 (February 2004), 27–33.

[7] B ISCHOFF, S., KOBBELT, L. P., AND SEIDEL, H.-P. Towards hardwareimplementation of loop subdivision. InHWWS ’00: Proceedings of the ACMSIGGRAPH/EUROGRAPHICS workshop on Graphics hardware(New York,NY, USA, 2000), ACM Press, pp. 41–50.

[8] BOCK, RUDOLF K., AND KRISCHER, WERNER. Accelerator Physics - TheData Analysis BriefBook. Springer, 1998.

[9] BOLZ, J.,AND SCHRÖDER, P. Rapid evaluation of catmull-clark subdivisionsurfaces. InWeb3D ’02: Proceeding of the seventh international conferenceon 3D Web technology(New York, NY, USA, 2002), ACM Press, pp. 11–17.

[10] BRICKHILL , DAVID . Practical implementation techniques for multi-resolution subdivision surfaces. Game Developers Conference, 2001.

[11] BUNNELL, M. GPU Gems 2. http://developer.nvidia.com/GPUGems2 (vis-ited 2005-05-29).

[12] BURDEA, GRIGORE C., AND COIFFET, PHILIPPE. Virtual Reality Technol-ogy. John Wiley & Sons, Inc, 2003.

[13] BURNS, M. The stl format - reprint from automated fabrication.http://www.ennex.com/ fabbers/StL.asp (visited 2005-05-29), October 1989.

65

Page 76: Visualization of CAD Models - Semantic Scholar...Master thesis in Computing Science, 20 credits Visualization of CAD Models-NURBS vs. Subdivision David Jonsson

66 REFERENCES

[14] CATMULL , E., AND CLARK , J. Recursively generated B-spline surfaces onarbitrary topological surfaces, November 1978.

[15] CHEUNG, G. K. L., LAU , R. W. H.,AND L I , F. W. B. Incremental render-ing of deformable trimmed nurbs surfaces. InVRST ’03: Proceedings of theACM symposium on Virtual reality software and technology(New York, NY,USA, 2003), ACM Press, pp. 48–55.

[16] COFFMAN STAIRS, LLC. http://www.coffmanstairs.com/ (visited 2005-05-29).

[17] Consultec System AB. http://www.consultec.se/ (visited 2005-05-29).

[18] DEL RÍO, A., BÓO, M., AMOR, M., AND BRUGUERA, J. D. Hardwareimplementation of the subdivision loop algorithm.Proc. of 28th EuromicroConference. IEEE Computer Society(September 2002), 189–197.

[19] DEROSE, T., KASS, M., AND TRUONG, T. Subdivision surfaces in characteranimation. InSIGGRAPH ’98: Proceedings of the 25th annual conference onComputer graphics and interactive techniques(New York, NY, USA, 1998),ACM Press, pp. 85–94.

[20] DISCREET. gmax white paper. http://www.discreet.com/docs/whitepapers/-gmax_whitepaper.pdf (visited 2005-05-29).

[21] DOO, D., AND SABIN , M. Behaviour of recursive division surfaces nearextraordinary points, September 1978.

[22] FAN , Z., QIU , F., KAUFMAN , A., AND YOAKUM -STOVER, S. Gpu clus-ter for high performance computing. InSC ’04: Proceedings of the 2004ACM/IEEE conference on Supercomputing(Washington, DC, USA, 2004),IEEE Computer Society, p. 47.

[23] FORD, F. Marine drafting weights. http://www.frets.com/FRETSPages/-Luthier/TipsTricks/DraftingWeights/draftweights.html (visited 2005-05-29).

[24] FREE SOFTWARE FOUNDATION, INC. Gnu lesser general public license.http://www.gnu.org/copyleft/lesser.html (visited 2005-05-29).

[25] GUTHE, M., BALÁZS, A., AND KLEIN , R. Interactive high quality trimmednurbs visualization using appearance preserving tessellation. In TCVG Sym-posium on Visualization 2004(May 2004), O. Deussen, C. Hansen, D. A.Keim, and D. Saupe, Eds., EUROGRAPHICS - IEEE.

[26] GUTHE, M., BORODIN, P., AND KLEIN , R. Efficient view-dependent out-of-core visualization. InThe 4th International Conference on Virtual Realityand its Application in Industry (VRAI’2003)(October 2003).

Page 77: Visualization of CAD Models - Semantic Scholar...Master thesis in Computing Science, 20 credits Visualization of CAD Models-NURBS vs. Subdivision David Jonsson

REFERENCES 67

[27] GUTHE, M., MESETH, J., AND KLEIN , R. Fast and memory efficientview-dependent trimmed nurbs rendering. InPacific Graphics 2002(Oc-tober 2002), S. Coquillart, H.-Y. Shum, and S.-M. Hu, Eds., IEEE ComputerSociety, pp. 204–213.

[28] GUTHE, M., ÁKOS BALÁZS, AND KLEIN , R. Gpu-based trimming andtessellation of nurbs and t-spline surfaces. Not yet available.

[29] HEARN, D., AND BAKER, M. P. Computer Graphics with OpenGL, third ed.Prentice Hall, inc., August 2003.

[30] HEDGES, R. lib3ds. http://lib3ds.sourceforge.net/ (visited 2005-05-29).

[31] HOPPE, H., DEROSE, T., DUCHAMP, T., HALSTEAD, M., JIN , H., MC-DONALD , J., SCHWEITZER, J., AND STUETZLE, W. Piecewise smoothsurface reconstruction. InSIGGRAPH ’94: Proceedings of the 21st annualconference on Computer graphics and interactive techniques (New York, NY,USA, 1994), ACM Press, pp. 295–302.

[32] IBM. Ibm software - catia imagine & shape 2 (ima) - add-onoverview.http://www-306.ibm.com/software/applications/plm/catiav5/prods/ima/ (vis-ited 2005-05-29).

[33] JOHANSSON, H., AND WEIDEMANN , C. Kommunikation av solidmodellervia STEP AP203 och AP204: Rekommenderationer och testresultat. Tech.rep., The Swedish Institute of Production Engineering Research, Apr. 1999.

[34] KAHLESZ, F., BALÁZS, A., AND KLEIN , R. Multiresolution rendering bysewing trimmed nurbs surfaces. InSMA ’02: Proceedings of the seventh ACMsymposium on Solid modeling and applications(New York, NY, USA, June2002), K. Lee and N. M. Patrikalakis, Eds., ACM Press, pp. 281–288.

[35] KUMAR , S., MANOCHA, D., AND LASTRA, A. Interactive display of large-scale nurbs models. InSI3D ’95: Proceedings of the 1995 symposium onInteractive 3D graphics(New York, NY, USA, 1995), ACM Press, pp. 51–ff.

[36] KUMAR , S., MANOCHA, D., ZHANG, H., AND KENNETH E. HOFF, I.Accelerated walkthrough of large spline models. InSI3D ’97: Proceedingsof the 1997 symposium on Interactive 3D graphics(New York, NY, USA,1997), ACM Press, pp. 91–ff.

[37] L.J. SMITH STAIR SYSTEMS. Photo portfolio. http://www.ljsmith.net/ (vis-ited 2005-05-29).

[38] LOOP, CHARLES TEORELL. Smooth subdivision surfaces based on triangles.Master’s thesis, University of Utah, USA, August 1987.

Page 78: Visualization of CAD Models - Semantic Scholar...Master thesis in Computing Science, 20 credits Visualization of CAD Models-NURBS vs. Subdivision David Jonsson

68 REFERENCES

[39] LOSASSO, F., HOPPE, H., SCHAEFER, S., AND WARREN, J. Smooth ge-ometry images. InSGP ’03: Proceedings of the 2003 Eurographics/ACMSIGGRAPH symposium on Geometry processing(Aire-la-Ville, Switzerland,Switzerland, 2003), Eurographics Association, pp. 138–145.

[40] LUXOLOGY, LLC. modo. http://www.luxology.com/modo/ (visited 2005-05-29).

[41] M ICROSOFT CORPORATION. An introduction to directx8.0. http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dndrive/html/directx112000.asp (visited 2005-05-29).

[42] M ICROSOFT CORPORATION. X file format reference.http://msdn.microsoft.com/library/default.asp?url=/library/en-us/directx9_c/directx/graphics/reference/fileformat/xfileformat.asp (visited2005-05-29).

[43] M ICROSOFTCORPORATION. Xbox 360 fact sheet. http://www.xbox.com/en-US/xbox360/factsheet.htm (visited 2005-05-29).

[44] MORETON, H. Watertight tessellation using forward differencing. In HWWS’01: Proceedings of the ACM SIGGRAPH/EUROGRAPHICS workshop onGraphics hardware(New York, NY, USA, 2001), ACM Press, pp. 25–32.

[45] NADEAU , D.R.,, A., AND MORELAND, J.L. The VRML Sourcebook. JohnWiley & Sons, Inc, 1996.

[46] NEWTEK. Lightwave 3d - features list. http://www.newtek.com/products/-lightwave/product/list.html (visited 2005-05-29).

[47] NIST. Iges project. http://www.nist.gov/iges/ (visited 2005-05-29).

[48] OKINO COMPUTER GRAPHICS, INC. Cad program compatiblity chart.http://www.okino.com/conv/filefrmt_cad.htm (visited 2005-05-29).

[49] OKINO COMPUTER GRAPHICS, INC. Polytrans home page.http://www.okino.com/conv/conv.htm?0 (visited 2005-05-29).

[50] OKINO COMPUTER GRAPHICS, INC. Supported 3d model import file for-mats. http://www.okino.com/conv/filefrmt_3dimport.htm(visited 2005-05-29).

[51] OPEN DESIGN ALLIANCE . Why isn’t dxf good enough?http://www.opendesign.com/about/whtpaper/whynot.htm(visited 2005-05-29).

[52] OSG COMMUNITY . Open scene graph - introduction.http://www.openscenegraph.org/ (visited 2005-05-29).

Page 79: Visualization of CAD Models - Semantic Scholar...Master thesis in Computing Science, 20 credits Visualization of CAD Models-NURBS vs. Subdivision David Jonsson

REFERENCES 69

[53] PHARR, M., Ed. GPU Gems 2: Programming Techniques for High-Performance Graphics and General-Purpose Computation. Addison-Wesley,2005.

[54] PIEGL, L., AND TILLER , W. The NURBS Book, second ed. Springer, 1997.

[55] PROSTEP IV IP ASSOCIATION. http://www.prostep.org/ (visited 2005-05-29).

[56] PROSTEP IV IP ASSOCIATION. Application protocols.http://www.prostep.org/de/stepportal/was/ap/ (visited 2005-05-29).

[57] PROSTEP IV IP ASSOCIATION. Was ist step?http://www.prostep.org/de/stepportal/was/ (visited 2005-05-29).

[58] ROCKWOOD, A., HEATON, K., AND DAVIS, T. Real-time rendering oftrimmed surfaces. InSIGGRAPH ’89: Proceedings of the 16th annual con-ference on Computer graphics and interactive techniques(New York, NY,USA, 1989), ACM Press, pp. 107–116.

[59] ROGERS, D. F. An Introduction to NURBS - with Historical Perspective.Morgan Kaufmann Publishers, 2001.

[60] SCHAEFER, S., AND WARREN, J. On c2 triangle/quad subdivision.ACMTrans. Graph. 24, 1 (2005), 28–36.

[61] SCHRÖDER, P. Caltech multi-res modeling group - fast subdivision software.http://www.multires.caltech.edu/software/fastsubd/ (visited 2005-05-29).

[62] SEDERBERG, T. W., CARDON, D. L., FINNIGAN , G. T., NORTH, N. S.,ZHENG, J., AND LYCHE, T. T-spline simplification and local refinement.ACM Trans. Graph. 23, 3 (2004), 276–283.

[63] SEDERBERG, T. W., ZHENG, J., BAKENOV, A., AND NASRI, A. T-splinesand t-nurccs.ACM Trans. Graph. 22, 3 (2003), 477–484.

[64] SEDERBERG, T. W., ZHENG, J., SEWELL, D., AND SABIN , M. Non-uniform recursive subdivision surfaces. InSIGGRAPH ’98: Proceedings ofthe 25th annual conference on Computer graphics and interactive techniques(New York, NY, USA, 1998), ACM Press, pp. 387–394.

[65] SHENE, C.-K. A User Guide to the Surface Subsystem of DesignMentor.http://lumimath.univ-mrs.fr/ jlm/cours/DMmanuals/surface/ (visited 2005-05-29).

[66] SHIUE, L.-J., , JONES, I., AND PETERS, J. A realtime gpu subdivisionkernel. InSIGGRAPH 2005: Computer Graphics Proceedings(New York,NY, USA, 2005), ACM Press.

Page 80: Visualization of CAD Models - Semantic Scholar...Master thesis in Computing Science, 20 credits Visualization of CAD Models-NURBS vs. Subdivision David Jonsson

70 REFERENCES

[67] SOLID MODELING SOLUTIONS. VDAFS - Vereinung Deutsche Automo-bilindustrie Flächen Schnittstelle. http://www.smlib.com/vdafs.html (visited2005-05-29).

[68] SOLIDTHINKING . solidthinking - the breakthrough 3d environment.http://www.solidthinking.com/products/index.htm (visited 2005-05-29).

[69] SONY COMPUTER ENTERTAINMENT INC. Collada - digital asset schemarelease 1.3.0 - specification, April 2005.

[70] SPINK, M. Nurbs toolbox. http://www.aria.uklinux.net/nurbs.php3 (visited2005-05-29).

[71] Stair Supplies. http://www.stairsupplies.com/ (visited 2005-05-29).

[72] Staircase & Millwork Co. http://www.mrstair.com/ (visited 2005-05-29).

[73] STEP TOOLS, INC. Standard-based software for e-manufacturing.http://www.steptools.com/ (visited 2005-05-29).

[74] STEPHENSON, I. Implementing renderman on the sony ps2. InGRAPH ’03:Proceedings of the SIGGRAPH 2003 conference on Sketches & applications(New York, NY, USA, 2003), ACM Press, pp. 1–1.

[75] SUZUKI , H., TAKARADA , Y., TAKEUCHI , S., KAWANO , I., AND HOTTA,J. S-code: A subdivision based coding system for cad models.InternationalJournal of CAD/CAM 3, 2 (2003), 97–109.

[76] WEB3D CONSORTIUM. Vrml97 and related specifications.http://www.web3d.org/x3d/specifications/vrml/.

[77] WIKIPEDIA - THE FREE ENCYCLOPEDIA. Spline (device).http://en.wikipedia.org/wiki/Spline_%28device%29 (visited 2005-05-29).

[78] WOO, M., NEIDER, J., DAVIS, D., AND SHREINER, D. OpenGL Program-ming Guide, third ed. Addison-Wesley, 1999.

[79] ZEID, I. CAD/CAM Theory and Practice. McGraw-Hill, 1991.

[80] ZORIN, DENNIS, AND SCHRÖDER, PETER. Using subdivision surfaces.Game Developers Conference, 2001. ACM Course Notes.