Abstract:
The present invention smooths piece-wise linear shapes by defining neighborhoods of vertices around vertices of the shape. One or more vectors is defined between the vertex and each of its neighbors. Vector sums are alternately multiplied by one of two scale factors. The scale factors are opposite in sign with the negative scale factor of larger magnitude. The vertices of the shape are displaced by the multiplied vector sums to attain new positions. The process is repeated with the vertices moving back and forth approximately through their final position until the shape is smoothed without shrinkage.

Description:
FIELD OF THE INVENTION 
     This invention relates to a system and method for smoothing a curve or a surface without reducing the curve length or the surface area. More specifically, the invention relates to the field of smoothing curves or surfaces in computer graphics and image processing. 
     BACKGROUND OF THE INVENTION 
     For our purposes, curves and surfaces will be referred to as shapes, and polygonal curves and polyhedral surfaces will be referred to as piece-wise linear shapes, respectively. 
     In many applications, particularly in visualization of scientific data, and as intermediate steps within a number of other procedures, polygonal curve approximations of two and three dimensional curves, and polyhedral surface approximations of surfaces, are routinely determined. An inherent problem of these piece-wise linear approximation methods is that the resulting piece-wise linear shapes appear faceted. To reduce the apparent faceting, smoothing methods are used. 
     Smoothing methods are also used in the Computer Graphics and Geometric Modeling literature within the context of curve and surface design. Subdivision surfaces are designed as limits of sequences of polyhedral surfaces. Starting with an initial skeleton polyhedral surface, the next polyhedral surface in the sequence is obtained by subdividing all the faces of the current surface, and then applying a polyhedral surface smoothing step to the subdivided surface. The main problem with most of these surface design methods is that the limiting surface is significantly smaller in size than the initial skeleton surface. Subdivision curves are defined likewise and suffer the same problems. 
     Boundary-following and iso-surface construction algorithms are prior art examples of algorithms that produce these piece-wise linear approximations. In general, algorithms to compute piece-wise linear approximations of smooth curves and surfaces differ depending on how the original curve or surface is described. Among the most common descriptions, curves and surfaces can be described analytically by parametric or implicit equations. 
     The prior art recognizes that implicit curves and surfaces (i.e., those defined by implicit equations) are particularly difficult to approximate. Points of implicit curves and surfaces are determined by solving systems of equations. Alternatively, points of parametric curves are more easily obtained by substituting values for one parametric variable (parametric surfaces are defined by two variables) in a set of parametric equations. 
     Implicit and parametric curves and surfaces are defined by functions. Functions can be expressed as analytic formulas or as tables of values. When the functions are defined by tables of values, it may be necessary to determine intermediate values by interpolation. Boundary or contour following algorithms produce typical examples of two-dimensional parametric curves or surfaces that are defined by tables of values. These are curves extracted from digital images as the boundary curves of image regions. The table of values is constructed as the sequence of coordinates of the boundary vertices of the pixels visited while following the boundary of the region, which constitute a polygonal approximation of an underlying smooth curve. The state of the art in contour following algorithms was disclosed in the prior art by the year 1973. 
     An iso-surface construction algorithm computes a piece-wise linear approximation of an implicit surface from the table of values that the defining function attain on a regular three dimensional grid. The so-called marching cubes algorithm is one of the most widely known iso-surface construction algorithms, but there exists in the prior art a large family of closely related algorithms, which differ essentially in how they tessellate the volume defined by the grid of function values, and on how they interpolate function values between existing table values. 
     The main problem with almost all of these approximation algorithms is that, even though the underlying curve or surface is smooth, the resulting piece-wise linear shape appears faceted. This is so because, due to the discretization or interpolation processes, the location of points on the underlying curve or surface cannot be determined with high precision. FIG. 1 is a prior art example of piece-wise linear approximations of smooth curves and surfaces showing the faceting problem. A smooth curve approximation algorithm produces a faceted piece-wise linear approximation 120 of a smooth curve 110. A smooth surface approximation algorithm produces a faceted piece-wise linear approximation 140 of a smooth curve 130. 
     The prior art provides essentially two approaches to solve the smoothing problem regarding surfaces--visual smoothing and geometric smoothing. Visual smoothing uses variations of illumination to make piece-wise linear surfaces appear smooth without changing the surface. (This technique does not exist for curves.) Geometric smoothing modifies the geometry of the curve or surface to perform actual smoothing. 
     In visual smoothing, different illumination models and face shading algorithms can be used to produce a visually smoothing effect. Among these algorithms there are those that define the surface normal at a vertex of the polyhedral surface as a weighted average of the surface normals of the incident faces, and use these computed surface normals at the vertices to produce a smooth shading of the surface using the so-called Phong shading method, also known as normal-vector interpolation shading. Using these methods, the surface geometry is not modified, but just rendered in such a way that it looks smooth. 
     Visual smoothing methods are of no use when the surface approximation is determined with some other purpose in mind, such as for example, to locate points of high curvature or other geometric invariant features on the curve or surface for identification or registration applications, to measure curve length, surface area, area enclosed by a closed curve, or volume enclosed by a closed surface. In these cases the geometry of the polyhedral surface must be modified to achieve accurate results in the computations performed afterwards. 
     Most prior art geometric smoothing methods suffer from a number of problems. Perhaps the most important one is the shrinkage problem: when applied iteratively a large number of times, a shape eventually converges to its centroid. FIG. 2A illustrates the problem of shrinkage that most prior art smoothing algorithms have in the case of curves, and FIGS. 2B illustrates the same problem in the case of surfaces. FIG. 2 is a prior art example of the shrinkage problem. A shrinking piece-wise linear curve smoothing algorithm produces a smoother but smaller piece-linear curve 220 when applied to a piece-linear curve 210. A shrinking piece-wise linear surface smoothing algorithm produces a smoother but smaller piece-linear surface 240 when applied to a piece-linear surface 230. 
     In geometric smoothing, smoothing polygonal curves is simpler than smoothing polyhedral surfaces because curves have an intrinsic linear ordering. For a closed curve, the fact that each vertex has exactly two neighbors in the intrinsic ordering, one preceding it and the other following it, allows for the application of Fourier analysis. The so-called Fourier descriptors--the use of the coefficients in a Fourier series expansion of the tangent-angle versus arc-length description of a curve--provide a multi-resolution representation of continuous curves. To smooth a curve it is sufficient to truncate its Fourier series. However, the result is no longer a polygonal curve, but a smooth parametric curve defined by analytic equations. To obtain a new polygonal curve, the new continuous curve, the truncated Fourier series of the original curve, is sampled at regular intervals. Fourier descriptors date back to the early 1960&#39;s, and have been widely used since then in the computer vision literature as multi-resolution shape descriptors for object recognition. In practice, this continuous process is approximated by computing the Discrete Fourier Transform of the sequence of vertex coordinates, setting the coefficients of the transform associated with high frequencies to zero, and back transforming the resulting sequence. 
     The method of Fourier descriptions for curve smoothing does not have the shrinkage problem, but it is well known in the prior art that truncating the Fourier series of a function introduces an unwanted high frequency perturbation. This problem is known in the prior art as the Gibbs phenomenon. There are two other important problems with this method for smoothing polyhedral curves. First, it is rather computationally expensive. Even using the Fast Fourier Transform algorithm, the number of arithmetic operations is of the order of n log(n), where n is the number of vertices. Linear algorithms, those which require in the order of n arithmetic operations, are more desirable, particularly for surfaces, where the number of vertices is large. The second problem with the method of fourier descriptions is that it does not extend to surfaces of arbitrary topological type, but just to surfaces that can be parameterized with vector functions of two variables defined on a rectangular region. And even in these cases, the results are dependent on the particular parameterization used. In the case of curves the intrinsic order determines a canonical parameterization, the arc-length parameterization, but there is no such a thing in the case of surfaces. 
     Perhaps the most popular linear (the number of operations are proportional to the number faces, edges, or vertices of the piece-wise linear shape) technique of geometric smoothing parameterized curves is the so-called Gaussian filtering method. In the continuous case, Gaussian filtering is performed by convolving the vector function that parameterizes the curve with a Gaussian kernel. Gaussian filtering also extends to those surfaces that can be parameterized by functions of two variables defined on a rectangular domain, but not to surfaces of arbitrary topological type because there is not even a valid notion of convolution for general surfaces. Gaussian filtering is applied to images in this way, because images are modeled as graphs of functions of two variables. But it is well known though that Gaussian filtering has the difficulty that it produces shrinkage. Some heuristic solutions to this problem have been proposed, and more recently Oliensis presented a better analysis of the problem and an elegant solution. By looking at the filtered curve in the frequency domain, and because the Fourier transform of a convolution is the product of the Fourier transforms of the two factors, Oliensis showed that the shrinkage problem is a consequence on the fact that the Fourier transform of a Gaussian kernel, a Gaussian function itself, does not constitute a low-pass filter. Except for the zero frequency, all the frequencies are attenuated. Since an ideal low-pass filter has infinite support in the space domain, the problem is difficult to solve, but Oliensis proceeded to define a low-pass filter kernel that solves the problem. That is, convolution of a curve with this kernel produces smoothing without shrinkage. The main problem with this method is that it does not extend to surfaces of arbitrary topological type either, i.e., it only applies to surfaces where the neighborhood is defined by a rectangular grid. This is so mainly because of two reasons. First, although almost compact, the significant part of the support of the kernel must extend significantly far away from the current vertex to produce a significant smoothing effect. And second, based on the usual representation of a polyhedral surface as a list of vertices and a list of faces, it is very difficult to access vertices that are far away from a given vertex without building special purpose data structures. Furthermore, for a general surface the neighborhood structure changes from vertex to vertex, and so, a different kernel should be designed for each vertex, consuming a significant amount of storage. All of this is very impractical, both in terms of the number of arithmetic operations and in terms of the amount of storage required to encode all this information. 
     In the Computer Graphics and Geometric Modeling literature, surface smoothing is also called surface fairing, and is usually associated with patch technology. In this framework surface fairing is case as a smooth surface interpolation problem where each planar face of the initial polyhedral surface is replaced by a smooth parametric patch. Since algorithms in this group produce interpolating surfaces, they do not suffer from the shrinkage problem, but a significant amount of high curvature variation from the skeleton polyhedron might remain present in the resulting surfaces. That is, the problem of smoothing the skeleton polyhedral surface is not solved. In that sense, these methods are somehow like the visual smoothing methods described above. Furthermore, the resulting surfaces are no longer polyhedral, and so, cannot be compared with other geometric smoothing algorithms. More recently surface fairing has been formulated as a global nonlinear minimization problem on a polyhedral surface, with a number of degrees of freedom proportional to the number of vertices or faces of the surface. Some of these algorithms produce interpolating surfaces as well, but at the expense of a very high computational cost, and others do produce shrinkage. 
     The weighted averaging method is the simplest approximation of Gaussian smoothing for polygonal curves and polyhedral surfaces. In the weighted averaging method the new position of each vertex is computed as a weighted average of the current position of the vertex, and the current position of its first order neighbors, those vertices that share an edge (or face) with the current vertex. The weighted averaging method has a number of advantages with respect to the prior art discussed above, but still produces shrinkage. The first advantage is that it applies to polygonal curves and polyhedral surfaces of arbitrary topological type, not only those that can be parameterized by functions defined on a rectangular domain. The second advantage is that, since first order neighbors are defined implicitly in the list of edges or faces of the curve or surface, no storage is required to encode the neighborhood structures. The third advantage is that the number of operations is a linear function of the total number of vertices and faces. 
     OBJECTS OF THE INVENTION 
     In object of this invention is an improved system and method that has general application to smoothing all piece-wise linear curves or surfaces. 
     Another object of this invention is an improved system and method that has general application to smoothing piece-wise linear approximations of smooth curves or surfaces. 
     Another object of this invention is an improved system and method that smooths piece-wise linear curves (surfaces) without reducing the curve length (surface area). 
     Another object of this invention is an improved system and method that smooths piece-wise linear curves (surfaces) without reducing the curve length (surface area) in producing a computer image. 
     SUMMARY OF THE INVENTION 
     The present invention is a novel system and method for smoothing piece-wise linear curves (surfaces) by modifying the position of the vertices defining the shape. The invention produces a smoothing effect while preventing shrinkage, even when it is applied iteratively a large number of times. The invention applies to general and arbitrary polygonal curves, polyhedral surfaces, and more generally polytopes of arbitrary dimension. It produces a low-pass filter effect as a function of curvature. The invention achieves minimal computational cost, because the number of steps required is proportional to the number of vertices, edges, or faces of the curve or surface. It requires minimal storage for representing and encoding information about neighborhoods of vertices. 
     The present method begins by determining a set of vertices that define a piece-linear shape. Typically, these vertices define a piece-wise linear approximation of a curve (surface). Then for each given vertex defining the shape, a neighborhood of vertices near the vertex is selected. One or more first vectors is defined between the vertex and each of its neighbors. A first vector average is determined for each vertex by vector averaging the first vectors. A first vector displacement is then determined for each vertex by multiplying the first vector average by a first scale factor. Then a first position of each vertex is determined. The first position of the vertex is the position it attains if moved by the direction and magnitude of the first displacement vector. At this point, a second vector average is determined between each vertex and each of its neighbors by the same process. A second vector average is determined by vector averaging all the second vectors. A second vector displacement is then determined by multiplying the second vector average by a second scale factor. This second scale factor is opposite in sign than the first scale factor. The negative scale factor is also of greater magnitude than the positive scale factor. A second position of each vertex is then determined. The second position of the vertex is the position it attains if moved in the direction and magnitude of the second vector displacement. If the shape as defined by all the vertices in their second position is within certain smoothness criteria, the algorithm finishes. If not, the method is repeated starting with the step that determines the first vectors for each vertex. 
     The method can be run on a computer system to produce smooth images from the piece-wise linear curves and surfaces. In a preferred embodiment, the first (second) vector average is determined by weighting the first (second) vectors. In a more preferred embodiment, the weights are all positive and sum to the value 1. 
    
    
     BRIEF DESCRIPTION OF THE DRAWINGS 
     FIGS. 1, comprising FIG. 1A and FIG. 1B, is a prior art example of piece-wise linear approximations of smooth curves (FIG. 1A) and surfaces (FIG. 1B). 
     FIGS. 2, comprising FIG. 2A and FIG. 2B, is a prior art examples of the shrinkage problem for curves (FIG. 2A) and surfaces (FIG. 2B). 
     FIG. 3 is a block diagram of a typical computer system executing the present method. 
     FIG. 4 is a flow chart showing the steps of the present smoothing algorithm. 
     FIGS. 5, comprising FIG. 5A and FIG. 5B, is a diagram of a piece-wise linear curve (FIG. 5A), and of a piece-wise linear surface (FIG. 5B), showing their defining parts. 
     FIG. 6, comprising FIGS. 6A and 6B, is a diagram that shows a typical neighborhood (FIG. 6A), and a typical first order neighborhood (FIG. 6B) of a vertex of a piece-wise linear surface. 
     FIG. 7, comprising FIGS. 7A and 7B, is a diagram that shows the first vector average, the first vector displacement, the first position (FIG. 7A), the second vector average, the second vector displacement, and the second position of a vertex (FIG. 7B) of a piece-wise linear shape. 
     FIG. 8 is a vector diagram showing one preferred embodiment that weights neighbor vectors. 
     FIG. 9 is a diagram that shows a piece-wise linear shape not satisfying the smoothness criterion, and satisfying the smoothness criterion. 
     FIG. 10 is a flow chart showing the steps of the present smoothing algorithm in a preferred embodiment of the smoothness criterion. 
     FIG. 11, comprising FIGS. 11A and 11B is a diagram that showing the curvature low-pass filter transfer function and the curvature low-pass filter parameters of the smoothing core (FIG. 11A), and of the whole algorithm (FIG. 11B). 
     FIG. 12 is a flow chart showing the steps of the present smoothing algorithm in a more preferred embodiment of the smoothness criterion. 
     FIG. 13 is a diagram of a piece-wise linear shape generated on a computer graphical display by the present invention. 
    
    
     DETAILED DESCRIPTION OF THE INVENTION 
     FIG. 3 is a block diagram showing a computer system 300 on which a preferred embodiment of the present invention operates. The preferred embodiment includes one or more application programs 302. One type of application program 302 is a compiler 305 which includes an optimizer 306. The compiler 305 and optimizer 306 are configured to transform a source (like other application programs 302) program into optimized executable code. More generally, the source program is transformed to an optimized form and then into executable code. The compiler 305 and optimizer 306 operate on a computer platform 304 that includes a hardware unit 312. One application program 302 that runs on the system 300 is the present method 400. 
     The hardware unit 312 includes one or more central processing units (CPU) 316, a random access memory (RAM) 314, and an input/output interface 318. Micro-instruction code 310, for instance a reduced instruction set, may also be included on the platform 304. Various peripheral components may be connected to the computer platform 304 including a graphical interface or terminal 326, a data storage device 330, and a printing device 334. An operating system 308 coordinates the operation of the various components of the computer system 300. An example of computer system 300 like this is the IBM RISC System/6000 (RISC System/6000 is a trademark of the IBM Corporation.) It is readily understood that those skilled in the computer arts will be familiar with many equivalent computer systems 300. 
     FIG. 4 is a flow chart showing the steps of the smoothing algorithm 400 run by the computer system 300. 
     FIGS. 5A and 5B are diagrams of a piece-wise linear curve 510, and a piece-wise linear surface 540, respectively, showing their defining parts. In step 410 the set of vertices V={ν i  :i=1,2, . . . , n v  } of the input piece-wise linear shape 405 to be smoothed is determined. For a two-dimensional curve a vertex 520 is a two-dimensional vector ν i  =(x i , y i ), while for a surface (also for a three-dimensional curve), a vertex 550 is a three-dimensional vector ν i  =(x i , y i , z i ). The preferred means of representing a piece-wise linear curve 510 is as a pair of lists C={V,E}, the list of vertices V described above, and a list of edges E={e k  :k=1,2, . . . , n E  }, with each edge 530 e k  =(i 1   k , i 2   k ) being a pair of different indices of vertices (i is the index of vertex ν i ). The preferred means of representing a piece-wise linear surface 540 is as a pair of lists S={V,F}, the list of vertices V described above, and a list of faces F={ƒ k  :k=1,2, . . . , n F  }, with each face 560 ƒ k  =(i 1   k , . . . , i nfk   k ) being a sequence of non-repeated indices of vertices, and representing itself a closed three dimensional polygon, not necessarily flat. In some cases, the number of vertices n fk  varies from face to face, while in others all the faces have the same number of vertices. Triangulated surfaces are the most common, where all the faces are triangles ƒ k  =(i 1   k , i 2   k , i 3   k ). 
     In step 420 a neighborhood of vertices is determined for each vertex ν i  describing the input piece-wise linear shape 405. FIG. 6A is a diagram that shows a typical neighborhood of a vertex 610 of a piece-wise linear surface 605. The preferred means of representing the neighborhood of a vertex 610 ν i  is by a set i  of indices of vertices. If the index j belongs to the neighborhood i , we say that ν j  is a neighbor of ν i . In FIG. 6A, the neighbors of vertex 610 are the vertices 612,614,616,618,620,622, and 624. No vertex is allowed to be a neighbor of itself, but otherwise no further restrictions are imposed on the neighborhoods. In particular, it is permitted that a vertex ν j  be a neighbor of vertex ν i  without vertex ν i  being a neighbor of vertex ν j . A neighborhood structure is symmetric if the situation just described never happens, i.e., every time that a vertex ν j  is a neighbor of vertex ν i , also ν i   is a neighbor of ν j . It is allowed that the neighborhood i  of a vertex ν i  be the empty set. The neighborhood structure for the shape 405 is defined as the family of all the neighborhoods {i :i=1,2, . . . , n v  }. The preferred choice of neighborhood structure is the first order neighborhood structure, where for each pair of vertices ν i  and ν j  that share an edge (or face), we make ν j  a neighbor of ν i , and ν i  a neighbor of ν j . The first order neighborhood structure is symmetric. FIG. 6B is a diagram that shows the first order neighborhood of a vertex 630 of a piece-wise linear surface 625. In FIG. 6B, the first order neighbors of vertex 630 are the vertices 632, 634, 636,638, and 640, which share an edge 650 or face 660 with vertex 630. 
     In step 430 a first scale factor and a second scale factor of opposite signs are defined, with the magnitude of the negative scale factor greater than the magnitude of the positive scale factor. In a preferred embodiment the first scale factor λ is positive and the second scale factor μ is negative (i.e. 0&lt;λ&lt;-μ). For ease of explanation, this non-limiting embodiment will be carried through the remainder of the application. 
     The smoothing core 435 is composed of steps 440, 450, 460, 470, and 475. The smoothing core is executed a certain number of times until the smoothness criterion 480 is satisfied. In a preferred embodiment the scale factors are permitted to change from one iteration to the next of the smoothing core. In another preferred embodiment the scale factors are permitted to change from vertex to vertex of the piece-wise linear shape. In another preferred embodiment the scale factors change from one iteration to the next of the smoothing core and from vertex to vertex of the piece-wise linear shape. 
     In step 440 the first vector averages and the first vector displacements are determined for all the vertices of the piece-wise linear shape. FIG. 7A is a diagram that shows the first vector average 726 and the first vector displacement 728 of a vertex of a piece-wise linear shape 705 which has all its vertices in their current position. If the neighborhood i  of vertex ν i  is empty, the first vector average 726 Δν i  of vertex ν i  is set equal to the zero vector. Otherwise, the first vector average 726 Δν i  of vertex ν i  is determined as the average of the first vectors 712, 714, 716, 718, 720, 722, and 724 ν j  -ν i  that extend from the current position 710 of vertex ν i  to the current position of a neighbor vertex ν j . The first vector displacement 728 λΔν i  of vertex ν i  is determined by multiplying the first vector average 726 Δν i  by the first scale factor λ . 
     In this context, the vector average 726 is determined by dividing the vector sum of the first vectors (above) by the number of vectors in the neighborhood i . In an alternative embodiment, the vector average 726 is mere the vector sum. 
     In step 450 the first vertex positions are determined for all vertices of the piece-wise linear shape. FIG. 7A also shows the first vertex position 730 of vertex ν i . The first vertex position 730 ν&#39; i  =ν i  +λΔν i  of vertex ν i  is determined by moving the vertex from its current position 710 by the first displacement vector 728 λΔν i . If the neighborhood of the vertex is empty, the first vector displacement is zero and the first position of the vertex is equal to its current position. 
     In step 460 the second vector averages and the second vector displacements are determined for all the vertices of the piece-wise linear shape. FIG. 7B is a diagram that shows the second vector average 756 and the second vector displacement 758 of a vertex of a piece-wise linear shape 735. If the neighborhood i  of vertex 710 ν i  is empty, the first vector average 756 Δν i  is set equal to the zero vector. Otherwise, the second vector average 756 Δν&#39; i  of vertex ν i  is determined as the average of the second vectors 742, 744, 746, 748, 750, 752, and 754 ν&#39; i  -ν&#39; i  that extend from the first position 740 of vertex ν i  to the first position of a neighbor vertex ν j . The second vector displacement 758 μΔν&#39; i  of vertex ν i  is determined by multiplying the second vector average 756 Δν&#39; i  by the second scale factor μ. 
     As before, the vector average 756 is determined by dividing the vector sum of the second vectors (above) by the number of vectors in the neighborhood i . In an alternative embodiment, the vector average 756 is mere the vector sum. 
     Note that because the scale factors are of opposite signs, the first vector displacement 728 and the second vector displacement 758 are in approximate opposite directions. In this manner, the vertex (710, 740) moves forward and back through its final position and therefore the overall smoothed shape 735 does not shrink. 
     Further note that the present invention can be applied to N-dimensional objects or polytopes. This is done by defining the neighborhoods and the neighbor vertices/vectors in the N-dimensional space. 
     In step 470 the second vertex positions are determined for all vertices of the piece-wise linear shape. FIG. 7B also shows the second vertex position 760 of vertex ν i . The second vertex position 760 ν&#34; i  =ν&#39; i  +μΔν&#39; i  of vertex ν i  is determined by moving the vertex from its first position 740 by the second displacement vector 758 μΔν&#39; i . If the neighborhood of the vertex is empty, the second vector displacement is zero, and the second position is equal to its current position. 
     By assigning no neighbors to a vertex, the vertex position does not change throughout the smoothing algorithm 400. Vertices like this can be used as boundary conditions or as constraints in surface or curve smoothing. 
     In step 475 the current position of each vertex is established as its respective second position. 
     In step 480 the smoothness criterion is evaluated. If the smoothness criterion is not satisfied, the algorithm loops back to the beginning of the smoothing core 435. Otherwise, the algorithm terminates in step 490 outputting the resulting smoothed shape. 
     FIG. 9 is a diagram that shows a piece-wise linear shape 960 not satisfying the smoothness criterion, and satisfying the smoothness criterion 970. 
     In a preferred embodiment the first (second) vector average of a vertex ν i  is determined as the weighted average of the first (second) vectors ν j  -ν i  weighted by the respective neighbor weights w ij . This may or may not be divided by the sum of the weights. In a more preferred embodiment, the neighbor weights are all positive and for each vertex, the sum of all its neighbor weights is equal to the value 1. FIG. 8 is a diagram that shows a neighborhood of a vertex 810 ν i  where the first vectors 832, 834, 836, 838, 840, 842, and 844 are determined by weighting the vectors 812, 814, 816, 818, 820, 822, and 824, respectively. In alternative embodiments, the weights can change from iteration to iteration of the smoothing core 435. 
     In a preferred embodiment, the smoothness criterion 480 is met when the smoothing core 435 has been executed a certain number of times N. FIG. 10 shows the flow chart of FIG. 4 modified to incorporate this preferred smoothness criterion. (Note that reference numerals for steps that have identical functions are the same as in FIG. 4.) The number of iterations 1010 N of the smoothing core are determined before executing the smoothing core for the first time. The algorithm finishes when the number of iterations reaches the value N 1020. 
     In a more preferred embodiment, the first scale factor λ, the second scale factor μ, (see 430) and the number of iterations N are computed as functions of the low-pass filter parameters. FIG. 11B is a diagram that shows the low-pass filter transfer function 1050, and the low-pass filter parameters. The low-pass filter parameters are the pass-band curvature 1060 κ PB , the pass-band ripple 1070 κ PB , the stop-band curvature 1080 κ SB , and the stop-band ripple 1090 κ SB . The low-pass filter parameters must satisfy the constraints [100], [110], and [120]. 
     
         0&lt;κ.sub.PB &lt;κ.sub.SB                           [ 100] 
    
     
         0&lt;δ.sub.PB                                           [ 110] 
    
     
         0&lt;δ.sub.SB.                                          [120] 
    
     FIG. 12 shows the flow chart of FIG. 10 modified to incorporate this preferred smoothness criterion. Reference numerals for steps that have identical functions are the same as in FIGS. 4 and 10. In step 1110 the pass-band curvature and the pass-band ripple are defined. In step 1130 the stop-band curvature and the stop-band ripple are defined. In step 1150 the first scale factor, the second scale factor, and the number of iterations are computed as functions of the low-pass filter parameters. The first scale factor λ, the second scale factor μ, and the number of iterations N are computed from the low-pass filter parameters as a solution of the system of equations and inequalities [200], [210], [220], [230], [240], and [250]. ##EQU1## If this system admits more than one solution, the solution corresponding to the minimum value of N is chosen, to minimize the computation time. A detailed discussion of the derivation of these equations is given in the Appendix. 
     In a preferred embodiment, the invention can be used to generate images of piece-wise linear shapes. FIG. 13 is a diagram that shows an image 1320 of a piece-wise linear shape being displayed in a computer terminal 1310. 
     Is it understood that other embodiments are possible that incorporate the principles of the invention and that the above disclosure is merely illustrative of such principles and is not intended to be limiting in any respect. For example, applications of the invention include, but are not restricted to: smoothing piece-wise linear approximation of smooth curves and surfaces such as those produced by iso-surface construction algorithms, smoothing curves and surfaces as a preprocessing step within an object recognition system, smoothing surfaces of molecules within a drug design system, and smoothing curves and surfaces designed within a computer aided geometric design system. 
     APPENDIX 
     To determine the equations that relate the low-pass filter parameters and the first scale factor, the second scale factor, and the number of iterations of the smoothing core, it is necessary to find an analytic expression for the final positions of the vertices of the shape as a function of the initial positions of the corresponding vertices, and of the first scale factor, the second scale factor, and the number of iterations of the smoothing core. 
     For a two-dimensional shape, let X be the n v  ×2 matrix with i-th. row equal to the coordinates (x i  y i ) of current position of vertex ν i . For a three-dimensional shape, let X be the n v  ×3 matrix with i-th. row equal to the coordinates (x i , y i , z i ) of the current position of vertex ν i . Let X&#39; and X&#34; be matrices constructed in the same way, but with the coordinates of the first and second positions of the vertices, respectively. And let X N  be yet another matrix constructed in the same way, but with the coordinates of the current position of the vertices when the algorithm stops, after the smoothing core 435 is executed N times. 
     The relation between the matrices X and X&#39; can be described in matrix form as 
     
         X&#39;=(I-λK)X, 
    
     where λ is the first scale factor, K is the square n v  ×n v  matrix K=I-W, I is the n v  ×n v  identity matrix, and W is the square n v  ×n v  matrix with elements {w ij  :i,j=1,2, . . . , n v  } defined as follows. 
     For each index i=1,2, . . . , n v , and for each index j=1,2,. . . , n v , the element w ij  is equal to 0 if vertex ν j  is not a neighbor of vertex ν i , and Otherwise, if the neighborhood i.sup. of vertex ν i  has |i.sup. | elements, for each neighbor ν j  of vertex ν i , w ij  is equal to the inverse 1/|i.sup. | of the number of neighbors of ν i . 
     Similarly, the relation between the matrices X&#39; and X&#34; can be described in matrix form as 
     
         X&#39;=(I-μK)X, 
    
     where μ is the second scale factor, and K is the same matrix described above. 
     Since the matrices I-λK and I-μK commute with each other, the relation between the position of the vertices before and after the smoothing core 435 is executed N times can be described in matrix form as 
     
         X.sup.N =((I-μK)(I-λK)).sup.N X. 
    
     When the neighborhood structure is symmetric, the matrix K defined above has all real non-negative eigenvalues, and sets of left and right eigenvectors that form respective bases of n v  -dimensional space. Let 0≦κ 1  ≦κ 2  ≦. . . ≦κ nv  be the eigenvalues of the matrix K, and let ƒ(κ) be the polynomial of one variable κ defined by 
     
         ƒ(κ)=(1-λκ)(1-μκ). 
    
     Polynomials of one variable can be evaluated in square matrices. In particular the matrix ((I-μK)(I-λK)) N  can be written as the evaluation ƒ(K) N  of the polynomial ƒ(κ) N  in the matrix K. If u 1 , u 2 , . . . , u nv  is a set of linearly independent unit length right eigenvectors of the matrix K associated with the eigenvalues κ 1 , κ 2 , . . . , κ nv , respectively, then u 1 , u 2 , . . . , u nv  are also right eigenvectors of the matrix ƒ(κ) N , with associated eigenvalues ƒ(κ 1 ) N , . . . ,ƒ(κ nv ) N . Furthermore, since u 1 , u 2 , . . . , u nv  constitute a basis of n v  -dimensional space, each column vector x of the matrix X (the vectors of first, second, or third coordinates of the vertices of the piece-wise linear shape) can be written in a unique way as a linear combination of the basis vectors 
     
         x=ξ.sub.1 u.sub.1 +. . .+ξ.sub.nv u.sub.nv, 
    
     where ξ 1 , . . . , ξ nv  are constants, and so 
     
         ƒ(K).sup.N x=ƒ(θ.sub.1).sup.N ξ.sub.1 u.sub.1 +. . .+ƒ(κ.sub.n).sup.N ξ.sub.nv u.sub.nv. 
    
     FIG. 11A is a diagram that shows the graph of the polynomial ƒ(κ). FIG. 11B is a diagram that shows the transfer function 1050 of the low-pass filter. The transfer function 1050 shown in FIG. 11B is the graph of the function ƒ(κ) N . The graph 1015 of the polynomial ƒ(κ) is an inverted parabola with roots at 1025 κ=1/λ≦0 and 1030 κ=1/μ&lt;0. The value of the polynomial ƒ(κ) is positive for 1/μ&lt;κ&lt;1/λ, and negative for κ&lt;1/μ and κ&gt;1/λ. Furthermore, since for 1040 κ=0 we have 1045 ƒ(κ)=1, and since in the preferred embodiment μ+λ&lt;0, there is another value of κ, let us denote it 1042 κ PB , such that ƒ(κ PB )=1. The value of κ PB  is ##EQU2## 
     The graph 1050 of the function ƒ(κ) N  displays a typical low-pass filter shape in the region of interest, i.e., from 1065 κ=0 to 1085 κ=1/λ. The pass-band region extends from 1065 κ=0 to 1060 κ=κ PB . For values of κ in the pass-band region, ƒ(κ) N  stays almost unchanged above the value 1075 one. The transition region extends from 1060 κ=κ PB  to 1080 κ=κ SB . The stop-band region extends from 1080 κ=κ PB  to 1085 κ=1/λ. For values of κ in the stop-band region, ƒ(κ) N  converges to 0 as N grows. 
     Regarding the eigenvalues of the matrix K, if the magnitude of the number ƒ(κ i ) is significantly less than 1, i.e., when κ i  is greater than the stop-band curvature κ SB , then ƒ(κ i ) N  is very close to 0 for large N. And if the magnitude of ƒ(κ i ) is close 1, i.e., when κ i  is not greater than the pass-band curvature κ PB , then ƒ(κ i ) N  is also close to 1 for large N. 
     To determine the first scale factor λ, the second scale factor μ, and the number of iterations N as functions of the pass-band curvature κ PB , the pass-band ripple κ PB , the stop-band curvature κ SB , and the stop-band ripple δ, we first observe that, based the previous discussion, these parameters must satisfy the equalities and inequalities [100], [120], [200], [210], [220], and [230]. In equality [240] corresponds to the fact that the transfer function should not be greater than the pass-band ripple plus one 1+δ PB  in the pass-band region. This is so because the transfer function ƒ(κ) N  attains its maximum value ##EQU3## at the mean point 1067 of the pass-band region. Inequality [250] establishes the fact that the transfer function should not be greater than the stop-band ripple in the stop-band region. And this is so because the transfer function attains its maximum value in the stop-band region at the stop-band curvature.