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
f6488673
Commit
f6488673
authored
Nov 04, 2013
by
Guillaume Seguin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix handling of sequential object plates in 2D viewer
parent
54bdf39f
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
15 additions
and
14 deletions
+15
-14
gviz.py
printrun/gviz.py
+15
-14
No files found.
printrun/gviz.py
View file @
f6488673
...
@@ -329,17 +329,17 @@ class Gviz(wx.Panel):
...
@@ -329,17 +329,17 @@ class Gviz(wx.Panel):
dc
.
DrawRectangle
(
width
-
14
,
(
1.0
-
(
1.0
*
(
self
.
layerindex
+
1
))
/
len
(
self
.
layers
))
*
height
,
13
,
height
-
1
)
dc
.
DrawRectangle
(
width
-
14
,
(
1.0
-
(
1.0
*
(
self
.
layerindex
+
1
))
/
len
(
self
.
layers
))
*
height
,
13
,
height
-
1
)
if
self
.
showall
:
if
self
.
showall
:
for
i
in
self
.
layers
:
for
i
,
_
in
enumerate
(
self
.
layers
)
:
self
.
_drawlines
(
dc
,
self
.
lines
[
i
],
self
.
pens
[
i
])
self
.
_drawlines
(
dc
,
self
.
lines
[
i
],
self
.
pens
[
i
])
self
.
_drawarcs
(
dc
,
self
.
arcs
[
i
],
self
.
arcpens
[
i
])
self
.
_drawarcs
(
dc
,
self
.
arcs
[
i
],
self
.
arcpens
[
i
])
return
return
if
self
.
layerindex
<
len
(
self
.
layers
)
and
self
.
layer
s
[
self
.
layerindex
]
in
self
.
lines
:
if
self
.
layerindex
<
len
(
self
.
layers
)
and
self
.
layer
index
in
self
.
lines
:
for
layer_i
in
range
(
max
(
0
,
self
.
layerindex
-
6
),
self
.
layerindex
):
for
layer_i
in
range
(
max
(
0
,
self
.
layerindex
-
6
),
self
.
layerindex
):
self
.
_drawlines
(
dc
,
self
.
lines
[
self
.
layers
[
layer_i
]
],
self
.
fades
[
self
.
layerindex
-
layer_i
-
1
])
self
.
_drawlines
(
dc
,
self
.
lines
[
layer_i
],
self
.
fades
[
self
.
layerindex
-
layer_i
-
1
])
self
.
_drawarcs
(
dc
,
self
.
arcs
[
self
.
layers
[
layer_i
]
],
self
.
fades
[
self
.
layerindex
-
layer_i
-
1
])
self
.
_drawarcs
(
dc
,
self
.
arcs
[
layer_i
],
self
.
fades
[
self
.
layerindex
-
layer_i
-
1
])
self
.
_drawlines
(
dc
,
self
.
lines
[
self
.
layer
s
[
self
.
layerindex
]],
self
.
pens
[
self
.
layers
[
self
.
layerindex
]
])
self
.
_drawlines
(
dc
,
self
.
lines
[
self
.
layer
index
],
self
.
pens
[
self
.
layerindex
])
self
.
_drawarcs
(
dc
,
self
.
arcs
[
self
.
layer
s
[
self
.
layerindex
]],
self
.
arcpens
[
self
.
layers
[
self
.
layerindex
]
])
self
.
_drawarcs
(
dc
,
self
.
arcs
[
self
.
layer
index
],
self
.
arcpens
[
self
.
layerindex
])
self
.
_drawlines
(
dc
,
self
.
hilight
,
self
.
hlpen
)
self
.
_drawlines
(
dc
,
self
.
hilight
,
self
.
hlpen
)
self
.
_drawarcs
(
dc
,
self
.
hilightarcs
,
self
.
hlpen
)
self
.
_drawarcs
(
dc
,
self
.
hilightarcs
,
self
.
hlpen
)
...
@@ -405,10 +405,11 @@ class Gviz(wx.Panel):
...
@@ -405,10 +405,11 @@ class Gviz(wx.Panel):
break
break
if
not
has_move
:
if
not
has_move
:
continue
continue
self
.
lines
[
layer
.
z
]
=
[]
viz_layer
=
len
(
self
.
layers
)
self
.
pens
[
layer
.
z
]
=
[]
self
.
lines
[
viz_layer
]
=
[]
self
.
arcs
[
layer
.
z
]
=
[]
self
.
pens
[
viz_layer
]
=
[]
self
.
arcpens
[
layer
.
z
]
=
[]
self
.
arcs
[
viz_layer
]
=
[]
self
.
arcpens
[
viz_layer
]
=
[]
for
gline
in
layer
:
for
gline
in
layer
:
if
not
gline
.
is_move
:
if
not
gline
.
is_move
:
continue
continue
...
@@ -431,8 +432,8 @@ class Gviz(wx.Panel):
...
@@ -431,8 +432,8 @@ class Gviz(wx.Panel):
start_pos
=
self
.
lastpos
[:]
start_pos
=
self
.
lastpos
[:]
if
gline
.
command
in
[
"G0"
,
"G1"
]:
if
gline
.
command
in
[
"G0"
,
"G1"
]:
self
.
lines
[
layer
.
z
]
.
append
((
_x
(
start_pos
[
0
]),
_y
(
start_pos
[
1
]),
_x
(
target
[
0
]),
_y
(
target
[
1
])))
self
.
lines
[
viz_layer
]
.
append
((
_x
(
start_pos
[
0
]),
_y
(
start_pos
[
1
]),
_x
(
target
[
0
]),
_y
(
target
[
1
])))
self
.
pens
[
layer
.
z
]
.
append
(
self
.
mainpen
if
target
[
3
]
!=
self
.
lastpos
[
3
]
else
self
.
travelpen
)
self
.
pens
[
viz_layer
]
.
append
(
self
.
mainpen
if
target
[
3
]
!=
self
.
lastpos
[
3
]
else
self
.
travelpen
)
elif
gline
.
command
in
[
"G2"
,
"G3"
]:
elif
gline
.
command
in
[
"G2"
,
"G3"
]:
# startpos, endpos, arc center
# startpos, endpos, arc center
arc
=
[
_x
(
start_pos
[
0
]),
_y
(
start_pos
[
1
]),
arc
=
[
_x
(
start_pos
[
0
]),
_y
(
start_pos
[
1
]),
...
@@ -441,8 +442,8 @@ class Gviz(wx.Panel):
...
@@ -441,8 +442,8 @@ class Gviz(wx.Panel):
if
gline
.
command
==
"G2"
:
# clockwise, reverse endpoints
if
gline
.
command
==
"G2"
:
# clockwise, reverse endpoints
arc
[
0
],
arc
[
1
],
arc
[
2
],
arc
[
3
]
=
arc
[
2
],
arc
[
3
],
arc
[
0
],
arc
[
1
]
arc
[
0
],
arc
[
1
],
arc
[
2
],
arc
[
3
]
=
arc
[
2
],
arc
[
3
],
arc
[
0
],
arc
[
1
]
self
.
arcs
[
layer
.
z
]
.
append
(
arc
)
self
.
arcs
[
viz_layer
]
.
append
(
arc
)
self
.
arcpens
[
layer
.
z
]
.
append
(
self
.
arcpen
)
self
.
arcpens
[
viz_layer
]
.
append
(
self
.
arcpen
)
self
.
lastpos
=
target
self
.
lastpos
=
target
# Only add layer.z to self.layers now to prevent the display of an
# Only add layer.z to self.layers now to prevent the display of an
...
...
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