OpenSCAD, 2D offsets and 2-manifold warnings

I have been working on a design in OpenSCAD for a while and everything was fine. I then decided to take the 2D shape and use the “offset” feature with a negative delta value to make it smaller instead of trying to scale down the finished linear_extrude results from it. Now, I have warning about 2-manifold parts when I try to export the STL. Has anyone else had this issue? Somewhere along the line, I took a difference between two 2D shapes instead of taking the difference between the two 3D shapes. I do not know if that has anything to do with it either.

I have no idea how, but I managed to get the warnings to go away.

How are you getting OpenScad output into gcode? I’ve been using Meshcam, which mostly works but can do weird things sometimes.

Thanks, John S.

I export an STL file from OpenSCAD and use Cura to slice the STL file.

It’s probably specific to an aspect of your model, rather than general with using negative delta on offsets; negative delta on an offset is OK generally.

I checked a few things online and it looked like it sometimes happens when two objects have flat sides that touch each other. I would think it would just try to union them or something in that case. Although, having them separate does allow some structural control when designing 3D parts because the section where they touch would be a double wall (you would at least hope) when Cura or some other slicer deals with it.

It’s more subtle than that. Look into numeric precision and floating point math and you’ll find that apparently touching doesn’t necessarily mean touching. As an example, 3 * 1/3 doesn’t exactly equal 1 when you represent the intermediate values as native numbers. It’s not symbolic constructive geometry…

My solution is to explicitly overlap by just a little bit. This also solves z-fighting during F5 visualization.

In this particular case, I have most things defined in digits. There is one part that is defined as a for loop and a hull between two linear_extrude outputs of a scaled 2D shape with the size defined using sine and cosine and the 2D shape was defined as a hull of 3 circles. It would be helpful if OpenSCAD had a pop up window showing a transparent version of the object with the items mentioned in the 2 manifold warning highlighted. Maybe I should bug them for it or go look at their code and try to help them fix it.