hPatch = swplot.cylinder(rStart, rEnd, R)
hPatch = swplot.cylinder(rStart, rEnd, R, nPatch, close)
hPatch = swplot.cylinder(handle, ...)
hPatch = swplot.cylinder(rStart, rEnd, R) generates multiple cylinders
with a single triangular patch command. The cylinders are defined by
start and end positions and their radii.
hPatch = swplot.cylinder(rStart, rEnd, R, nPatch, close) creates
cylinders with number of patch faces per arrow.
Handle can be the handle of an axes object or a patch object. It either selects an axis to plot or a patch object (triangulated) to add vertices and faces.
Draw 100 random cylinders within the cube:
swplot.figure N = 100; swplot.cylinder(2*rand(3,N)-1,2*rand(3,N)-1,0.1,100,true) swplot.zoom(30)
- Handle of an axis or patch object. In case of patch object, the constructed faces will be added to the existing object instead of creating a new one.
- Coordinate of the starting point or multiple starting points in a matrix with dimensions .
- Coordinate of the end point or multiple end points in a matrix with dimensions .
- Radius of the arrow body, scalar.
- Number of points on the circle of the body, default value is stored in
swpref.getpref('npatch'). The final patch object will have number of faces and number of vertices.
truethe cylinder is closed at both ends. Default is