This post is in reference to the previous question here.

How could I adapt the solution given to have the following constraints: fixed radius, fixed length, number of cylinders, and within a specified domain. Issues might arise when too many cylinders are specified for a small volume.

  • $\begingroup$ Welcome to Mathematica.SE! 1) As you receive help, try to give it too, by answering questions in your area of expertise. 2) Take the tour and check the faqs! 3) When you see good questions and answers, vote them up by clicking the gray triangles, because the credibility of the system is based on the reputation gained by users sharing their knowledge. Also, please remember to accept the answer, if any, that solves your problem, by clicking the checkmark sign! $\endgroup$
    – user9660
    Dec 2, 2015 at 19:20
  • 1
    $\begingroup$ Your question is really too broad. You should describe what you tried and where you are specifically having a problem. $\endgroup$
    – george2079
    Dec 2, 2015 at 19:28

1 Answer 1


Data for the array cylinder can be modified by

cylinder = Map[(s = Plus @@ (First@#)/2; d = 50 Subtract @@ (First@#)/
    Norm[Subtract @@ (First@#)]; {{s + d, s - d}, Last@#}) &, cylinders];

after which the procedure in the referenced question yields

enter image description here


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.