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
4e359fde
Commit
4e359fde
authored
Jul 25, 2013
by
Guillaume Seguin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Move rotate_shape to Plater
parent
77ca068e
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
20 additions
and
15 deletions
+20
-15
objectplater.py
printrun/objectplater.py
+11
-0
stlview.py
printrun/stlview.py
+9
-15
No files found.
printrun/objectplater.py
View file @
4e359fde
...
...
@@ -118,6 +118,17 @@ class Plater(wx.Frame):
]
return
True
def
rotate_shape
(
self
,
angle
):
"""rotates acive shape
positive angle is clockwise
"""
name
=
self
.
l
.
GetSelection
()
if
name
==
wx
.
NOT_FOUND
:
return
False
name
=
self
.
l
.
GetString
(
name
)
model
=
self
.
models
[
name
]
model
.
rot
+=
angle
def
autoplate
(
self
,
event
=
None
):
print
_
(
"Autoplating"
)
separation
=
2
...
...
printrun/stlview.py
View file @
4e359fde
...
...
@@ -164,17 +164,11 @@ class StlViewPanel(wxGLPanel):
elif
event
.
ButtonUp
(
wx
.
MOUSE_BTN_RIGHT
):
if
self
.
initpos
is
not
None
:
self
.
initpos
=
None
def
rotate_shape
(
self
,
angle
):
"""rotates acive shape
positive angle is clockwise
"""
name
=
self
.
parent
.
l
.
GetSelection
()
if
name
==
wx
.
NOT_FOUND
:
return
False
name
=
self
.
parent
.
l
.
GetString
(
name
)
model
=
self
.
parent
.
models
[
name
]
model
.
rot
+=
angle
else
:
event
.
Skip
()
return
event
.
Skip
()
wx
.
CallAfter
(
self
.
Refresh
)
def
wheel
(
self
,
event
):
"""react to mouse wheel actions:
...
...
@@ -185,9 +179,9 @@ class StlViewPanel(wxGLPanel):
if
not
event
.
ShiftDown
():
angle
=
10
if
delta
>
0
:
self
.
rotate_shape
(
angle
/
2
)
self
.
parent
.
rotate_shape
(
angle
/
2
)
else
:
self
.
rotate_shape
(
-
angle
/
2
)
self
.
parent
.
rotate_shape
(
-
angle
/
2
)
else
:
factor
=
1.05
x
,
y
=
event
.
GetPositionTuple
()
...
...
@@ -221,10 +215,10 @@ class StlViewPanel(wxGLPanel):
self
.
parent
.
move_shape
((
0
,
-
step
))
#[
if
keycode
==
91
:
self
.
rotate_shape
(
-
angle
)
self
.
parent
.
rotate_shape
(
-
angle
)
#]
if
keycode
==
93
:
self
.
rotate_shape
(
angle
)
self
.
parent
.
rotate_shape
(
angle
)
event
.
Skip
()
wx
.
CallAfter
(
self
.
Refresh
)
...
...
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