Commit dd10fa15 authored by lode_leroy's avatar lode_leroy

Contour

git-svn-id: https://pycam.svn.sourceforge.net/svnroot/pycam/trunk@48 bbaffbd6-741e-11dd-a85d-61de82d9cad9
parent d530ae74
Currently it is not necessary to install the software,
simply unpack the distribution archive, and run "python pycam.py"
from the archive directory
DEPENDENCIES:
-------------
Windows:
--------
Python 2.5
PyOpenGL : http://pyopengl.sourceforge.net/
http://downloads.sourceforge.net/pyopengl/PyOpenGL-3.0.0.win32.exe
TOGL: http://downloads.sourceforge.net/togl/Togl2.0-8.4-Windows.zip
(just copy the directory Togl2.0 into Python25/tcl)
GLUT : http://www.cip.physik.uni-muenchen.de/~georg.hennig/downloads/glut-3.7.6-wheel_mingw.zip
Unix:
-----
Install PyOpenGL, Togl, Glut using your package manager.
Or compile from source:
http://downloads.sourceforge.net/pyopengl/PyOpenGL-3.0.0.tar.gz
In case Togl is not available or not working, I suggest to compile Togl yourself.
http://downloads.sourceforge.net/togl/Togl2.0-src.tar.gz
Install the source packages for tcl and tk using your package manager.
cd ~/Togl2.0
./configure --prefix=/usr --exec-prefix=/usr --enable-threads
make
make install
or, failing that, for download the sources for the same version of tcl and tk
as you have installed on your system:
(http://sourceforge.net/project/showfiles.php?group_id=10894&package_id=10452)
Togl only needs access to a few header files that are not part of the
binary distributions...
I unpacked the tcl and tk sources next to the Togl sources in my home directory, then
cd ~/tcl-8.5.5/unix;
./configure
cd ~/tk-8.5.5/unix;
./configure
cd ~/Togl2.0;
./configure --with-tcl=$HOME/tcl-8.5.5 --with-tk=$HOME/tk-8.5.5 \
--prefix=/usr --exec-prefix=/usr --enable-threads
make
make install
......@@ -19,6 +19,7 @@ Features:
** Linear
** ZigZag
** Polygon
** Contour (aka. waterline)
* Importers:
** STL
......@@ -30,23 +31,6 @@ Features:
** OpenGL
INSTALL:
PyOpenGL : http://pyopengl.sourceforge.net/
http://downloads.sourceforge.net/pyopengl/PyOpenGL-3.0.0b5.tar.gz
(requires TOGL)
TOGL: http://downloads.sourceforge.net/togl/Togl2.0-8.4-Windows.zip
(just copy Togl2.0 into Python25/tcl)
http://downloads.sourceforge.net/togl/Togl2.0-src.tar.gz
(download tcl-8.4-src.tgz and tk-8.4-src.tgz and compile and install togl)
(on windows, this also requires GLUT)
GLUT : http://www.cip.physik.uni-muenchen.de/~georg.hennig/downloads/glut-3.7.6-wheel_mingw.zip
RUNNING:
extract the archive and run "python pycam.py"
......@@ -57,12 +41,21 @@ USAGE:
as a practical approach, you would probably:
1) use the Cylindrical cutter with the PushCutter Pathgenerator and the Polygon PostProcessor to do the "rough" cutting
1) for "rough" cutting,
use the Cylindrical cutter
with the PushCutter Pathgenerator
and the Polygon PostProcessor in "x" or "y" mode
2) use the Toroidal cutter with the ContourCutter Pathgenerator to do the "semifinish" cutting.
(it's not yet implemented, so you can skip this one for now :-)
2) for "semifinish" cutting,
use the Cylindrical/Toroidal cutter
with the PushCutter Pathgenerator
and the Contour PostProcessor in "xy" mode
3) use the Spherical cutter with the DropCutter Pathgenerator and the ZigZag PostProcessor to do the "finish" cutting.
3) "finish" cutting
use the Spherical cutter
with the DropCutter Pathgenerator
and the ZigZag PostProcessor in "x" or "y" mode
TODO:
......@@ -78,12 +71,8 @@ TODO:
* Cutters
** FiletCutter
* PathGenerators
** ContourCutter
-> waterlevel tracer
* PathProcessors
** Traveling Salesman
** Traveling Salesman for Polygon PostProcessor
* Gui
** create something better than "SimpleGui"
......@@ -98,15 +87,13 @@ FEATURE REQUESTS:
* diagonal paths
* start at arbitrary corner
KNOWN BUGS:
* The combination of PushCutter with PolygonCutter sometimes cuts accross
the model in between lines
* The combination of PushCutter with ContourCutter sometimes cuts accross
the model in between lines in "x" or "y" mode
* The combination of PushCutter with ContourCutter sometimes gives erratic
toolpaths in "xy" mode
* The combination of PushCutter with PolygonCutter and ContourCutter
sometimes make tiny cuts accross the model in between lines
OPTIMIZATION:
......@@ -114,7 +101,7 @@ OPTIMIZATION:
* short-circuit the plane/triangle/line/edge/point/vertex tests,
so that when the result is known, no further intersections are calculated
* use kdtree
* use kdtree to speed up collision detection
* make Model have unique points
......
......@@ -16,11 +16,13 @@ def g(x):
def b(x):
return ((col[(x)%12]>> 0)&0xff)
def test_image(image):
def test_image(image, image2=None):
pe = PolygonExtractor(policy=PolygonExtractor.CONTOUR)
h = len(image)
w = len(image[0])
for dir in [0, 1]:
for dir in [1, 0, 1]:
if dir == 1 and image2:
image = image2
pe.new_direction(dir)
imax = 0
jmax = 0
......@@ -80,10 +82,10 @@ def test_image(image):
elif dir == 1:
path_list = pe.ver_path_list
else:
if hasattr(pe, "merge_path_list"):
path_list = pe.merge_path_list
else:
path_list = []
if not path_list:
continue
for curr_path in path_list:
for point in curr_path.points:
......@@ -325,6 +327,41 @@ if __name__ == "__main__":
]
test_image(image)
if (test==9):
image = [
" ",
" ",
" *********** ",
" *********** ",
" *********** ",
" *********** ",
" ",
" ",
" *** ",
" ***** ",
" ********* ",
" *********** ",
" ",
" ",
]
image2 = [
" ",
" ",
" *********** ",
" *********** ",
" *********** ",
" *********** ",
" ",
" * ",
" *** ",
" ***** ",
" ********* ",
" *********** ",
" ",
" ",
]
test_image(image, image2 )
if (test==10):
image = [
......
This diff is collapsed.
......@@ -6,13 +6,16 @@ class ContourCutter:
self.paths = []
self.curr_path = None
self.scanline = None
self.pe = PolygonExtractor(PolygonExtractor.CONTOUR)
self.pe = None
self.points = []
def append(self, p):
self.points.append(p)
def new_direction(self, dir):
if self.pe == None:
self.pe = PolygonExtractor(PolygonExtractor.CONTOUR)
self.pe.new_direction(dir)
def end_direction(self):
......@@ -38,5 +41,5 @@ class ContourCutter:
self.paths = self.pe.ver_path_list
for p in self.paths:
p.append(p.points[0])
self.pe = 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