subdivision3d( x, ...) "subdivision3d"( x, depth = 1, normalize = FALSE, deform = TRUE, ... ) divide.mesh3d(mesh, vb = mesh$vb, ib = mesh$ib, it = mesh$it ) normalize.mesh3d(mesh) deform.mesh3d(mesh, vb = mesh$vb, ib = mesh$ib, it = mesh$it )
deform
is TRUE
subdivision3d
takes
a mesh object and replaces each triangle or quad with 4 new ones
by adding vertices half-way along the edges (and one in the
centre of a quad). The positions of the vertices are
deformed so that the resulting surface is smoother than the original. These operations are repeated depth
times.The other functions do the individual steps of the subdivision.
divide.mesh3d
adds the extra vertices. deform.mesh3d
does the smoothing by replacing each vertex with the average of each of its neighbours. normalize.mesh3d
normalizes the homogeneous coordinates, by setting the
4th coordinate to 1. (The 4th coordinate is used as a
weight in the deform step.)
r3d
mesh3d
open3d()
shade3d( subdivision3d( cube3d(), depth = 3 ), color = "red", alpha = 0.5 )
Run the code above in your browser using DataLab