9
EUROGRAPHICS 2003 / P. Brunet and D. Fellner (Guest Editors) Volume 22 (2003), Number 3 Automatic texture atlas generation from trimmed NURBS models M. Guthe and R. Klein Department of Computer Science II, University of Bonn, Bonn, Germany Abstract A Texture Atlas is a two dimensional representation of a 3D model usable for paint systems or as a sewing pattern. The field of texture atlas generation from polygonal models has been well exploited in the recent years. The devel- oped algorithms work on piecewise linear surface representations, but not on parametric surfaces like NURBS, that are still the main surface representation in CAD systems. If a texture atlas is generated from a triangulated NURBS model, the result cannot be edited further in a CAD system, since the separation into charts is not based on the separate NURBS patches of the original model. We present a method for automatic generation of a texture atlas directly from trimmed NURBS models, while preserving the original NURBS representation. The resulting texture atlas is build of several charts, each consisting of the original NURBS patches sewn together. Categories and Subject Descriptors (according to ACM CCS): I.3.3 [Computer Graphics]: Picture/Image Generation; I.3.5 [Computer Graphics]: Computational Geometry and Object Modeling; I.3.7 [Computer Graphics]: Three- Dimensional Graphics and Realism - Color, Shading and Texture; J.6 [Computer-aided Engineering]: Computer- aided design (CAD) 1. Introduction The main representation of surfaces in CAD systems are trimmed NURBS patches. Even huge models like ship-hulls, aeroplanes and cars are composes of such patches. In or- der to add different textures to the models, texture coordi- nates have to be assigned to the surface. There are two main reasons why the natural parameterizations of the individual patches cannot be used to generate these texture coordinates. First, these parameterizations are not optimized with respect to distortions. Second, adjacent patches in the model have independent parameterizations and thus parameter-lines are not continuous over patch boundaries. This leads to clearly visible artifacts. Therefore, a parametrization for the whole object has to be found. In order to avoid high distortions in the texture on a 3d model in most cases the surface is split into different parts which can easily be flattened. In practice this is done manu- ally. For example the sewing pattern for a car seat is designed by a tailor and after cutting the individual parts out of cloth they are sewed together on the real model (see figure 1). In computer graphics the cutting process is called texture atlas generation (see e.g. 15, 17 ). The model to be textured is sep- Figure 1: Cloth covered car seat generated using our texture mapping algorithm arated into a set of so called charts that are homeomorphic to discs and to each of them a parametrization is applied. There are a number of algorithms to generate such a texture c The Eurographics Association and Blackwell Publishers 2003. Published by Blackwell Publishers, 108 Cowley Road, Oxford OX4 1JF, UK and 350 Main Street, Malden, MA 02148, USA.

Automatic texture atlas generation from trimmed …guthe/...computer graphics the cutting process is called texture atlas generation (see e.g. 15, 17). The model to be textured is

  • Upload
    others

  • View
    11

  • Download
    0

Embed Size (px)

Citation preview

Page 1: Automatic texture atlas generation from trimmed …guthe/...computer graphics the cutting process is called texture atlas generation (see e.g. 15, 17). The model to be textured is

EUROGRAPHICS 2003 / P. Brunet and D. Fellner(Guest Editors)

Volume 22(2003), Number 3

Automatic texture atlas generation from trimmed NURBSmodels

M. Guthe and R. Klein

Department of Computer Science II, University of Bonn, Bonn, Germany

AbstractA Texture Atlas is a two dimensional representation of a 3D model usable for paint systems or as a sewing pattern.The field of texture atlas generation from polygonal models has been well exploited in the recent years. The devel-oped algorithms work on piecewise linear surface representations, but not on parametric surfaces like NURBS,that are still the main surface representation in CAD systems. If a texture atlas is generated from a triangulatedNURBS model, the result cannot be edited further in a CAD system, since the separation into charts is not basedon the separate NURBS patches of the original model. We present a method for automatic generation of a textureatlas directly from trimmed NURBS models, while preserving the original NURBS representation. The resultingtexture atlas is build of several charts, each consisting of the original NURBS patches sewn together.

Categories and Subject Descriptors(according to ACM CCS): I.3.3 [Computer Graphics]: Picture/Image Generation;I.3.5 [Computer Graphics]: Computational Geometry and Object Modeling; I.3.7 [Computer Graphics]: Three-Dimensional Graphics and Realism - Color, Shading and Texture; J.6 [Computer-aided Engineering]: Computer-aided design (CAD)

1. Introduction

The main representation of surfaces in CAD systems aretrimmed NURBS patches. Even huge models like ship-hulls,aeroplanes and cars are composes of such patches. In or-der to add different textures to the models, texture coordi-nates have to be assigned to the surface. There are two mainreasons why the natural parameterizations of the individualpatches cannot be used to generate these texture coordinates.First, these parameterizations are not optimized with respectto distortions. Second, adjacent patches in the model haveindependent parameterizations and thus parameter-lines arenot continuous over patch boundaries. This leads to clearlyvisible artifacts. Therefore, a parametrization for the wholeobject has to be found.

In order to avoid high distortions in the texture on a 3dmodel in most cases the surface is split into different partswhich can easily be flattened. In practice this is done manu-ally. For example the sewing pattern for a car seat is designedby a tailor and after cutting the individual parts out of cloththey are sewed together on the real model (see figure1). Incomputer graphics the cutting process is calledtexture atlasgeneration(see e.g.15, 17). The model to be textured is sep-

Figure 1: Cloth covered car seat generated using our texturemapping algorithm

arated into a set of so called charts that are homeomorphicto discs and to each of them a parametrization is applied.There are a number of algorithms to generate such a texture

c© The Eurographics Association and Blackwell Publishers 2003. Published by BlackwellPublishers, 108 Cowley Road, Oxford OX4 1JF, UK and 350 Main Street, Malden, MA02148, USA.

Page 2: Automatic texture atlas generation from trimmed …guthe/...computer graphics the cutting process is called texture atlas generation (see e.g. 15, 17). The model to be textured is

Guthe and Klein / Texturing trimmed NURBS models

atlas for piecewise linear or bilinear models, e.g. triangle andquad meshes, but using these algorithms for NURBS modelsintroduces a number of problems:

• The original NURBS representation has to be approxi-mated by a piecewise linear or bilinear mesh. This leadsto two representations for the same data. The texture coor-dinates are attached to the vertices of the polygonal meshand are not available in the NURBS representation.

• These two representations for the same object generateproblems in any downstream application of the CAD pro-cess. For example if a in subsequent step a Finite Ele-ment Mesh of the model is generated based on the origi-nal patch representation, the texture coordinates cannot bereused.

• Furthermore, the original NURBS patches are not pre-served by the segmentation of the standard texture atlasgeneration algorithms although some of these algorithmscould be modified to preserve the original patch topolo-gies.

• If the model is parameterized using a mesh approximationand for each patch a NURBS approximation of its param-eterization is generated, these do not fit together on thetexture atlas.

• The finest resolution of the tessellation is fixed. If during asubsequent CAD process or during visualization the patchis tessellated with a finer resolution, this leads to artifacts.

• Rendering techniques cannot take advantage of the origi-nal NURBS representation. This is especially a drawbackfor view-dependent rendering.

For this reasons we developed a special texture atlas gen-eration algorithm to parameterize trimmed NURBS mod-els. The segmentation part of our algorithm takes care ofthe individual patch borders. Furthermore, the resulting tex-ture parametrization is done over the same parameter domainas the original patch. In this way we follow the texturedNURBS proposal from the NURBS extension in VRML6.In addition to this we restrict the NurbsTextureSurface tohave the same dimensions, orders and knot vectors as theNurbsSurface itself. Altogether the only difference to theoriginal patch representation is, that the control point noware six- instead of four-dimensional. This saves computationcost when tessellating the surfaces and generating new tex-ture coordinates. Again this is of major importance for view-dependent rendering using on the fly tessellation of patches.

The important overall properties of our new method are:

• Each chart consists of NURBS patches from the originalmodel that are sewn together.

• The parameterization for each chart is optimized with re-spect to angle as well as area deformations.

• A new area and angle preserving reparametrization tech-nique is used, resulting in a good tradeoff between angleand area distortion compared to e.g.14 that only preservesangles and local area ratios.

• The segmentation of the charts is done during the

reparametrization process and is based on high distortionas well as on feature lines along the original border ofpatches.

• Since we parameterize the NURBS patches directly ourmethod is independent of the resolution of any mesh con-structed from the NURBS model.

• A main texture directionor a vector field can be assignedto the model along with analignment strictnessthat deter-mines how strict this direction is preserved. Furthermorea deformation thresholdcan be set to control the overalldeformations on the model.

The rest of our paper is organized as follows. In Section2we briefly discuss related work on texture atlas generationfrom polygonal meshes. Section3 gives an overview of ouralgorithm, that is described in detail in the sections4 to 6.Finally we show our results in section7 and conclude in sec-tion 8.

2. Related Work

The generation of a texture atlas can be divided in threesteps:

1. Segmentation: The model is decomposed into uncon-nected charts.

2. Parameterization: Each chart is flattened fromR3 to R2.3. Packing: Placing the charts in texture space.

Many algorithms for texture atlas generation from trianglemeshes have been proposed in the recent years, developingnew methods for segmentation, parametrization and pack-ing. But to our knowledge no special algorithms were pro-posed that are suitable for trimmed NURBS models. Nev-ertheless, many ideas and techniques of this previous algo-rithms are useful in our context.

Segmentation: The segmentation is a crucial part of allmethods, since a convenient placement of cuts can greatlyreduce the distortion of angles and area. A good choice forthese cuts is along high curvature regions of the model20.In early approaches17, 11 the segmentation is generated bythe user, while Maillot et al.15 group facets by their normalsto perform automatic segmentation. Several multiresolutionalgorithms12, 7 have been developed, which decompose themodel into charts representing the simplices of the base com-plex. Sander et al.19 use a region growing approach mergingcharts according to compactness and planary criteria. Re-cently Lévy et al.14 presented a new segmentation algorithmto decompose the model into regions homeomorphic to discswith a low deformation. To accomplish this, edges of highcurvature are detected and feature curves are grown fromthese. Then the charts are generated with a greedy algorithmusing the distance to the feature edges. Another approachwas made by Sheffer and Hart21 by cutting the mesh at ver-tices of high distortion and low visibility, after the genus ofthe mesh is reduced to zero by a genus reduction method.

c© The Eurographics Association and Blackwell Publishers 2003.

Page 3: Automatic texture atlas generation from trimmed …guthe/...computer graphics the cutting process is called texture atlas generation (see e.g. 15, 17). The model to be textured is

Guthe and Klein / Texturing trimmed NURBS models

In our method we adopt this approach but replace the vis-ibility criterion by a feature based criterion.

Parameterization: The first algorithm was presented byMaillot et al.15 using a spring network analogy and mini-mizing its energy with a conjugate gradient method. In thefollowing years, most algorithms used Discrete HarmonicMaps3, that are approximations of Continuous HarmonicMaps4 and minimize a metric dispersion criterion. As shownby Pinkall and Polthier18 this criterion is linked with an otherone named conformality and both can be expressed in termsof Dirichlet energy.

Using the theory on graph embedding, Tutte23 introducedBarycentric Maps guaranteeing the bijectivity of the param-eterization. By using specific weights Floater5 improved thequality of the mapping, in terms of area deformation andconformality. This method was extended to take additionalconstraints into account by Lévy and Mallet13.

Thus far the methods represented the deformation energyas an indirect coupling between parameters and thus requireboundary conditions, i.e. the boundary needs to be fixed ona convex border in parameter space. To overcome this prob-lem non-linear methods like MIPS9 can be used, this how-ever leads to time-consuming non-linear optimizations thatcan get stuck local minima. It is also possible to use circlepackings10 to approximate a conformal mapping, but build-ing circle packings is quite expensive. Lévy et al.14 intro-duced a fast method to compute the least squares approxima-tion of conformal maps. Additionally Sheffer and Sturler22

apply an overlay grid on a parameterized surface to mini-mize the linear distortion.

Recently Desbrun et al.2 presented an algorithm to gen-erate intrinsic parameterizations from triangle meshes andshowed that linear combinations of two the base intrinsicparameterizations (conformal and authalic) can be used toconstruct any intrinsic parameterization.

Packing: The problem of finding the optimal packing isknown as the bin packing problem and has been studiedby several authors, like Milenkovic16, but since it is NP-complete all algorithms are very expensive. Several heuris-tics have been developed to speed up this process, e.g. forseparate triangles1 or by packing the bounding boxes ofcharts19. An other method proposed by Lévy et al.14 is usinghorizons to pack charts more efficiently than with boundingboxes.

3. Algorithm Overview

First of all each NURBS patch is reparameterized indepen-dently from the others as described in section4. Second,based on the neighborhood graph of the patches in the 3Dmodel the stiff reparameterized 2D parameter domains of thesurface patches are connected by springs, where the weightof each spring represents feature lines, in such a way that

springs along these feature lines have a lower weight. Af-ter a relaxation process, starting with the longest spring, thatwas generated, one after the next is removed and the posi-tion of the patches is recalculated. This process is describedin section5. The reparameterization of the patches beforesewing them together is necessary, since we only want tosew the patches at points where this introduces a low distor-tion. If the patches are not parameterized correctly before thesewing algorithm, these points cannot be identified. Finally,overlappings in the generated sewing patterns are removedby an additional segmentation step and the separate chartsare packed into a texture atlas as described in section6.

4. Flattening of a NURBS patch

The overall algorithm for flattening the individual NURBSpatches is as follows. To apply the flattening procedure to aNURBS patch, we first generate a piecewise bilinear approx-imation of the patch using a regular grid. Then we use a spe-cialized spring network model to minimize area as well asangle deformations. In section4.1we describe the distortionmeasure we use and explain our specialized spring network.Afterwards we propose a method to find the minimal energyof this network in section4.2.

4.1. Distortion measure

To preserve the edge lengths of the NURBS patches, thelength of the springs are equal to the length of the edgesin euclidean space. Since we want to optimize the boundaryas well as the inside of the patch, we use the following edgelength energy function22 E, which preserves the overall edgelength:

E = ∑i j∈Edges,Diagonals

(‖ti − t j‖‖pi − p j‖

−1

)2

,

wherepi is the position of the grid vertexi in euclidian spaceandti its texture coordinate.

To preserve angles as well as area over the patch, with-out introducing another energy functional, we add diagonalsprings in every cell of our 2D grid (see figure2). This hasthe advantage that we only need to minimize one energyfunctional.

Adding two diagonal springs instead of one has two mainadvantages:

• The parameterization becomes symmetric for mirroredpatches and models.

• Angle and area distortion as well asL2 andL∞ stretch19

of the tessellated model noticeably decreased in our ex-periments (for details see table1).

4.2. Finding the minimal energy

To find the minimum of the non-linear energy function incombination with the highly constrained spring network we

c© The Eurographics Association and Blackwell Publishers 2003.

Page 4: Automatic texture atlas generation from trimmed …guthe/...computer graphics the cutting process is called texture atlas generation (see e.g. 15, 17). The model to be textured is

Guthe and Klein / Texturing trimmed NURBS models

Figure 2: Additional diagonal springs (marked in red) tominimize area and angle deformations

first need to set up a start parameterization that is as closeas possible to the global minimum. In order to generate thisparameterization we start from the center of the grid and in-crementally calculate the 2D positions of the surroundinggrid points. These positions are calculated to preserve theedge length along theu andv axis of the NURBS parameterdomain (see figure3).

Figure 3: Starting from the center of the grid a start param-eterization is build (added edges marked in red).

It is possible to additionally preserve the edge length ofthe diagonal, but the number of iterations needed to find theminimum is not reduced in general.

After a start parameterization is found, the energy is mini-mized by iteratively finding the optimal placement for everyvertex in respect with its 1-ring2. Note that although the en-ergy functional does not explicitly prevent foldovers they didnot occur with the tested models.

Since our energy function only depends on the ratio be-tween the edge length in the model and in the parameteriza-tion, moving one vertex in the mesh only affects the directlyattached springs (its 1-ring). If a vertex is moved to minimizeits local energy, the energy on the rest of the mesh does notchange. Thus reducing the energy of one vertex reduces thetotal energy of the mesh. This means that the algorithm re-duces the total energy in every step and so always convergesto a (local) minimum.

4.3. Fitting the NurbsTextureSurface

After the mesh is parameterized the texture control pointsTi j are generated. Since the NURBS cannot approximate the

mesh exactly we calculate the least squares fit by setting upthe following linear equation system: B1,11 · · · B1,nm

.... . .

...Bl ,11 · · · Bl ,nm

T11

...Tnm

=

t1...tl

,

wheretk is the texture coordinate of the grid vertexk andBk,i j the basis function values of the grid vertex and the con-trol pointTi j .

To solve the least squares approximation of this linearequation system we apply a singular value decomposition.

5. Chart generation

In the next step the flattened NURBS patches are sewn to-gether into charts. This process corresponds to the segmen-tation in the mesh based approaches. We have to determinewhich NURBS patches should be combined in a chart andwhere a cut between patches must be introduced. To accom-plish this, we first convert their trimming curves into poly-lines and sew these together in 3D space using the seamgraph data structure described in8. Note that in some casesthis leads to a non-manifold model. Nevertheless, the con-nectivity guarantees that no T-vertices occur at sewn patchboundaries.

To reduce deformations on the model, a good placementfor a cut is through a region if high distortion. To identifythese regions it is possible to use a parameterization of thecomplete model and cut at high distortion vertices that lie onpatch boundaries (see e.g.21). In this paper instead of gen-erating a parameterization of the whole model, we considerthe patches to be stiff and attach springs between boundaryvertices which were sewn together in the 3d model.

An additional criterion for the placement of a cut are fea-tures at the boundary vertices of the model. A feature be-tween NURBS patches can be identified by the deviationbetween the normals of these patches. To take the angle be-tween normals into account, we use the following weightfunction that reduces the strength of springs connecting fea-ture vertices:

wi j = 10−→ni ·−→n j (l i + l j )‖ti − t j‖2

l i = ∑ik∈Edges

‖ti − tk‖

5.1. Finding an initial placement

To minimize the total energy of the springs we first place thepatches in the texture space. For this initial placement we donot allow rotations of the patches.

This means, that its energyEtrans is minimal if thebarycenter of its boundary verticesbp lies on the barycen-ter of their corresponding vertices in adjacent patchesbn. To

c© The Eurographics Association and Blackwell Publishers 2003.

Page 5: Automatic texture atlas generation from trimmed …guthe/...computer graphics the cutting process is called texture atlas generation (see e.g. 15, 17). The model to be textured is

Guthe and Klein / Texturing trimmed NURBS models

be able to take features into account, we use a weightwi j forevery pairi, j of sewn boundary vertices.

Etrans = ∑i j∈Sewn∧i∈Patch

wi j ‖ti − t j‖2

∂Etrans

∂x= 2 ∑

i j∈Sewn∧i∈Patch

wi j(tix− t jx

)= 2 ∑

i j∈Sewn∧i∈Patch

wi j tix−2 ∑i j∈Sewn∧i∈Patch

wi j t jx

= k(bpx−bnx)∂Etrans

∂y= k(bpy−bny) ,

where k = 2 ∑i j∈Sewn∧i∈Patch

wi j .

Since the derivatives of the energy functionalEtrans arelinear, this leads to a linear equation system that we solveusing a singular value decomposition. Note however that thismay lead to overlappings of patches in the chart.

5.2. Alignment of the textures

The givenmain texture directiondefines the direction inwhich the texture should be placed on the patch. This re-stricts the rotation of the parameterizations.

The alignment strictnesson the rotation can have threeadjustments illustrated in figure4.

Figure 4: Effects of different alignment strictness (from leftto right: without, weak and strong rotation restriction)

Without rotation restriction: When using this setting, allsurfaces are allowed to rotate freely and thus the texture di-rection is ignored (figure4 left).

Weak rotation restriction: The surface is sampled in theparameter domain. For each sample the main texture direc-tion is projected onto the surface, where the length of theprojected direction

−→di resembles the cosinus between the

main texture direction and the surface. These directions areweighted by the local area of the corresponding sample-points and summed up to the total direction

−→d of the patch.

The length of−→d divided by the area of the surface is then

used to determine the maximum angleα the surface is al-lowed to rotate with the following equation:

α = 2arccos‖−→d ‖Area

Using this kind of strictness aligns the texture of the patchaccording to the given direction (figure4 middle). Note that

the patches in the center of the car seat are allowed to ro-tate because the main texture direction is not parallel to thesurface.

Strong rotation restriction: If we normalize the local tex-ture direction

−→di before it is summed up into

−→d the length of−→

d increases for patches that are not parallel to the given tex-ture direction. For these patchesα decreases and the givendirection is preserved more strictly (figure4 right).

5.3. Optimizing the placement

To find the optimal placement for each NURBS patch insidea chart, we allow the patches to move freely and to rotate ina certain angle that depending on thealignment strictnessasdescribed in section5.2.

Since the energy of a patch is minimal if the barycenter ofits boundary verticesbp lies on the barycenter of their cor-responding vertices in adjacent patchesbn, rotating aroundthe barycenter does not chance the location of the minimumof E and thus can be applied after moving the patch so thatbp = bn. This leads to the following energy function and itsderivative:

Erot = ∑i j∈Sewn∧i∈Patch

wi j

∥∥∥∥(cosα −sinαsinα cosα

)∆ti −∆t j

∥∥∥∥2

∂Erot

∂α= 2cosα ∑

i j∈Sewn∧i∈Patch

wi j (∆t jy∆tix−∆t jx∆tiy)

+ 2sinα ∑i j∈Sewn∧i∈Patch

wi j (∆t jx∆tix−∆t jy∆tiy),

with ∆ti =(

∆tix∆tiy

)= ti −bp.

Since this is a harmonic oscillation, the minima and max-ima of the energy functionErot are at:

γ = kπ−arctan

∑i j∈Sewn∧i∈Patch

wi j (∆t jx∆tix−∆t jy∆tiy)

∑i j∈Sewn∧i∈Patch

wi j (∆t jy∆tix−∆t jx∆tiy)

Because this is not a linear function, the partial derivatives

do not form a linear equation system. To solve this nonlinearsystem, we minimize the energy for every patch with respectto its direct neighbors. To prevent patches from rotation fur-ther than their allowed angle without introducing additionalconstraints, we check if|γ|> α and when this is the case wesetγ = α signγ.

Our energy functionalE = Etrans+ Erot minimizes theedge-length distortion along the patch boundaries, whichgives priority to the minimization of the area distortion. Itwould be possible to minimize the angle distortions instead,but we choose to minimize the edge-length to preserve theoverall area of the model.

Since reducing the energy of a patch with respect to its 1-ring does not change the energy between other patches, the

c© The Eurographics Association and Blackwell Publishers 2003.

Page 6: Automatic texture atlas generation from trimmed …guthe/...computer graphics the cutting process is called texture atlas generation (see e.g. 15, 17). The model to be textured is

Guthe and Klein / Texturing trimmed NURBS models

total energy is reduced in every step. Due to the same argu-ment as described in section4.2the algorithm converges.

5.4. Acceleration

When a patch is moved, it changes the location and angleof the minimum of the energy functionalE of its neighbors.The magnitude of this change corresponds to the distancethe patch has moved. For this reason we use a priority queueto speed up the convergence of our method instead of mov-ing all patches in each iteration. If a patch moves, the maxi-mum distance a point on the patch has moved is added to theweight of its neighbors. In this way we optimize the place-ment of the patches in regions of high distortion first andthus reduce unnecessary movement.

5.5. Segmentation

To reduce the overall distortion on the model, we now cut thelongest spring since it represents a high distortion vertex on afeature of the model. After applying the cut, the energy func-tion E = Etrans+ Erot of the adjacent patches has changedand thus we restart minimization described in section5.3. Inorder to speed up this process, we put these patches on topof the priority queue. The cutting procedure is repeated untilthe maximum deformation of the trimming curves is belowthe givendeformation threshold. It is necessary to apply theplacement process after each cut to prevent undesired cuts asshown in figure5.

Figure 5: Undesired cuts (red, marked with blue circle) ifmove that one spring (green) is cut between two placementprocesses

The whole process of placement and cutting is shown infigure6.

At the start many overlappings occur in the model andthe gaps between sewn patches are clearly visible (top left).As more and more springs are cut, the patches move closertogether and most overlappings vanish. This is show in thesubsequent pictures (top right to bottom left). At the end ofthe segmentation algorithm the gaps between patches are al-most closed and only overlappings between larger parts ofthe model are left (bottom right). This is due to the fact thatthe boundary of a chart can move freely and thus intersectitself. Note that, as this is real output of our algorithm, thesprings are not visible in the pictures.

Figure 6: Placement and segmentation process

5.6. Remove overlappings

Since the generated sewing pattern contains overlappings,it has to be cut into non overlapping charts. To overcomethis, we first determine which patches are overlapping. Sincewe have not fitted the sewn boundary vertices of adjacentpatches to each other, we use the center of the spring thatconnects them as vertex position. Then we start with sepa-rate patches and cluster pairs of charts with adjacent patches,as long as no two overlapping patches would be combinedin the same chart. Since we introduce new cuts, that shouldbe placed at feature edges, we use the total weight of thesprings between two adjacent patches as sorting criterion forthe clustering.

5.7. Adjusting parameterizations

After clustering the sewn points need to be moved to theircommon barycenter and the parameteriozations of the cor-responding patches have to be changed slightly in order tointerpolate new barycentric positions. To accomplish this wemove the control points in texture space to a least squares fitby setting up the following linear equation system: B1,11 · · · B1,nm

.... . .

...Bl ,11 · · · Bl ,nm

∆T11

...∆Tnm

=

∆t1...

∆tl

,

whereTi j are the texture control points andBk,i j the basisfunction values of the boundary vertextk and the controlpointTi j .

Since this deformation should be distributed over thewhole patch. In order to distribute the deformation also onthe whole patch and not only along the trimming curves,we add the following lines to the equations system to linkthe movement of neighbouring control points on the whole

c© The Eurographics Association and Blackwell Publishers 2003.

Page 7: Automatic texture atlas generation from trimmed …guthe/...computer graphics the cutting process is called texture atlas generation (see e.g. 15, 17). The model to be textured is

Guthe and Klein / Texturing trimmed NURBS models

patch:D11,11 · · · D11,nmD11,11 · · · D11,nm

.... . .

...Dn−1m−1,11 · · · Dn−1m−1,nmDn−1m−1,11 · · · Dn−1m−1,nm

∆T11

...∆Tnm

= 0

Dkl,i j =

d : k = i ∧ l = j

−d : k = i +1 ∧ l = j0 : else

Dkl,i j =

d : k = i ∧ l = j

−d : k = i ∧ l = j +10 : else,

whered is a given distribution value withd� 1.

This greatly reduces the overall area and angle deforma-tions as shown in figure7. As this result shows the adjust-ment of the parameterization increases the angle and areadeformations of the original patches only slightly demon-strating the suitability of this adjustment technique. Theleast squares inversion of the matrixA is calculated usinga singular value decomposition to minimize the distance be-tween the border points of the patch and the centers of thespring connecting it to an other patch. After each iterationthe springs have changed and thus their centers have to berecalculated. The process is stopped when the positions arewithin a given distance to their barycenter, or all points fur-ther away cannot be sewn.

6. Generation of texture atlas

These charts are placed in a texture atlas to build the finalsewing pattern. Since the packing problem is known to beNP-complete, we use a heuristic to pack the chart boundingboxes instead. The bounding boxes are sorted by their heightand inserted into the texture atlas one after an other whiletrying to minimize the area of the texture atlas after eachinsertion19.

Instead of packing the bounding box, horizon lines can beused to pack the charts into the texture atlas14. The wastedspace is reduced compared to the bounding box packing, butthere is still space left especially if objects are concave orhave holes.

Since we want to produce a texture atlas for further edit-ing in a CAD system, we only need to pack the boundingboxes of the charts resulting in slightly larger texture atlasthan with horizon lines.

7. Results

In our examples we used 10 percent of the average size ofadjacent patches as deformation threshold. Table1 shows the

car seat wheel rim

surfaces 116 151parameterization 114 sec 179 secsegmentation 869 sec 23 secsewing 36 sec 42 secL2 stretch 1.004 1.019L∞ stretch 5.269 7.472

L2 stretch (one spring) 1.006 1.052L∞ stretch (one spring) 6.725 23.450

Table 1: Statistics and timings (grid size:16×16cells

computation times and results of our method for differentCAD models consisting of NURBS surfaces.

Note the reducedL2 andL∞ stretch when using two in-stead of one diagonal spring. The segmentation of the carseat model is more expensive than that of the wheel rim, be-cause more boundary vertices are sewn together and thus thecomputation cost of the placement increases as well as thenumber of cuts.

Figure7 shows the angle and area deformation of the gen-erated sewing pattern for the car seat model before and afterthe sewing algorithm. Note however, that most of the de-formations are below the specified tolerance of 10 percent(marked by the red lines).

Figure 7: Angle and area deformation histograms of the carseat model (top: after flattening, bottom: after sewing)

Note how well the angles and the area on the patches arepreserved by the flattening process. It is clearly visible, thatmost of the deformations are introduced by the sewing algo-rithm.

We have compared our results with the least squares con-formal maps parameterization14 (see figure8 for the defor-mation histograms). Since the segmentation algorithm de-scribed in14 cannot be applied to NURBS models, we use the

c© The Eurographics Association and Blackwell Publishers 2003.

Page 8: Automatic texture atlas generation from trimmed …guthe/...computer graphics the cutting process is called texture atlas generation (see e.g. 15, 17). The model to be textured is

Guthe and Klein / Texturing trimmed NURBS models

segmentation algorithm described in this paper and appliedthe parameterization to the generated charts. It is clearly vis-ible that our method preserves the area by far better at thecost of a slightly higher angle distortion. For natural materi-als like cloth or leather these slightly higher angle deforma-tions are by far not as disturbing as a high area deformation.

Figure 8: Angle and area deformation histograms of thecar seat model parameterized with least squares conformalmaps

Some of the resulting texture atlases created with ourmethod and the corresponding textured models are shownin figures9 and10.

Figure 9: Car seat model with associated texture atlas con-structed by our algorithm. The model is covered with a gridtexture to show angle and edge length deformations.

8. Conclusions

We have developed a method for automatic texture atlas gen-eration directly from trimmed NURBS models without us-ing a triangulated approximation. Our method preserves theoriginal structure of the model and thus the resulting textureatlas can be edited further in a CAD system. The distortionmeasure we use allows us to minimize angle as well as areadeformations and the overall deformation can be controlled

Figure 10: Wheel rim model with associated texture atlasconstructed by our algorithm.

with a threshold value. Furthermore the texture atlas is inde-pendent of the resolution and method used to tessellate thepatches.

Acknowledgements

We want to thank DaimlerCrysler and Volkswagen for pro-viding us with the CAD models. This work was partiallyfunded by the BMBF under the project of OpenSG PLUSand by the European Union under the project of Real Re-flect.

References

1. P. Cigogni, C. Montani, C. Rocchini and R. Scopino. Ageneral method for recovering attributes values on sim-plified meshes.Proc. IEEE Visualization 1998, pp:59-66, 1998. 3

2. M. Desbrun, M. Meyer and P. Alliez. Intrinsic Parame-terizations of Surface Meshes.Computer Graphics Fo-rum (Eurographics ’02 Proc.), 21(2), 2002. 3, 4

3. M. Eck, T. DeRose, T. Duchamp, H. Hoppe, M. Louns-bery and W. Stuetzle. Multiresolution analysis of arbi-trary meshes.In Siggraph ’95, pp:173–182, 1995.3

4. J. Eells and L. Lemaire. Another report on harmonicmaps.Bull. London Math. Soc., 20:385–524, 1988.3

c© The Eurographics Association and Blackwell Publishers 2003.

Page 9: Automatic texture atlas generation from trimmed …guthe/...computer graphics the cutting process is called texture atlas generation (see e.g. 15, 17). The model to be textured is

Guthe and Klein / Texturing trimmed NURBS models

5. M. Floater. Parameterization and smooth approxima-tion of surface triangulations.Computer Aided Geo-metric Design, 14(3):231–250, Apr. 1997.3

6. Holger Grahn, Thomas Volk, and Hans J. Wolters.NURBS in VRML. In Proceedings of the Web3D-VRML, 1999. 2

7. I. Guskov, K. Vidimce, W. Sweldens and P. Schröder.Normal Meshes.In Siggraph ’00, pp:95–102, 2000.2

8. M. Guthe, J. Meseth and R. Klein. Fast and memoryefficient view-dependent trimmed NURBS rendering.In Pacific Graphics 2002, pp:204–213, 2002.4

9. K. Hormann and G. Greiner. MIPS: An efficient globalparametrization method.Curve and Surface Design:Saint-Malo 1999, pp:153–162, 1999.3

10. M. Hurdal, P. Brower, K. Stephenson, D. Sumners,K. Rehms, K. Schaper and D. Rottenberg. Quasi-conformally flat mapping the human cerebellum.Proc.of MICCAI ’99, volume 1679 ofLecture Notes in Com-puter Science, pp:279–286, 1999.3

11. V. Krishnamurthy and M. Levoy. Fitting smooth sur-faces to dense polygon meshes.In Siggraph ’96,pp:313–324, 1996.2

12. A. Lee, W. Sweldens, P. Schröder, L. Cowsar and D.Dobkin. MAPS: multiresolution adaptive parameteri-zation of surfaces.In Siggraph ’98, pp:95–104, 1998.2

13. B. Lévy and J.-L. Mallet. Non-distorted texture map-ping for sheared triangulated meshes.In Siggraph ’98,pp:343–352, 1998.3

14. B. Lévy, S. Petitjean, N. Ray and J. Maillot. LeastSquares Conformal Maps for Automatic Texture AtlasGeneration.In Siggraph ’02, July 2002. 2, 3, 7

15. J. Maillot, H. Yahia and A. Verroust. Interactive TextureMapping.In Siggraph ’93, pp:27–34, Aug. 1993.1, 2,3

16. V. Milenkovic. Rotational polygon containment andminimum enclosure using only robust 2D construc-tions. Computational Geometry, 13(1):3–19, 1999.3

17. H. Pedersen. Decorating implicit surfaces.In Siggraph’95, pp:291–300, 1995.1, 2

18. U. Pinkall and K. Polthier. Computing discrete mini-mal surfaces and their conjugates.Experimental Math.,2(15), 1993. 3

19. P. Sander, J. Snyder, S. Gortler and H. Hoppe. Texturemapping progressive meshes.In Siggraph ’01, pp:409–416, 2001. 2, 3, 7

20. A. Sheffer. Spanning tree seams for reducing param-eterization distortion of triangulated surfaces.Proc.

Shape Modelling International, pp:61–66, May 2002.2

21. A. Sheffer and J.C. Hart. Seamster: InconspicuousLow-Distortion Texture Seam Layout.Proc. IEEE Vi-sualization 2002, Oct. 2002. 2, 4

22. A.Sheffer and E. de Sturler. Smoothing an OverlayGrid to Minimize Linear Distortion in Texture MappingACM Transactions on Graphics, 21(4):874–890, 2002.3

23. W. Tutte. Convex representation of graphs.Proc. Lon-don Math. Soc., 10, 1960. 3

c© The Eurographics Association and Blackwell Publishers 2003.