deviation_in_mm = 0.03
sel = FreeCADGui.Selection.getSelectionEx()
sel = [s.Object for s in sel]
for o in sel:
bb = o.Shape.BoundBox
devn = deviation_in_mm/((bb.XLength+bb.YLength+bb.ZLength)/3)*100
o.ViewObject.Deviation = devn
o.ViewObject.hide()
o.ViewObject.show()
Use:
1. select object to export, and run the macro
2. File->Export, stl format,... as usual.
I tried the brep file option and it made a file 3 x larger, even when compressed it was larger than the native freecad file. I do not have access to drop box. I am not doing very well!
Thanks for the macro DeepSOIC. I ran this as you suggested and I am still getting the same coarse looking stl file, see picture attached.
I selected the pocket object a the bottom of the tree and ran the macro and exported as stl.
DeltaFoxtrot wrote:I tried the brep file option and it made a file 3 x larger, even when compressed it was larger than the native freecad file.
FreeCAD project file is a zip containing the brep files for every shape in your project plus insignificant in size but important information about all parametric relations and properties. So what you just said doesn't make any sense to me.
Since nothing helps, I'm afraid that's the actual shape generated by thickness. And no amount of asking for finer mesh will help. The file size is actually a clue to that. Getting rid of thickness operation might be an only way of fixing the problem.
I had another go at saving in .brep format and this time the file was only a little larger than the FreeCad format so I zipped it and it has compressed enough to upload it.
Thanks for you help with this so far and if you can make any sense of the brep file that would be great.
So I can almost confirm my suspect on thickness operation.
Geometry check doesn't complete, and finds edges that are internally segmented (C0 means a b-spline curve with zero degree continuity, i.e. non-tangent joints between segments). Internal surface edges are smooth, but external are bad.
Consider any way of avoiding use of offset/thickness. They are known to be buggy and poor, sorry.
One way might be to attempt to use spiral vase printing mode (for that, you need a solid; slicer will "take care of applying thickness"). Other way might be to try creating another loft spaced right distance off the original, and subtracting the two lofts (at least, that's how I do it most of the times).
I went back to my sketches and re-lofted my cowl. I ran DeepSOIC's macro and exported the mesh and it looks pretty good. So it appears that something goes wrong when I thickness the solid to get my hollow cowl.
The wrinkles come back when I thickness the solid. I wonder is there are any settings I need to use to improve this or if there is a better way to do this? Perhaps if I make a copy of the solid and scale it then subtract it from the original ?