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
b27cb371
Commit
b27cb371
authored
May 23, 2013
by
Guillaume Seguin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Split gcoder.Line current_pos tuples into standalone attributes
parent
5e1a0be4
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
9 additions
and
5 deletions
+9
-5
gcoder.py
printrun/gcoder.py
+5
-2
actors.py
printrun/libtatlin/actors.py
+4
-3
No files found.
printrun/gcoder.py
View file @
b27cb371
...
@@ -30,7 +30,8 @@ class Line(object):
...
@@ -30,7 +30,8 @@ class Line(object):
__slots__
=
(
'x'
,
'y'
,
'z'
,
'e'
,
'f'
,
'i'
,
'j'
,
's'
,
__slots__
=
(
'x'
,
'y'
,
'z'
,
'e'
,
'f'
,
'i'
,
'j'
,
's'
,
'raw'
,
'split_raw'
,
'raw'
,
'split_raw'
,
'command'
,
'is_move'
,
'command'
,
'is_move'
,
'relative'
,
'relative_e'
,
'current_pos'
,
'extruding'
,
'relative'
,
'relative_e'
,
'current_x'
,
'current_y'
,
'current_z'
,
'extruding'
,
'gcview_end_vertex'
)
'gcview_end_vertex'
)
def
__init__
(
self
,
l
):
def
__init__
(
self
,
l
):
...
@@ -112,7 +113,9 @@ class Layer(object):
...
@@ -112,7 +113,9 @@ class Layer(object):
current_y
=
line
.
y
or
current_y
current_y
=
line
.
y
or
current_y
current_z
=
line
.
z
or
current_z
current_z
=
line
.
z
or
current_z
line
.
current_pos
=
(
current_x
,
current_y
,
current_z
)
line
.
current_x
=
current_x
line
.
current_y
=
current_y
line
.
current_z
=
current_z
return
(
current_x
,
current_y
,
current_z
),
(
xmin
,
xmax
),
(
ymin
,
ymax
),
(
zmin
,
zmax
)
return
(
current_x
,
current_y
,
current_z
),
(
xmin
,
xmax
),
(
ymin
,
ymax
),
(
zmin
,
zmax
)
class
GCode
(
object
):
class
GCode
(
object
):
...
...
printrun/libtatlin/actors.py
View file @
b27cb371
...
@@ -229,17 +229,18 @@ class GcodeModel(Model):
...
@@ -229,17 +229,18 @@ class GcodeModel(Model):
if
not
gline
.
is_move
:
if
not
gline
.
is_move
:
continue
continue
vertex_list
.
append
(
prev_pos
)
vertex_list
.
append
(
prev_pos
)
vertex_list
.
append
(
gline
.
current_pos
)
current_pos
=
(
gline
.
current_x
,
gline
.
current_y
,
gline
.
current_z
)
vertex_list
.
append
(
current_pos
)
arrow
=
self
.
arrow
arrow
=
self
.
arrow
# position the arrow with respect to movement
# position the arrow with respect to movement
arrow
=
vector
.
rotate
(
arrow
,
movement_angle
(
prev_pos
,
gline
.
current_pos
),
0.0
,
0.0
,
1.0
)
arrow
=
vector
.
rotate
(
arrow
,
movement_angle
(
prev_pos
,
current_pos
),
0.0
,
0.0
,
1.0
)
arrow_list
.
extend
(
arrow
)
arrow_list
.
extend
(
arrow
)
vertex_color
=
self
.
movement_color
(
gline
)
vertex_color
=
self
.
movement_color
(
gline
)
color_list
.
append
(
vertex_color
)
color_list
.
append
(
vertex_color
)
prev_pos
=
gline
.
current_pos
prev_pos
=
current_pos
gline
.
gcview_end_vertex
=
len
(
vertex_list
)
gline
.
gcview_end_vertex
=
len
(
vertex_list
)
self
.
layer_stops
.
append
(
len
(
vertex_list
))
self
.
layer_stops
.
append
(
len
(
vertex_list
))
...
...
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