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
0a6e668b
Commit
0a6e668b
authored
Jul 25, 2013
by
Guillaume Seguin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add move support to gcodeplater
parent
da9b819d
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
17 additions
and
1 deletion
+17
-1
gcodeplater.py
gcodeplater.py
+17
-1
No files found.
gcodeplater.py
View file @
0a6e668b
...
@@ -28,6 +28,22 @@ from printrun import gcoder
...
@@ -28,6 +28,22 @@ from printrun import gcoder
from
printrun.objectplater
import
Plater
from
printrun.objectplater
import
Plater
from
printrun.gl.libtatlin
import
actors
from
printrun.gl.libtatlin
import
actors
class
GcodeViewPanel
(
gcview
.
GcodeViewPanel
):
def
handle_rotation
(
self
,
event
):
if
self
.
initpos
is
None
:
self
.
initpos
=
event
.
GetPositionTuple
()
else
:
if
not
event
.
ShiftDown
():
p1
=
self
.
initpos
p2
=
event
.
GetPositionTuple
()
x1
,
y1
,
_
=
self
.
mouse_to_3d
(
p1
[
0
],
p1
[
1
])
x2
,
y2
,
_
=
self
.
mouse_to_3d
(
p2
[
0
],
p2
[
1
])
self
.
parent
.
move_shape
((
x2
-
x1
,
y2
-
y1
))
self
.
initpos
=
p2
else
:
super
(
GcodeViewPanel
,
self
)
.
handle_rotation
(
event
)
class
GcodePlater
(
Plater
):
class
GcodePlater
(
Plater
):
load_wildcard
=
_
(
"STL files (*.stl;*.STL)|*.stl;*.STL|OpenSCAD files (*.scad)|*.scad"
)
load_wildcard
=
_
(
"STL files (*.stl;*.STL)|*.stl;*.STL|OpenSCAD files (*.scad)|*.scad"
)
...
@@ -35,7 +51,7 @@ class GcodePlater(Plater):
...
@@ -35,7 +51,7 @@ class GcodePlater(Plater):
def
__init__
(
self
,
filenames
=
[],
size
=
(
800
,
580
),
callback
=
None
,
parent
=
None
,
build_dimensions
=
None
):
def
__init__
(
self
,
filenames
=
[],
size
=
(
800
,
580
),
callback
=
None
,
parent
=
None
,
build_dimensions
=
None
):
super
(
GcodePlater
,
self
)
.
__init__
(
filenames
,
size
,
callback
,
parent
,
build_dimensions
)
super
(
GcodePlater
,
self
)
.
__init__
(
filenames
,
size
,
callback
,
parent
,
build_dimensions
)
viewer
=
gcview
.
GcodeViewPanel
(
self
,
build_dimensions
=
self
.
build_dimensions
)
viewer
=
GcodeViewPanel
(
self
,
build_dimensions
=
self
.
build_dimensions
)
self
.
set_viewer
(
viewer
)
self
.
set_viewer
(
viewer
)
self
.
platform
=
actors
.
Platform
(
self
.
build_dimensions
)
self
.
platform
=
actors
.
Platform
(
self
.
build_dimensions
)
self
.
platform_object
=
gcview
.
GCObject
(
self
.
platform
)
self
.
platform_object
=
gcview
.
GCObject
(
self
.
platform
)
...
...
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