Installation

Anonymous Damian Wrobel J-P chrisko spicer

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:

https://github.com/ltspicer/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: https://www.python.org/downloads/,
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) [http://www.xpdfreader.com/download.html] (Xpdf-tools package),
- pstoedit (>=3.70) [https://sourceforge.net/projects/pstoedit/],
- gswin32c (>=9.09) [https://sourceforge.net/projects/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: https://src.fedoraproject.org/rpms/dxf2gcode).

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 $var | tr -d "\r" > clean/$var;
done
mv clean/* ./
rmdir clean/

Make the file executable

chmod +x dxf2gcode.py

Related

Wiki: Home

Discussion

  • Billy Waggoner

    Billy Waggoner - 2017-07-18

    I have done all the appropriate configuring and now instead of getting the PSTOEDIT error message it goes to open my PDF file then immediately closes the application....

     
    • Damian Wrobel

      Damian Wrobel - 2017-09-25

      Please consider to re-check it using version 20170925.

       

Log in to post a comment.