CAM simulation for the Path Workbench

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!
User avatar
shaise
Posts: 486
Joined: Thu Jun 11, 2015 8:11 am

Re: CAM simulation for the Path Workbench

Post by shaise »

sliptonic wrote: Sun Sep 17, 2017 6:40 pm It could move into the TC and then simulation (or anything else that needs it) could ask the TC for it's shape. Does that make sense?
I definitely agree the toolpath should visualize the tool so the user can see the changes. I also think that it should show some kind of a 2d graphic representation so the user will understand the meaning of each parameter - something like in other CAM SW, ie Mastercam:
tooledit.png
tooledit.png (18.18 KiB) Viewed 1958 times
I would gladly help on both things, however this involves working on the master freecad code, and I am not there yet.

shai
roivai
Posts: 117
Joined: Thu Feb 02, 2017 5:29 pm
Location: Oulu, Finland

Re: CAM simulation for the Path Workbench

Post by roivai »

Wow! This is truly wonderful stuff! I played with very similar idea for maybe two nights and gave up after found out that OCC had weird bugs.. I am very glad you weren't a quitter like me and worked around them! :)
User avatar
bill
Posts: 376
Joined: Fri Jan 09, 2015 9:25 pm

Re: CAM simulation for the Path Workbench

Post by bill »

Very cool, :D :D :D ; FYI ???
CAM_SIM.png
CAM_SIM.png (17.19 KiB) Viewed 1917 times
User avatar
shaise
Posts: 486
Joined: Thu Jun 11, 2015 8:11 am

Re: CAM simulation for the Path Workbench

Post by shaise »

Ooops :roll:
soory for that. I just posted a fix...
User avatar
shaise
Posts: 486
Joined: Thu Jun 11, 2015 8:11 am

Re: CAM simulation for the Path Workbench

Post by shaise »

Hi Everyone!

I have updated the macro a bit with much better UI and more control. The control is now in the Task panel. Pressing OK will keep the result part. Cancel will discard it. Added option to simulate selected operations.
SimTask.png
SimTask.png (14.54 KiB) Viewed 1850 times
But here comes the bad news. I have tried one of sliptonics 'Torture' samples. Though the simulation went well, it was exteeeeeemly slow... :cry:, 1 hour 25 minutes to be exact...
This make this approach rather impractical.
Back to the drawing board.
I think I will try to write my own simulator from scratch in c++, as I have some experience with 3D mesh coding.
Here it the simulation video: https://youtu.be/uKcYLPnMeOo
User avatar
sliptonic
Veteran
Posts: 3459
Joined: Tue Oct 25, 2011 10:46 pm
Location: Columbia, Missouri
Contact:

Re: CAM simulation for the Path Workbench

Post by sliptonic »

This is still a very worthwhile effort to improve UI and figure out how it fits into the workflow.

If you're going to start digging deeper on a custom implementation, take some time to study awallin's code. It's GPL3 so not much we can use directly but worth learning from, I'm sure.

http://www.anderswallin.net/tag/cutsim/
mlampert
Veteran
Posts: 1772
Joined: Fri Sep 16, 2016 9:28 pm

Re: CAM simulation for the Path Workbench

Post by mlampert »

shaise wrote: Tue Sep 19, 2017 8:01 pm Here it the simulation video: https://youtu.be/uKcYLPnMeOo
Oops - it's milling the square hole from the bottom up! Could you post the generated g-code and/or the FC file with the Path in it so I can have a look at it?
User avatar
shaise
Posts: 486
Joined: Thu Jun 11, 2015 8:11 am

Re: CAM simulation for the Path Workbench

Post by shaise »

Hi Mlampert,

Here is the FC file.
Thanks again for your work!
By the way, is there a way to hide the path lines? The standard hide functionality does not affect them, they are always visible.

shai
Attachments
testPockets.FCStd
(919.58 KiB) Downloaded 66 times
ickby
Veteran
Posts: 3116
Joined: Wed Oct 05, 2011 7:36 am

Re: CAM simulation for the Path Workbench

Post by ickby »

One way to speed up things a bit could be to increase.the Boolean tolerance. Na default it uses 1e-7, reducing this to e.g. 1e-3 may speed up things and us still good enough for the purpose.

Tolerance is a parameter to the Boolean functions.
mlampert
Veteran
Posts: 1772
Joined: Fri Sep 16, 2016 9:28 pm

Re: CAM simulation for the Path Workbench

Post by mlampert »

realthunder wrote:ping
Realthunder could you have a look at this please?

I checked that file and the pockets are - weird. Some of them get milled from the bottom up, and two of them get milled in two parts, first upwards from about 3/4 of the total depth to the starting depth, and then downwards from 3/4 to the final depth. It's also changing the patterns on those boundaries (you can see it clearly if you switch to "top view", very noticeable on the cylinder and square holes on the bottom left
Post Reply