Post Processing Error - FreeCAD v0.20

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!
bmsaus4ax
Posts: 255
Joined: Sat Nov 14, 2020 9:16 pm
Location: Bargara, Queensland, Australia UTC+10

Re: Post Processing Error - FreeCAD v0.20

Post by bmsaus4ax »

SaazyPants wrote: Thu Nov 24, 2022 10:40 pm
I'm not nearly familiar enough with FreeCAD to try and diagnose what the issue is. The only thing that comes to mind is that I'm running the FlatPak version which may have oddities as far as paths to files. I'm still experiencing the same symptom when I try to post the paths, as expected given the error above.

I did install FreeCAD from the repos and tried the same thing above to the same end...
The directory path is quite likely the problem.
The error stating Path is not a package may indicate you only need "Post.Utils", or maybe "Path.Path.Post.Utils", whatever allows the location of the files to be resolved.

I am going to have a try at doing a refactor on my own processor using the linuxcnc processor before and after files as examples.

I don't know if there may be a script to extract the required set of "values[ ] " arguments for a particular post processor for the refactored file.

Seems to involve cross referencing the three files, _post.py, UtilsArguments.py, and UtilsExport.py, to achieve the required configuration.
spitzlbergerj
Posts: 12
Joined: Mon Feb 28, 2022 7:04 pm

Re: Post Processing Error - FreeCAD v0.20

Post by spitzlbergerj »

Hi,
I have the same problem with snapmaker postprocessor as in the first post.

I use

Code: Select all

OS: Windows 10 Version 2009
Word size of FreeCAD: 64-bit
Version: 0.20.1.29410 (Git)
Build type: Release
Branch: releases/FreeCAD-0-20
Hash: f5d13554ecc7a456fb6e970568ae5c74ba727563
Python 3.8.10, Qt 5.15.2, Coin 4.0.1, Vtk 8.2.0, OCC 7.6.3
Locale: German/Germany (de_DE)
Installed mods: 
  * LCInterlocking
With some of the other preprocessors I was able to generate the gcode successfully (marlin, linuxcnc, centroid).

I have tried all the solutions in this thread. By cribbing in the other postprocessors I applied the following imports in python code:

Code: Select all

# sjj, 2023-01-02, begin
# Changed because of an error while postprocessiong
# see https://forum.freecadweb.org/viewtopic.php?p=640402#p640402
# see other postprocessors of version 0.20.1
#
#from PathScripts import PostUtils
#from PathScripts import PathUtils

import PathScripts.PostUtils as PostUtils
import PathScripts.PathUtils as PathUtils
# sjj, 2023-01-02, end
so the import works, but the error is again

Code: Select all

15:02:30  snapmaker_freecad_post gcode postprocessor loaded.
15:02:40  snapmaker_freecad_post gcode postprocessor loaded.
15:02:43  snapmaker_freecad_post gcode postprocessor loaded.
15:02:43  <Path.Area> Area.cpp(2691): edge break point not found
15:02:43  <Path.Area> Area.cpp(2691): edge break point not found
15:02:43  <Path.Area> Area.cpp(2691): edge break point not found
15:02:43  <Path.Area> Area.cpp(2691): edge break point not found
15:02:43  <Path.Area> Area.cpp(2691): edge break point not found
15:02:43  <Path.Area> Area.cpp(2691): edge break point not found
15:02:43  helix_generator(59).generate((helix: <0.0, -56.0>
 hole radius 5.2
 inner radius 0.0
 step over 0.5
 start point 0.0
 end point -5.1
 step_down 6.0
 tool diameter 6.0
 direction CW
 startAt Inside))
15:02:43  helix_generator.DEBUG: (124) - (single helix mode)

15:02:43  helix_generator.DEBUG: (144) - Radii: [2.2]
15:02:43  helix_generator(59).generate((helix: <0.0, -56.0>
 hole radius 5.2
 inner radius 0.0
 step over 0.5
 start point 0.0
 end point -5.1
 step_down 6.0
 tool diameter 6.0
 direction CW
 startAt Inside))
15:02:43  helix_generator.DEBUG: (124) - (single helix mode)

15:02:43  helix_generator.DEBUG: (144) - Radii: [2.2]
15:02:46  post: snapmaker_freecad(D:/OneDrives/OneDrive - La Gondola Barocca/_PCBüroLustheim/Eigene Dateien/CAD, Designer, Publisher/_CNC-Fräsungen/Vakuumplatte/vakuumplatte200x200.snapmaker.cnc, )
15:02:46  snapmaker_freecad_post gcode postprocessor loaded.
15:02:46  Show editor = 1
15:02:46  postprocessing...
15:02:46  Running the Python command 'Path_Post' failed:
Traceback (most recent call last):
  File "C:\Program Files\FreeCAD\0.20.1.stable\Mod\Path\PathScripts\PathPost.py", line 437, in Activated
    (fail, rc, filename) = self.exportObjectsWith(slist, job)
  File "C:\Program Files\FreeCAD\0.20.1.stable\Mod\Path\PathScripts\PathPost.py", line 216, in exportObjectsWith
    gcode = processor.export(objs, filename, postArgs)
  File "C:\Program Files\FreeCAD\0.20.1.stable\Mod\Path\PathScripts\PathPostProcessor.py", line 105, in export
    return self.script.export(obj, filename, args)
  File "C:\Program Files/FreeCAD/0.20.1.stable/Mod/Path/PathScripts/post\snapmaker_freecad_post.py", line 204, in export
    job = PathUtils.findParentJob(obj)
  File "C:\Program Files\FreeCAD\0.20.1.stable\Mod\Path\PathScripts\PathUtils.py", line 405, in findParentJob
    for i in obj.InList:

'_TempObject' object has no attribute 'InList'
Another google search for the error text at the end didn't get me anywhere.

Thank you for your help.

Many greetings

Sepp
Last edited by spitzlbergerj on Sat Jan 14, 2023 6:24 am, edited 1 time in total.
Grüße
Sepp
-----------
Alles entsteht zuerst in deiner Fantasie

Mein Repository: https://github.com/spitzlbergerj/freecad-3d-repository
(im Aufbau)
Noku
Posts: 8
Joined: Fri Nov 11, 2022 5:13 pm

Re: Post Processing Error - FreeCAD v0.20

Post by Noku »

I wanna try one of the Marlin Post processors , first check a simple gcode and then try on the machine very high above the work plate.
I see that there are some problems with Arc Gcodes in the snapmaker firmware, therefore maybe I check more then one post processor and check the gcode. Last time I have my mashine disassembled to measure and adjust the linear modules....maybe next week some tests.
spitzlbergerj
Posts: 12
Joined: Mon Feb 28, 2022 7:04 pm

Re: Post Processing Error - FreeCAD v0.20

Post by spitzlbergerj »

Good morning,
after not being able to isolate or even solve the error further, I am now no longer using the postprocessor published by SnapMaker. clsergent has developed a postprocessor for Snapmaker A350, A250, A150 and provided it on github https://github.com/clsergent/Snapmaker2Postprocessor which works great.

greetings and thanks
Sepp
Grüße
Sepp
-----------
Alles entsteht zuerst in deiner Fantasie

Mein Repository: https://github.com/spitzlbergerj/freecad-3d-repository
(im Aufbau)
chrisb
Veteran
Posts: 53933
Joined: Tue Mar 17, 2015 9:14 am

Re: Post Processing Error - FreeCAD v0.20

Post by chrisb »

I asked the author if he wants to integrate it into the FreeCAD sources.
A Sketcher Lecture with in-depth information is available in English, auf Deutsch, en français, en español.
SaazyPants
Posts: 10
Joined: Wed Nov 24, 2021 4:07 pm

Re: Post Processing Error - FreeCAD v0.20

Post by SaazyPants »

spitzlbergerj wrote: Sat Jan 14, 2023 6:30 am Good morning,
after not being able to isolate or even solve the error further, I am now no longer using the postprocessor published by SnapMaker. clsergent has developed a postprocessor for Snapmaker A350, A250, A150 and provided it on github https://github.com/clsergent/Snapmaker2Postprocessor which works great.

greetings and thanks
Sepp
I was unaware someone had made a new post processor! I installed it this evening and it indeed posts correctly. I'll have to give it a try this weekend on the machine to confirm everything is working as intended. Ich bin sehr aufgeregt! Vielen dank!

Code: Select all

if ($hungry) { eat(); } else { sleep(); }
tropicfunk52
Posts: 1
Joined: Mon Feb 06, 2023 1:21 pm

Re: Post Processing Error - FreeCAD v0.20

Post by tropicfunk52 »

I've read through this whole thread and I'm still getting an error with the Snapmaker_2_CNC_post python script that was recommended.

Code: Select all

08:13:58  Running the Python command 'Path_Post' failed:
Traceback (most recent call last):
  File "C:\Program Files\FreeCAD 0.20\Mod\Path\PathScripts\PathPost.py", line 437, in Activated
    (fail, rc, filename) = self.exportObjectsWith(slist, job)
  File "C:\Program Files\FreeCAD 0.20\Mod\Path\PathScripts\PathPost.py", line 215, in exportObjectsWith
    processor = PostProcessor.load(postname)
  File "C:\Program Files\FreeCAD 0.20\Mod\Path\PathScripts\PathPostProcessor.py", line 47, in load
    exec("import %s as current_post" % postname, namespace)
  File "<string>", line 1, in <module>
  File "C:\Program Files\FreeCAD 0.20\bin\Lib\site-packages\shiboken2\files.dir\shibokensupport\__feature__.py", line 142, in _import
    return original_import(name, *args, **kwargs)
  File "C:\Program Files/FreeCAD 0.20/Mod/Path/PathScripts/post\Snapmaker_2_CNC_post.py", line 166, in <module>
    class Command:
  File "C:\Program Files/FreeCAD 0.20/Mod/Path/PathScripts/post\Snapmaker_2_CNC_post.py", line 185, in Command
    def addParameter(self, parameter, value: str | int | float = ''):

unsupported operand type(s) for |: 'type' and 'type'
Any help on figuring this out would be a big help.

FreeCAD version: 20.2
OS: Windows
SaazyPants
Posts: 10
Joined: Wed Nov 24, 2021 4:07 pm

Re: Post Processing Error - FreeCAD v0.20

Post by SaazyPants »

If anyone is struggling with the post processor created by clsergent on the latest version of FreeCAD (v0.21.0) I've forked his post repository and corrected the import issues.

https://github.com/SaazyTheGoat/Snapmaker2Postprocessor

Code: Select all

if ($hungry) { eat(); } else { sleep(); }
Post Reply