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
1dcf7be5
Commit
1dcf7be5
authored
May 15, 2013
by
Guillaume Seguin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Start cleaning up gcode measurement code
parent
f4a16223
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
17 additions
and
25 deletions
+17
-25
gcoder.py
gcoder.py
+17
-25
No files found.
gcoder.py
View file @
1dcf7be5
...
@@ -129,12 +129,12 @@ class Layer(object):
...
@@ -129,12 +129,12 @@ class Layer(object):
def
measure
(
self
):
def
measure
(
self
):
xmin
=
999999999
xmin
=
float
(
"inf"
)
ymin
=
999999999
ymin
=
float
(
"inf"
)
zmin
=
0
zmin
=
0
xmax
=
-
999999999
xmax
=
float
(
"-inf"
)
ymax
=
-
999999999
ymax
=
float
(
"-inf"
)
zmax
=
-
999999999
zmax
=
float
(
"-inf"
)
relative
=
False
relative
=
False
relative_e
=
False
relative_e
=
False
...
@@ -272,29 +272,21 @@ class GCode(object):
...
@@ -272,29 +272,21 @@ class GCode(object):
def
measure
(
self
):
def
measure
(
self
):
xmin
=
999999999
xmin
=
float
(
"inf"
)
ymin
=
999999999
ymin
=
float
(
"inf"
)
zmin
=
0
zmin
=
0
xmax
=
-
999999999
xmax
=
float
(
"-inf"
)
ymax
=
-
999999999
ymax
=
float
(
"-inf"
)
zmax
=
-
999999999
zmax
=
float
(
"-inf"
)
for
l
in
self
.
layers
:
for
l
in
self
.
layers
:
xd
,
yd
,
zd
=
l
.
measure
()
xd
,
yd
,
zd
=
l
.
measure
()
if
xd
[
0
]
<
xmin
:
xmin
=
min
(
xd
[
0
],
xmin
)
xmin
=
xd
[
0
]
xmax
=
max
(
xd
[
1
],
xmax
)
if
xd
[
1
]
>
xmax
:
ymin
=
min
(
yd
[
0
],
ymin
)
xmax
=
xd
[
1
]
ymax
=
max
(
yd
[
1
],
ymax
)
zmin
=
min
(
zd
[
0
],
zmin
)
if
yd
[
0
]
<
ymin
:
zmax
=
max
(
zd
[
1
],
zmax
)
ymin
=
yd
[
0
]
if
yd
[
1
]
>
ymax
:
ymax
=
yd
[
1
]
if
zd
[
0
]
<
zmin
:
zmin
=
zd
[
0
]
if
zd
[
1
]
>
zmax
:
zmax
=
zd
[
1
]
self
.
xmin
=
xmin
self
.
xmin
=
xmin
self
.
xmax
=
xmax
self
.
xmax
=
xmax
...
...
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