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
ddec65e5
Commit
ddec65e5
authored
Jan 25, 2012
by
Václav 'Ax' Hůla
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Colors!
parent
20a28bb6
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
11 additions
and
7 deletions
+11
-7
gcview.py
gcview.py
+11
-7
No files found.
gcview.py
View file @
ddec65e5
...
@@ -283,9 +283,9 @@ class gcline(object):
...
@@ -283,9 +283,9 @@ class gcline(object):
]
]
def
glcolor
(
self
):
def
glcolor
(
self
):
if
self
.
extrusion_ratio
==
0
:
if
self
.
extrusion_ratio
==
0
:
return
[
10
,
10
,
10
,
0
,
10
,
10
,
10
,
0
]
return
[
255
,
255
,
255
,
128
,
128
,
128
]
else
:
else
:
return
[
255
,
128
,
128
,
12
0
,
255
,
128
,
128
,
12
0
]
return
[
255
,
128
,
128
,
12
8
,
0
,
0
]
def
float_from_line
(
axe
,
line
):
def
float_from_line
(
axe
,
line
):
...
@@ -317,8 +317,7 @@ class gcview(object):
...
@@ -317,8 +317,7 @@ class gcview(object):
layer_name
=
line
.
z
layer_name
=
line
.
z
if
line
.
z
not
in
self
.
layers
:
if
line
.
z
not
in
self
.
layers
:
self
.
layers
[
line
.
z
]
=
pyglet
.
graphics
.
Batch
()
self
.
layers
[
line
.
z
]
=
pyglet
.
graphics
.
Batch
()
self
.
layers
[
line
.
z
]
.
add
(
2
,
GL_LINES
,
None
,
(
"c4B"
,
line
.
glcolor
()))
self
.
layers
[
line
.
z
]
.
add
(
2
,
GL_LINES
,
None
,
(
"v3f"
,
line
.
glline
()),
(
"c3B"
,
line
.
glcolor
()))
self
.
layers
[
line
.
z
]
.
add
(
2
,
GL_LINES
,
None
,
(
"v3f"
,
line
.
glline
()))
self
.
layerlist
=
self
.
layers
.
keys
()
self
.
layerlist
=
self
.
layers
.
keys
()
self
.
layerlist
.
sort
()
self
.
layerlist
.
sort
()
t2
=
time
.
time
()
t2
=
time
.
time
()
...
@@ -800,11 +799,16 @@ class TestGlPanel(GLPanel):
...
@@ -800,11 +799,16 @@ class TestGlPanel(GLPanel):
glTranslatef
(
*
(
i
.
offsets
))
glTranslatef
(
*
(
i
.
offsets
))
glRotatef
(
i
.
rot
,
0.0
,
0.0
,
1.0
)
glRotatef
(
i
.
rot
,
0.0
,
0.0
,
1.0
)
glScalef
(
*
i
.
scale
)
glScalef
(
*
i
.
scale
)
#glEnable(GL_COLOR_MATERIAL)
#glMaterialfv(GL_FRONT_AND_BACK, GL_AMBIENT_AND_DIFFUSE, vec(0.93, 0.37, 0.25, 1))
glMaterialfv
(
GL_FRONT_AND_BACK
,
GL_AMBIENT_AND_DIFFUSE
,
vec
(
0.93
,
0.37
,
0.25
,
1
))
glEnable
(
GL_COLOR_MATERIAL
)
glLineWidth
(
0.5
)
[
i
.
gc
.
layers
[
j
]
.
draw
()
for
j
in
i
.
gc
.
layerlist
if
j
<
i
.
curlayer
]
[
i
.
gc
.
layers
[
j
]
.
draw
()
for
j
in
i
.
gc
.
layerlist
if
j
<
i
.
curlayer
]
glMaterialfv
(
GL_FRONT_AND_BACK
,
GL_AMBIENT_AND_DIFFUSE
,
vec
(
0.5
,
0.6
,
0.9
,
1
))
glLineWidth
(
3.5
)
i
.
gc
.
layers
[
i
.
curlayer
]
.
draw
()
i
.
gc
.
layers
[
i
.
curlayer
]
.
draw
()
glLineWidth
(
1.5
)
glDisable
(
GL_COLOR_MATERIAL
)
glPopMatrix
()
glPopMatrix
()
glPopMatrix
()
glPopMatrix
()
...
...
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