New Python3 PyQt5 3D version

433 views
Skip to first unread message

JP

unread,
Jun 14, 2015, 4:00:21 AM6/14/15
to dxf2gc...@googlegroups.com

Hiya all,

I have tried to postpone this now for long enough now. So here it is.

As most of you probably know I have been working on a new version.

This version is 3d, and written for PyQt5 and python3 (although the latter might change and I might make it also compatible for python2)

 

So in what way does this version differ with the one we already have?

*It’s 3d, duh – panning is done while holding shift; zooming with scroll; rotating with alt (depending if you do it with right click or left click you turn over different axis)

Because it’s 3d you are able to see all segments. So you can see that you might have multiple line segments where a single one would suffice – indicating your dxf was not made optimal; here you can also see the effect of split line segments (is an option)

Some changes that I have only done in this version (but could easily be transformed to the 2d version):

*Every change in the tool parameters should change the canvas, (the thickness of the shape; the direction arrows may change etc.) – it is probably most useful if you use the drag knife option and change the tool width.

*Dragknife now looks at absolute values – meaning if you use it with blocks it still works as expected.

*The direction of the shapes is now by default always clock wise – for straight lines it looks at the position wrt to the work piece zero

*Automatic cutter compensation now can handle nested shapes

*Incremental programming is now supported - G91; in the postpro_config file it’s denoted by abs_export (you should for this option set it on False)

*Break shapes are now applied in the post process (no longer during import). Meaning it only applies the break shapes that are active (i.e. you can deselect some) consequence break shapes are no longer treated as normal shapes i.e. if you have selected them and you do an export it no longer produces g code for them, but simply use them to break other shapes.

*I’m probably still missing a few more changes I made which I simply cannot remember, currently

 

 

There are still a few things I have to implement (but just give low priority):

*rubberband for multi selecting

*connect the show path directions option in the menu (don’t really know what I should do with this one…)

 

So what I have installed to get it all working

Python 3.4(x32)

PyQt GPL v5.4.1 for Python v3.4 (x32)

It can work next to the python2.x and PyQt4!

 

 

Ps: there is one nasty bug in it, the Z direction can for one strange reason flip (only in the gui so not really a big problem only it looks strange) I actually blame this on opengl2.0, but I assume this goes away when I move to a newer version of it – downside of that is that we become depend on another external library (currently 2.0 is by default in the PyQt5 version)



Some pics ;)


pic below I got from the dxf in the topic Mill breaksa.k.a. Tabs error


Frontplatte.png

Kirk Wallace

unread,
Jun 14, 2015, 9:35:16 AM6/14/15
to dxf2gc...@googlegroups.com


On Sunday, June 14, 2015 at 1:00:21 AM UTC-7, JP wrote:

Hiya all,

I have tried to postpone this now for long enough now. So here it is.

As most of you probably know I have been working on a new version.

This version is 3d, and written for PyQt5 and python3



Thank you. I really appreciate your effort. Hopefully, I'll get time to explore the new features soon.

JP

unread,
Jun 14, 2015, 4:17:17 PM6/14/15
to dxf2gc...@googlegroups.com
You're welcome. Just liked to do it.

But I just have added a nother great functionality.
Namely DXF2GCODE is now able to create the G41 and G42 paths. So if your machine cannot handle the cutter compensation you can just create it.
You can turn it on in the config file under Cutter_Compensation by setting done_by_machine to False

Check out the attachements
1997.png
rippen.png

Romain Fontaine

unread,
Jun 16, 2015, 8:29:47 PM6/16/15
to dxf2gc...@googlegroups.com
Hi JP, great job!

I'd be very happy to try and discuss the cutter compensation with you. I had an error on a Fanuc 0M control last weekend with the G42. It was just a matter of inverting 2 lines in the gcode to get it running, I can document more about that (maybe open a ticket?)

There is one thing I noticed when trying to setup a job, I often repeat the same actions a lot of time. For example, it doesn't hold any settings when re-opening a DXF file, or it looses all the tools informations when resetting the origin to a different location.
Also, any modification should not change the selected entities (reselect all)
It could be great to have a project files to hold DXF, cut configuration and settings. Plus handling DXF revisions and reloading the file would update the features accordingly (assuming we can address them with a UID).

Another idea: job statistics could be fun to see: minimal radius for the shape/job, total time, milling time to help tool selection and job planning. Plus suggest tool?

JP

unread,
Jun 17, 2015, 6:48:50 AM6/17/15
to dxf2gc...@googlegroups.com
 Hi,
Yeah feel free to open a ticket on that. Those other tickets you made are also some great additions. If no one else will fix them I will fix them in the near future. First I want to make the new code python2, python3, pyqt4 and pyqt5 compatible so that if we make some changes we don't have to apply them to both versions. Since I think we still have to support the old version for quite a while :|

About the setup... I have seen this complain before... But a while a go some user developed a nice method for that http://sourceforge.net/p/dxf2gcode/wiki/LayerControl/ (Robert has added some more nice features to it)

But I'm also thinking about developing something for that. Not yet sure though wat the friendliest solution is, and the easiest to develop... Have to think about it, but if you have some more nice Ideas... let us know! (the one you suggest shouldn't be too difficult...)
*Origin to a different location reset's it all. Only options that stays the same while reloading or opening another file are the options in the options tab.

I like the idea of statistics. Especially since it is very easy to supply them, because we actually already got all that data more or less.
Suggest a tool seems rather difficult. How should we do that, where should we base that on?

JP

unread,
Jul 2, 2015, 4:41:48 PM7/2/15
to dxf2gc...@googlegroups.com
I have currently merged both branches on the branch Bringing_both_versions_together. If none of the developers/admins has a complaint (or someone finds a bug) I will soon make that branch the master branch (after I have updated the translation files). Since I also fixed quite some known issues/bugs on that branch, and it contains some new features like the offset algorithm.
This version can now be used with Python 2 and 3. And even with PyQt4 and PyQt5!!! And that really took me some time to accomplish, but definitely worth it ;)

O 3d is an option only available if you have Qt5.4, but dxf2gcode will let you know if you are running it incorrectly - it's an option in the config file mode3d

JP

unread,
Jul 13, 2015, 5:35:49 PM7/13/15
to dxf2gc...@googlegroups.com
Hi,
I think this branch is now good to go (thanks to some users who provided me some feedback). So I have merged it to master.

Translation files are updated (although they can use some tlc)
Updating 'D:\dxf2gcode-sourcecode\source\i18n\dxf2gcode_de_DE.qm'...
    Generated 153 translation(s) (153 finished and 0 unfinished)
    Ignored 18 untranslated source text(s)
Updating 'D:\dxf2gcode-sourcecode\source\i18n\dxf2gcode_fr.qm'...
    Generated 149 translation(s) (149 finished and 0 unfinished)
    Ignored 22 untranslated source text(s)

I also added the long awaited feature that makes it possible to save your project. So no longer needed to retype all parameters if you want to run it again, or if you have updated your original file with some added shapes etc... - changing shapes is allowed, but they will be considered a complete new shape (so you do need to retype it for that shape, but not updated shapes are added last, so they are easy to notice in tree view)







On Thursday, July 2, 2015 at 10:41:48 PM UTC+2, JP wrote:
I have currently merged both branches on the branch Bringing_both_versions_together. If none of the developers/admins has a complaint (or someone finds a bug) I will soon make that branch the master branch (after I have updated the translation files). Since I also fixed quite some known issues/bugs on that branch, and it contains some new features like the offset algorithm.
This version can now be used with Python 2 and 3. And even with PyQt4 and PyQt5!!! And that really took me some time to accomplish, but
...

Christian Kohlöffel

unread,
Jul 14, 2015, 5:10:16 AM7/14/15
to dxf2gc...@googlegroups.com
Hi JP,

don't know if you already fixed it, but i found another "missing
feature" in the 2D Canvas. In former times the center of scaling was at
the curser location. Seems like in the new version the scaling center is
just the center of the canvas, right?

regards
Christian

Christian Kohlöffel

unread,
Jul 14, 2015, 8:48:54 AM7/14/15
to dxf2gc...@googlegroups.com
HI JP,

just merged you update into my branch. Now i have the following error
running with python 2.7. With python 3.3 there is no error message.

Traceback (most recent call last):
File "D:\EGIT_DXF2GCODE\sourcecode\source\dxf2gcode.py", line 45, in
<module>
from core.project import Project
File "D:\EGIT_DXF2GCODE\sourcecode\source\core\project.py", line 141
exec(content, globals(), {'d2g': self})
SyntaxError: unqualified exec is not allowed in function 'load' it
contains a nested function with free variables


regards
Christian

JP

unread,
Jul 14, 2015, 11:26:49 AM7/14/15
to dxf2gc...@googlegroups.com
Scaling still happens at cursor location. At least on my machine in 2d and 3d version! Please recheck it correctly.

I don't get the project exec error in 2.7.9 so I cannot reproduce the error. But I do know a work around. Will commit it tonight.

JP

unread,
Jul 14, 2015, 3:21:36 PM7/14/15
to dxf2gc...@googlegroups.com
Alright I have just fixe it and pushed it to master.

The syntaxerror appears only to happen to early versions of Python 2.7 (http://bugs.python.org/issue21591). Took me a while to reproduce it, since I even couldn't reproduce it with Py2.6. But gladly with all this testing I found two more "bugs". One related to Py2.6, since that versions does not support dict comprehensions (is available since Py2.7). And I found a bug related to the arrow's directions of the export route. Also tested the zooming and that really works correct (just like old the old versions)!

Regards,
JP

Christian Kohlöffel

unread,
Jul 15, 2015, 9:50:01 AM7/15/15
to dxf2gc...@googlegroups.com

Thanks JP. I'm still working  on the offset thing. I think i will have some preliminary for closed shapes soon. I will let you know to test it. It's faster, but also kind of complex again.
Regards Christian

--
--
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.
For more options, visit https://groups.google.com/d/optout.

Christian Kohlöffel

unread,
Jul 15, 2015, 5:28:56 PM7/15/15
to dxf2gc...@googlegroups.com
Hi JP,

just commited my last changes. Still not working 100% but it's kind of
stable for closed shapes with some bugs. Feel free to check it ...

regards
Christian

JP

unread,
Jul 28, 2015, 6:10:26 AM7/28/15
to dxf2gcode-dev, christian-...@t-online.de
Hi Christian,
Did you make any progress? Otherwise I think it's time for a new release (of current master branch) - will make one. With the current offset algorithm released with a warning as beta version.

Christian Kohlöffel

unread,
Jul 28, 2015, 2:47:20 PM7/28/15
to dxf2gc...@googlegroups.com
Hi JP,

I'm sorry but i did not gain any further progress since last week. I'm still working on the global intersections, which will be the next step. However, i think the implemented offset algorithm in my branch is working and it's producing good results for the most of the shapes. I think you may use this one in the beta version as well.
Yes its time for a new release ....

regards
Christian
--

rando.sauvage

unread,
Oct 15, 2015, 11:49:31 AM10/15/15
to dxf2gcode-dev
Hi,

I have just tested the 3D mode on Linux (Mageia 5), with python-2.7 and PyQT5.4
I must say this is a huge improvement, I used to launch a simulation version of LinuxCNC to check my GCODE ; with the 3D mode of dxf2gcode, it won't be necessary anymore :-)

I have 2 remarks regarding this new 3D feature:

- On Linux, [ALT] + mouse click has always been reserved to move/resize the current window, so could you please provide another combination (I can't rotate my pieces in dxf2gcode)? Maybe using [CTRL] key, or no key at all like in LinuxCNC?

- For each shape, should I see all the slices of the tool paths (like on LinuxCNC) or just the first one and the last one? Currently I am only seeing the first and the last one, but I would prefer to see all the slices.

Thanks for your great work,
Xavier

JP

unread,
Oct 19, 2015, 3:17:48 AM10/19/15
to dxf2gcode-dev
Hiya,
I indeed only plot the first and last slice. But if you want you can edit the drawHorLine function in canvas3d.py. It is really simple to edit that function for this purpose. But I did it on purpose since more lines make it slower. And I'm not sure how it will perform on an old video card. I currently tested it with the heaviest dxf I know (draak.dxf)... (this one still goes smoothly on my machine, but I doubt it if I draw more lines it still goes smoothly on slower machines) Maybe this should be an option as well (in the config file).

I did not know that [alt] + mouse click is reserved in linux. But the most appropriate solution would be no combination at all. since I still think [ctrl] should be used for multi-select, and the [shift] key was already used in the 2d version for panning. So no key would seem the best solution, and its also good if it's more like linuxCNC behaviour ;)

Feel free to edit. It's quite simple just do some appropriate stuff with the flag isRotating :P
I will fix this one (if you don't) but not very soon - can take a couple of months; too busy currently. So feel free to fix it yourself - or simply cancel that linux combo http://askubuntu.com/questions/118151/how-do-i-disable-window-move-with-alt-left-mouse-button-in-gnome-shell 

Rando Sauvage

unread,
Oct 19, 2015, 5:32:08 AM10/19/15
to dxf2gc...@googlegroups.com
Hi,

Thanks for your detailed answer. As for the slices, you are right, a config option for drawing all the slices or not is the best solution. I will try to look at this in the next weeks.

As for the [ALT] + click, I will most likely look at this too. You are right, using [CTRL] is a bad idea since it's already used. I will most likely use no key, it shouldn't have any drawback. And removing the [ALT] + click function on Linux is not an option ;-) It is a really useful feature, especially on multi-head setups like mine, I use it a lot to move the windows across all the screens.

See you,
Xavier

--
--
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.
For more options, visit https://groups.google.com/d/optout.

Chrisko

unread,
Jan 5, 2016, 11:16:57 AM1/5/16
to dxf2gcode-dev, christian-...@t-online.de
Hi there,

best new year wishes from my side. I hope all of you had a good start into the new year. 

Today i found the time to fix the open topic with cutter offset of open shapes. 

My intention was to commit it into my working branch, but i failed and commited it into the master (thats what i think i did) Im sorry for that. But as it is working quite stable i propose to keep it as is. 

JP can you check if i missed something during my complex merge, But i for me everything looks quit OK. Feel free to comment, i'am open for any improvements. 

regards
Christian

Ps: I also found the time to have a detailed look on all the new features of the PyQT5 version. You all did a great job there, thanks again for contribution. 

JP and rando, i added you both to the administer of the groups, if there are any spam etc. messages to be delete or edited (whatever, its good to have admin rights, right?.

JP

unread,
Jan 6, 2016, 8:12:32 AM1/6/16
to dxf2gcode-dev, christian-...@t-online.de
Hi,
Best wishes to you too.
I already thought you merged it from the wrong direction: your branch to master instead of the otherway around. But yeah it does not really matter - so let's leave it ;-)
Checked it and placed a comment in the other topic :P

Thanks for me adding me

rando.sauvage

unread,
Jan 10, 2016, 2:59:46 PM1/10/16
to dxf2gcode-dev, christian-...@t-online.de
Hi there,

Happy new year to both of you :-)
Thanks for adding me too.

I used my branch (with config window) a lot these days for milling some pieces, and I also found a lot of bugs in dxf2gcode (none related to the config window). Most of these bugs were causing segfault to dxf2gcode, so they are a bit annoying ;-) (divide by zero error in 3D version, several errors related to custom gcode that has not the properties of a standard shape, also causing segfault, ...).
Excepted these bugs, the newer versions are really great (especially the "Save as" feature). And maybe some of these bugs are now corrected.

Anyway, I plan to merge my branch into the main, and then correct / report all these bugs.

Question: is the main currently stable and working fine, or do you have some pending commits to do before I merge my branch with the main?

See you,
Xavier

JP

unread,
Jan 12, 2016, 5:02:13 AM1/12/16
to dxf2gcode-dev, christian-...@t-online.de
Hi,
It should be stable now. Though I have done nothing with the code so the bugs you mention divide by zero should be still there....

Also a known bug with the save as is that it looks at not the abs geos. But it is also now not working anymore on master with the old files because of the last made merge. Since Christian chanched some of the __str__ functions - I used the __str__ functions. I must made some new functions especially for the sava as functions. Will do it this week, including the known bug...
Reply all
Reply to author
Forward
0 new messages