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
81127b31
Commit
81127b31
authored
Jul 04, 2013
by
Guillaume Seguin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Draw simpler grid in stlview
parent
ee91741b
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
11 additions
and
8 deletions
+11
-8
actors.py
printrun/gl/libtatlin/actors.py
+10
-7
stlview.py
printrun/stlview.py
+1
-1
No files found.
printrun/gl/libtatlin/actors.py
View file @
81127b31
...
...
@@ -71,7 +71,8 @@ class Platform(object):
"""
graduations_major
=
10
def
__init__
(
self
,
build_dimensions
):
def
__init__
(
self
,
build_dimensions
,
light
=
False
):
self
.
light
=
light
self
.
width
=
build_dimensions
[
0
]
self
.
depth
=
build_dimensions
[
1
]
self
.
height
=
build_dimensions
[
2
]
...
...
@@ -102,19 +103,21 @@ class Platform(object):
elif
i
%
(
self
.
graduations_major
/
2
)
==
0
:
glColor4f
(
*
self
.
color_grads_interm
)
else
:
if
self
.
light
:
return
False
glColor4f
(
*
self
.
color_grads_minor
)
return
True
# draw the grid
glBegin
(
GL_LINES
)
for
i
in
range
(
0
,
int
(
math
.
ceil
(
self
.
width
+
1
))):
color
(
i
)
glVertex3f
(
float
(
i
),
0.0
,
0.0
)
glVertex3f
(
float
(
i
),
self
.
depth
,
0.0
)
if
color
(
i
):
glVertex3f
(
float
(
i
),
0.0
,
0.0
)
glVertex3f
(
float
(
i
),
self
.
depth
,
0.0
)
for
i
in
range
(
0
,
int
(
math
.
ceil
(
self
.
depth
+
1
))):
color
(
i
)
glVertex3f
(
0
,
float
(
i
),
0.0
)
glVertex3f
(
self
.
width
,
float
(
i
),
0.0
)
if
color
(
i
):
glVertex3f
(
0
,
float
(
i
),
0.0
)
glVertex3f
(
self
.
width
,
float
(
i
),
0.0
)
glEnd
()
# draw fill
...
...
printrun/stlview.py
View file @
81127b31
...
...
@@ -75,7 +75,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
)
self
.
platform
=
actors
.
Platform
(
self
.
build_dimensions
,
light
=
True
)
self
.
dist
=
max
(
self
.
build_dimensions
[
0
],
self
.
build_dimensions
[
1
])
self
.
basequat
=
[
0
,
0
,
0
,
1
]
wx
.
CallAfter
(
self
.
forceresize
)
...
...
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