Loading project files doesn't work (fine) anymore

23 views
Skip to first unread message

rando.sauvage

unread,
Aug 17, 2020, 6:36:05 PM8/17/20
to dxf2gcode-dev

Hi there!

Yesterday I have upgraded my Linux distribution (Mageia 3 -> Mageia 7.1), and installed the latest version of dxf2gcode... and found some bugs ;-)
  1. The drag & drop of the shapes with the mouse doesn't work anymore (still works with the up & down arrows though). Is it the same on your systems? (I am currently using python 3.7 + qt 5.12). Do you know when it broke?
    .
  2. Loading a project file (.d2g) that includes some custom GCode crashes dxf2gcode. I found the bug (missing test), I will commit a fix. For reference, the error is:
      File "/usr/lib/python3.7/site-packages/dxf2gcode-20191025-py3.7.egg/EGG-INFO/scripts/dxf2gcode", line 1209, in <module>
      File "/usr/lib/python3.7/site-packages/dxf2gcode-20191025-py3.7.egg/EGG-INFO/scripts/dxf2gcode", line 790, in load
      File "/usr/lib/python3.7/site-packages/dxf2gcode-20191025-py3.7.egg/EGG-INFO/scripts/dxf2gcode", line 1086, in loadProject
      File "/usr/lib/python3.7/site-packages/dxf2gcode-20191025-py3.7.egg/dxf2gcode/core/project.py", line 228, in load
      File "/usr/lib/python3.7/site-packages/dxf2gcode-20191025-py3.7.egg/EGG-INFO/scripts/dxf2gcode", line 913, in plot
      File "/usr/lib/python3.7/site-packages/dxf2gcode-20191025-py3.7.egg/EGG-INFO/scripts/dxf2gcode", line 476, in automaticCutterCompensation
    AttributeError: 'CustomGCode' object has no attribute 'cut_cor'
    .
  3. This "fix" (for "automatic cutter compensation") causes most of my .d2g project files to load totally messed-up: https://sourceforge.net/p/dxf2gcode/sourcecode/ci/361065354fcb97ae60f755f888d2f376c64001a6/
    Basically, the "fix" removes cutter compensation for all shapes when "Automatic cutter compensation" is not checked, which is wrong because no automatic compensation doesn't mean "absence of compensation" (compensation can be chosen manually).
    Side effect of this code is: when loading an existing project file (.d2g with cutter compensation done manually and saved into the project file), any existing compensation is cancelled by this patch and all the work previously done is lost.
    I have attached a project file + a dxf to show the problem (uncheck "Automatic cutter compensation" to test). Basically, my project should look like the first image, but has in fact lost all its compensation settings, as shown on 2nd image (latest dxf2gcode).

For point 3), I am about to revert the "fix". I can possibly add a menu entry named "Cancel all cutter compensations" that executes the code from the "fix", but not sure it's necessary, because removing all cutter compensations is just a matter of selecting all shapes and selecting "Cutter Compensation -> G40 No Compensation".

Christian, Andrey, what do you think? Do I add this menu entry?


dxf2gcode_ok.pngdxf2gcode_cutter_compensation_messed-up.png


See you,

Xavier

beijing_patte_spot_SLV_229090.d2g
beijing_patte_spot_SLV_229090.dxf

Christian Kohlöffel

unread,
Aug 18, 2020, 4:16:41 PM8/18/20
to 'Timo Birnschein' via dxf2gcode-dev
Hi Xavier,
I am currently not at home am can't verify / check the things you mentioned. But I'll try to answer for now based on what I remember:
1. I can confirm that behaviour and I was not able to find the problem fast. I think it started with this version: https://sourceforge.net/projects/dxf2gcode/files/DXF2GCODE-2019.01.03-win32.msi/download
May be related to python 3 or pyQt5?

2. I never used custom code up to now. Thanks for preparing the fix.

3. I also didn't test that up to now. Based on what you explain I would also revert it as it sounds like a unnecessary  "fix". No need for a menu entry I think. But it's just an opinion. 

Best regards Christian

PS: good to hear that you still use dxf2gcode an many thanks for the support


--
--
You received this message because you subscribed to the Google
Groups-group "dxf2gcode-dev".
To post a message, send mail to dxf2gc...@googlegroups.com
To unsubscribe, send mail to dxf2gcode-de...@googlegroups.com
See http://groups.google.de/group/dxf2gcode-dev?hl=en for more options
and the dxf2gcode project page at http://code.google.com/p/dxf2gcode/
---
You received this message because you are subscribed to the Google Groups "dxf2gcode-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to dxf2gcode-de...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/dxf2gcode-dev/3e5996b2-0a78-426a-9308-b8f59f86d007o%40googlegroups.com.
dxf2gcode_ok.png
dxf2gcode_cutter_compensation_messed-up.png

rando.sauvage

unread,
Aug 25, 2020, 8:59:00 PM8/25/20
to dxf2gcode-dev
Hi Christian!

Thanks for your valuable answer. Yes I still use dxf2gcode, but I tend to not update software often once they are installed and working fine ;-) Now that I have upgraded my distribution, it was time to install the latest version of dxf2gcode too. Thanks for continuing to actively maintain dxf2gcode and answering to various questions! (I am still following the lists)

So, I found some time to make the changes we discussed earlier:
  1. I think I found the problem for the Drag & Drop not working anymore (QMimeData.setData() function expected a QByteArray() as parameter, but got a string...). It should work with all qt5 versions, but who knows? Since I am not 100% sure of my patch, I have placed it in a new branch called "neveruml_tests". Can you checkout it and test if it works for you too?
    (you can also directly apply the patch since it's really simple: https://sourceforge.net/p/dxf2gcode/sourcecode/ci/928fb2720e773f5dd3db0973c31db2a8ea1423f6/ )
  2. The error is fixed by point 3 below:
  3. As discussed, I have reverted the patch and committed to master branch. The fix should work straightforward.
See you,
Xavier
Reply all
Reply to author
Forward
0 new messages