Waterline ignore multipass/general sanity check I guess

Here's the place for discussion related to CAM/CNC and the development of the Path module.
Forum rules
Be nice to others! Respect the FreeCAD code of conduct!
Post Reply
User avatar
pathfinder
Posts: 315
Joined: Mon Oct 04, 2021 10:27 am

Waterline ignore multipass/general sanity check I guess

Post by pathfinder »

Hello,

I'm currently playing around with imported STLs, which FreeCAD admittedly isn't designed to deal with, but I thought I'd get your input anyways.

The file is just a small bit of the piece I want to machine. First attempts at creating toolpaths led to an unresponsive FreeCAD.

After some tinkering, I got FreeCAD to generate a waterline toolpath that looks somewhat sane (see file), but it ignores that it's supposed to be multi-pass. Trying single pass just doesn't work at all.

I think apart from help with the task at hand, what I really want to know is whether this is a futile endeavor or not. There's barely any open source tools out there which might do what I want (I tried Kiri:Moto, which made ok waterlines and am still fighting to get BlenderCAM to do what I want it to do). Maybe I'm at a point where I need to go commercial.

Version info:

OS: Arch Linux (XFCE/xfce)
Word size of FreeCAD: 64-bit
Version: 0.20.27008 (Git) AppImage
Build type: Release
Branch: (HEAD detached at 9162733)
Hash: 91627338a44371fe9a8e815b4900f62558af98a1
Python version: 3.9.9
Qt version: 5.12.9
Coin version: 4.0.0
OCC version: 7.5.3
Locale: English/United States (en_US)

OCL is installed, or at least I didn't get any notification stating otherwise.
Attachments
welle1_small.FCStd
(958.8 KiB) Downloaded 18 times
GeneFC
Veteran
Posts: 5373
Joined: Sat Mar 19, 2016 3:36 pm
Location: Punta Gorda, FL

Re: Waterline ignore multipass/general sanity check I guess

Post by GeneFC »

I tried your file, and it seems to work correctly. It is using Multipass mode.

Waterline moves the cutter down until it touches the model and cuts at that level everywhere needed. Then the cutter moves down by the Step Down increment and cuts everywhere needed at the new level. Repeat until finished.

I do not believe a single pass mode makes any sense for Waterline. If the surface was correctly and completely cut the operation would not be a waterline.

You may be thinking of 3D Pocket or 3D Surface for which the removed stock is taken away one layer at a time in multipass mode, whether the cut is at the model surface or not.

3D surface might be a better choice if you want to peel away the stock a small bit at a time.

Gene
chrisb
Veteran
Posts: 53933
Joined: Tue Mar 17, 2015 9:14 am

Re: Waterline ignore multipass/general sanity check I guess

Post by chrisb »

Did you try 3D surface? It can do multipass well.
A Sketcher Lecture with in-depth information is available in English, auf Deutsch, en français, en español.
User avatar
pathfinder
Posts: 315
Joined: Mon Oct 04, 2021 10:27 am

Re: Waterline ignore multipass/general sanity check I guess

Post by pathfinder »

GeneFC wrote: Sun Jan 23, 2022 4:37 pm Waterline moves the cutter down until it touches the model and cuts at that level everywhere needed. Then the cutter moves down by the Step Down increment and cuts everywhere needed at the new level. Repeat until finished.
My mistake, you are indeed correct. My misinterpretation comes from the fact that other programs do use "waterline" as a means to remove actual material (e.g. Kiri:Moto). So I guess it's a misunderstanding.

Here's the real issue though, that I forgot to mention in the original post:

The sample file is a very small section of the actual piece I want to work on; the original object is roughly 800 x 1200 mm and this one is roughly 25 x 35 mm. Any attempt at generating either a 3d surfacing or waterline operation on the original object filled my RAM and swap (around 70GB combined) within a minute and led to a crash.
So I tried running roughly a 10th of the object, which leads either to nothing or is taking ages; I'm not quite sure because after having my computer run for 2 days, I decided to call it quits (I had a core working at 100% the whole time, so I guess something was happening).

I don't think this is something that I can really influence, so this is maybe where I need to look elsewhere (I tried both Kiri:Motos and BlenderCAMs waterline function and they took 5 minutes max, so I'm wondering what FreeCAD does differently here. Sadly, both of these option come with their share of restrictions). Or am I missing something?

I guess it's also not within FreeCADs scope, so I'm probably not the "target audience" with this kind of work in the first place.

chrisb wrote: Sun Jan 23, 2022 4:55 pm Did you try 3D surface? It can do multipass well.
Yes, for the small bit, 3d surface is actually what I'm looking for. I'm not sure why it didn't work the first time I tried it, running it now works fine, except for the issue described above (i.e. size and computing time).
GeneFC
Veteran
Posts: 5373
Joined: Sat Mar 19, 2016 3:36 pm
Location: Punta Gorda, FL

Re: Waterline ignore multipass/general sanity check I guess

Post by GeneFC »

pathfinder wrote: Sun Jan 23, 2022 4:58 pm size and computing time
Unfortunately these 3D operations depend on complex mesh calculations. For whatever reasons those calculations are very slow in FreeCAD.

You can greatly speed the process by adjusting (loosening) the tolerances. Look in the Property Panel for the Surface operation and find "Angular Deflection" and "Linear Deflection" under the "Mesh Conversion" heading. Relax each of those parameters by 10x and try again.

I have found quite a few cases for which I could reach a reasonable compromise between speed and accuracy.

There are other places that have accuracy and tolerance impact, but I believe those two are the most important in this case.

It would be useful to have the capability to create a mesh one time and then try various Path operations on the pre-computed mesh, but I am not aware if that is currently possible.

Perhaps some of the refactoring that is underway might help.

Gene
User avatar
pathfinder
Posts: 315
Joined: Mon Oct 04, 2021 10:27 am

Re: Waterline ignore multipass/general sanity check I guess

Post by pathfinder »

GeneFC wrote: Sun Jan 23, 2022 5:17 pm
Unfortunately these 3D operations depend on complex mesh calculations. For whatever reasons those calculations are very slow in FreeCAD.
Yeah, this is the issue here. It's really weird and honestly kinda frustrating, since other, less developed programs have no issues with it. I wonder whether they take shortcuts and what they look like.
GeneFC wrote: Sun Jan 23, 2022 5:17 pm
You can greatly speed the process by adjusting (loosening) the tolerances. Look in the Property Panel for the Surface operation and find "Angular Deflection" and "Linear Deflection" under the "Mesh Conversion" heading. Relax each of those parameters by 10x and try again.

Doesn't really do much for me, I'm afraid. Maybe I let the computer run overnight to see if something happens. but it doesn't seem to help me here.
GeneFC wrote: Sun Jan 23, 2022 5:17 pm
It would be useful to have the capability to create a mesh one time and then try various Path operations on the pre-computed mesh, but I am not aware if that is currently possible.
I just play around with a small fraction of the original object and when I have parameters dialed in, I try to run them on the original object. Sadly, it doesn't work here because the original object is too big to handle.
User avatar
pathfinder
Posts: 315
Joined: Mon Oct 04, 2021 10:27 am

Re: Waterline ignore multipass/general sanity check I guess

Post by pathfinder »

Ok, I feel like this warrants a double post, maybe even a new topic.

This is just weird and I have no idea what's going on here.

I experimented a bit more and here's some of the things I found:

First of all, the base mesh I'm working with here was created in Blender. If you export an STL in Blender you have to scale it by 1000 to make it the right size in Freecad, assuming you use Blenders millimeters as millimeters (a lot of people simply act as if Blenders meters are millimeters).

In Freecad, I did the same thing every time:

Code: Select all

Import mesh

Part workbench:

Create shape from mesh

Convert to solid

Path workbench:

(same template, containing the same 4mm endmill, Linuxcnc as post-processor)

choose upper left corner, set origin

3d Operaion --> 3d surface

      set sample interval to 0,1 mm, leave everything else default (line, single pass, etc.)

I tried this with both the offical 0.20 version, as well as Realthunders branch. This is relevant later. I tried Realthunders branch first, but wanted to confirm my findings with the official branch. Turns out, the two behave wildy differently.

Official 0.20:

I tried a 120 x 120 mm fraction of the shape and ran 3d surface on the body. The Toolpath was created just fine and reasonably quickly (sub 30 seconds).

I tried 120 x 240 mm, with 240 being the x- or y-dimension: Freecad hangs in both cases. Stopped after roughly 15 min computing time.



I tried Realthunders branch before and this is what happened:

120 x 120 mm: no issues.

120 (x-axis) x 240 (y-axis): no issues.

120 (x) x 480 (y): no issues.

Tried the original fraction, which is roughly 240 x 350 mm: Branch hangs. Stopped after 15 min.

Tried 120 (x) x 720 (y), which is roughly the same surface as the fraction before: No issues, computing time of maybe a minute.

240 (x) x 720 (y): Branch hangs. Rotating the object in Freecad doesn't change anything; still hangs.

Took the 120 x 480 from before, transformed it by rotating it 90 degrees, so now it's 480 x 120: no issues.

Some other things I tried:

Created a 240 x 240 STL the same way as the others, only this time just a cube instead of a complex mesh. Worked fine.

Cut out a 240 x 480 mm fraction in Blender, exported it at half scale:

Tried to run it like the others: hangs.

scaled it to the right scale in Freecad using the Draft workbench: hangs.

Scaled the 120 x 240 mm fraction to double its size using thew Draft workbench: works fine.

To summarize:

In the official version 0.20, at a certain size, the program just hangs, no matter the orientation of the longer dimension.

In Realthunders branch, the dimension only matters in the original x-direction, in the y-dimension, the object can be at least 720 mm long (I haven't tested anything longer). If the object is rotated in Freecad itself, the toolpath is generated just fine, as long as the original object wasn't too wide.

I don't know the exact size where it stops working, the 120mm were picked arbitrarily.

If anyone wants to play around with my original samples, here are most of the STLs I used:

https://we.tl/t-6C1OUvHGwH

Needless to say, I'm confused and don't understand what's going on here. I tried some other things, but there's far too many variables to figure this out for me.
GeneFC
Veteran
Posts: 5373
Joined: Sat Mar 19, 2016 3:36 pm
Location: Punta Gorda, FL

Re: Waterline ignore multipass/general sanity check I guess

Post by GeneFC »

I have never worked with STL files, either as input or output, so I am not sure I did everything optimally.

I loaded the 240x720 file and had a go. This is what I came up with.

Capture.JPG
Capture.JPG (120.13 KiB) Viewed 1575 times

The deflections are still a bit coarse, but you can see the pattern. This took a bit less that 2 minutes on my rather modest Core 5 computer. The one big deal is memory use. I saw up to about 15 GB during the processing. I have maxed out at 32 GB at times on my own files.

Soooo, I believe the process works, but it may not be efficient enough to be useful.

OS: Windows 7 Version 6.1 (Build 7601: SP 1)
Word size of FreeCAD: 64-bit
Version: 0.20.26858 (Git)
Build type: Release
Branch: master
Hash: e209bc706d35121098f9bac779bc6b09c24ddd95
Python version: 3.8.6+
Qt version: 5.15.2
Coin version: 4.0.1
OCC version: 7.5.3
Locale: English/United States (en_US)

Gene
User avatar
pathfinder
Posts: 315
Joined: Mon Oct 04, 2021 10:27 am

Re: Waterline ignore multipass/general sanity check I guess

Post by pathfinder »

Huh, I don't know whether that makes me feel better or worse.

Is there anything special you did? Or rather what were the steps you took? What did you change from the defaults?

My hardware is new and pretty beefy so I doubt that's the issue here. Memory use isn't the biggest issue for me, I can use swapfiles for that and have it run a little longer, if I know that it actually works.

It doesn't make any sense to me, because a 120 x 720 piece is totally fine, but a piece with other dimensions, but more or less the same surface area is somehow an issue.

EDIT:

Ok, I played around a bit more with the 240x720 and I managed to get pretty good results in the end. Here's what I did:

I started super rough; 10 mm sample intervals, angular Deflection at 10 mm, Linear at 1mm. It ran through ok. After that, I changed the properties to better values, one after the other. Managed to get Angular to 0.1 mm, Linear deflection to 1 micrometer and sample size to 0.1 mm. It even let me change from single pass to multipass within a minute or two.

I don't really know how well these values follow the original shape or whether maybe it's just smoke and mirrors, but it does look like it did something. I'm currently running a simulation which probably takes a few hours, but this seems to work.

It's still not particularly elegant, though.

Oh, and for reference, I did the above on the official 0.20 version mentioned in the first post.
Post Reply