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!
Post Reply
realthunder
Veteran
Posts: 2190
Joined: Tue Jan 03, 2017 10:55 am

Re: CAM simulation for the Path Workbench

Post by realthunder »

This looks awesome! Excellent job
Try Assembly3 with my custom build of FreeCAD at here.
And if you'd like to show your support, you can donate through patreon, liberapay, or paypal
User avatar
sliptonic
Veteran
Posts: 3457
Joined: Tue Oct 25, 2011 10:46 pm
Location: Columbia, Missouri
Contact:

Re: CAM simulation for the Path Workbench

Post by sliptonic »

shaise wrote: Thu Oct 26, 2017 9:50 am Hi Sliptonic,

I have managed to integrate my C++ voxel simulation into FreeCAD. The thing is, since it has C++ code, it can not be a separate module or macro.
I would like to integrate it into main freecad, but before issuing a pull request, I would like to talk to developpers in charge of the Path workbech, to ask some questions and make sure my code is acceptable by them.
This looks amazing. I can't wait. Do you use IRC or Gitter? For something like this, I'd recommend we meet in the Path room and do an informal walk-thru. It's easier to ask questions in realtime but is still logged and available to anyone who wants to join.
User avatar
shaise
Posts: 470
Joined: Thu Jun 11, 2015 8:11 am

Re: CAM simulation for the Path Workbench

Post by shaise »

Hi Sliptonic,

I have just joined gitter.
Do I just leave a long message there explaining what changes I made?

shai
User avatar
JoshM
Posts: 456
Joined: Thu Oct 05, 2017 5:34 pm
Location: New Hampshire

Re: CAM simulation for the Path Workbench

Post by JoshM »

Hi Shaise,
I just used your simulator for a job I'm about to run. Initially I thought the icon was a placeholder because when I 1st tried to use it nothing happened--turns out because I have Custom-GCode Operations in my list which it doesn't like. It also doesn't like the Fixture-Operataion.

Once I deselected those from the simulation, it ran and is BEAUTIFUL! Thanks so much for your work. If anyone else hasn't tried this yet, you're missing a wonderful addition to FC-Path!

At maximum Speed, Best-Accuracy, it takes a couple of minutes to run on my PC.

Best Regards,
Josh
Attachments
FC_Path_Simulator_Result.jpg
FC_Path_Simulator_Result.jpg (301.4 KiB) Viewed 1634 times
FC_Path_Simulator_Model.jpg
FC_Path_Simulator_Model.jpg (263.95 KiB) Viewed 1634 times
User avatar
shaise
Posts: 470
Joined: Thu Jun 11, 2015 8:11 am

Re: CAM simulation for the Path Workbench

Post by shaise »

Happy to hear it worked for you.
I will add Custom-GCode Operations to the to-do list.
What is the Fixture-Operataion? I am not familiar with.
User avatar
JoshM
Posts: 456
Joined: Thu Oct 05, 2017 5:34 pm
Location: New Hampshire

Re: CAM simulation for the Path Workbench

Post by JoshM »

Hi Shaise,
The Fixture-Operation is under the Path-Partial_Commands, and all it does is specify the coordinate-system. In my case, I am using it to set my job in the G55 coordinate-system.

You really knocked this one out of the park!

If anyone wants to check it out on a semi-complex job, I saved a copy of my project and it simply requires that Fixture and Custom Commands be de-selected in order to run. https://ln.sync.com/dl/703870e60/6suhi2 ... t-ffesyjym

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

Re: CAM simulation for the Path Workbench

Post by roivai »

Hi Shaise,

I finally had time to build and try the new simulator. I did not succeed as well as others..

I'm running Linux. Just pulled the latest source like one hour ago.

Code: Select all

OS: Debian GNU/Linux 8.6 (jessie)
Word size of OS: 64-bit
Word size of FreeCAD: 64-bit
Version: 0.17.12600 (Git)
Build type: Unknown
Branch: master
Hash: 987b8db0b5ab31ea4d5148787495b1ed856cef41
Python version: 2.7.9
Qt version: 4.8.6
Coin version: 4.0.0a
OCC version: 7.1.0
Locale: English/UnitedStates (en_US)
I created a simple path operation with one tool and two operations.
When I launch the simulator by clicking the icon on the toolbar I get:

Code: Select all

Running the Python command 'Path_Simulator' failed:
Traceback (most recent call last):
  File "/home/pekka/builds/FreeCAD/freecad-build2/Mod/Path/PathScripts/PathSimulatorGui.py", line 519, in Activated
    pathSimulation.Activate()
  File "/home/pekka/builds/FreeCAD/freecad-build2/Mod/Path/PathScripts/PathSimulatorGui.py", line 82, in Activate
    self.SimulateMill()
  File "/home/pekka/builds/FreeCAD/freecad-build2/Mod/Path/PathScripts/PathSimulatorGui.py", line 154, in SimulateMill
    self.SetupSimulation()
  File "/home/pekka/builds/FreeCAD/freecad-build2/Mod/Path/PathScripts/PathSimulatorGui.py", line 105, in SetupSimulation
    self.SetupOperation(0)
  File "/home/pekka/builds/FreeCAD/freecad-build2/Mod/Path/PathScripts/PathSimulatorGui.py", line 112, in SetupOperation
    toolProf = self.CreateToolProfile(self.tool, Vector(0,1,0), Vector(0,0,0), self.tool.Diameter / 2.0)
  File "/home/pekka/builds/FreeCAD/freecad-build2/Mod/Path/PathScripts/PathSimulatorGui.py", line 392, in CreateToolProfile
    lR = Part.makeLine(vBR, vTR)
    
    Line through identic points
If I still go on and press the Play button, I get

Code: Select all

Traceback (most recent call last):
  File "/home/pekka/builds/FreeCAD/freecad-build2/Mod/Path/PathScripts/PathSimulatorGui.py", line 243, in PerformCut
    self.PerformCutVoxel()
  File "/home/pekka/builds/FreeCAD/freecad-build2/Mod/Path/PathScripts/PathSimulatorGui.py", line 213, in PerformCutVoxel
    if self.resetSimulation:
AttributeError: PathSimulation instance has no attribute 'resetSimulation'
Traceback (most recent call last):
  File "/home/pekka/builds/FreeCAD/freecad-build2/Mod/Path/PathScripts/PathSimulatorGui.py", line 243, in PerformCut
    self.PerformCutVoxel()
  File "/home/pekka/builds/FreeCAD/freecad-build2/Mod/Path/PathScripts/PathSimulatorGui.py", line 213, in PerformCutVoxel
    if self.resetSimulation:
AttributeError: PathSimulation instance has no attribute 'resetSimulation'
....
....
That error message keeps coming multiple times per second until I press Stop button..

My test file is attached.

Any clue what could be wrong? Thanks for any hints.

Pekka
Attachments
simutest.fcstd
(18.08 KiB) Downloaded 48 times
User avatar
shaise
Posts: 470
Joined: Thu Jun 11, 2015 8:11 am

Re: CAM simulation for the Path Workbench

Post by shaise »

Hi roivai,

The tools you use are invalid.
Just edit your tools and give the cutting edge height a value other then 0.

shai
User avatar
shaise
Posts: 470
Joined: Thu Jun 11, 2015 8:11 am

Re: CAM simulation for the Path Workbench

Post by shaise »

JoshM wrote: Wed Nov 15, 2017 2:55 pm At maximum Speed, Best-Accuracy, it takes a couple of minutes to run on my PC.
Hi Josh,

I'm curious. How much time your complex simulation takes when you press the fast forward button. (this skips the animation but shows you the final result)

shai
User avatar
JoshM
Posts: 456
Joined: Thu Oct 05, 2017 5:34 pm
Location: New Hampshire

Re: CAM simulation for the Path Workbench

Post by JoshM »

Hi Shai,
About 5 seconds--didn't catch on to that. Beautifully done. So, now I get it, I can look at final output in 5 Seconds or so, but playback if I need to see where something bad happened. That's so cool!
Thanks,
Josh

OS: Windows 10
Word size of OS: 64-bit
Word size of FreeCAD: 64-bit
Version: 0.17.12595 (Git)
Build type: Release
Branch: master
Hash: 8c7bb0cd551cf11551ff71d716a16211c6d5e13d
Python version: 2.7.8
Qt version: 4.8.7
Coin version: 4.0.0a
OCC version: 7.1.0
Locale: English/UnitedStates (en_US)
Post Reply