Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in
Toggle navigation
P
pyMKcam
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
machinery
pyMKcam
Commits
2f58933a
Commit
2f58933a
authored
Jun 19, 2012
by
Lars Kruse
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
improved TinySidewaysMovesFilter
* skip move to safety height if we go straight down afterwards
parent
118c3b49
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
10 additions
and
4 deletions
+10
-4
Filters.py
pycam/Toolpath/Filters.py
+10
-4
No files found.
pycam/Toolpath/Filters.py
View file @
2f58933a
...
@@ -107,18 +107,22 @@ class TinySidewaysMovesFilter(BaseFilter):
...
@@ -107,18 +107,22 @@ class TinySidewaysMovesFilter(BaseFilter):
for
move_type
,
args
in
toolpath
:
for
move_type
,
args
in
toolpath
:
if
move_type
in
(
MOVE_STRAIGHT
,
MOVE_STRAIGHT_RAPID
):
if
move_type
in
(
MOVE_STRAIGHT
,
MOVE_STRAIGHT_RAPID
):
if
in_safety
and
last_pos
:
if
in_safety
and
last_pos
:
# check if the last position was very close and at the
# check if we can skip a possible previous safety move
# same height
if
(
pdist
(
last_pos
,
args
)
<
self
.
settings
[
"tolerance"
])
and
\
if
(
pdist
(
last_pos
,
args
)
<
self
.
settings
[
"tolerance"
])
and
\
(
abs
(
last_pos
[
2
]
-
args
[
2
])
<
epsilon
):
(
abs
(
last_pos
[
2
]
-
args
[
2
])
<
epsilon
):
# within tolerance -> remove previous safety move
# same height, within tolerance -> no safety move
new_path
.
pop
(
-
1
)
elif
(
abs
(
last_pos
[
0
]
-
args
[
0
])
<
epsilon
)
and
\
(
abs
(
last_pos
[
1
]
-
args
[
1
])
<
epsilon
):
# same position, but different height
new_path
.
pop
(
-
1
)
new_path
.
pop
(
-
1
)
in_safety
=
False
in_safety
=
False
last_pos
=
args
last_pos
=
args
elif
move_type
==
MOVE_SAFETY
:
elif
move_type
==
MOVE_SAFETY
:
in_safety
=
True
in_safety
=
True
else
:
else
:
pass
# it is not safe to assume that we are still at safety height
in_safety
=
False
new_path
.
append
((
move_type
,
args
))
new_path
.
append
((
move_type
,
args
))
return
new_path
return
new_path
...
@@ -181,6 +185,8 @@ class Crop(BaseFilter):
...
@@ -181,6 +185,8 @@ class Crop(BaseFilter):
class
TransformPosition
(
BaseFilter
):
class
TransformPosition
(
BaseFilter
):
""" shift or rotate a toolpath based on a given 3x3 or 3x4 matrix
"""
PARAMS
=
(
"matrix"
,
)
PARAMS
=
(
"matrix"
,
)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment