# Simplify mesh by cutting out inside parts

I have a mesh that I created with a particle emitter and it's just a bunch of cubes randomly rotated. Here's a picture:

What I want to do is simplify this mesh so only the exterior parts are left. Basically something like a binary operation of adding the two cubes together, except every single piece needs to be added together so it simplifies into one exterior mesh with nothing protruding inside. How can this be accomplished?

• You could separate each cube into a separate object (P> Loose Parts) and use boolean modifiers, however I don't think there is any easy way to set this up for so many objects. You might be able to script it, but I can't think of how the script would detect which cubes need to be boolean intersected with which cubes. You would need to somehow get the names of the cubes which are intersecting a given cube. – gandalf3 Dec 23 '13 at 20:54
• Maybe two random cubes each time, then doing that again with the result, over and over until all cubes are removed? – Keavon Dec 23 '13 at 20:58
• You can use the remesh modifier, however you will need a beefy machine. – gandalf3 Dec 23 '13 at 21:29
• Can you please post that as an answer? Using that modifier, I'm getting (awesome, but different) shapes like this. – Keavon Dec 23 '13 at 21:48
• Unfortunately, I'm not at a computer to try this out, but wouldn't the shrink-wrap modifier do what he is wanting? – Adam Masters Dec 25 '13 at 0:45

I don't think there is any easy way to do this. Here are a few ways, however they are quite resource intensive:

# Remesh modifier:

You can use the Remesh modifier to do this, however it will take a long time to compute and result in a very dense mesh.

Make sure you have Remove Disconnected Pieces disabled:

# Python:

Expanding on Matt's answer, you can make a script that will create boolean modifiers for every cube on every cube:

import bpy

# Make a group of your particle cubes and replace 'Group' with the name of your group:
particles = bpy.data.groups['Group'].objects

#iterate through every cube in the group:
for object in particles:
# Remove all existing modifiers:
object.modifiers.clear()
# For every object in the group,
for target in particles:
# Test if the object is the not the same as the object we are currently adding modifiers to:
if target.name != object.name:
mod = object.modifiers.new(name="test", type="BOOLEAN")
# Set the target object:
mod.object = target
# Set the operation mode to UNION:
mod.operation = 'UNION'


I tested it with 100 cubes and it took quite a long time.
Also note that every cube will be joined to every other cube, so there will be a lot of failed boolean operations caused by cubes that don't intersect trying to be joined.

I found a possible solution that involves 3 steps though it has its limits.

1. Create a cube big enough to cover the target object.
2. Add a boolean modifier to the cube, set it to intersect and choose the target.
3. Apply the modifier. Hide or delete the original mesh.

It doesn't work well in some cases when intersections are too complex. But works great to hollow a pile of overlapping objects.

The simplest tool would be a boolean modifier. It's not as daunting as it might seem to add it to all the cubes: add it to one, select the rest of them (making sure the one with the modifier is "active") and hit ctrll to bring up the linking menu, and pick "Modifiers" to make them all have the same modifiers as the active selection. The boolean union operation should at least attempt to remove interior faces.

That being said, I wouldn't be surprised if the boolean doesn't give very nice results. This is a fairly complex operation that you're trying to accomplish.

Frankly, if your goal is simplicity, then if these are all just 8-point rectangular prisms, the geometry is probably simpler this way. Trying to get rid of internal geometry will probably add complexity, rather than reduce it.

• Unless I'm missing something, you will still have to do this for every cube. – gandalf3 Dec 23 '13 at 21:07
• Okay, so I added the modifier to all the cubes, but what good does that do? I still need to get every modifier to target each other and then apply all of them. – Keavon Dec 23 '13 at 21:20
• Sorry, I forgot about the targeting part :-/ ...yeah, that's gonna be a doosie... Honestly, I think your best bet is just going to be joining them into one mesh, selecting all the vertices you can see (paint select with culling turned on), ctrl-l to select whole cubes, then invert your selection. This will give you any whole cubes that are completely invisible, which you can delete. Other than that, I think it's a simple as it can get...if simplicity is your goal, here. – Matt Dec 23 '13 at 21:56

Update: Sorry, this doesn't always work. It also yields strange results if there are spare faces :(

Hey I just came up with this and remembered I read this page before so here it is for future reference:

1. Join your objects into one. (CTRL+J)
2. Duplicate it (SHIFT+D) and press ESC, you don't wanna move it.
3. Add a boolean modifier to one of the twins, select Union and the other twin. Apply.
4. Use wireframe shading (Z) or go into edit mode and delete some faces to find out what object's lacking internal geometry. Discard the object that still has it.

Cheers,

Eneko

Just stuck with the same question and found the answer! It got me a day to try all the variants, that can be found on the internet.

I have a complex model, builded from different parts (human body in fact) with holes and non-manifold meshes (legs/hands/breast - are all separate meshes that intersects inside the chest mesh, some of them even not closed, etc).

And i want to get single mesh, strictly following only the outer surface of the body (viewed as the union of all parts). This was surprisingly hard.

What i tryed:

• remesh modifier. It just not working on poorly prepared meshes - modifier generate big holes around messed part of object, even with high octree levels.
• recreate mesh with shrinkwrap modifier. Tedious and error-prone way, almost the same as manual remesh.
• carve mesh from cube with boolean modifier/BoolTools. Not working as expected either - mostly because this tools are NOT eliminating inner parts of bool result (i think this is because meshes are messed and non closed in many ways). Carve solver gives better results, but it completely cuts off random parts of mesh (dont know why)

But there is one thing that finally worked well: