<p>Blender imports all STL files as if they are a single object. If you have multiple meshes in the object that you want to be separated, you can press tab to enter edit mode, select the parts that need to be separated, then hit P and separate by selected.</p>

<p>If you want to print those pieces as one part you have to get rid of any internal faces. The easiest way to do that is to select an object and then use the boolean modifier in union mode. Once you have the object that you want to fuse selected and in place, apply the modifier, that should leave you with an object without internal faces.</p>

CC BY-SA 4.0
2018-09-12T23:19:42.560Z
2018-09-12T23:19:42.560Z
Michael
<p>Let's look at it...</p>

<p>It's something like this: a closed box with protrusions that have no inner surface. like this cobbled together thing.</p>

<p><a href="https://i.sstatic.net/PDnW4.png" rel="nofollow noreferrer"><img src="https://i.sstatic.net/PDnW4.png" alt="Box with pseudobox"></a></p>

<p>Let's just for fun export it as a .stl. yes, a single .stl file. And now open it in MeshMixer:</p>

<p><a href="https://i.sstatic.net/QcYO4.png" rel="nofollow noreferrer"><img src="https://i.sstatic.net/QcYO4.png" alt="MeshMixer view of the same model"></a></p>

<p>Looks not half bad, right? But a red box? What shall that mean? look at the blender model again: Oh right, the normals on those surfaces are backwards! <code>W</code> <code>F</code> in blender flips the normals, reexport the .stl, reload into MeshMixer!</p>

<p><a href="https://i.sstatic.net/7GQeP.png" rel="nofollow noreferrer"><img src="https://i.sstatic.net/7GQeP.png" alt="After flipping the normals in the top &quot;cube&quot;"></a></p>

<p>Now we are talking! Let's look how we can fix this... <code>Edit &gt; Make Solid</code> with a high <code>Solid Accuracy</code> with both a high <code>Solid Accuracy</code> and <code>Mesh Density</code> results in reasonable sharp corners and... DANG! One solid body, all neatly closed.</p>

<p><a href="https://i.sstatic.net/gWh6P.png" rel="nofollow noreferrer"><img src="https://i.sstatic.net/gWh6P.png" alt="After solidifying"></a>
Now, test: Export (<code>ctrl+E</code>) and import into blender.</p>

<p><a href="https://i.sstatic.net/ttjmx.png" rel="nofollow noreferrer"><img src="https://i.sstatic.net/ttjmx.png" alt="Solidified in blender"></a></p>

<p>Yet, we got a problem: this thing that had been 11 faces and 16 vertices became almost 1.2 million vertices and 2.4 million faces. This surely can be condensed some, but we just achieved a well printable merge of the objects.</p>

<p><a href="https://i.sstatic.net/jzxam.png" rel="nofollow noreferrer"><img src="https://i.sstatic.net/jzxam.png" alt="New mesh of the corner geometry"></a></p>

CC BY-SA 4.0
2018-09-13T12:24:44.243Z
2018-09-13T12:24:44.243Z
Trish
<p>I think there's an easier way to do this - <em>if</em> you're not committed to using Blender, and it sounds as if you're not.</p>

<p>Take a look at <a href="http://www.openscad.org/" rel="nofollow noreferrer">http://www.openscad.org/</a> (which should run anywhere that Blender does). It's very easy to write code to produce your desired shape (in this case it would be a union of cuboids) in OpenSCAD's description language, and then you can use OpenSCAD itself to render that to STL. (It's even possible to automate this from the command line.)</p>

CC BY-SA 4.0
2018-09-07T17:06:53.923Z
Thanks for the tip! I plan to test your idea in a while when I'm working on this project again, and let you know how it goes.
James Newton
CC BY-SA 4.0
2018-09-07T10:31:44.227Z
2018-09-07T10:31:44.227Z
Firedrake
<p>I want to print a object that looks like a flat board with a set of matchbox-like lumps on top of it.</p>

<p>I have written a script that outputs an STL file. To keep the script simple, it creates an object that includes non-manifold edges. To be precise, the board and the boxes are a single model, but each has 6 faces made from 2 triangles. The underside of each matchbox rests on the top of the larger flat board.</p>

<p>If I understand correctly, the top face of the board should be broken up into many smaller triangles to take into account the position of the matchboxes, but coding this by hand (although it might be an interesting Exercise For The Reader) would not be a good use of time. Well-written code that already does this is built into FOSS applications like Blender.</p>

<p>However, Blender cannot merge or fuse shapes that are part of the same object. My current understanding is that I will need to:</p>

<ol>
<li>Provide Blender with multiple objects</li>
<li>Select all the objects</li>
<li>Use Ctrl-J to merge them</li>
<li>Export the world in STL format</li>
</ol>

<p>Is this a valid approach?</p>

<p>If so, my key question is: how do I format the STL file so that Blender will recognize that it contains multiple separate objects?</p>

<p>(I have found references to STL files containing multiple objects, but I have seen nothing in any of the STL files that I have examined that tells me: here is the end of one object and the beginning of another.)</p>

<p>Or should I just be clunky and export two STL files — one for the board and one for all the matchboxes — and then import both into Blender?</p>

<hr>

<p>NOTE: I know that there are free services like <a href="https://service.netfabb.com/login.php" rel="noreferrer">Netfabb</a> that will correct my simple files for me, but I would prefer not to include that in my workflow if possible.</p>

CC BY-SA 4.0
2018-09-13T05:26:37.917Z
You would have had an easier time getting an answer on the blender Stack Exchange, but it is a good question for here too.
Trish
<stl><file-formats><blender>
Outputting an STL file that contains multiple objects for import into Blender
James Newton
# Outputting an STL file that contains multiple objects for import into Blender

(Asked by: username_0 on 2017-11-11)

I want to print a object that looks like a flat board with a set of matchbox-like lumps on top of it.

I have written a script that outputs an STL file. To keep the script simple, it creates an object that includes non-manifold edges. To be precise, the board and the boxes are a single model, but each has 6 faces made from 2 triangles. The underside of each matchbox rests on the top of the larger flat board.

If I understand correctly, the top face of the board should be broken up into many smaller triangles to take into account the position of the matchboxes, but coding this by hand (although it might be an interesting Exercise For The Reader) would not be a good use of time. Well-written code that already does this is built into FOSS applications like Blender.

However, Blender cannot merge or fuse shapes that are part of the same object. My current understanding is that I will need to:

1. Provide Blender with multiple objects
2. Select all the objects
3. Use Ctrl-J to merge them
4. Export the world in STL format

Is this a valid approach?

If so, my key question is: how do I format the STL file so that Blender will recognize that it contains multiple separate objects?

(I have found references to STL files containing multiple objects, but I have seen nothing in any of the STL files that I have examined that tells me: here is the end of one object and the beginning of another.)

Or should I just be clunky and export two STL files — one for the board and one for all the matchboxes — and then import both into Blender?

---

NOTE: I know that there are free services like [Netfabb](https://service.netfabb.com/login.php) that will correct my simple files for me, but I would prefer not to include that in my workflow if possible.

**Tags:** stl, file-formats, blender
> **Comments:**
> **username_1**: You would have had an easier time getting an answer on the blender Stack Exchange, but it is a good question for here too.  

---

## 3 answers

### Answer by username_2 on 2018-09-12. Score: 2

Blender imports all STL files as if they are a single object. If you have multiple meshes in the object that you want to be separated, you can press tab to enter edit mode, select the parts that need to be separated, then hit P and separate by selected.

If you want to print those pieces as one part you have to get rid of any internal faces. The easiest way to do that is to select an object and then use the boolean modifier in union mode. Once you have the object that you want to fuse selected and in place, apply the modifier, that should leave you with an object without internal faces.


---

### Answer by username_1 on 2018-09-13. Score: 0

Let's look at it...

It's something like this: a closed box with protrusions that have no inner surface. like this cobbled together thing.

[![Box with pseudobox](https://i.sstatic.net/PDnW4.png)](https://i.sstatic.net/PDnW4.png)

Let's just for fun export it as a .stl. yes, a single .stl file. And now open it in MeshMixer:

[![MeshMixer view of the same model](https://i.sstatic.net/QcYO4.png)](https://i.sstatic.net/QcYO4.png)

Looks not half bad, right? But a red box? What shall that mean? look at the blender model again: Oh right, the normals on those surfaces are backwards! `W` `F` in blender flips the normals, reexport the .stl, reload into MeshMixer!

[![After flipping the normals in the top ](https://i.sstatic.net/7GQeP.png)](https://i.sstatic.net/7GQeP.png)

Now we are talking! Let's look how we can fix this... `Edit > Make Solid` with a high `Solid Accuracy` with both a high `Solid Accuracy` and `Mesh Density` results in reasonable sharp corners and... DANG! One solid body, all neatly closed.

[![After solidifying](https://i.sstatic.net/gWh6P.png)](https://i.sstatic.net/gWh6P.png)
Now, test: Export (`ctrl+E`) and import into blender.

[![Solidified in blender](https://i.sstatic.net/ttjmx.png)](https://i.sstatic.net/ttjmx.png)

Yet, we got a problem: this thing that had been 11 faces and 16 vertices became almost 1.2 million vertices and 2.4 million faces. This surely can be condensed some, but we just achieved a well printable merge of the objects.

[![New mesh of the corner geometry](https://i.sstatic.net/jzxam.png)](https://i.sstatic.net/jzxam.png)


---

### Answer by username_3 on 2018-09-07. Score: 0

I think there's an easier way to do this - *if* you're not committed to using Blender, and it sounds as if you're not.

Take a look at <http://www.openscad.org/> (which should run anywhere that Blender does). It's very easy to write code to produce your desired shape (in this case it would be a union of cuboids) in OpenSCAD's description language, and then you can use OpenSCAD itself to render that to STL. (It's even possible to automate this from the command line.)

> **Comments:**
> **username_0**: Thanks for the tip! I plan to test your idea in a while when I'm working on this project again, and let you know how it goes.  

---

