Thursday, November 1, 2018

Figuring out bad meshes in Cura and Blender

One of my recent quick projects was making a simple "D" with a cut for a magnet. I was using magnets from my first project on Thingiverse, so I started by appending the "white" portion of that Blender file.

The benefits of appending, means that I get the Blender object, without having been converted to an STL. This means if I do edge loops, Blender already knows how to play with it...and I can use my current Blender startup file, instead of the dated one I used two years ago.

I switched into edit mode after the append, selected all of the planes of the magnet-holding portion, and hid all of that. I then selected the rest and deleted it. Looking back, I should have just done Control-I, to invert the selection. Oh well...un-hid the ring of planes and made it a cylinder (select an edge with Alt-A, F to create a face, repeat it for the other end of the cylinder. Renamed it Magnet.

Back in Object mode, I added Text, Edit Mode to make it a D. Object mode, Object>Convert to>Mesh from Curve/Text. I went back into Edit mode to scale the interior of the D in, so it would be a thicker letter. Boolean>Solidify>Thicken 1mm...Apply, easy.

It should be a simple matter just to Boolean>Difference the magnet out of the D...and it was. Opened the STL in Cura, and it was ready to print. But there's a red bit. Huh. (I'm posting the fix above it, the broken original beneath.)


It probably would have printed, but it also means something is wrong in the design.

Running Blender 2.78 on OSX, I re-examine the cutout...it's a slightly different shade. It's an easy enough fix, reseting normals in Edit mode. Mesh>Normals>Recalculate Outside. But it doesn't explain why this was a problem!


Remember my first steps? I used the magnet sizing from the STOP sign...and the cylinder part inside-outside normals were flipped. When I made the magnet cutout, by using those cylinder sides, it used those same normals. You can see the Magnet object that is off-color. (When I was doing work, I hid objects and never saw the color difference.)



Be wary of Boolean cuts with bad normals!

[The solution is: fix the normals on the "bad" magnet, so the colors look correct. When you use boolean on the D to remove the magnet shape, it will have the correct normals.]