Howto Howto install dxf2gcode

spicer

Forum-Chef
Teammitglied
Administrator
Moderator
Top Poster des Monats
Landesflagge

Introduction​

Although we aim to make DXF2GCODE work on all major platforms, we would like it if you test it on other platforms (and report the result back to us).
This page tells you how to install the program on Unixes, Windows and macOS (it applies to version 20170925 or newer).

Prerequisites​

Unix machines:​

Automated installer for Debian based systems:​

GitHub - dxf2gcode.linux.installer

Build dependencies:​

- /usr/bin/python3 and development package (>=3.5),
- PyQt5 (>=5.7),
- PyOpenGL (>=3.1),
- /usr/bin/lrelease-qt5 or /usr/bin/lrelease5 or /usr/bin/lrelease,
- /usr/bin/pylupdate5,
- /usr/bin/pyuic5,
- /usr/bin/pyrcc5

Runtime dependencies:​

- /usr/bin/python3 (>=3.5),
- PyQt5 (>=5.7),
- PyOpenGL (>=3.1),
- /usr/bin/pdftops (>=0.45),
- /usr/bin/pstoedit (>=3.70).

Note: Depending you used operating system flavour different package names
might provides required dependencies. Please use package manager to retrieve
those names (e.g. on Fedora Linux use: $ dnf provides /usr/bin/python3).

Windows machine​

Build dependencies:​

- python3 (>=3.6.2),
- setuptools (>=28.8.0),
- sip (>=4.19.3),
- pip (>=9.0.1),
- PyQt5 (>=5.9),
- PyOpenGL (>=3.1),
- pyqt5-tools (>=5.9.0.1.2),
- cx-Freeze (>=5.0.2).

Python 3 should be installed from: Download Python,
during installation pip package should be installed which should install
sip, and setuptools packages. Using pip remaining python dependencies like:
PyQt5, PyOpenGL, pyqt5-tools and cx-Freeze should be installed.

Runtime dependencies:​

only for source release​

- python3 (>=3.6.2),
- PyQt5 (>=5.9),
- PyOpenGL (>=3.1),

additional for both source and binary releases​

- pdftops (>=4.00) [Download Xpdf and XpdfReader] (Xpdf-tools package),
- pstoedit (>=3.70) [pstoedit],
- gswin32c (>=9.09) [Ghostscript].

Note: if gswin32c is not on the PATH then -gs option needs to be added to
pstoedit tool in Options->Configuration->Software config->pstoedit
e.g.: -gs, C:/Program Files (x86)/gs/gs9.09/bin/gswin32c.exe
(above assumes v9.09 and default path installation).

Note(2): pstoedit needs C++ runtime libraries if you don't have it please search for:
"Microsoft Visual C++ 2010 Redistributable Package (x64)" and install it.
It is recommended to run both pdftops and pstoedit from command line (CMD) to
verify the installation correctness.

Building and Installing​

Unix (assumes bash shell):​

$ ./make_tr.py # generates .qm translation files in i18 directory
$ ./make_py_uic.py # generates: dxf2gcode_ui5.py and dxf2gcode_images.qrc
$ python3 ./st-setup.py build
# python3 ./st-setup.py install
$ dxf2gcode

Note(1): depending on used desktop environment you might need to run:
$ /bin/touch --no-create /usr/share/icons/hicolor
and/or re-login to make application’s shortcut appears in the system menu.

Note(2): On Fedora Linux distribution (version >=26) dxf2gode can be
installed directly either by using: dnf install dxf2gcode or from
your preferred graphical package manager (e.g. GNOME Software)
(see also: Overview - rpms/dxf2gcode - src.fedoraproject.org).

Windows​

Using source packages​

Assumes python.exe v3 is on PATH and you are using source distribution from SF files section (dxf2gcode-YYYYMMDD.zip):
python.exe ./make_tr.py
python.exe ./make_py_uic.py
python.exe setup.py bdist_msi

Using precompiled binariess​

Assumes you are using MSI installer either created by aforementioned steps or downloaded from SF files section (DXF2GCODE-YYYY.MM.DD-win32.msi):
Install DXF2GCODE-YYYY.MM.DD-win32.msi
Launch it from Start Menu by typing: dxf2gcode

macOS (not tested at all):​

$ python3 ./make_tr.py
$ python3 ./make_py_uic.py
$ python3 ./setup.py bdist_dmg # this should create Mac disk image

Configuration​

Unix, Windows:​

Basic configuration requires verification of location of pdftops and
pstoedit executables in menu Options->Configuration->Software config.
See "Runtime dependencies" above for list of additional dependencies.

Configuration files are stored on all platforms at the following directory:
~/.config/dxf2gcode

Alternatively the following python code can be used to determine it as well:
import os; print(os.path.join(os.path.expanduser("~"),
".config/dxf2gcode").replace("\\", "/"))

Integration in EMC 2.2 and Axis​

(1) The executable file and all related files must be in the /usr/bin/ folder otherwise Axis can't find the file.
Another method is to make a symbolic link in the /usr/bin/ folder to the executable file located in a different folder (that's how I do it, remember the name may be different depending on the version)
sudo ln -s /SOMEWHERE/...../source/dxf2gcode.py /usr/bin/dxf2gcode.py

To make the link executable you must type the following code
sudo chmod a+x /usr/bin/dxf2gcode.py

(2) Change the AXIS Config File to tell the machine you want to associate all dxf files with dxf2gcode. On my machine the file is located at: home/ICH/emc2/configs/Meine-Maschine/Meine-Maschine.ini
You need to change the Section FILTER to the following (maybe you want to add the Editor also):
[FILTER]
PROGRAM_EXTENSION =.dxf 2D ACad/QCad Drawing
dxf = dxf2gcode.py
PROGRAM_FILTER = python
PROGRAM_EXTENSION = *.py Python Script
[DISPLAY]
EDITOR = gedit

(3) Now there is only one thing left to do. You need to tell DXF2GCODE to write to the standard output of Unix. The Config file can be found, depending on the version, in different folders. The newest version produces the Config folder in the same folder where the dxf2gcode executable is located (not the symbolic link). Please change the write to stdout option as shown below.
[Export Parameters]
write_to_stdout = 1

Failure Messages and Solutions​

bash: ./dxf2gcode.py:
/usr/bin/python3^M: bad interpreter: No such file or directory

The file may contain carriage return characters. Therefore you need to convert those files first.
In bash, the files can be converted conveniently by the following lines:
mkdir clean
for var in $( ls dxf2gcode*.py );
do cat [imath]var | tr -d "\r" > clean/[/imath]var;
done
mv clean/* ./
rmdir clean/

Make the file executable
chmod +x dxf2gcode.py


Installer for Debian based OS download: dxf2gcode Installer für Linux User
 
Zuletzt bearbeitet:
I've created a installer script for Linux users (Debian based -- Debian, Ubuntu, Linux Mint, etc.).

Just start in the console with:
./linux.installer.sh
or double-click and select "run in terminal".
Then follow the instructions. The script will install all necessary packages and dxf2gcode automatically.
The installation is ONLY complete when the script "dxf2gcode was successfully installed." spends in red!

Python 3.7 or higher is required. Is checked by the script.
This script is tested on Debian 10 & 11 with GNOME, Linux Mint 20.3 / 21.1 MATE, Xubuntu 22.04 (XFCE), Kubuntu 22.04 (KDE) and Lubuntu 20.04.4 (LXDE).

Because dxf2gcode does not run properly under Python 3.10, the script can now install Python 3.9 if desired.

Let me know if something doesn't work.
 
;Bonjour
je m'appelle georges barnasson amateur CNC et informatique je viens de faire la traduction de dxf2gcode en francais.
Puis J'ai compilé et installé dxf2gcode sur opensuse tous est ok
I speak English a little if you want i send you DIR i18N .
Salutations
georges.barnasson@free.fr
 
Hello Georges,
I didn't get everything cause I don't speak french. But yes we can integrate the French translation in dxf2gcode. There are 2 possible ways, just send it to me and I will integrate it, or I can grant you rights in sourceforge to do it by yourself.
Regards Christian
 
Hello
I come back from WE and i read your answer.
For the first question i prefer send you the File or i create a account on this forum for transmit file ,image or doc? it better for you?
I can send you also "dxf2gcode-2022_02_26-py3.6.egg" if you want.
For the second question , its more difficult for me . I am just a little boy in soft and all my job must be controlled.For make a rpm a new account be create in OpenSuse for use the tools
and my version 15.2 must be update .A lot of job and time for me.I don't refused but i must be reflect !
this is your mail "christian.kohloeffel@googlemail.com"
Sincères Salutations
 
Hello Geroges,
thats fine, you can send me the files directly to the above mentioned e-mail. I will add them to the development version of dxf2gcode and so they will find their way in the next release.
thanks
Christian
 
The installer is for Debian based OS only.
OSX is not supported.

It seems that you start the script with sudo python3 . That is not correct. In the readme.md I say, that the script must be running without sudo in front.
Just ./linux.installer.sh .
 
Zuletzt bearbeitet:

Benutzer welche diesen Thread betrachten (Mitglieder: 0, Gäste: 1)

Zurück
Oben