Simulate g-code toolpaths from external CAM?

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!
Russ4262
Posts: 953
Joined: Sat Jun 30, 2018 3:22 pm
Location: Oklahoma
Contact:

Re: Simulate g-code toolpaths from external CAM?

Post by Russ4262 »

Harvie,
Thanks for checking back.
harvie wrote: Wed Jan 16, 2019 7:59 pmAny news on this?
I see the bug report created by
sliptonic wrote:@Sliptonic
is still in the Mantis bug tracking system. I don't know what progress has been made since last summer.

Honestly, I think developers have been working on other transitional issues related to Qt 5 and Python 3 updates. I do know @Sliptonic is still hard at work on the PathWB tool set in general.

We'd be glad to have you code with us.

Russell
User avatar
Kunda1
Veteran
Posts: 13434
Joined: Thu Jan 05, 2017 9:03 pm

Re: Simulate g-code toolpaths from external CAM?

Post by Kunda1 »

Related tickets:
issue #3463
issue #3464
Any other open tickets related to this issue?
Alone you go faster. Together we go farther
Please mark thread [Solved]
Want to contribute back to FC? Checkout:
'good first issues' | Open TODOs and FIXMEs | How to Help FreeCAD | How to report Bugs
harvie
Posts: 10
Joined: Wed Apr 11, 2018 3:30 pm

Re: Simulate g-code toolpaths from external CAM?

Post by harvie »

Hi guys. Have you looked again into the simulating of 3rd party g-code?

Update: ah sorry, didn't noticed there is second page of comments in this topic :oops:
sliptonic wrote: Mon May 07, 2018 2:13 pm It's funny you mention this as I started looking into it last week.
shaise wrote: Mon May 07, 2018 3:17 pm I Will fix the segfault, but the main cause is because there is an operation without any tool assigned.
harvie
Posts: 10
Joined: Wed Apr 11, 2018 3:30 pm

Re: Simulate g-code toolpaths from external CAM?

Post by harvie »

When i don't use preprocessor, the g-code gets imported but nothing else happens. So i tried with latest 0.19-development appimage, and when i used the "pre_gcode" preprocessor it looks like it's trying to create some job using the g-code, but it ends up giving some python errors and the import fails.
User avatar
sliptonic
Veteran
Posts: 3460
Joined: Tue Oct 25, 2011 10:46 pm
Location: Columbia, Missouri
Contact:

Re: Simulate g-code toolpaths from external CAM?

Post by sliptonic »

harvie wrote: Tue Dec 15, 2020 10:48 pm When i don't use preprocessor, the g-code gets imported but nothing else happens. So i tried with latest 0.19-development appimage, and when i used the "pre_gcode" preprocessor it looks like it's trying to create some job using the g-code, but it ends up giving some python errors and the import fails.
You should definitely be using 0.19. Create your job first then try to import using the gcode_pre. This hasn't gotten a lot of testing so bugs are possible (likely). Please paste the python errors. If it's a long backtrack, create a pastebin and paste the pastebin link here.

news on other fronts;

I've been talking with the camotics people about improving the integration between camotics and freecad. I've done an initial experiment using their camsim command line tool. There's a branch on my repo here: https://github.com/sliptonic/FreeCAD/tr ... e/camotics
With it installed, you get a new button on the toolbar if camotics is installed. Select a job and press the button and it will do the simulation externally and import the resulting .stl mesh to the freecad project. This is a first step. Next, we'll look at building a proper API that FreeCAD can talk to a running camotics instance through.
User avatar
Kunda1
Veteran
Posts: 13434
Joined: Thu Jan 05, 2017 9:03 pm

Re: Simulate g-code toolpaths from external CAM?

Post by Kunda1 »

So cool!
Alone you go faster. Together we go farther
Please mark thread [Solved]
Want to contribute back to FC? Checkout:
'good first issues' | Open TODOs and FIXMEs | How to Help FreeCAD | How to report Bugs
harvie
Posts: 10
Joined: Wed Apr 11, 2018 3:30 pm

Re: Simulate g-code toolpaths from external CAM?

Post by harvie »

sliptonic wrote: Tue Dec 15, 2020 11:23 pm Please paste the python errors.
I just tried to import g-code again using gcode_pre. using latest development appimage on archlinux. and it printed following error:

Code: Select all

Traceback (most recent call last):
  File "<string>", line 1, in <module>
  File "/tmp/.mount_FreeCAQiabq6/usr/Mod/Path/PathScripts/post/gcode_pre.py", line 118, in insert
    QtCore.QT_TRANSLATE_NOOP('Path_Custom', 'Custom'), '', ''
<class 'NameError'>: name 'QtCore' is not defined
Traceback (most recent call last):
  File "<string>", line 1, in <module>
<class 'RuntimeError'>: name 'QtCore' is not defined
When using <none> preprocessor, the import does not fail.
User avatar
sliptonic
Veteran
Posts: 3460
Joined: Tue Oct 25, 2011 10:46 pm
Location: Columbia, Missouri
Contact:

Re: Simulate g-code toolpaths from external CAM?

Post by sliptonic »

harvie wrote: Wed Feb 17, 2021 7:31 pm latest development appimage on archlinux.
That isn't a version. Please paste your FreeCAD info.

Please keep an eye on this PR: https://github.com/FreeCAD/FreeCAD/pull/4477
Vcoder
Posts: 9
Joined: Thu Nov 28, 2013 10:34 am
Location: Russia

Re: Simulate g-code toolpaths from external CAM?

Post by Vcoder »

I am trying to open gcode file. I'm starting FreeCAD from AppImage, then select "File->Open", located gcode file and clicked the "Open button". Next I select pocessor "gcode_pre" and clicked the "OK" button.

As a result I get an error message box saying:

Code: Select all

'NoneType' object has no attribute 'sendMsgToViews'
Also there are error messages in FreeCad's Report view:

Code: Select all

23:24:30  Traceback (most recent call last):
  File "<string>", line 1, in <module>
  File "/tmp/.mount_FreeCAjsga5o/usr/lib/python3.10/site-packages/shiboken2/files.dir/shibokensupport/feature.py", line 139, in _import
    return original_import(name, *args, **kwargs)
<class 'ModuleNotFoundError'>: No module named 'gcode_pre'
23:24:30  Traceback (most recent call last):
  File "<string>", line 1, in <module>
<class 'RuntimeError'>: No module named 'gcode_pre'
23:24:30  Traceback (most recent call last):
  File "<string>", line 2, in <module>
  File "<string>", line 46, in <module>
<class 'AttributeError'>: 'NoneType' object has no attribute 'sendMsgToViews'
What am I doing wrong?

My FreeCAD info:

Code: Select all

OS: Ubuntu 22.04.4 LTS (KDE/plasma)
Word size of FreeCAD: 64-bit
Version: 0.21.2.33771 (Git) AppImage
Build type: Release
Branch: (HEAD detached at 0.21.2)
Hash: b9bfa5c5507506e4515816414cd27f4851d00489
Python 3.10.13, Qt 5.15.8, Coin 4.0.0, Vtk 9.2.6, OCC 7.6.3
Locale: Russian/Russia (ru_RU)
Installed mods: 
  * kicadStepUpMod 11.1.0
  * pcb 6.2023.1
xemul
Posts: 425
Joined: Tue Mar 21, 2023 9:35 pm

Re: Simulate g-code toolpaths from external CAM?

Post by xemul »

Vcoder wrote: Wed Apr 17, 2024 6:30 pm ...
Snip macro screenshot-431548.png
Snip macro screenshot-431548.png (27.99 KiB) Viewed 133 times
Would you better start a new topic?
Post Reply