Commit e98e735f authored by sumpfralle's avatar sumpfralle

fixed the ContourCutter to be used with the new grid generator (climb/conventional/ignore)


git-svn-id: https://pycam.svn.sourceforge.net/svnroot/pycam/trunk@772 bbaffbd6-741e-11dd-a85d-61de82d9cad9
parent 6b9fe392
......@@ -21,6 +21,7 @@ along with PyCAM. If not, see <http://www.gnu.org/licenses/>.
"""
from pycam.Geometry.PolygonExtractor import PolygonExtractor
from pycam.Geometry.Point import Point
from pycam.Toolpath import simplify_toolpath
class ContourCutter:
......@@ -31,9 +32,15 @@ class ContourCutter:
self.pe = None
self.points = []
self.reverse = reverse
self.__forward = Point(1, 1, 0)
def append(self, p):
self.points.append(p)
# Sort the points in positive x/y direction - otherwise the
# PolygonExtractor breaks.
if self.points and (p.sub(self.points[0]).dot(self.__forward) < 0):
self.points.insert(0, p)
else:
self.points.append(p)
def new_direction(self, direction):
if 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