I'd like to draw a large number of 3D cylinders using Graphics3D
. My list specifying the cylinders has elements that look like the following:
{ {{{p1x1, p1y1, p1z1}, {p2x1, p2y1, p2z1}},r1}, {{{p1x2, p1y2, p1z2}, {p2x2, p2y2, p2z2}},r2}, {{{p1x3, p1y3, p1z3}, {p2x3, p2y3, p2z3}},r3}, ...}
Here, the first subelement, e.g. {{p1x1, p1y1, p1z1}, {p2x1, p2y1, p2z1}}
, specifies the coordinates for the two end-points of the cylinder, and the the second subelement, e.g. r1
or r2
, specifies the radius of the specific cylinder.
Is there a way to use mapping to draw all of these cylinders with a condensed line of code?