Slice takes 15 minutes

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!
Post Reply
jfc941640
Posts: 9
Joined: Mon Oct 28, 2019 6:20 pm

Slice takes 15 minutes

Post by jfc941640 »

Hi all,
I start with freecad and I like it : python + 3D, the perfect combination !
Today, I try to slice Tux with the cross-sections tool from the PartWB, it works great on many slice (it takes 10 secondes) but when I try to slice it at z=4.740459585189811, operation takes 15 minutes !
At the end everything is ok but do you have an idea why it takes so much time ?
Or can I do something before to simplify this operation ?
File is available on https://www.dropbox.com/s/xnetwohddlirh ... FCStd?dl=0
Thanks for your help !

OS: Windows 10
Word size of OS: 64-bit
Word size of FreeCAD: 64-bit
Version: 0.18.16131 (Git)
Build type: Release
Branch: releases/FreeCAD-0-18
Hash: 3129ae4296e40ed20e7b3d460b86e6969acbe1c3
Python version: 3.6.6
Qt version: 5.6.2
Coin version: 4.0.0a
OCC version: 7.3.0
Locale: French/Belgium (fr_BE)
Attachments
Tux.png
Tux.png (132.97 KiB) Viewed 904 times
User avatar
DeepSOIC
Veteran
Posts: 7896
Joined: Fri Aug 29, 2014 12:45 am
Location: used to be Saint-Petersburg, Russia

Re: Slice takes 15 minutes

Post by DeepSOIC »

Hi!
I don't know, why is it so long, I would guess that there may be exceptionally many triangles at some height.

Meshes converted to shapes are an extremely inefficient, both in terms of memory consumption and processing speed.
You should slice the mesh instead. I don't think there is a GUI tool for it (FreeCAD's mesh support is rather rudimentary), but I think there was a python routine.

I assume you want the slices to cut the thing with laser cutter or something alike. Consider bending a 3d-printing slicer for the purpose. Slic3r, for example, can slice to svgs.
User avatar
HarryGeier
Veteran
Posts: 1231
Joined: Mon Jul 10, 2017 12:36 pm
Location: Hof Germany

Re: Slice takes 15 minutes

Post by HarryGeier »

You can use the mesh workbench to analyze the mesh. These days someone sent me an STL with hundreds of errors and more than a quarter million triangles for a rather simple part ( fan duct ) . Most of these problems come from ineffective STL generation or from insane parameters like 0.0001mm minimum line length.

Meshlab or meshmixer can help preparing meshes for sucessfull remodelling in cad systems.

Seen later: why are there so many digits after the comma ?? That appears at least as strange to me..
Kaum macht man´s richtig , gehts´s
My Video Tutorials on Youtube: https://www.youtube.com/channel/UCoe3B ... p8Q/videos
My FreeCAD Stuff on Hidrive: https://my.hidrive.com/share/qr3l1yddy6#$/
jfc941640
Posts: 9
Joined: Mon Oct 28, 2019 6:20 pm

Re: Slice takes 15 minutes

Post by jfc941640 »

Thanks DeepSOIC and HarryGeier for your help, I'm going to test your different propositions.
My goal is to convert any 3D file to a LEGO model.
It is working but sometimes too slow on specific slice as I explain in my problem.
I have to possibility to specify the number of slice and I detect the problem on slice with z=4.740459585189811
This is a calculated number if I use 20 slices for this object.
To give you an idea, here is the result of the LEGO model for Tux ;-)
Attachments
Tux02.png
Tux02.png (43.16 KiB) Viewed 797 times
Tux01.png
Tux01.png (32.92 KiB) Viewed 797 times
User avatar
HarryGeier
Veteran
Posts: 1231
Joined: Mon Jul 10, 2017 12:36 pm
Location: Hof Germany

Re: Slice takes 15 minutes

Post by HarryGeier »

There seems to be something wrong with the mesh..

I converted to STL Mesh, looked good with about 13K Triangles, but has self intersections and is no solid. Therefore i guess the operations have a problem.

I am not good in Mesh WB tools usage, so i can not help further how to fix the holes that come out after trying a repair with analyze mesh function.
Kaum macht man´s richtig , gehts´s
My Video Tutorials on Youtube: https://www.youtube.com/channel/UCoe3B ... p8Q/videos
My FreeCAD Stuff on Hidrive: https://my.hidrive.com/share/qr3l1yddy6#$/
jfc941640
Posts: 9
Joined: Mon Oct 28, 2019 6:20 pm

Re: Slice takes 15 minutes

Post by jfc941640 »

To conclude, I just test Mesh WB, meshlab and meshmixer but none give me the perfect result to have a clean mesh that does not causes any problem in freecad to slice.
The best solution for me was to use Slic3r and export svg.
For info, I create a post on my "Solid to LEGO" macro here : https://forum.freecadweb.org/viewtopic.php?f=22&t=41255
Post Reply