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
43655cc3
Commit
43655cc3
authored
Jul 25, 2013
by
Guillaume Seguin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Draw objects centered on the offset position in plater
parent
76860fb6
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
10 additions
and
9 deletions
+10
-9
plater.py
plater.py
+3
-4
stlview.py
printrun/stlview.py
+7
-5
No files found.
plater.py
View file @
43655cc3
...
@@ -327,10 +327,9 @@ class StlPlater(Plater):
...
@@ -327,10 +327,9 @@ class StlPlater(Plater):
maxz
=
j
[
2
]
maxz
=
j
[
2
]
model
.
dims
=
[
minx
,
maxx
,
miny
,
maxy
,
minz
,
maxz
]
model
.
dims
=
[
minx
,
maxx
,
miny
,
maxy
,
minz
,
maxz
]
self
.
add_model
(
name
,
model
)
self
.
add_model
(
name
,
model
)
#if minx < 0:
model
.
centeroffset
=
[(
maxx
-
minx
)
/
2
,
# model.offsets[0] = -minx
(
maxy
-
miny
)
/
2
,
#if miny < 0:
0
]
# model.offsets[1] = -miny
self
.
s
.
drawmodel
(
model
,
2
)
self
.
s
.
drawmodel
(
model
,
2
)
def
export_to
(
self
,
name
):
def
export_to
(
self
,
name
):
...
...
printrun/stlview.py
View file @
43655cc3
...
@@ -354,12 +354,14 @@ class StlViewPanel(wxGLPanel):
...
@@ -354,12 +354,14 @@ class StlViewPanel(wxGLPanel):
glPushMatrix
()
glPushMatrix
()
# Draw objects
# Draw objects
for
i
in
self
.
parent
.
models
.
values
():
for
i
in
self
.
parent
.
models
:
model
=
self
.
parent
.
models
[
i
]
glPushMatrix
()
glPushMatrix
()
glTranslatef
(
*
(
i
.
offsets
))
glTranslatef
(
*
(
model
.
offsets
))
glRotatef
(
i
.
rot
,
0.0
,
0.0
,
1.0
)
glTranslatef
(
*
(
model
.
centeroffset
))
glScalef
(
*
i
.
scale
)
glRotatef
(
model
.
rot
,
0.0
,
0.0
,
1.0
)
i
.
batch
.
draw
()
glScalef
(
*
model
.
scale
)
model
.
batch
.
draw
()
glPopMatrix
()
glPopMatrix
()
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