Commit 5223de46 authored by sumpfralle's avatar sumpfralle

merged r1088-r1093


git-svn-id: https://pycam.svn.sourceforge.net/svnroot/pycam/trunk@1096 bbaffbd6-741e-11dd-a85d-61de82d9cad9
parent 249f874a
Version 0.5.1 - UNRELEASED Version 0.5.1 - 2011-06-13
* added extrusion for 2D models * added extrusion for 2D models
* 2D projection of multi-layered 2D models * 2D projection of multi-layered 2D models
* significantly improved performance of 3D visualization * significantly improved performance of 3D visualization
* fixed "help" links for Windows users * fixed "help" links for Windows users
* added GTK theme with a native look&feel for Windows * added GTK theme with a native look&feel for Windows
* improved detection of library locations for Windows package * improved detection of library locations for Windows package
* added file type associations (mime) to the debian package
* minor bugs fixed * minor bugs fixed
Version 0.5 - 2011-03-28 Version 0.5 - 2011-03-28
......
...@@ -8,7 +8,7 @@ include release_info.txt ...@@ -8,7 +8,7 @@ include release_info.txt
include pycam include pycam
recursive-include desktop * recursive-include desktop *
recursive-include man * recursive-include man *
recursive-include src * recursive-include src *.py
recursive-include share * recursive-include share *
recursive-include samples * recursive-include samples *
recursive-include Tests * recursive-include Tests *
pycam (0.4-2) unstable; urgency=low pycam (0.5.1-1) unstable; urgency=low
* Improved the packaging based on suggestions by Benoît Knecht: * initial debian package
* Changed the copyright file to the format specified by DEP5 * Closes: #600779
* Removed postinst and prerm placeholders
* Added descriptions to the patches
* Added a watch file
-- Lars Kruse <devel@sumpfralle.de> Sun, 14 Nov 2010 15:46:01 +0100 -- Lars Kruse <devel@sumpfralle.de> Mon, 13 Jun 2011 02:04:59 +0200
pycam (0.4-1) unstable; urgency=low
* new upstream release
-- Lars Kruse <devel@sumpfralle.de> Tue, 19 Oct 2010 12:11:27 +0200
pycam (0.3-1) unstable; urgency=low
* new upstream release
* Switch to dpkg-source 3.0 (quilt) format
* Updated policy to 3.9.1 (no changes)
-- Lars Kruse <devel@sumpfralle.de> Mon, 16 Aug 2010 15:57:45 +0200
pycam (0.2.3-1) unstable; urgency=low
* new upstream release
-- Lars Kruse <devel@sumpfralle.de> Mon, 05 Apr 2010 02:48:36 +0200
pycam (0.2.2-1) unstable; urgency=low
* Initial debianization of r243 of the SVN repo on sourceforge
-- Sebastian Kuzminsky <seb@highlab.com> Tue, 16 Mar 2010 22:14:56 -0600
...@@ -4,7 +4,7 @@ Priority: extra ...@@ -4,7 +4,7 @@ Priority: extra
Maintainer: Lars Kruse <devel@sumpfralle.de> Maintainer: Lars Kruse <devel@sumpfralle.de>
Build-Depends: python, debhelper (>= 7), cdbs, patchutils Build-Depends: python, debhelper (>= 7), cdbs, patchutils
Build-Depends-Indep: python-support, help2man Build-Depends-Indep: python-support, help2man
Standards-Version: 3.9.1 Standards-Version: 3.9.2
Homepage: http://sourceforge.net/projects/pycam/ Homepage: http://sourceforge.net/projects/pycam/
Package: pycam Package: pycam
...@@ -12,18 +12,20 @@ Architecture: all ...@@ -12,18 +12,20 @@ Architecture: all
Depends: python-gtk2, python-opengl (>>3.0.0~b6-3), python-gtkglext1, Depends: python-gtk2, python-opengl (>>3.0.0~b6-3), python-gtkglext1,
${misc:Depends}, ${python:Depends} ${misc:Depends}, ${python:Depends}
Recommends: python-pyode (>>1.2.0-3), python-psyco, python-setproctitle Recommends: python-pyode (>>1.2.0-3), python-psyco, python-setproctitle
Description: CAM program & library written in Python Suggests: inkscape, pstoedit, qcad-data
This is a set of Python modules for toolpath generation for 3-Axis Description: CAM program & Python library for generating toolpaths
CNC machining, and a GUI program that uses them. PyCAM is a toolpath generator for 3 axis machines. The generated
GCode can be used with EMC2 and other machine controllers.
The included Python library can be used independently from the GUI.
. .
Features: Features:
* read and write STL model files * read and write STL model files (3D)
* limited support for 2D models (SVG or DXF) * support for 2D models (DXF/SVG/PS)
* generate and export toolpaths (gcode) for various strategies and * generate toolpaths (GCode) for various strategies and drill
drill definitions definitions
* manage processing templates (e.g. rough, semi-finish and finish * manage and store processing templates
operations)
* scale, move, rotate, flip and transform the model * scale, move, rotate, flip and transform the model
* interactive 3D model view * interactive 3D model view based on OpenGL
* non-interactive generation of GCode via commandline * non-interactive generation of GCode via commandline
* render single-line fonts (provided by QCAD)
...@@ -4,12 +4,12 @@ Maintainer: Lars Kruse <devel@sumpfralle.de> ...@@ -4,12 +4,12 @@ Maintainer: Lars Kruse <devel@sumpfralle.de>
Source: http://pycam.sourceforge.net Source: http://pycam.sourceforge.net
Files: * Files: *
Copyright: 2010, Lars Kruse <devel@sumpfralle.de> Copyright: 2010-2011, Lars Kruse <devel@sumpfralle.de>
2006-2010, Lode Leroy 2006-2010, Lode Leroy
License: GPL-3+ License: GPL-3+
Files: debian/* Files: debian/*
Copyright: 2010, Lars Kruse <devel@sumpfralle.de> Copyright: 2010-2011, Lars Kruse <devel@sumpfralle.de>
2010, Sebastian Kuzminsky <seb@highlab.com> 2010, Sebastian Kuzminsky <seb@highlab.com>
License: GPL-3+ License: GPL-3+
......
usr/share/applications usr/share/applications
usr/share/icons/hicolor/scalable/apps
Changelog
technical_details.txt technical_details.txt
README.TXT README.TXT
Description: Remove windows-only file from the Debian package
The respective file is a helper script for packaging the windows installer
of PyCAM.
Forwarded: not-needed
Author: Lars Kruse <devel@sumpfralle.de>
diff -Nur -x '*.orig' -x '*~' pycam-0.2.2//setup.py pycam-0.2.2.new//setup.py
--- pycam-0.2.2//setup.py 2010-03-20 12:57:16.000000000 +0100
+++ pycam-0.2.2.new//setup.py 2010-03-20 13:07:53.026518970 +0100
@@ -76,7 +76,7 @@
"pycam.Toolpath",
"pycam.Physics",
],
- scripts = ['pycam', 'pycam_win32_postinstall.py'],
+ scripts = ['pycam'],
data_files=[("share/pycam/doc", [
"COPYING.TXT",
"technical_details.txt",
Subject: Remove documentation files that are not useful for the package.
Forwarded: not-needed
Author: Lars Kruse <devel@sumpfralle.de>
diff --git a/setup.py b/setup.py
index 3046304..9f66f6d 100755
--- a/setup.py
+++ b/setup.py
@@ -78,13 +78,9 @@ setup(
],
scripts = ['pycam'],
data_files=[("share/pycam/doc", [
- "COPYING.TXT",
"technical_details.txt",
- "INSTALL.TXT",
- "LICENSE.TXT",
"README.TXT",
- "Changelog",
- "release_info.txt"]),
+ "Changelog"]),
("share/pycam/ui", [
os.path.join("share", "ui", "pycam-project.ui"),
os.path.join("share", "ui", "menubar.xml"),
00.remove_windows_install_script.patch
01.remove-superfluous-files-from-doc.patch
../share/mime/pycam.mime
\ No newline at end of file
../share/mime/pycam.xml
\ No newline at end of file
...@@ -27,6 +27,14 @@ build/pycam:: ...@@ -27,6 +27,14 @@ build/pycam::
# install the .desktop file # install the .desktop file
install/pycam:: install/pycam::
cp -v desktop/pycam.desktop `pwd`/debian/pycam/usr/share/applications/ # "desktop" file
cp -v share/desktop/pycam.desktop `pwd`/debian/pycam/usr/share/applications/
# application logo for the menu entry
cp -v share/ui/logo_scalable.svg `pwd`/debian/pycam/usr/share/icons/hicolor/scalable/apps/pycam.svg
# remove "doc" directory from /usr/share/pycam/
rm -rf `pwd`/debian/pycam/usr/share/pycam/doc rm -rf `pwd`/debian/pycam/usr/share/pycam/doc
# the CXF fonts are distributed by QCAD - use them instead of the embedded ones
rm -rf `pwd`/debian/pycam/usr/share/pycam/fonts
# the gtkrc file for Windows is useless
rm `pwd`/debian/pycam/usr/share/pycam/ui/gtkrc_windows
...@@ -95,6 +95,7 @@ log = pycam.Utils.log.get_logger() ...@@ -95,6 +95,7 @@ log = pycam.Utils.log.get_logger()
EXAMPLE_MODEL_LOCATIONS = [ EXAMPLE_MODEL_LOCATIONS = [
os.path.join(BASE_DIR, "samples"), os.path.join(BASE_DIR, "samples"),
os.path.join(sys.prefix, "share", "pycam", "samples"), os.path.join(sys.prefix, "share", "pycam", "samples"),
os.path.join(sys.prefix, "local", "share", "pycam", "samples"),
os.path.join("usr", "share", "pycam", "samples")] os.path.join("usr", "share", "pycam", "samples")]
# for pyinstaller (windows distribution) # for pyinstaller (windows distribution)
if "_MEIPASS2" in os.environ: if "_MEIPASS2" in os.environ:
......
...@@ -9,6 +9,7 @@ from pycam.Utils import get_platform, PLATFORM_LINUX, PLATFORM_WINDOWS, PLATFORM ...@@ -9,6 +9,7 @@ from pycam.Utils import get_platform, PLATFORM_LINUX, PLATFORM_WINDOWS, PLATFORM
from pycam import VERSION from pycam import VERSION
USE_DEBUG=False
UI_DATA_RELATIVE = os.path.join("share", "ui") UI_DATA_RELATIVE = os.path.join("share", "ui")
UI_DATA_DIR = os.path.join(BASE_DIR, UI_DATA_RELATIVE) UI_DATA_DIR = os.path.join(BASE_DIR, UI_DATA_RELATIVE)
ORIGINAL_STARTUP_SCRIPT = os.path.join(BASE_DIR, "pycam") ORIGINAL_STARTUP_SCRIPT = os.path.join(BASE_DIR, "pycam")
...@@ -23,11 +24,8 @@ if rename_startup_script: ...@@ -23,11 +24,8 @@ if rename_startup_script:
else: else:
STARTUP_SCRIPT = ORIGINAL_STARTUP_SCRIPT STARTUP_SCRIPT = ORIGINAL_STARTUP_SCRIPT
data = [(os.path.join(UI_DATA_RELATIVE, "pycam-project.ui"), os.path.join(UI_DATA_DIR, "pycam-project.ui"), "DATA"), data = []
(os.path.join(UI_DATA_RELATIVE, "menubar.xml"), os.path.join(UI_DATA_DIR, "menubar.xml"), "DATA"), data.extend(Tree(UI_DATA_DIR, prefix=UI_DATA_RELATIVE))
(os.path.join(UI_DATA_RELATIVE, "logo_gui.png"), os.path.join(UI_DATA_DIR, "logo_gui.png"), "DATA"),
(os.path.join(UI_DATA_RELATIVE, "gtkrc_windows"), os.path.join(UI_DATA_DIR, "gtkrc_windows"), "DATA"),
]
# sample models # sample models
data.extend(Tree(os.path.join(BASE_DIR, "samples"), prefix="samples")) data.extend(Tree(os.path.join(BASE_DIR, "samples"), prefix="samples"))
...@@ -183,10 +181,10 @@ exe = EXE(pyz, ...@@ -183,10 +181,10 @@ exe = EXE(pyz,
exclude_binaries=False, exclude_binaries=False,
name=output_name, name=output_name,
icon=icon_file, icon=icon_file,
debug=True, debug=USE_DEBUG,
strip=False, strip=False,
upx=False, upx=True,
console=True, console=USE_DEBUG,
) )
......
...@@ -2,6 +2,9 @@ ...@@ -2,6 +2,9 @@
install_script = pycam_win32_postinstall.py install_script = pycam_win32_postinstall.py
bitmap = share/ui/logo_gui_vertical.bmp bitmap = share/ui/logo_gui_vertical.bmp
[bdist_msi]
install_script = pycam_win32_postinstall.py
[bdist_rpm] [bdist_rpm]
packager = Lars Kruse <devel@sumpfralle.de> packager = Lars Kruse <devel@sumpfralle.de>
doc_files = Changelog doc_files = Changelog
......
...@@ -37,7 +37,7 @@ WINDOWS_START_SCRIPT = "pycam-loader.py" ...@@ -37,7 +37,7 @@ WINDOWS_START_SCRIPT = "pycam-loader.py"
DEFAULT_START_SCRIPT = "pycam" DEFAULT_START_SCRIPT = "pycam"
# we don't want to include the windows postinstall script in other installers # we don't want to include the windows postinstall script in other installers
is_windows_installer = "bdist_wininst" in sys.argv is_windows_installer = "bdist_wininst" in sys.argv or "bdist_msi" in sys.argv
if is_windows_installer: if is_windows_installer:
shutil.copy2(os.path.join(BASE_DIR, DEFAULT_START_SCRIPT), shutil.copy2(os.path.join(BASE_DIR, DEFAULT_START_SCRIPT),
......
...@@ -2,8 +2,12 @@ ...@@ -2,8 +2,12 @@
Version=1.0 Version=1.0
Name=PyCAM Name=PyCAM
GenericName=Toolpath Generator GenericName=Toolpath Generator
Comment=Toolpath Generation for 3-Axis CNC machining Comment=generate GCode for 3-Axis CNC machining
Exec=pycam Exec=pycam %u
TryExec=pycam
Terminal=false Terminal=false
Type=Application Type=Application
Categories=Development;Engineering;Robotics; Categories=Development;Engineering;Robotics;Education;Science;2DGraphics;VectorGraphics;3DGraphics
MimeType=application/sla;image/svg+xml;application/postscript;image/vnd.dxf
Icon=pycam
application/sla; pycam '%s'; description="Stereo Lithographic File"; test=test -n "$DISPLAY"; nametemplate=%s.stl application/sla; pycam '%s'; description="Stereo Lithographic File"; test=test -n "$DISPLAY"; nametemplate=%s.stl
image/vnd.dxf; pycam '%s'; description="Drawing Interchange File"; test=test -n "$DISPLAY"; nametemplate=%s.dxf
image/svg+xml; pycam '%s'; description="Vector Graphics"; test=test -n "$DISPLAY" && which inkscape && which pstoedit; nametemplate=%s.svg
application/postscript; pycam '%s'; description="Postscript"; test=test -n "$DISPLAY" && which pstoedit
...@@ -7,5 +7,12 @@ ...@@ -7,5 +7,12 @@
</magic> </magic>
<glob pattern="*.stl"/> <glob pattern="*.stl"/>
</mime-type> </mime-type>
<mime-type type="image/vnd.dxf">
<comment>Drawing Interchange Files (2D or 3D models)</comment>
<magic priority="50">
<match type="string" offset="0:20" value="SECTION"/>
</magic>
<glob pattern="*.dxf"/>
</mime-type>
</mime-info> </mime-info>
This diff is collapsed.
...@@ -59,7 +59,7 @@ def _get_num_converter(step_width): ...@@ -59,7 +59,7 @@ def _get_num_converter(step_width):
""" Return a float-to-decimal conversion function with a prevision suitable """ Return a float-to-decimal conversion function with a prevision suitable
for the given step width. for the given step width.
""" """
digits=_get_num_of_significant_digits(step_width) digits = _get_num_of_significant_digits(step_width)
format_string = "%%.%df" % digits format_string = "%%.%df" % digits
return lambda number: decimal.Decimal(format_string % number) return lambda number: decimal.Decimal(format_string % number)
......
...@@ -928,15 +928,15 @@ class PolygonGroup(object): ...@@ -928,15 +928,15 @@ class PolygonGroup(object):
if len(valid_points) < 3: if len(valid_points) < 3:
result = [] result = []
elif len(valid_points) == 3: elif len(valid_points) == 3:
result = [Triangle(*valid_points)] result = [Triangle(*valid_points)]
else: else:
# create a simple star-like fan of triangles - not perfect, but ok # create a simple star-like fan of triangles - not perfect, but ok
result = [] result = []
start = valid_points.pop(0) start = valid_points.pop(0)
while len(valid_points) > 1: while len(valid_points) > 1:
p2, p3 = valid_points[0:2] p2, p3 = valid_points[0:2]
result.append(Triangle(start, p2, p3)) result.append(Triangle(start, p2, p3))
valid_points.pop(0) valid_points.pop(0)
return result return result
def _get_grid_matrix(self, stepping): def _get_grid_matrix(self, stepping):
......
...@@ -50,12 +50,11 @@ from pycam import VERSION ...@@ -50,12 +50,11 @@ from pycam import VERSION
import pycam.Physics.ode_physics import pycam.Physics.ode_physics
# this requires ODE - we import it later, if necessary # this requires ODE - we import it later, if necessary
#import pycam.Simulation.ODEBlocks #import pycam.Simulation.ODEBlocks
import gtk import gtk
import gobject import gobject
import webbrowser import webbrowser
import ConfigParser import ConfigParser
import urllib
import urlparse
import string import string
import StringIO import StringIO
import pickle import pickle
...@@ -69,10 +68,9 @@ import re ...@@ -69,10 +68,9 @@ import re
import os import os
import sys import sys
GTKBUILD_FILE = "pycam-project.ui" GTKBUILD_FILE = "pycam-project.ui"
GTKMENU_FILE = "menubar.xml" GTKMENU_FILE = "menubar.xml"
GTKRC_FILE_WINDOWS = os.path.join(UI_SUBDIR, "gtkrc_windows") GTKRC_FILE_WINDOWS = "gtkrc_windows"
WINDOW_ICON_FILENAMES = ["logo_%dpx.png" % pixels for pixels in (16, 32, 48, 64, 128)] WINDOW_ICON_FILENAMES = ["logo_%dpx.png" % pixels for pixels in (16, 32, 48, 64, 128)]
...@@ -347,7 +345,7 @@ class ProjectGui(object): ...@@ -347,7 +345,7 @@ class ProjectGui(object):
gtk.main_quit() gtk.main_quit()
self.gui.add_from_file(gtk_build_file) self.gui.add_from_file(gtk_build_file)
if pycam.Utils.get_platform() == pycam.Utils.PLATFORM_WINDOWS: if pycam.Utils.get_platform() == pycam.Utils.PLATFORM_WINDOWS:
gtkrc_file = get_data_file_location(GTKRC_FILE_WINDOWS) gtkrc_file = get_ui_file_location(GTKRC_FILE_WINDOWS)
if gtkrc_file: if gtkrc_file:
print "GTKRC: %s" % str(gtkrc_file) print "GTKRC: %s" % str(gtkrc_file)
gtk.rc_add_default_file(gtkrc_file) gtk.rc_add_default_file(gtkrc_file)
......
...@@ -73,10 +73,27 @@ def convert_eps2dxf(eps_filename, dxf_filename, location=None, unit="mm"): ...@@ -73,10 +73,27 @@ def convert_eps2dxf(eps_filename, dxf_filename, location=None, unit="mm"):
return False return False
returncode = process.wait() returncode = process.wait()
if returncode == 0: if returncode == 0:
return True try:
# pstoedit fails with exitcode=0 if ghostscript is not installed.
# The resulting file seems to be quite small (268 byte). But it is
# not certain, that this filesize is fixed in case of this problem.
if os.path.getsize(dxf_filename) < 280:
log.warn(("SVGImporter: maybe there was a problem with " + \
"the conversion from EPS (%s) to DXF.\nProbably " + \
"you need to install 'ghostscript' " + \
"(http://pages.cs.wisc.edu/~ghost).") % \
str(eps_filename))
return True
except OSError:
# The dxf file was not created.
log.warn("SVGImporter: no DXF file was created, even though " + \
"no error code was returned. This seems to be a bug " + \
"of 'pstoedit'. Please send the original model file " + \
"to the PyCAM developers. Thanks!")
return False
elif returncode == -11: elif returncode == -11:
log.warn(("SVGImporter: maybe there was a problem with the " + \ log.warn(("SVGImporter: maybe there was a problem with the " + \
"conversion from EPS (%s) to DXF\n Users of Ubuntu 'lucid' " + \ "conversion from EPS (%s) to DXF.\n Users of Ubuntu 'lucid' " + \
"should install the package 'libpstoedit0c2a' from the " + \ "should install the package 'libpstoedit0c2a' from the " + \
"'maverick' repository to avoid this warning.") % \ "'maverick' repository to avoid this warning.") % \
str(eps_filename)) str(eps_filename))
......
...@@ -23,6 +23,8 @@ along with PyCAM. If not, see <http://www.gnu.org/licenses/>. ...@@ -23,6 +23,8 @@ along with PyCAM. If not, see <http://www.gnu.org/licenses/>.
import os import os
import sys import sys
import pycam.Utils.log
DATA_DIR_ENVIRON_KEY = "PYCAM_DATA_DIR" DATA_DIR_ENVIRON_KEY = "PYCAM_DATA_DIR"
FONT_DIR_ENVIRON_KEY = "PYCAM_FONT_DIR" FONT_DIR_ENVIRON_KEY = "PYCAM_FONT_DIR"
...@@ -44,7 +46,10 @@ if FONT_DIR_ENVIRON_KEY in os.environ: ...@@ -44,7 +46,10 @@ if FONT_DIR_ENVIRON_KEY in os.environ:
FONT_DIR_OVERRIDE = os.path.normpath(os.environ[FONT_DIR_ENVIRON_KEY]) FONT_DIR_OVERRIDE = os.path.normpath(os.environ[FONT_DIR_ENVIRON_KEY])
else: else:
FONT_DIR_OVERRIDE = None FONT_DIR_OVERRIDE = None
FONT_DIR_FALLBACK = "/usr/share/qcad/fonts" FONT_DIRS_FALLBACK = ["/usr/share/librecad/fonts", "/usr/share/qcad/fonts"]
log = pycam.Utils.log.get_logger()
def get_ui_file_location(filename, silent=False): def get_ui_file_location(filename, silent=False):
...@@ -78,11 +83,13 @@ def get_font_dir(): ...@@ -78,11 +83,13 @@ def get_font_dir():
else: else:
log.warn(("Failed to locate the fonts directory '%s' below '%s'. " \ log.warn(("Failed to locate the fonts directory '%s' below '%s'. " \
+ "Falling back to '%s'.") \ + "Falling back to '%s'.") \
% (FONTS_SUBDIR, DATA_BASE_DIRS, FONT_DIR_FALLBACK)) % (FONTS_SUBDIR, DATA_BASE_DIRS, ":".join(FONT_DIRS_FALLBACK)))
if os.path.isdir(FONT_DIR_FALLBACK): for font_dir_fallback in FONT_DIRS_FALLBACK:
return FONT_DIR_FALLBACK if os.path.isdir(font_dir_fallback):
return font_dir_fallback
else: else:
log.warn(("The fallback font directory (%s) does not exist. " \ log.warn(("None of the fallback font directories (%s) exist. " + \
+ "No fonts will be available.") % FONT_DIR_FALLBACK) "No fonts will be available.") % \
":".join(FONT_DIRS_FALLBACK))
return None return None
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment