How to make a 3D trapezoidal pile with cylinders?

jospercomp shared this question 6 months ago
Answered

How to make a 3D trapezoidal pile with cylinders and two sliders?

a slider with the number of cylinders in the first row

and a slider with the number of layers.

689653fb8bac19318ff8736250746a0e

Best Answer
photo

l1=Flatten(Sequence(Sequence((2r k - r j, (-h) / 2, r + sqrt(3) r (n - 1 - j)), k, 0, j), j, n - l, n - 1))

l2=Flatten(Sequence(Sequence((2r k - r j, h / 2, r + sqrt(3) r (n - 1 - j)), k, 0, j), j, n - l, n - 1))

Zip(Cylinder(P1, P2, 1), P1, l1, P2, l2)

Comments (6)

photo
1

l1=Flatten(Sequence(Sequence(Sequence((2r k - r j, (-h) / 2, r + 2 sqrt(2) / sqrt(3) r (n - 1 - j)), m, 0, l), k, 0, j), j, 0, n - 1))

l2=Flatten(Sequence(Sequence(Sequence((2r k - r j, h / 2, r + 2 sqrt(2) / sqrt(3) r (n - 1 - j)), m, 0, l), k, 0, j), j, 0, n - 1))

Zip(Cylinder(P1, P2, 1), P1, l1, P2, l2)

I would need to restrict the number of levels or layers.

photo
1

l1=Flatten(Sequence(Sequence((2r k - r j, (-h) / 2, r + 2sqrt(2) / sqrt(3) r (n - 1 - j)), k, 0, j), j, n - l, n - 1))

l2=Flatten(Sequence(Sequence((2r k - r j, h / 2, r + 2sqrt(2) / sqrt(3) r (n - 1 - j)), k, 0, j), j, n - l, n - 1))

photo
1

Your z-coordinate is off again, the cylinders overlap. Replace the "2sqrt(2) / sqrt(3)" by "sqrt(3)". (It's just based on the pythagorean theorem in a midpoint triangle.)

Also, in your "cylinder(P1, P2, 1)", you should probably use radius r instead of 1. Or if you want fixed radius r=1, then you can get rid of the r in your l1, l2.

photo
1

Thank you!!!/A55IchPVAExUAAAAAElFTkSuQmCC

photo
1

l1=Flatten(Sequence(Sequence((2r k - r j, (-h) / 2, r + sqrt(3) r (n - 1 - j)), k, 0, j), j, n - l, n - 1))

l2=Flatten(Sequence(Sequence((2r k - r j, h / 2, r + sqrt(3) r (n - 1 - j)), k, 0, j), j, n - l, n - 1))

Zip(Cylinder(P1, P2, 1), P1, l1, P2, l2)

photo
photo
2

así

Files: foro.ggb
© 2021 International GeoGebra Institute