6
$\begingroup$

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 that will correct my simple files for me, but I would prefer not to include that in my workflow if possible.

$\endgroup$
  • $\begingroup$ You would have had an easier time getting an answer on the blender Stack Exchange, but it is a good question for here too. $\endgroup$ – Trish Sep 13 '18 at 5:26
2
$\begingroup$

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.

| improve this answer | |
$\endgroup$
0
$\begingroup$

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.)

| improve this answer | |
$\endgroup$
  • $\begingroup$ 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. $\endgroup$ – James Newton Sep 7 '18 at 17:06
0
$\begingroup$

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

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

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 "cube"

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 Now, test: Export (ctrl+E) and import into blender.

Solidified in blender

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

| improve this answer | |
$\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.