Pi-surfaces: products of implicit surfaces towards constructive composition of 3D objects
ΠΠ -surfaces: products of implicit surfaces towardsconstructive composition of 3D objects Adriano N. Raposo and Abel J.P. GomesInstituto de Telecomunicações and Universidade da Beira InteriorR. Marquês de Ávila e Bolama6200-001, Covilhã, [email protected], [email protected]
ABSTRACT
Implicit functions provide a fundamental basis to model 3D objects, no matter they are rigid or deformable, incomputer graphics and geometric modeling. This paper introduces a new constructive scheme of implicitly-defined3D objects based on products of implicit functions. This scheme is in contrast with popular approaches like blobbies , meta balls and soft objects , which rely on the sum of specific implicit functions to fit a 3D object to a setof spheres. Keywords
Implicit surfaces, surface modeling, constructive modeling, 3D modeling, computational geometry, geometricmodeling.
Both implicit surfaces and parametric surfaces havebeen widely used in computer-aided design, geomet-ric modeling, visualization, animation, and computergraphics [GVJ + Permission to make digital or hard copies of all or part ofthis work for personal or classroom use is granted withoutfee provided that copies are not made or distributed for profitor commercial advantage and that copies bear this notice andthe full citation on the first page. To copy otherwise, or re-publish, to post on servers or to redistribute to lists, requiresprior specific permission and/or a fee. algebraic surfaces (e.g., spheres, ellipsoids, cylinders,hyperboloids, and tori), called Π - surfaces . These Π -surfaces allow us: (1) to represent a surface as the prod-uct of two or more patches; (2) to globally edit theshape of each patch (e.g. patch replacement, patch re-moval, patch insertion); (3) to locally edit the shape ofeach patch (e.g. deformations like recesses, saliences,and so forth); (4) to blend two patches using a singleblending parameter; and (5) to better control bulgingeffects inherent to sum-based surfaces (e.g., ∑ -surfaceslike Gaussian surfaces) via the blending parameter.In short, we propose a new constructive method for3D objects through products of implicit functions,which differs from the dominant method found inthe literature, which is based on ∑ -surfaces (e.g., blobby molecules [Bli82], metaballs [NHK + softobjects [WMW86], blobby model [Mur91], piece-wise implicit surface patches [Baj88, BX97], andhomotopy-generated surfaces [Bed92] [HH85]. Π -SURFACES Π -surfaces can be used to approximate any givensmooth and bounded object in R whose surface is de-fined by a single polynomial as a product of subsidiarypolynomials. In other words, we can design any smoothobject with a single algebraic surface. Let us denote thedefining polynomials as f i ∈ R [ x , . . . , x n ]( i = , . . . , k ) .Then, the approximating object is defined by thepolynomial F ( x , y , z ) = ∏ i f i ( x , y , z ) − r (1) a r X i v : . [ c s . G R ] J un here r ∈ R stands for the blending parameter that con-trols the approximating error.From Eq. (1), which is the core equation of this paper,we can find that the shape of the approximating surfacedepends on the primitive surfaces f i and the parame-ter r . That is, we have a product ( Π ) of functions f i ,where each function represents an arbitrary geometricprimitive i , and r is the approximation parameter forthe entire surface. Π -surfaces are built up from arbitrary implicit surfaceprimitives. However, unlike traditional distance-basedmethods, Π -surface primitives are not limited to setsof spheres (or ellipsoids) to compose 3D objects. In-stead, Π -surfaces use primitives like planes, quadrics,tori, and other more complicated surfaces. These prim-itives split into two different groups: bounded primi-tives (e.g., sphere, ellipsoid, torus, and so forth) and un-bounded primitives (e.g., plane, cylinder, cone, hyper-boloid of 1 sheet, hyperboloid of 2 sheets, paraboloid,hyperbolic paraboloid, and the like). Both bounded andunbounded primitives may be combined into the same3D object. There are three different types of shape operations: shape repositioning , global shrinking or inflation , and local bulges or concavities . The shape of a Π -surface can also be adjusted by con-trolling the position of the primitives. This is somehowintuitive, though the blending of the primitives only de-pends on the distance between them and the blendingparameter r . For example, both spherical primitives inFigure 1 are combined into a Π -surface (in transparentgray). Obviously, considering the blending parameter r = .
25 remains unchanged, the resulting Π -surfacedepends on the distance between both primitives. Varying the blending parameter r in Eq. (1) makes theentire Π -surface shrink or inflate. Specifically, decreas-ing the value of r to zero makes the Π -surface shrinkto the surface of the union of implicit surface primi-tives. Conversely, increasing the value of r inflates the Π -surface globally. Figure 2 shows how distinct valuesof r affect the global shape of a Π -surface.Similar to ∑ -surfaces, undesired bulges about the inter-section regions of primitives may occur in Π -surfaces.The difference is that Π -surfaces allow the control onbulges by reducing the value of the approximation pa-rameter r , as illustrated in Figure 3. Unlike ∑ -surfaces, Π -surfaces are very efficient in per-forming local deformations without affecting the globalshape of the objects. Such deformations are performedby the action of primitives on other primitives. Thereare two main types of local deformations: local protru-sions and local depressions . Local protrusions are generated by adding a relativelysmall primitive to the Π -surface, but the small primitiveneeds to be close enough to the Π -surface in order toaffect it. This mechanism is illustrated by the red objectin Figure 4(a), where a small sphere imposes a sphericalbump to the plane x = Local depressions are a little bit trickier to obtain with Π -surfaces. In this case, we need to invert the sign ofthe implicit function of the small primitive, yet invert-ing the original implicit function of the global shape isalso feasible. This local deformation mechanism is il-lustrated in Figure 4(b)-(c), where we also used a smallsphere to obtain a concavity in the plane x = As seen above, adding a primitive is as simple as in-cluding its defining implicit function in the product of Π -surface. This procedure only changes the already ex-isting object locally. Besides, the position and geomet-ric parameters of the primitive can also be interactivelyadjusted on the fly by the user. There two types of shapecomposition control: additive and subtractive. Additive shape composition means we interactively addpositive primitives to a given object without losing thecontrol of its overall shape, i.e., without losing the ca-pability of anticipating how the inclusion of a specificprimitive will affect the global shape the object, as il-lustrated in Figure 5. In this case, the user creates thehandle of the cup by interactively adding a torus to anexisting bowl composed by a flattened ellipsoid and an-other torus. As depicted in Figure 5, when the userinteractively displaces the handle until its final posi-tion, the handle remains perfectly blended with the cup.If needed, the user might also interactively change the”thickness” of the handle just by changing the smallerradius of the torus.Let us now see how three more objects are obtainedfrom the composition of positive primitives.
Example 1 . The hammer shown in Figure 6(a) wasbuilt using two implicit primitives so that F = f . f − c ,where c = f definesthe first primitive (a block) and f the second primitive(an ellipsoidal handle) as follows: f = ( x − ) + (cid:16) y (cid:17) + z − f = (cid:16) x (cid:17) + y + z − . Example 2 . The sword pictured in Figure 6(b) is definedby F = f . f . f −
5, where f , f , and f define threeigure 1: Repositioning of two spheres of the surface F ( x , y , z ) = (( x − d ) + y + z − ) · (( x + d ) + y + z − ) − .
25: (a) d = .
8; (b) d = .
9; (c) d = . d = .
1. The positions of the surface primitives were adjusted, but the parameter r remained unchanged. The Π -surface appears in translucent gray. (a) (b) (c)Figure 2: “Eggplant” surface defined by the function F ( x , y , z ) = ( x + y + z − . ) · (( x + ) + y + z − ) − r = r : (a) 1.0; (b) 0.25; and (c) 0.05. The Π -surface appears in translucent gray. (a) (b)Figure 3: The parameter r is used to reduce an undesired bulge that occurs about the intersection of two crossed cylindersdefined by the function F ( x , y , z ) = ( x + z − ) · ( y + z − ) − r =
0: (a) r =
1; (b) r = . (a) (b) (c)Figure 4: Local deformations obtained by placing a small sphere near the x = ( f ( x , y , z ) = ( x + y + z − ) · ( x ) − =
0; (b) depression obtained by inverting the sign of the original plane as in f ( x , y , z ) =( x + y + z − ) · ( − x ) − =
0; and (c) concavity obtained by inverting the sign of the sphere as in f ( x , y , z ) = ( − x − y − z − . ) · ( x ) − = implicit primitives, two crossed ellipsoids and a sphere,as follows: f = ( x + ) + y + z − f = ( x + ) + (cid:16) y (cid:17) + z − f = (cid:16) x (cid:17) + (cid:16) y (cid:17) + ( z ) − . Example 3 . The table shown in Figure 6(c) is definedby F = f · f · f · f · f −
1, that is, by five implicit primitives, a rounded parallelepiped for the table topand four ellipsoids for the table legs, where f = . · x + . · y + ( z + ) − f , , , = (cid:18) x ± . (cid:19) + (cid:18) y ± . (cid:19) + (cid:16) z . (cid:17) − . . Subtractive shape composition means we interactivelyadd negative primitives to an existing Π -surface, asshown in Figure 7. Interestingly, the negative primi-tive used to create the concavity shrinks as it gets closea) (b) (c)Figure 5: Interactive edition of a moving handle (or torus) to create a cup as given by the function F ( x , y , z ) =((( x − . · a ) + ( z + ) + y + . − . ) − · (( x − . · a ) + ( z + ) )) · ( · x + · y + ( z + ) − . ) · ((( z + ) + · x + · y + ) − · ( x + y )) − Additive shape composition of Π -surface objects: (a) hammer; (b) sword; and (c) table. Figure 7: Interactive edition of a depression on a rounded cube surface by moving a small negative sphere. Theresulting object is defined by the following Π -surface: F ( x , y , z ) = ( x + y + z − ) · ( − ( x + a ) − ( y + b ) − ( z + c ) + . ) − .
01, where ( a , b , c ) is the position of the sphere.to the existing object, and even vanishes at some point.This is a very useful feature because it eliminates un-desired components in the final object; specifically, thenegative sphere in Figure 7 is used to interactively cre-ate a concavity in one of the faces of a 3D cube. Noticehow the sphere becomes smaller and smaller to a pointat which it finally vanishes in the proximity of the cube. The geometry evaluation (also known as boundary eval-uation [RV85]) builds upon ray casting to solve two dif-ficult problems in implicit surface modeling: • Rendering . We can immediately visualize the sur-face on screen with a significant realism and geome-try fidelity, including singularities like apices, inter-section curves, and the like, though without explic-itly solving such singularities (i.e. the loci where thefirst derivatives vanish), as well as multi-componentsurfaces (see, for example, [RG06]). • Triangulation . The point sampling inherent to raycasting allows us to reconstruct the surface becausewe classify the surface points as either regular orsingular using the gradient (i.e. first derivatives).Essentially, this problem consists in triangulating apoint cloud whose points are samples of the surface(see, for example, [BMR +
99, LHRS05, KBH06]).Note that the nearby points are associated with adja-cent pixels on the screen so that the triangulation ismore amenable to carry out than in standard surfacereconstruction algorithms lacking information likenormals or partial derivatives. Moreover, knowingthe partial derivatives at such points, we can quicklyidentify singularities like apices, sharp features, self-intersections, and so forth. Summing up, we usea novel image-based surface reconstruction, thoughwe also may use algorithms like those described bySkala et al. in [ ˇCS04, ˇCS05, ˇCS07]. Obviously, af-ter triangulating a surface, we no longer need raycasting for the purpose of the graphics output.hus, our renderer combines ray casting and triangula-tion approaches into a single renderer. Π -surfaces Molecular modelling is an important application for Π -surfaces. Knowing that each atom has a correspond-ing van der Waals (VDW) radius [Bon64][Bat01], amolecule can be seen as a set of overlapping spheresrepresenting the atoms. Π -surface Formulation The molecular surface S of a molecule can be then de-scribed by the following Π -surface: S = n ∏ i = f i − r (2)where f i = ( x − x i ) + ( y − y i ) + ( z − z i ) − R i (3)represents the spherical surface of the i -th atom of ra-dius R i and center ( x i , y i , z i ) . This formulation is incontrast with the Gaussian Σ -surface proposed by Blinn[Bli82] to represent molecular surfaces.It is worthy noting that for r >
0, Equation 2 representsa smooth molecular surface, so there is no need to useray casting to sample the surface. Instead, we can di-rectly triangulate the surface on-the-fly using triangula-tion algorithms as those described in [RG06, RQG09,DG11, DG15, DNJG17]. Π -surfaces Let us now see how to model the molecular structuresof two real drugs using Π -surfaces: (a) formic acid and(b) acetic acid . Formic acid . This drug occurs naturally and is presentin the venom of bees and ant stings. Using the atomicstructure obtained from the DrugBank and the VDWradii from [Bat01] (1.52 Å for oxygen and 1.70 Å forcarbon), the spheres have the following center pointsand radii: c = ( . , − . , . ) , R = . c = ( . , − . , . ) , R = . c = ( . , − . , . ) , R = . . Then, using Equation 2 (with r =
1) we obtain the Π -surface that represents the formic acid molecule as fol-lows: S = (( x − . ) + ( y + . ) + z − . ) · (( x − . ) + ( y + . ) + z − . ) · (( x − . ) + ( y + . ) + z − . ) − Formic acid: (a) ball-and-stick; (b) atom-describing spheres (VDW representation); and (c) molecular Π -surface. The formic acid Π -surface is shown in Figure 8 (c). Acetic acid . This drug results from the oxidation ofethanol and destructive distillation of wood. As seenin the previous example, the center points and radii ofits atoms are as follows: c = ( . , − . , . ) , R = . c = ( . , − . , . ) , R = . c = ( . , − . , . ) , R = . c = ( . , − . , . ) , R = . r = acetic acid moleculeas follows: S = (( x − . ) + ( y + . ) + z − . ) · (( x − . ) + ( y + . ) + z − . ) · (( x − . ) + ( y + . ) + z − . ) · (( x − . ) + ( y + . ) + z − . ) − acetic acid Π -surface is depicted in Figure 9 (c).(a) (b) (c)Figure 9: Acetic acid: (a) ball-and-stick; (b) atom-describingspheres (VDW representation); and (c) molecular Π -surface. The
Molecular Π -surface formulation can also be used,for the sake of simplification, to model the four nu-cleotides (adenine, cytosine, guanine and thymine) usedas DNA building blocks in [RG12, RG14, RG15], re-placing the Gaussian Σ -surface model. CONCLUSIONS AND FUTUREWORK
This paper presents a new general method to modelcomplex 3D objects as the product of algebraic func-tions representing simpler implicit surface primitives.The resulting surfaces are here called Π -surfaces. Un-like traditional methods used in implicit modeling, thisnew method is not based on a sum of specific distancefunctions. Instead, the 3D objects are built upon a prod-uct of algebraic functions representing arbitrary im-plicit surfaces such as spheres, ellipsoids, and tori. Thisnew approach allows us to interactively perform con-trolled deformations on the object shape both locallyand globally. Two possible applications are proposedfor this new model: constructive building of 3D objects and molecular surfaces modeling . As future work, andknowing that an increase in the number of primitivesmight generate higher degree algebraic surfaces, it isour intention to develop some strategies to overcomepossible limitations that may occur in these cases. Asa final remark, we believe that this new method is animportant contribution for the geometric modeling re-search field. This research has been partially supported by thePortuguese Research Council (Fundação para aCiência e Tecnologia), under the FCT ProjectUID/EEA/50008/2019. We are also grateful toreviewers for their suggestions to improve this paper. [Baj88] Chandrajit L. Bajaj. Geometric modelingwith algebraic surfaces. In
Proceedingsof the 3rd IMA Conference on the Mathe-matics of Surfaces, Keble College, Oxford,September 19-21, 1988 , pages 3–48, 1988.[Bat01] S.S. Batsanov. Van der Waals radii of el-ements.
Inorganic Materials , 37(9):871–885, 2001.[Bed92] Sanjeev Bedi. Surface design using func-tional blending.
Computer-Aided Design ,24:505–511, 09 1992.[BGA04] Aurélien Barbier, Eric Galin, and SamirAkkouche. Complex skeletal implicit sur-faces with levels of detail.
Journal ofWSCG , 12(1-3), 2004.[Bli82] James F. Blinn. A generalization of al-gebraic surface drawing. In
SIGGRAPH’82: Proceedings of the 9th Annual Con-ference on Computer Graphics and Inter-active Techniques , page 273, New York,NY, USA, 1982. ACM. [BMR +
99] F. Bernardini, J. Mittleman, H. Rushmeier,C. Silva, and G. Taubin. The ball-pivotingalgorithm for surface reconstruction.
IEEETransactions on Visualization and Com-puter Graphics , 5(4):349–359, 1999.[Bon64] A. Bondi. Van der Waals Volumes andRadii.
J Phys Chem , 68(3):441–451, 1964.[BX97] Chandrajit L. Bajaj and Guoliang Xu.Spline approximations of real algebraicsurfaces.
Journal of Symbolic Computa-tion , 23(2-3):315–333, 1997.[CCD00] F.L. Chen, C.S. Chen, and J.S. Deng.Blending pipe surfaces with piecewise al-gebraic surfaces.
Chinese Journal of Com-puters , 23(9):911–916, 2000.[ ˇCS04] Martin ˇCermák and Václav Skala. Curva-ture dependent polygonization by the edgespinning. In Antonio Laganá, Marina L.Gavrilova, Vipin Kumar, Youngsong Mun,C. J. Kenneth Tan, and Osvaldo Gervasi,editors,
Computational Science and Its Ap-plications – ICCSA 2004 , pages 325–334,Berlin, Heidelberg, 2004. Springer BerlinHeidelberg.[ ˇCS05] Martin ˇCermák and Vaclav Skala. Polygo-nization of implicit surfaces with sharpfeatures by edge-spinning.
The VisualComputer , 21:252–264, 05 2005.[ ˇCS07] Martin ˇCermák and Vaclav Skala. Polygo-nisation of disjoint implicit surfaces by theadaptive edge spinning algorithm of im-plicit objects.
Int. J. Comput. Sci. Eng. ,3(1):45–52, July 2007.[DG11] Sérgio E.D. Dias and Abel J.P. Gomes.Graphics processing unit-based triangula-tions of blinn molecular surfaces.
Con-currency and Computation: Practice andExperience , 23(17):2280–2291, 2011.[DG15] Sérgio E.D. Dias and Abel J.P. Gomes.Triangulating molecular surfaces over alan of gpu-enabled computers.
ParallelComputing , 42:35–47, February 2015.[DNJG17] Sérgio E.D. Dias, Quoc Trong Nguyen,Joaquim Jorge, and Abel J.P. Gomes.Multi-gpu-based detection of protein cav-ities using critical points.
Future Gen-eration Computer Systems , 67:430–440,February 2017.[Gom03] Abel Gomes. A concise b-rep data struc-ture for stratified subanalytic objects. In
Proceedings of the Eurographics/ACMSIGGRAPH Symposium on Geometry Pro-cessing (SGP’03), Aachen, Germany, June23-25, pages 83–93. Eurographics Associ-tion, 2003.[GRM99] Abel Gomes, Chris Reade, and AlanMiddleditch. A mathematical model forboundary representations of n-dimensionalgeometric objects. In
Proceedings of the5th Symposium on Solid Modeling and Ap-plications (SPM’99), Ann Arbor, Michi-gan, USA, June 8-11, pages 270–277.ACM Press, 1999.[GVJ +
09] Abel Gomes, Irina Voiculescu, JoaquimJorge, Brian Wyvill, and Callum Galbraith.
Implicit Curves and Surfaces: Mathe-matics, Data Structures and Algorithms .Springer Publishing Company, Inc., 1stedition, 2009.[HH85] C. Hoffmann and J. Hopcroft. Automaticsurface generations in computer aided de-sign.
The Visual Computer , 1(2):92–100,August 1985.[KBH06] Michael Kazhdan, Matthew Bolitho, andHugues Hoppe. Poisson surface recon-struction. In
Proceedings of the 4th Eu-rographics Symposium on Geometry Pro-cessing (SGP’06), Cagliari, Sardinia, Italy,June 26-28, pages 61–70, Aire-la-Ville,Switzerland, Switzerland, 2006. Euro-graphics Association.[LHRS05] Florian Levet, Julien Hadim, PatrickReuter, and Christophe Schlick.Anisotropic sampling for differential pointrendering of implicit surfaces. In
WSCGThe 13th International Conference in Cen-tral Europe on Computer Graphics, Visu-alization and Computer Vision . UNIONAgency - Science Press, Plzen, Czech Re-public, 2005.[LPP06] S. Lazard, L. M. Peñaranda, and S. Petit-jean. Intersecting quadrics: an efficientand exact implementation.
ComputationalGeometry: Theory and Applications , 35(1-2):74–99, 2006.[Mur91] Shigeru Muraki. Volumetric shape de-scription of range data using “blobbymodel”.
SIGGRAPH Computer Graph-ics , 25(4):227–235, July 1991.[NHK +
85] Hiromitsu Nishimura, Masashi Hirai,Tsuyoshi Kawai, Tory Kawata, Isao Shi-rakawa, and Kengo Omura. Objectmodelling by distribution function and amethod of image generation.
Transactionsof the IEICE Japan , J68-D(4):718–725,1985.[PK89] Markus Pilz and Hussein Kamel. Creationand boundary evaluation of CSG-models.
Engineering with Computers , 5(2):105–118, 1989.[RG06] Adriano N. Raposo and Abel J.P. Gomes.Polygonization of multi-component non-manifold implicit surfaces through asymbolic-numerical continuation algo-rithm. In
Proceedings of the 4th Interna-tional Conference on Computer Graphicsand Interactive Techniques in Australa-sia and Southeast Asia (GRAPHITE’06),Kuala Lumpur, Malaysia, November 29 -December 02, pages 399–406, New York,NY, USA, 2006. ACM.[RG12] Adriano N. Raposo and Abel J. P. Gomes.3D molecular assembling of B-DNA se-quences using nucleotides as buildingblocks.
Graph. Models , 74(4):244–254,July 2012.[RG14] Adriano N. Raposo and Abel J.P. Gomes.Efficient deformation algorithm for plas-mid DNA simulations.
BMC Bioinformat-ics , 15:301, Sep 2014.[RG15] Adriano N. Raposo and Abel J. P. Gomes.isDNA: A tool for real-time visualizationof plasmid DNA monte-carlo simulationsin 3D. In
Bioinformatics and Biomedi-cal Engineering , pages 566–577. SpringerInternational Publishing, 2015.[RQG09] Adriano N. Raposo, J. Queiroz, andAbel J.P. Gomes. Triangulation of molec-ular surfaces using an isosurface contin-uation algorithm. In
Proceedings of the2009 International Conference on Com-putational Science and Its Applications ,ICCSA ’09, pages 145–153. IEEE Com-puter Society, 2009.[RV85] Aristides Requicha and Herbert Voelcker.Boolean operations in solid modeling:Boundary evaluation and merging algo-rithm.
Proceedings of the IEEE , 73(1):30–43, 1985.[War89] J. Warren. Blending algebraic surfaces.
ACM Transactions on Graphics , 8(4):263–278, 1989.[WMW86] Geoff Wyvill, Craig McPheeters, andBrian Wyvill. Data structure for soft ob-jects.
The Visual Computer , 2(4):227–234,Aug 1986.[WZ00] T. R. Wu and Y. S. Zhou. On blending ofseveral quadratic algebraic surfaces.