10
$\begingroup$

I'm trying to find a way to achieve an extruded version of what the image below shows without having to manually scale every cylinder.

I tried particle systems (hair, both vertex and face modes), but I seem to be unable to reach a satisfying compromise between gaps and intersections. My cylinders, in an ideal world, should not intersect at all, and every cylinder must be touchng at least another one.

Here is my reference image: enter image description here

Any ideas?

Thanks in advance :)

$\endgroup$
  • $\begingroup$ One try would be rigid body, like blender.stackexchange.com/a/63839/1245. In this case you will want all the cylinders to be laying on their sides (if ref image is from side view) and not changing that while falling down. It will not provide you with no gaps at all (depending on physics setup though but it's better to have some space there). $\endgroup$ – Mr Zak Jun 3 '17 at 19:06
11
$\begingroup$

Here is a basic way you can fake it.

enter image description here

Create a new box mesh object that should be large enough to encompass a simulation covering an area big enough to produce the desired patterned area.

This Box would ideally be flat, narrow in one direction and large in two others (like say 10 x 10 x 0.2 units).

In the physics tab set it to Rigid Body, Passive and Shape two Mesh.

enter image description here

Then create a Cylinder mesh, rotate it in Object Mode 90º about the X axis so it lays flat. Set its physics properties to Rigid Body, Active and Shape to Cylinder. Make sure the physics bounds cylinder aligns properly to the mesh geometric shape.

enter image description here

Now add some constrains to it, so it won't rotate about an axis we don't care about. Add a new Limit Rotation constraint, then turn on the options Limit X and Limit Y only, and change the space to Local Space.

enter image description here

Clone-duplicate the cylinder around and place all copies in an array-like grid, along the top of the box, making sure they all fit completely inside the previously created box.

enter image description here

When seen from the top the cylinders should be tall enough to barely fit the box, and the box should be narrow enough so the cylinders are tight but not too close, which would cause problems with simulation precision.

enter image description here

To make cylinders have random size by selecting one of them, turn on Proportional Edit, switch the Fallow Type to Random, then scale one cylinder with S.

While scaling press Shift+Y to exclude scaling along the Y axis (so the cylinders all maintain the same height and still fit tightly in the box), and while editing scroll the mouse wheel to control the influence radius so it encompasses all cylinders. Make sure you hide or lock the box beforehand so it is not affected.

Adjust scaling as desired to create the amount of variation you see fit. Scale multiple times if necessary to achieve a larger range of sizes.

enter image description here

Now play the animation with Alt+A, to cache the physics simulation. You may also need to adjust the Rigid Body World properties in the Scene tab of the Properties Window, like increasing the Steps per Second and Solver Iterations.

enter image description here

Let it play for a while after falling, so the simulation settles down. The end result should be what you desire.

You can then optionally apply physics if you want static objects with actual position, or join them all into a single mesh. You may also remove one end of the cylinders so you get a "2D" flat pattern.

enter image description here

$\endgroup$
  • 1
    $\begingroup$ Duarte, I'm always impresed by how smart your solutions are. I'm thinking about an alternative answer right now. It may be hard after seeing yours though :) $\endgroup$ – Paul Gonet Jun 7 '17 at 0:03
  • $\begingroup$ @PaulGonet Thanks mate, glad you like it :) Took me a few tries with different techniques including particles. This is not at all my area though, but that's what I love about BSE, it forces us to try new things and learn outside our comfort zone. If you find any alternatives be sure to post them, and feel to poke me, I'm definitely interested in seeing what you cook up :) $\endgroup$ – Duarte Farrajota Ramos Jun 7 '17 at 0:12
  • 1
    $\begingroup$ ..it would be tempting to shake the box in X a little to see whether the cylinders settle any more.. annealing.. but I guess it might create as many gaps as it would fill.. $\endgroup$ – Robin Betts Dec 27 '18 at 7:45
  • 1
    $\begingroup$ That is impressive! $\endgroup$ – Rita Geraghty Apr 24 at 14:05

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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