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
65fc1711
Commit
65fc1711
authored
Jul 25, 2013
by
Guillaume Seguin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Initial import of gcodeplater.py (pure GUI for now)
parent
350bc6c8
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
68 additions
and
0 deletions
+68
-0
gcodeplater.py
gcodeplater.py
+68
-0
No files found.
gcodeplater.py
0 → 100644
View file @
65fc1711
#!/usr/bin/env python
# This file is part of the Printrun suite.
#
# Printrun is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# Printrun is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with Printrun. If not, see <http://www.gnu.org/licenses/>.
# Set up Internationalization using gettext
# searching for installed locales on /usr/share; uses relative folder if not found (windows)
from
printrun.printrun_utils
import
install_locale
install_locale
(
'plater'
)
import
wx
import
sys
from
printrun
import
gcview
from
printrun
import
gcoder
from
printrun.objectplater
import
Plater
from
printrun.gl.libtatlin
import
actors
class
GcodePlater
(
Plater
):
load_wildcard
=
_
(
"STL files (*.stl;*.STL)|*.stl;*.STL|OpenSCAD files (*.scad)|*.scad"
)
save_wildcard
=
_
(
"STL files (*.stl;*.STL)|*.stl;*.STL"
)
def
__init__
(
self
,
filenames
=
[],
size
=
(
800
,
580
),
callback
=
None
,
parent
=
None
,
build_dimensions
=
None
):
super
(
GcodePlater
,
self
)
.
__init__
(
filenames
,
size
,
callback
,
parent
,
build_dimensions
)
viewer
=
gcview
.
GcodeViewPanel
(
self
,
build_dimensions
=
self
.
build_dimensions
)
self
.
set_viewer
(
viewer
)
self
.
platform
=
actors
.
Platform
(
self
.
build_dimensions
)
self
.
platform_object
=
gcview
.
GCObject
(
self
.
platform
)
def
get_objects
(
self
):
return
[
self
.
platform_object
]
+
self
.
models
.
values
()
objects
=
property
(
get_objects
)
def
load_file
(
self
,
filename
):
gcode
=
gcoder
.
GCode
(
open
(
filename
))
model
=
actors
.
GcodeModel
()
model
.
load_data
(
gcode
)
obj
=
gcview
.
GCObject
(
model
)
obj
.
dims
=
[
gcode
.
xmin
,
gcode
.
xmax
,
gcode
.
ymin
,
gcode
.
ymax
,
gcode
.
zmin
,
gcode
.
zmax
]
obj
.
centeroffset
=
[
-
(
obj
.
dims
[
1
]
+
obj
.
dims
[
0
])
/
2
,
-
(
obj
.
dims
[
3
]
+
obj
.
dims
[
2
])
/
2
,
0
]
self
.
add_model
(
filename
,
obj
)
wx
.
CallAfter
(
self
.
Refresh
)
def
export_to
(
self
,
name
):
raise
NotImplementedError
if
__name__
==
'__main__'
:
app
=
wx
.
App
(
False
)
main
=
GcodePlater
(
sys
.
argv
[
1
:])
main
.
Show
()
app
.
MainLoop
()
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