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
c328768f
Commit
c328768f
authored
Jul 04, 2013
by
Guillaume Seguin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add support for loading files through CLI in plater
parent
ba1bd6d8
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
12 additions
and
8 deletions
+12
-8
plater.py
plater.py
+12
-8
No files found.
plater.py
View file @
c328768f
...
@@ -242,8 +242,9 @@ class showstl(wx.Window):
...
@@ -242,8 +242,9 @@ class showstl(wx.Window):
class
stlwin
(
wx
.
Frame
):
class
stlwin
(
wx
.
Frame
):
def
__init__
(
self
,
size
=
(
800
,
580
),
callback
=
None
,
parent
=
None
):
def
__init__
(
self
,
filenames
=
[],
size
=
(
800
,
580
),
callback
=
None
,
parent
=
None
):
wx
.
Frame
.
__init__
(
self
,
parent
,
title
=
_
(
"Plate building tool"
),
size
=
size
)
wx
.
Frame
.
__init__
(
self
,
parent
,
title
=
_
(
"Plate building tool"
),
size
=
size
)
self
.
filenames
=
filenames
if
hasattr
(
sys
,
"frozen"
)
and
sys
.
frozen
==
"windows_exe"
:
if
hasattr
(
sys
,
"frozen"
)
and
sys
.
frozen
==
"windows_exe"
:
self
.
SetIcon
(
wx
.
Icon
(
sys
.
executable
,
wx
.
BITMAP_TYPE_ICO
))
self
.
SetIcon
(
wx
.
Icon
(
sys
.
executable
,
wx
.
BITMAP_TYPE_ICO
))
else
:
else
:
...
@@ -280,7 +281,7 @@ class stlwin(wx.Frame):
...
@@ -280,7 +281,7 @@ class stlwin(wx.Frame):
self
.
mainsizer
.
Add
(
self
.
panel
)
self
.
mainsizer
.
Add
(
self
.
panel
)
#self.mainsizer.AddSpacer(10)
#self.mainsizer.AddSpacer(10)
if
glview
:
if
glview
:
self
.
s
=
stlview
.
TestGl
Panel
(
self
,
(
580
,
580
))
self
.
s
=
stlview
.
StlView
Panel
(
self
,
(
580
,
580
))
else
:
else
:
self
.
s
=
showstl
(
self
,
(
580
,
580
),
(
0
,
0
))
self
.
s
=
showstl
(
self
,
(
580
,
580
),
(
0
,
0
))
self
.
mainsizer
.
Add
(
self
.
s
,
1
,
wx
.
EXPAND
)
self
.
mainsizer
.
Add
(
self
.
s
,
1
,
wx
.
EXPAND
)
...
@@ -398,14 +399,17 @@ class stlwin(wx.Frame):
...
@@ -398,14 +399,17 @@ class stlwin(wx.Frame):
def
right
(
self
,
event
):
def
right
(
self
,
event
):
dlg
=
wx
.
FileDialog
(
self
,
_
(
"Pick file to load"
),
self
.
basedir
,
style
=
wx
.
FD_OPEN
|
wx
.
FD_FILE_MUST_EXIST
)
dlg
=
wx
.
FileDialog
(
self
,
_
(
"Pick file to load"
),
self
.
basedir
,
style
=
wx
.
FD_OPEN
|
wx
.
FD_FILE_MUST_EXIST
)
dlg
.
SetWildcard
(
_
(
"STL files (*.stl;*.STL)|*.stl;*.STL|OpenSCAD files (*.scad)|*.scad"
))
dlg
.
SetWildcard
(
_
(
"STL files (*.stl;*.STL)|*.stl;*.STL|OpenSCAD files (*.scad)|*.scad"
))
if
(
dlg
.
ShowModal
()
==
wx
.
ID_OK
)
:
if
dlg
.
ShowModal
()
==
wx
.
ID_OK
:
name
=
dlg
.
GetPath
()
name
=
dlg
.
GetPath
()
if
(
name
.
lower
()
.
endswith
(
".stl"
)):
self
.
load_file
(
event
,
name
)
self
.
load_stl
(
event
,
name
)
elif
(
name
.
lower
()
.
endswith
(
".scad"
)):
self
.
load_scad
(
event
,
name
)
dlg
.
Destroy
()
dlg
.
Destroy
()
def
load_file
(
self
,
event
,
filename
):
if
filename
.
lower
()
.
endswith
(
".stl"
):
self
.
load_stl
(
event
,
filename
)
elif
filename
.
lower
()
.
endswith
(
".scad"
):
self
.
load_scad
(
event
,
filename
)
def
load_scad
(
self
,
event
,
name
):
def
load_scad
(
self
,
event
,
name
):
lf
=
open
(
name
)
lf
=
open
(
name
)
s
=
[
i
.
replace
(
"
\n
"
,
""
)
.
replace
(
"
\r
"
,
""
)
.
replace
(
";"
,
""
)
for
i
in
lf
if
"stl"
in
i
]
s
=
[
i
.
replace
(
"
\n
"
,
""
)
.
replace
(
"
\r
"
,
""
)
.
replace
(
";"
,
""
)
for
i
in
lf
if
"stl"
in
i
]
...
@@ -491,6 +495,6 @@ class stlwin(wx.Frame):
...
@@ -491,6 +495,6 @@ class stlwin(wx.Frame):
if
__name__
==
'__main__'
:
if
__name__
==
'__main__'
:
app
=
wx
.
App
(
False
)
app
=
wx
.
App
(
False
)
main
=
stlwin
()
main
=
stlwin
(
sys
.
argv
[
1
:]
)
main
.
Show
()
main
.
Show
()
app
.
MainLoop
()
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