Commit 9066251e authored by Lars Kruse's avatar Lars Kruse

"simplify_toolpath" should handle Path objects

parent e2f7fd61
...@@ -61,6 +61,9 @@ def simplify_toolpath(path): ...@@ -61,6 +61,9 @@ def simplify_toolpath(path):
@type path: list of points @type path: list of points
""" """
index = 1 index = 1
# stay compatible with pycam.Geometry.Path objects
if hasattr(path, "points"):
path = path.points
while index < len(path) - 1: while index < len(path) - 1:
if _check_colinearity(path[index-1], path[index], path[index+1]): if _check_colinearity(path[index-1], path[index], path[index+1]):
path.pop(index) path.pop(index)
......
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