Coarse ellipse and circle defintion

Post here for help on using FreeCAD's graphical user interface (GUI).
Forum rules
and Helpful information
IMPORTANT: Please click here and read this first, before asking for help

Also, be nice to others! Read the FreeCAD code of conduct!
User avatar
DeepSOIC
Veteran
Posts: 7896
Joined: Fri Aug 29, 2014 12:45 am
Location: used to be Saint-Petersburg, Russia

Re: Coarse ellipse and circle defintion

Post by DeepSOIC »

Here's the macro, if interested:

Code: Select all

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.
DeltaFoxtrot
Posts: 21
Joined: Fri Jan 13, 2017 8:46 pm

Re: Coarse ellipse and circle defintion

Post by DeltaFoxtrot »

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!
mario52
Veteran
Posts: 4673
Joined: Wed May 16, 2012 2:13 pm

Re: Coarse ellipse and circle defintion

Post by mario52 »

hi
try share with https://www.petit-fichier.fr/ (100 mgo)

mario
Maybe you need a special feature, go into Macros_recipes and Code_snippets, Topological_data_scripting.
My macros on Gist.github here complete macros Wiki and forum.
DeltaFoxtrot
Posts: 21
Joined: Fri Jan 13, 2017 8:46 pm

Re: Coarse ellipse and circle defintion

Post by DeltaFoxtrot »

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.
Attachments
Capture2.JPG
Capture2.JPG (39.81 KiB) Viewed 1290 times
Capture.JPG
Capture.JPG (21.08 KiB) Viewed 1290 times
User avatar
DeepSOIC
Veteran
Posts: 7896
Joined: Fri Aug 29, 2014 12:45 am
Location: used to be Saint-Petersburg, Russia

Re: Coarse ellipse and circle defintion

Post by DeepSOIC »

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.
:shock: 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.
DeltaFoxtrot
Posts: 21
Joined: Fri Jan 13, 2017 8:46 pm

Re: Coarse ellipse and circle defintion

Post by DeltaFoxtrot »

DeepSOIC,

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.

cheers
DF
Attachments
Brep_Test.zip
(769.27 KiB) Downloaded 21 times
User avatar
DeepSOIC
Veteran
Posts: 7896
Joined: Fri Aug 29, 2014 12:45 am
Location: used to be Saint-Petersburg, Russia

Re: Coarse ellipse and circle defintion

Post by DeepSOIC »

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).
Attachments
c0.png
c0.png (442.35 KiB) Viewed 1283 times
DeltaFoxtrot
Posts: 21
Joined: Fri Jan 13, 2017 8:46 pm

Re: Coarse ellipse and circle defintion

Post by DeltaFoxtrot »

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.
Attachments
Capture.JPG
Capture.JPG (25.26 KiB) Viewed 1278 times
DeltaFoxtrot
Posts: 21
Joined: Fri Jan 13, 2017 8:46 pm

Re: Coarse ellipse and circle defintion

Post by DeltaFoxtrot »

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 ?
Attachments
Capture2.JPG
Capture2.JPG (26.04 KiB) Viewed 1274 times
DeltaFoxtrot
Posts: 21
Joined: Fri Jan 13, 2017 8:46 pm

Re: Coarse ellipse and circle defintion

Post by DeltaFoxtrot »

Sorry DeepSOIC, I missed your last post. Thanks for looking and I will have a go with your suggestions.

cheers
DF
Post Reply