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
a9d984b3
Commit
a9d984b3
authored
Jun 26, 2013
by
Guillaume Seguin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Improve drawing of current layer in gcview
parent
07935b24
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
25 additions
and
14 deletions
+25
-14
actors.py
printrun/libtatlin/actors.py
+25
-14
No files found.
printrun/libtatlin/actors.py
View file @
a9d984b3
...
@@ -241,7 +241,8 @@ class GcodeModel(Model):
...
@@ -241,7 +241,8 @@ class GcodeModel(Model):
color_tool0
=
(
1.0
,
0.0
,
0.0
,
0.6
)
color_tool0
=
(
1.0
,
0.0
,
0.0
,
0.6
)
color_tool1
=
(
0.0
,
0.0
,
1.0
,
0.6
)
color_tool1
=
(
0.0
,
0.0
,
1.0
,
0.6
)
color_printed
=
(
0.2
,
0.75
,
0
,
0.6
)
color_printed
=
(
0.2
,
0.75
,
0
,
0.6
)
color_current
=
(
0.6
,
0.3
,
0
,
1
)
color_current
=
(
0.6
,
0.3
,
0
,
0.8
)
color_current_printed
=
(
0.1
,
0.4
,
0
,
0.8
)
use_vbos
=
True
use_vbos
=
True
loaded
=
False
loaded
=
False
...
@@ -361,9 +362,9 @@ class GcodeModel(Model):
...
@@ -361,9 +362,9 @@ class GcodeModel(Model):
# Draw printed stuff until end or end_prev_layer
# Draw printed stuff until end or end_prev_layer
cur_end
=
min
(
self
.
printed_until
,
end
)
cur_end
=
min
(
self
.
printed_until
,
end
)
if
end_prev_layer
>=
0
:
if
0
<=
end_prev_layer
<=
cur_end
:
cur_end
=
min
(
cur_end
,
end_prev_layer
)
glDrawArrays
(
GL_LINES
,
start
,
end_prev_layer
)
if
cur_end
>=
0
:
el
if
cur_end
>=
0
:
glDrawArrays
(
GL_LINES
,
start
,
cur_end
)
glDrawArrays
(
GL_LINES
,
start
,
cur_end
)
glEnableClientState
(
GL_COLOR_ARRAY
)
glEnableClientState
(
GL_COLOR_ARRAY
)
...
@@ -374,16 +375,26 @@ class GcodeModel(Model):
...
@@ -374,16 +375,26 @@ class GcodeModel(Model):
glDrawArrays
(
GL_LINES
,
start
,
end_prev_layer
-
start
)
glDrawArrays
(
GL_LINES
,
start
,
end_prev_layer
-
start
)
cur_end
=
end_prev_layer
cur_end
=
end_prev_layer
# Draw current layer
if
end_prev_layer
>=
0
:
glDisableClientState
(
GL_COLOR_ARRAY
)
glDisableClientState
(
GL_COLOR_ARRAY
)
glColor4f
(
*
self
.
color_current
)
# Backup & increase line width
# Draw current layer
orig_linewidth
=
(
GLfloat
)()
orig_linewidth
=
(
GLfloat
)()
glGetFloatv
(
GL_LINE_WIDTH
,
orig_linewidth
)
glGetFloatv
(
GL_LINE_WIDTH
,
orig_linewidth
)
glLineWidth
(
2.0
)
glLineWidth
(
2.0
)
if
end_prev_layer
>=
0
and
end
>
end_prev_layer
:
glDrawArrays
(
GL_LINES
,
end_prev_layer
,
end
-
end_prev_layer
)
glColor4f
(
*
self
.
color_current_printed
)
if
cur_end
>
end_prev_layer
:
glDrawArrays
(
GL_LINES
,
end_prev_layer
,
cur_end
-
end_prev_layer
)
glColor4f
(
*
self
.
color_current
)
if
end
>
cur_end
:
glDrawArrays
(
GL_LINES
,
cur_end
,
end
-
cur_end
)
# Restore line width
glLineWidth
(
orig_linewidth
)
glLineWidth
(
orig_linewidth
)
glEnableClientState
(
GL_COLOR_ARRAY
)
glEnableClientState
(
GL_COLOR_ARRAY
)
...
...
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