13
$\begingroup$

I'd like to create a plane mesh which is divided to arbitrary-form polygon regions, like gimp/Photoshop mosaic filter makes, or like Voronoi diagram (although the latter is not really arbitrary). So I want each piece of that mosaic plane to be a single face, and it also would be great to assign a (random) height to each face, making a stair-step terrain from the plane. What I've tried so far:

1) To generate a Voronoi diagram, paint each region in a grayscale value, and try to use it as a heightmap (import image as plane, then Displace with image texture). That was useless in terms of mosaic-faced plane fragmentation, of course, but I hoped that each diagram region will get its own height based on the color, so I'll get my stair-step terrain. That failed, it seems Displace doesn't work that way - it made a soft and smooth terrain, instead of sharp step-like breaks.

2) To take a mosaic picture as a texture, and use the Knife tool to draw the actual mosaic polygons over it. It works that way, but requires a lot of work by hand.

3) To open a Python console and try to make a Voronoi diagram right in Blender. Then I realized that what my code does is painting each pixel into corresponding region's color, so it doesn't create any edges or faces at all. Maybe there's some other algorithm (I don't actually need Voronoi diagram; anything that looks like about the same is ok) which will allow me to end up with a set of faces?

$\endgroup$
20
$\begingroup$

Modifiers:

This is possible with the displace modifier, and you can use a procedural texture for the voronoi diagram. This way you don't even need to paint in each part of the voronoi texture, because they will generated each slightly darker/lighter.

  1. Add a subsurf modifier to increase the mesh density.

  2. Add the displace modifier and add a new displace texture (click New on the texture input of the displace modifier). Set the Type of the texture to Voronoi and the Coloring to Position:

    enter image description here

  3. Add a Decimate modifier set to Planar to remove the unneeded geometry.

Result: (click for full size)

enter image description here

And here is an example blendfile.

You can sort of smooth out the edges with a Smooth modifier:

enter image description here

Cell fracture:

Expanding on Mike Pan's answer, here is a workflow using the Cell fracture addon. This addon is bundled with blender, but you still need to enable it in CtrlAltU> User Preferences > Addons:

enter image description here

Once it is enabled,

  1. Add a plane and subdivide it (Edit mode (Tab) > Select all (A) > W > Subdivide). The mesh density will affect the size of the resulting shards.

    enter image description here

  2. Select all and extrude down so it is now a manifold mesh:

    enter image description here

  3. With the cube selected in object mode, press Cell Fracture in 3D view > Tool shelf > Object tools > Cell fracture and set the Margin to 0. Changed settings are highlighted. Press OK when ready:

    enter image description here

  4. Delete the original cube, then select all the shards (making sure that one of them is active) and press CtrlJ to join them into one object:

    enter image description here

  5. Enter edit mode and remove double vertices by pressing A> Select all > W> Remove doubles. If needed increase the Merge Distance in the Tool Shelf > Redo menu:

    enter image description here

  6. Still with everything selected, run Delete> Limited Dissolve in order to further simplify the mesh (note that limited dissolve functions the same way as the Decimate modifier in planar mode):

    enter image description here

  7. Delete the excess geometry. The easest way to select it is by going into front orthographic view (Numpad 1, Numpad 5), the using Box select to only select the very top vertices:

    enter image description here

    You could also try going into top (Numpad 7) ortho view with solid shading enabled, then box selecting everything visible. This works, however you may need to deselect some vertices on the sides after doing this.

    The easiest way to do this is to enter front (Numpad 1) wire (Z) ortho view and deselect using box select. (B > MMB)

  8. Invert the selection (CtrlI) and delete the selected vertices (Delete> Vertices). This should result in a nice clean plane of ngons, like this:

    enter image description here

  9. Select all (A) and press AltE> Individual Faces:

    enter image description here

  10. Without changing the selection, set the Pivot Point to Individual Origins (Ctrl. (period), or set it in 3D view > Header) and scale (S) to taper the extrusions slightly:

    enter image description here

  11. Invert the selection (CtrlI) and hide those vertices (H), so you are left with this:

    enter image description here

  12. Switch to face select mode (CtrlTab> Face) and select random (* 3D view > Header > Select*):

    enter image description here

  13. Move the randomly selected faces on the Z axis (GA) arbitrarily, randomly select again, move again, etc.

    This process can be made slightly faster by running Select random from the Operator History (F3)

  14. Unhide the hidden geometry (AltH). This should result in something like this:

    enter image description here

$\endgroup$
  • $\begingroup$ That's great, thanks! An additional follower questing, though. That's my result. What I don't like here are those side ledges (your picture has them too), I'd rather prefer sides to be flat. If I use Decimate/Planar some faces are missing which is not good too; my final satisfying solution was using Decimate/Collapse, which kinda does the job. Thanks again for a detailed answer. $\endgroup$ – rocknrollnerd Jan 3 '14 at 0:29
  • $\begingroup$ @rocknrollnerd I think the only way to smooth the sides out is with more subdivisions and possibly a smooth modifier. The missing faces are strange, that doesn't happen over here. It could be a bug, what version of blender are you using? $\endgroup$ – gandalf3 Jan 3 '14 at 0:50
  • $\begingroup$ That's v2.66.1. I also notice that the number of missing faces grows when I increase Angle Limit value. $\endgroup$ – rocknrollnerd Jan 3 '14 at 8:30
  • $\begingroup$ @rocknrollnerd Hmm.. Does it still happen in 2.69? $\endgroup$ – gandalf3 Jan 3 '14 at 20:44
  • 1
    $\begingroup$ @gandalf3 Follow with Pivot Point: Individual Origins; Scale Z zero. It's a couple more keystrokes than before but still probably less than random, and guarantees (1) a uniform distribution, and (2) that all faces will be edited. (That's a weird effect, though.) $\endgroup$ – wchargin Jan 4 '14 at 17:11
7
$\begingroup$

If you just want a static geometry and have no plans for animation on the plane, Use the Cell Fracture add-on as a basis to generate the shape.

Generate a plane: enter image description here

After applying the cell fracture add-on: enter image description here

After 'randomize Transform' to raise the individual objects: enter image description here

The geometry you generate should be a lot less complex and cleaner than the subdiv method.

$\endgroup$
  • 1
    $\begingroup$ +1 Good idea with the cell fracture :) You could also try joining and merging the shards, then extruding individual faces. $\endgroup$ – gandalf3 Jan 3 '14 at 2:12
  • $\begingroup$ That answer is actually closer to the original question, because it's closer to the got one-piece-one-face geometry picture. Thanks for the idea. By the way, how do I merge shards side-by-side? $\endgroup$ – rocknrollnerd Jan 3 '14 at 8:59
  • $\begingroup$ Select all the shards, and then Join them with Ctrl+J $\endgroup$ – Mike Pan Jan 3 '14 at 19:07
1
$\begingroup$

Number one will still work, you just have to change (disable) the interpolation that Blender does with your image texture.

This post is relevant to your interests. The accepted answer says

In the texture's Image Sampling panel, make sure Interpolation is enabled, and increase the filter size (values between [1.5 ... 2.0] give quite smooth result, 3.0 and above are smooth but you loose definition).

...but you actually want the exact opposite: NON-smooth, UN-interpolated textures, so make sure it's disabled.

Good luck!

$\endgroup$

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.