By default, a cylinder along the x axis will be created.
sidesnumber — number of cylinder sides (10)
radiusnumber — radius of cylinder (1)
normalsflat | curve — flat normals will make
shading (from light source) across a face cone constant.
curve will gradiate the shading. Use curve to make a surface look more
round with fewer number of sides. (flat)
lineTypeParsableLine — line that can position and
orient the cylinder. First point of line is cylinder base center, and second
point is the top center.
lengthnumber — length of the cylinder if line isn't
defined (1)
endsboolean | 1 | 2 — true fills both ends of the cylinder.
false does not fill ends. 1 fills only the first end. 2 fills only the
the second end. (true)
rotationnumber — rotation of base - this is only noticable for
small numbers of sides (0)
points of cube
// Use curve normals to give rounder looks for same number of sides figure.add({ make:'cylinder', radius:0.2, length:0.5, sides:20, normals:'curve', color: [1, 0, 0, 1], });
Cylinder shape options object that extends OBJ_Generic3All and OBJ_FigurePrimitive
By default, a cylinder along the x axis will be created.
sidesnumber— number of cylinder sides (10)radiusnumber— radius of cylinder (1)normalsflat|curve—flatnormals will make shading (from light source) across a face cone constant.curvewill gradiate the shading. Usecurveto make a surface look more round with fewer number of sides. (flat)lineTypeParsableLine — line that can position and orient the cylinder. First point of line is cylinder base center, and second point is the top center.lengthnumber— length of the cylinder iflineisn't defined (1)endsboolean|1|2—truefills both ends of the cylinder.falsedoes not fill ends.1fills only the first end.2fills only the the second end. (true)rotationnumber— rotation of base - this is only noticable for small numbers of sides (0) points of cubeSee
To test examples, append them to the boilerplate
Example
Example
Example
Example