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
60c1da4c
Commit
60c1da4c
authored
Apr 05, 2014
by
Guillaume Seguin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Use non light platform, disable lighting for it, disable face culling
parent
229d6caa
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
7 additions
and
2 deletions
+7
-2
stlview.py
printrun/stlview.py
+7
-2
No files found.
printrun/stlview.py
View file @
60c1da4c
...
...
@@ -31,7 +31,8 @@ from pyglet.gl import GL_AMBIENT_AND_DIFFUSE, glBegin, glClearColor, \
GL_SMOOTH
,
GL_SPECULAR
,
glTranslatef
,
GL_TRIANGLES
,
glVertex3f
,
\
glGetDoublev
,
GL_MODELVIEW_MATRIX
,
GLdouble
,
glClearDepth
,
glDepthFunc
,
\
GL_LEQUAL
,
GL_BLEND
,
glBlendFunc
,
GL_SRC_ALPHA
,
GL_ONE_MINUS_SRC_ALPHA
,
\
GL_LINE_LOOP
,
glGetFloatv
,
GL_LINE_WIDTH
,
glLineWidth
,
glDisable
,
GL_LINE_SMOOTH
GL_LINE_LOOP
,
glGetFloatv
,
GL_LINE_WIDTH
,
glLineWidth
,
glDisable
,
\
GL_LINE_SMOOTH
,
glColorMaterial
from
pyglet
import
gl
from
.gl.panel
import
wxGLPanel
...
...
@@ -86,7 +87,7 @@ class StlViewPanel(wxGLPanel):
self
.
build_dimensions
=
build_dimensions
else
:
self
.
build_dimensions
=
[
200
,
200
,
100
,
0
,
0
,
0
]
self
.
platform
=
actors
.
Platform
(
self
.
build_dimensions
,
light
=
True
,
self
.
platform
=
actors
.
Platform
(
self
.
build_dimensions
,
circular
=
circular
)
self
.
dist
=
max
(
self
.
build_dimensions
[
0
],
self
.
build_dimensions
[
1
])
self
.
basequat
=
[
0
,
0
,
0
,
1
]
...
...
@@ -284,7 +285,9 @@ class StlViewPanel(wxGLPanel):
-
self
.
build_dimensions
[
4
]
-
self
.
platform
.
depth
/
2
,
0
)
# Move origin to bottom left of platform
# Draw platform
glPolygonMode
(
GL_FRONT_AND_BACK
,
GL_LINE
)
glDisable
(
GL_LIGHTING
)
self
.
platform
.
draw
()
glEnable
(
GL_LIGHTING
)
# Draw mouse
glPolygonMode
(
GL_FRONT_AND_BACK
,
GL_FILL
)
inter
=
self
.
mouse_to_plane
(
self
.
mousepos
[
0
],
self
.
mousepos
[
1
],
...
...
@@ -306,6 +309,7 @@ class StlViewPanel(wxGLPanel):
glPopMatrix
()
# Draw objects
glDisable
(
GL_CULL_FACE
)
glPushMatrix
()
glMaterialfv
(
GL_FRONT_AND_BACK
,
GL_AMBIENT_AND_DIFFUSE
,
vec
(
0.3
,
0.7
,
0.5
,
1
))
for
i
in
self
.
parent
.
models
:
...
...
@@ -318,6 +322,7 @@ class StlViewPanel(wxGLPanel):
model
.
batch
.
draw
()
glPopMatrix
()
glPopMatrix
()
glEnable
(
GL_CULL_FACE
)
# Draw cutting plane
if
self
.
parent
.
cutting
:
...
...
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