The code is divided into three main applications:
The driver file polygon_test.m constructs rounding of regular n-gons. It is easily adaptable to other polygons, only vertex locations are needed. The resulting polygons are automatically plotted.
The main routines used are smthabv(h,k,n)
and smthpoly(v,h,k,m)
.
The file smthabv.m contains a function which returns 2n equispaced samples of the convolution of a compactly supported kernel ( 1-x^2 )^k on [-1,1] with the function abs(x).
The file smthpoly.m smooths a polygon with vertices
listed in the variable v
. The other parameters h,k,m
specify the
smoothness of the resulting smoothed vertices and the number of sample
points therein.
The driver file polyhedron_test.m constructs rounding of the Platonic solids (except the dodecahedron). It is easily adaptable to other polyhedrons, only vertex, edge, and face information is needed. A carcass of the resulting polyhedron is plotted automatically.
The main files used are polyframe.m, smthvrtx.m, and smthedge.m.
polyframe(V,E,F)
takes a polyhedron with vertices inV
, edges and faces described inE
andF
, respectively, and returns data structures describing the local geometry of vertices, edges, and faces. For example, for each vertex a list of the other vertices joined to the given vertex by an edge is computed, along with an outward unit vector at the vertex, and faces that define each edge. This facilitates the computations used to smooth the polyhedron.smthvrtx(i,V,E,Vout,Fout,he,ke,hv,kv,me,mv)
smooths the polyhedron near the vertexi
. As beforeV,E,Vout,Fout
are geometric and combinatorial information about the polyhedron andhe,ke,hv,kv,me,mv
are parameters that specify the smoothing of the edgeshe,ke
, verticeshv,kv
. The number of samples returned on the smoothed objects are set byme,mv
.smthedge(v0,v1,nv0,nv1,mv0,mv1,lmin0,lmin1,h,k,ne,nh)
is a subroutine that smooths the edges of polyhedra. This program assumes that the vertices have already been smoothed, and that the variableslmin0,lmin1
describe the size of the region along the edge modified in the vertex smoothing step.
There are several utility plotting rountines: