Eteded Space Mappig with Béier Patches ad Volumes Bejami Schmitt 1, 2 Aleader Pasko 1 Vladimir Savcheko 1 Abstract We eplore a geeral eteded space mappig as a framework for trasformig a hypersurface i the coordiate-fuctio space with the followig projectio oto the geometric coordiate space to get the resultig implicit surface. Béier patches ad volumes allow for the iteractive modelig of comple shapes. We use them to defie geometric solids with the fuctio represetatio (F-rep) i 2D ad 3D space respectively. The positios of the cotrol poits i the coordiate-fuctio space are both used to maipulate fuctio values ad to defie space trasformatios. Because Béier primitives are parametrically defied, it is very difficult to cotrol their behavior outside of the domai of iterest. Hece, we apply fuctioal clippig to make the fuctio positive oly iside the domai. If the cotrol poits are moved i the coordiate space, we apply a eteded Béier clippig for the iverse mappig. We preset a iteractive modeler for Béier patches ad volumes with which we are able to desig comple 2D/3D F-rep objects. CR Categories ad Subject Descriptors: [Computer Graphics]: Computatioal Geometry ad Object Modelig Curve, Surface, ad Object Represetatios. Additioal Keywords: Shape Modelig Implicit Surfaces F-rep Eteded Space Space Mappig Fuctio Mappig Iteractivity. 1: Laboratory of Shape Modelig Uiversity of Aiu, Aiu-Wakamatsu City, Fukushima Prefecture 965-8580, Japa {pasko,savche}@u-aiu.ac.jp 2: Uiversité de Roue, Facultés des Scieces IUP Géie Mathématiques et Iformatique 76 000 Roue Frace schmitt_bejami@hotmail.com Implicit@ Surfaces 99, Eurographics/ACM SIGGRAPH Workshop (Bordeau, Frace, September 13-15 1999), J.Hughes ad C. Schlick (Eds.), pp. 25-31. 1 INTRODUCTION Differet ways eist for represetig comple shapes. Parametric represetatios of curves ad surfaces are the most commo oes i geometric modelig ad computer graphics. Aother way to represet solids is to use implicit surfaces. Usually, the set of primitive implicit shapes is restricted by quadrics, tori, superquadratics, ad skeleto-based models. To model a comple irregular shape with skeleto-based implicits, oe should usually use may skeleto primitives. I this paper, we propose to model a comple shape with oly oe primitive. We defie primitive solids by miig two represetatios: parametric ad implicit surfaces. Oe of the mai advatages of the first is that it leads to a desig paradigm based o a cotrol-poit array, ad the secod allows the use of multiple geometric operatios [2,6]. We choose Béier patches ad volumes as parametric fuctios because of the simplicity of calculatio. We use them to defie geometric solids i 2D ad 3D spaces respectively. This approach has already bee applied to costruct piecewise algebraic surfaces [8,9,10] ad thick free-form shells [4]. I cotrast, we wish to use them i fuctioally based costructive modelig. The positios of the cotrol poits i the coordiatefuctio space are both used to maipulate fuctio values ad to defie space trasformatios. I this sese, the proposed techique falls ito the category of a geeral eteded space mappig. Because Béier primitives are parametrically defied, it is very difficult to cotrol their behavior outside of the domai of iterest. Hece, we apply fuctioal clippig to make the fuctio positive oly iside the domai. It is implemeted usig R- fuctio based set-theoretic itersectio with the uit square/cube. This turs the modeled object ito the fuctio represetatio (Frep) rather tha a traditioal implicit surface [6]. We the defie a iverse mappig to establish a correspodece betwee the coordiate space ad the parameter space. If the cotrol poits are placed i the rectagular grid, this is just a scalig operatio, but if the cotrol poits are moved i space, we apply o-liear mappig usig volume splies ad Béier clippig. We preset a iteractive modeler for Béier patches ad volumes with which we are able to desig comple 2D/3D F-rep objects. 2 EXTENDED SPACE MAPPING A space mappig establishes a oe-to-oe correspodece betwee poits of a give space ad, if applied to some poit set i the space, it chages this set to a differet oe. A mappig ca be defied by the fuctioal depedece betwee the ew ad old coordiates of poits.
ξ S 3.1 Parametric Béier Patches ad Volumes 0 A B A B Figure 1: Trasformig a 1D segmet AB ito A B by applyig eteded space mappig to a curve S defied as ξ = f(). Here, we discuss the eample illustrated by Fig.1. The itetio is to model a 1D geometric object (a lie segmet AB) o the -ais, ad the to trasform it to A B. Let us itroduce a fuctio of oe variable ξ = f(). It defies the segmet AB as f() 0. At the same time, it defies a curve S i the (, ξ) plae. We call this plae a eteded space, because it has a geometric coordiate ad a additioal fuctio coordiate. The segmet AB ca be also cosidered as a projectio of the part of the curve S, which is above the -ais. Now, let us traslate the curve S to S as it is show i Fig. 1. By doig this, we map the eteded space (, ξ) oto itself ad thus defie a eteded space mappig. Now, the segmet A B ca be also cosidered as the projectio of the part of the curve S, which is above the -ais. Therefore, we trasformed AB to A B with the sigle eteded space mappig. Note that, to obtai this trasformatio with mappigs of the coordiate oly, oe has to thik of some compositio of 1D traslatio ad scalig. We itroduced the geeral defiitio of eteded space mappigs i [2]. A short formal itroductio to it ca be foud i the Appedi. The curve S i Fig. 1 ca be defied parametrically. The, by movig its cotrol poits vertically (fuctio mappig) ad horiotally (space mappig) oe ca itroduce differet eteded space mappigs ad correspodigly trasform the segmet AB (eve ca break it ito two or more segmets!). The subject of this paper is to itroduce ad implemet eteded space mappigs for modelig 2D ad 3D objects with Béier patches ad volumes. 3 BEZIER SOLIDS We cosider a defiitio of a closed subset of -dimesioal Euclidea space E by the iequality f( 1, 2,, ) 0, where f is a real cotiuous fuctio o E. We call f the defiig fuctio. The above iequality is the fuctio represetatio (F-rep) of a geometric solid. It allows for the followig defiitio of - dimesioal solid i E space: f(x) > 0 for poits iside the solid, f(x) = 0 for poits o the solid s boudary (a implicit curve i 2D ad a implicit surface i 3D), f(x) < 0 for poits outside the solid, where X = ( 1, 2,, ) is a poit of E. S A Béier patch S(u, is defied as follows: m S( u, = B B ( P, i= 0 j= 0 where P ij are 3-dimesioal poits, called cotrol poits ad B i (i=0..) are Berstei basis fuctios, defied by i i Bi ( t) = ( t) t i 1. Similarly, a Béier volume is defied as follows: S( u, B j ( ( k, i= 0 j= 0k= 0 where P are 4-dimesioal poits i this case. 3.2 F-rep with Béier Patches ad Volumes Here, we follow the defiitios of F-rep solids usig parametric patches ad volumes give i [1]. To defie a 2D solid by f(,y) 0 i the domai {(,y) : 0 (,y) 1}, we assume that the ad y coordiates of S(u, are S (u, ad S y (u, ad ca be epressed as follows: = Bi B j ( i= 0 j = 0 = u i y j i. e.: =, P ij = y y = Bi B j ( i= 0 j = 0 = v The, the -coordiate of S(u,, S (u,, ca be used to defie a 2D solid as f(,y) = S (u,. A Béier patch ad its correspodig 2D solid are show i Fig. 2. We ca apply a fuctio mappig to the 2D solid by movig cotrol poits of the patch vertically ad thus chagig fuctio values. i j ij f(,y) 0 Figure 2: A Béier patch ad a correspodig 2D solid.
Similarly, to defie a 3D solid f(,y,) 0 i the domai { (,y,) : 0,y, 1 }, we assume that the, y ad coordiates of S(u,, S (u,, S y (u, ad S (u,, are: B j ( ( k = u i= 0 j = 0k = 0 y y B j ( ( k = v i= 0 j = 0k = 0 B j ( ( k = w i= 0 j = 0k = 0 i y j k where P ad P =, P = l m =. The ξ coordiate of S(u,, S ξ (u,, is the used to defie a 3D solid as follows: f(,y,) = S ξ (u,. We ca modify the 3D solid by chagig the ξ coordiate (the fuctio value) i cotrol poits of the volume. 3.3 Fuctioal Clippig ad Iverse Mappig At this stage, we are able to defie a Béier solid. Nevertheless, the behavior of the parametric fuctio outside the domai is difficult to cotrol ad the shape of the domai, i.e., the uit square or the uit cube, is too restrictive. Hece, we use a fuctioal clippig ad the a iverse mappig to overcome these two udesirable properties. ad & is the symbol of the itersectio operatio defied with the R-fuctio [6,7] as: 2 2 G = g1 & g 2 = g1 + g 2 g1 + g 2. The result of this procedure is illustrated by Fig. 4 (usig the same patch as i Fig. 3). The defiig fuctio is egative outside the domai, ad the desirable 2D solid is uchaged. Figure 4: 2D Béier solid after the fuctioal clippig. The same procedure has to be applied i the 3D case: Sclip ( u, = S( u, & Fs ( u, where Fs ( u, = Fb & Fb ( & Fb ( is the uit cube. Fuctioal clippig allows us to defie closed solids as show i Fig. 5. We did ot apply fuctioal clippig to the volume o the left. Its boudary is ot a closed surface i the domai. Whereas, with the volume o the right, fuctioal clippig was applied, ad the 3D solid as well as its boudary are clearly defied. 3.3.1 Fuctioal Clippig Fig. 3 shows a Béier patch ad its correspodig 2D solid, which is bouded by the itersectio curve (cotour) of the patch with the plae f = 0. The patch was costructed to produce oly oe closed implicit curve i the uit-square. As it ca be observed, the behavior of the parametric fuctio outside the domai cotradicts the requiremet of egative values of a defiig fuctio for poits outside the defied object. It results i udesirable ( ghost ) ero-valued cotours outside the uit square. Figure 5: Surfaces of 3D Béier solids i the uit cube. The left oe without fuctioal clippig, the right oe with fuctioal clippig. I our implemetatio, the procedures defiig parametric patches ad volumes ecapsulate the itroduced fuctioal clippig. Oce a solid is modeled, this allows us to apply ay operatio provided by a F-rep modeler to it. 3.3.2 Iverse Mappig Figure 3: Béier patch ad 2D solid without fuctioal clippig. Let S(u, be a fuctio defiig a parametric patch where S(u, = S (u,. Cosider the itersectio betwee the uit-square ad the 2D solid defied by this fuctio: S( u, & F ( u, clip = where F s (u, = F b (u) & F b ( is a defiig fuctio of the uitsquare with F b defiig the uit strip by each variable: F b ( t) = (1 t) t, s Here, usig a 2D solid as a eample, we deal with the trasformatio of the domai of a fuctio f(,y) defied by a parametric fuctio S(u,. The trasformatio of the domai meas that although the domai of S(u, remais a uit square, we will chage the rage of { (u,,y(u, } from a uit square to some other regio. The etesio of this method to higher dimesioal cases is straightforward. Although the domai becomes complicated, it is easy to perform fuctioal clippig operatios i the parameter space after a iverse mappig from (,y) to (u,. Arbitrary values ca be specified for the ad y coordiates of each cotrol poit, thus we ca defie a geerally shaped domai bouded by four Béier curves. Fig. 6 shows a eample
of the trasformatio of the domai as eplaied above. Two cotrol poits are traslated i the (,y) plae without chagig their values from the origial patch. This is oe more method of deformig a 2D solid istead of chagig its values. Béier patch, static cotrol poits poits defie a grid belogig to the (,y) plae. By chagig the value of the scalar P, the fuctio f(,y) values ad the ero- valued cotour are chaged. Because is the -coordiate of a cotrol poit, it is possible to use the traditioal visual represetatio of the patch ad the cotrol poits as show i Fig. 6, ad to displace the cotrol poits alog the -ais. I order to represet 4D cotrol poits of the Béier volume, we itroduced the color scale show i Fig.7. Fig. 8 presets a y eample of a 3D grid defied by the P, P ad P coordiates of the volume cotrol poits. Each cotrol poit is represeted by a sphere, ad the color is defied by the value of the ξ coordiate. Béier patch, moved cotrol poits ξ > 0 ξ = 0 Figure 6: 2D space mappig defied by traslatio of two cotrol poits i the (,y) plae. I order to get the values of the parameters (u, at a give poit ( 0,y 0 ), we have to calculate a itersectio poit betwee a patch S(u, ad a straight lie parallel to -ais passig through a poit ( 0,y 0,0). I other words, we have to apply a iverse space mappig to the poit ( 0,y 0 ). Several methods are available to calculate the itersectio betwee a Béier patch ad a straight lie, like the Béier clippig method proposed i [3]. The problem with usig this method is that it does ot provide for ay mappig for poits outside the domai, ad for poits iside the domai, it works too slowly. We use a iverse mappig, that is a combiatio of a approimate iverse mappig ad the Béier clippig. The procedure is as follows: 1. Apply the approimate iverse mappig to the give poit ( 0,y 0 ). This mappig uses the scattered data iterpolatio by the volume splie based o Gree s fuctio [2]. I the 2D case this is well kow as the thi plate splie. We apply this splie to iterpolate the displacemet values of ay give poit. 2. If the resultig poit (u, of the previous step lies iside the uit square, defie a boudig bo for it ad apply Béier clippig. This procedure provides a iverse mappig for ay poit, ad is faster tha pure Béier clippig for the same give accuracy. If the cotrol poits are moved so that the grid looses its regularity, the iverse mappig still works but the results are less ituitive. Figure 7: Color scale for the ξ coordiate of cotrol poits of the Béier volume. ξ>>0 ξ < 0 ξ > 0 4 INTERACTIVE MODELING 4.1 Visual Represetatio of Cotrol Poits ξ < 0 ξ = 0 For the Béier patch, the ad y coordiates of the cotrol ij Figure 8: 3D grid of colored cotrol poits of a Béier volume.
Figure 9: Iteractive modelig of a 2D solid. Figure 10: Screeshot of the Béier solid modeler. Desig of a fish shape with oly oe primitive.
4.2 Modelig Iterface We have implemeted a iteractive modeler usig Tcl/Tk for the iterface ad MAM/VRS [11] for graphics. I this sectio we illustrate mai features of the modeler. 4.2.1 Modelig 2D Solids with Béier Patches Fig. 9 shows several steps of modelig a simple 2D solid. O the left side, the grid of cotrol poits (3 3), the plae f = 0, ad the Béier patch are preseted. The color of the Béier patch reflects the fuctio values i accordace with the color scale (Fig. 7). First, the coordiate of oe of the cotrol poits is chaged to a egative value by simply draggig the sphere alog the cylider parallel to the -ais. Net, at the ed of the secod step, the four cotrol poits at the corers have egative values, ad fially, the cetral poit is pulled up with its coordiate chaged to a positive value. A ero-valued cotour, the boudary of the 2D solid, appears o the right side. The other way to deform the 2D solid is to move cotrol poits i the (,y) plae as it is show i Fig. 6. I this way, chages to both compoets of the eteded space mappig, amely the fuctio mappig ad the space mappig, are supported by the iterface. 4.2.2 Modelig 3D Solids with Béier Volumes Fig. 10 presets the iterface used to model 3D solids with Béier volumes. I this modelig iterface for Béier volumes, the user ca select a volume cross-sectio (upper area), directly chage fuctio values ad correspodig colors of the cotrols poits i the 3D grid (lower left area), ad visually cotrol the surface of the solid (lower right area). First, we select a plae i oe of the three orthogoal directios i the 3D grid of cotrol poits. The, we are able to work with this selected cross sectio, ad defie a 2D solid usig the Béier patch iterface. After repeatig this process, we ca the reder the polygoied surface of the 3D solid usig the algorithm described i [5]. I the lower left area, we ca also directly move cotrol poits i the 3D space to perform the space mappig ad chage fuctio values to perform fuctio mappigs. Figure 11: A set of ero-valued cotours ad a correspodig surface of a 3D solid modeled with a Béier volume. Fig. 11 shows a set of ero-valued cotours for a 5 5 5 cotrol poit volume. Each cotour was modified by chagig the fourth coordiate ξ of the cotrol poits. This set gives a good idea of the resultig 3D solid, as the polygoied surface o the right shows. The cotours are updated by the system i real time, so the user ca request repolygoiatio of the surface after some sigificat chages have bee made. Figure 12: A Béier oo: a set of 3D solids modeled usig Béier volumes. 4.3 Iteractivity ad Eamples Is our modeler completely iteractive? Workig with a patch or a volume defied by less tha 10 cotrol poits o each ais, ad without usig a space mappig, the aswer is yes. I this case there is o delay betwee the modificatios beig made ad the visible result. Updates to the Béier patch ad ero-valued cotour are doe i real time. Polygoiatio is still too slow to be doe i real time. It takes 3 sec to polygoie the surface for the 5 5 5 cotrol poit volume with 20 20 20 polygoiatio grid o a 400 MH Petium II computer. If the umber of cotrol poits grows to become greater tha 10, or if a space mappig is applied, real time visualiatio becomes impossible. Before the implemetatio of this software, we wodered if it was possible to implemet a ituitive modeler, because the modelig techiques we use differ from stadard modelig techiques. Our eperiece shows that the proposed modelig paradigm is quite ituitive, ad usig it to desig comple solids becomes easy. We have produced may shapes usig our modeler (see Fig. 12). Note that each shape i this oo is defied by a sigle primitive. It would require may skeletal elemets, or may solid primitives as well as bledig set operatios to model each of these solids i the traditioal maer.
5 CONCLUSION We have developed a ew techique of modelig F-rep solids usig parametrically defied free-form patches ad volumes. Eve though the fuctio represetatio for geometric solids is widely used, there are difficulties with iteractive modificatio of F-rep solids. I order to overcome these difficulties, we use parametrically defied patches ad volumes with fuctioal clippig ad the combiatio of the o-liear iverse mappig ad Béier clippig. A etesio of this approach would be to use a piecewise model with several patches or volumes tied together. I this case a grid of uit squares/cubes is ivolved ad fuctioal clippig has ot to be applied at the shared edges/faces. We implemeted a iteractive modelig tool based o the proposed solutios. We eteded the F-rep library of the HyperFu laguage [12] with Béier solids. Our iteractive tool geerates the correspodig source code of the model i HyperFu. I this way, Béier solids ca be used to model comple F-rep objects alog with other primitives ad operatios such as set-theoretic, bledig, metamorphosis ad others [2,6]. APPENDIX. EXTENDED SPACE MAPPING Here, we provide defiitios for both eteded space ad eteded space mappigs itroduced i [2]. Cosider a +1- dimesioal Euclidea space E +1 ad a hypersurface S defied i it by a real cotiuous eplicit fuctio of variables: ξ = f( 1, 2,, ), (1) where P = ( 1, 2,, ) is a poit i the subspace E, ad P +1 = ( 1, 2,,,ξ) is a poit i E +1. The major requiremet for the fuctio f is to have at least C 0 cotiuity. The itersectio of the give hypersurface with the half space ξ 0 ad the projectio of the result alog the ξ ais oto E defie the poit set: G = { P : P +1 S,ξ 0 }. (2) Equatios 1 ad 2 together are equivalet to the more commo defiitio G = { P : f( 1, 2,, ) 0 } used i implicit ad F-rep modelig, but (1) ad (2) fit the formulatio of the eteded space mappig better. We cosider G to be a geometric object defied i the -dimesioal Euclidea space E. The space E +1 ca be called a eteded space ad ca be costructed from E by addig oe more dimesio with the ξ coordiate. A subset of G with ξ = 0 is usually called a implicit surface or a isosurface. I [2] we itroduced a geeral framework for trasformig geometric objects i E with the use of eteded space mappigs Φ:E +1 E +1 applied to the hypersurfaces (1) i E +1. Let a eteded space mappig be formulated as follows: P + 1 = Φ( P + 1 ), where P +1 = (,ξ) is a origial poit i E +1 with = ( 1, 2,, ), ad P + 1 = (,ξ ) is a poit resultig from the mappig Φ(,ξ) = (φ 1, φ 2 ). The trasformed geometric object from (2) is described by the system of equatios: = φ1(, ξ) ξ = φ2 (, ξ ) (3) ξ = f ( ) There are two compoets of the eteded space mappig: the first equatio of (3) defies a space mappig, ad the secod defies a fuctio mappig. The problem is to fid the eplicit descriptio of the trasformed object i the form: ξ = f ~ ( ), which does ot follow directly from the equatios (3). For a give, equatios (3) tur ito a system of +2 equatios with +2 variables,, ξ, ξ. Although oe ca fid the value of ξ by solvig this systeumerically for ay give poit, it is ot applicable i practice. We discussed i [2] several types of the eteded space mappig for which the fuctio ξ = f ~ ( ) ca be restored aalytically. ACKNOWLEDGEMENTS The authors would like to sicerely thak Eric Fausett for his help with the stylistic issues of this paper. We ackowledge the valuable commets by aoymous referees. REFERENCES [1] K.T. Miura, A.A. Pasko, V.V. Savcheko. Parametric patches ad volumes i the fuctioal represetatio of geometric solids, CSG 96 Coferece Proceedigs, Iformatio Geometers, Wichester, UK, 217-231, 1996. [2] V. Savcheko, A. Pasko. Trasformatio of fuctioally defied shapes by eteded space mappigs. The Visual Computer, 14:257-270, 1998. [3] T. Nishita, T.W. Sedeberg ad M. Kakimoto. Ray tracig trimmed ratioal surfaces patches, Computer Graphics 24, 3:337-345, August 1990. [4] J.P. Meo. Costructive shell represetatios for free-form surfaces ad solids, IEEE Computer Graphics ad Applicatios 14, 2:24-27, February 1994. [5] A.A. Pasko, V.V. Pilyugi ad V.V. Pokrovski. Geometric modelig i the aalysis of trivariate fuctios, Computers ad Graphics, 12, 3/4:457-465, 1988. [6] A.Pasko, V. Adhie A. Souri ad V. Savcheko. Fuctio represetatio i geometric modelig: cocepts, implemetatio ad applicatios, The Visual Computer, 11:429-446, 1995. [7] V. Shapiro. Real fuctios for represetatio of rigid solids, Computer Aided Geometric Desig 11, 2:152-175, 1994. [8] T.W. Sederberg. Piecewise algebraic surface patches, Computer Aided Geometric Desig 2:53-59, 1985. [9] N.M.Patrikalakis ad G.A. Krieis. Piecewise cotiuous algebraic surfaces i terms of B-splies, Geometric Modelig for Product Egieerig, M.J. Woy et al. (Eds), Elsevier Sciece Publishers, 3-19, 1990. [10] A.E. Middleditch ad E. Dimas. Solid models with piecewise algebraic free-form faces, CSG 94 Coferece Proceedigs, Iformatio Geometers, Wichester, UK, 133-148, 1994. [11] MAM/VRS, http://wwwmath.ui-muester.de/iformatik/u/mam/ [12] HyperFu, http://www/labs/sw-sm/frepwww/hf_descr.html