
"mesh3d"
object forming a cylindrical tube around the curve.cylinder3d(center, radius = 1, twist = 0, e1 = NULL, e2 = NULL, e3 = NULL,
sides = 8, closed = 0, debug = FALSE)
closed > 0
, it represents the number of points of
overlap in the coordinates.TRUE
, display the local Frenet coordinates at each point."mesh3d"
object holding the cylinder.center
,
after using xyz.coords
to convert it to a list. The other arguments
radius
, twist
, e1
, e2
, and e3
are extended to the same
length.
The three optional arguments e1
, e2
, and e3
determine the local
coordinate system used to create the vertices at each point in center
. If missing, they
are computed by simple numerical approximations. e1
should be the tangent coordinate,
giving the direction of the curve at the point. The cross-section of the polygon will be orthogonal
to e1
. e2
defaults to an approximation to the normal or curvature vector; it is
used as the image of the y
axis of the polygon cross-section. e3
defaults
to an approximation to the binormal vector, to which the x
axis of the polygon maps. The
vectors are orthogonalized and normalized at each point.# A trefoil knot
open3d()
theta <- seq(0, 2*pi, len=25)
knot <- cylinder3d(cbind(sin(theta)+2*sin(2*theta), 2*sin(3*theta), cos(theta)-2*cos(2*theta)),
e1=cbind(cos(theta)+4*cos(2*theta), 6*cos(3*theta), sin(theta)+4*sin(2*theta)),
radius=0.8, closed=TRUE)
shade3d(addNormals(subdivision3d(knot, depth=2)), col="green")
Run the code above in your browser using DataLab