Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in
Toggle navigation
P
Printrun
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
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
machinery
Printrun
Commits
1395a013
Commit
1395a013
authored
Nov 03, 2013
by
Guillaume Seguin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Revert "Correctly handle G92 in hosts" as argued in #443
This reverts commit
1877d2cc
. Conflicts: printrun/gcoder.py
parent
dc010932
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
8 additions
and
14 deletions
+8
-14
gcoder.py
printrun/gcoder.py
+8
-14
No files found.
printrun/gcoder.py
View file @
1395a013
...
...
@@ -96,8 +96,7 @@ class Layer(list):
self
.
z
=
z
def
_preprocess
(
self
,
current_x
,
current_y
,
current_z
,
offset_x
,
offset_y
,
offset_z
,
ignore_noe
=
False
,
host_mode
=
True
):
offset_x
,
offset_y
,
offset_z
,
ignore_noe
=
False
):
xmin
=
float
(
"inf"
)
ymin
=
float
(
"inf"
)
zmin
=
0
...
...
@@ -146,11 +145,6 @@ class Layer(list):
if
line
.
z
is
not
None
:
current_z
=
0
elif
line
.
command
==
"G92"
:
if
host_mode
:
current_x
=
line
.
x
or
current_x
current_y
=
line
.
y
or
current_y
current_z
=
line
.
z
or
current_z
else
:
if
line
.
x
is
not
None
:
offset_x
=
current_x
-
line
.
x
if
line
.
y
is
not
None
:
offset_y
=
current_y
-
line
.
y
if
line
.
z
is
not
None
:
offset_z
=
current_z
-
line
.
z
...
...
@@ -190,14 +184,14 @@ class GCode(object):
est_layer_height
=
None
def
__init__
(
self
,
data
,
host_mode
=
True
):
def
__init__
(
self
,
data
):
self
.
lines
=
[
Line
(
l2
)
for
l2
in
(
l
.
strip
()
for
l
in
data
)
if
l2
]
self
.
_preprocess_lines
()
self
.
filament_length
=
self
.
_preprocess_extrusion
()
self
.
_create_layers
()
self
.
_preprocess_layers
(
host_mode
=
host_mode
)
self
.
_preprocess_layers
()
def
__len__
(
self
):
return
len
(
self
.
line_idxs
)
...
...
@@ -374,7 +368,7 @@ class GCode(object):
def
num_layers
(
self
):
return
len
(
self
.
layers
)
def
_preprocess_layers
(
self
,
host_mode
=
True
):
def
_preprocess_layers
(
self
):
xmin
=
float
(
"inf"
)
ymin
=
float
(
"inf"
)
zmin
=
0
...
...
@@ -394,7 +388,7 @@ class GCode(object):
for
l
in
self
.
all_layers
:
meta
=
l
.
_preprocess
(
current_x
,
current_y
,
current_z
,
offset_x
,
offset_y
,
offset_z
,
ignore_noe
,
host_mode
)
ignore_noe
)
current_x
,
current_y
,
current_z
=
meta
[
0
]
offset_x
,
offset_y
,
offset_z
=
meta
[
1
]
(
xm
,
xM
),
(
ym
,
yM
),
(
zm
,
zM
)
=
meta
[
2
:]
...
...
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