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
b9ccd433
Commit
b9ccd433
authored
Jul 15, 2011
by
Keegi
Browse files
Options
Browse Files
Download
Plain Diff
Merge remote branch 'kliment/master'
parents
7e80870c
bd640591
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
41 additions
and
9 deletions
+41
-9
.pronsolerc.example
.pronsolerc.example
+5
-5
plater.py
plater.py
+16
-2
printcore.py
printcore.py
+2
-0
stltool.py
stltool.py
+18
-2
No files found.
.pronsolerc
→
.pronsolerc
.example
View file @
b9ccd433
# Sample .pronsolerc file - copy this into your home directory
# Sample .pronsolerc file - copy this into your home directory
and rename it to .pronsolerc
!print "Loaded " + self.rc_filename
!print "Loaded " + self.rc_filename
macro up move Z 10
macro up move Z 10
macro loud !self.p.loud = 1
macro loud !self.p.loud = 1
macro quiet !self.p.loud = 0
macro quiet !self.p.loud = 0
plater.py
View file @
b9ccd433
...
@@ -12,10 +12,12 @@ class stlwrap:
...
@@ -12,10 +12,12 @@ class stlwrap:
return
self
.
name
return
self
.
name
class
showstl
(
wx
.
Frame
):
class
showstl
(
wx
.
Window
):
def
__init__
(
self
,
parent
,
size
,
pos
):
def
__init__
(
self
,
parent
,
size
,
pos
):
wx
.
Window
.
__init__
(
self
,
parent
,
size
=
size
,
pos
=
pos
)
wx
.
Window
.
__init__
(
self
,
parent
,
size
=
size
,
pos
=
pos
)
self
.
l
=
wx
.
ListCtrl
(
self
,
size
=
(
300
,
100
),
pos
=
(
0
,
size
[
1
]
-
100
))
self
.
l
=
wx
.
ListCtrl
(
self
,
size
=
(
300
,
100
),
pos
=
(
0
,
size
[
1
]
-
100
))
self
.
b
=
wx
.
Button
(
self
,
label
=
"Export"
,
pos
=
(
300
,
size
[
1
]
-
100
))
self
.
b
.
Bind
(
wx
.
EVT_BUTTON
,
self
.
export
)
#self.SetBackgroundColour((0,0,0))
#self.SetBackgroundColour((0,0,0))
wx
.
FutureCall
(
200
,
self
.
paint
)
wx
.
FutureCall
(
200
,
self
.
paint
)
self
.
i
=
0
self
.
i
=
0
...
@@ -30,6 +32,18 @@ class showstl(wx.Frame):
...
@@ -30,6 +32,18 @@ class showstl(wx.Frame):
self
.
initpos
=
None
self
.
initpos
=
None
self
.
prevsel
=-
1
self
.
prevsel
=-
1
def
export
(
self
,
event
):
dlg
=
wx
.
FileDialog
(
self
,
"Pick file to save to"
,
self
.
basedir
,
style
=
wx
.
FD_SAVE
)
dlg
.
SetWildcard
(
"STL files (;*.stl;)"
)
if
(
dlg
.
ShowModal
()
==
wx
.
ID_OK
):
name
=
dlg
.
GetPath
()
facets
=
[]
for
i
in
self
.
models
.
values
():
facets
+=
i
.
facets
stltool
.
emitstl
(
name
,
facets
,
"plater_export"
)
print
"wrote "
,
name
def
right
(
self
,
event
):
def
right
(
self
,
event
):
dlg
=
wx
.
FileDialog
(
self
,
"Open file to print"
,
self
.
basedir
,
style
=
wx
.
FD_OPEN
|
wx
.
FD_FILE_MUST_EXIST
)
dlg
=
wx
.
FileDialog
(
self
,
"Open file to print"
,
self
.
basedir
,
style
=
wx
.
FD_OPEN
|
wx
.
FD_FILE_MUST_EXIST
)
dlg
.
SetWildcard
(
"STL files (;*.stl;)"
)
dlg
.
SetWildcard
(
"STL files (;*.stl;)"
)
...
@@ -120,7 +134,7 @@ class showstl(wx.Frame):
...
@@ -120,7 +134,7 @@ class showstl(wx.Frame):
class
stlwin
(
wx
.
Frame
):
class
stlwin
(
wx
.
Frame
):
def
__init__
(
self
,
size
=
(
500
,
600
)):
def
__init__
(
self
,
size
=
(
500
,
600
)):
wx
.
Frame
.
__init__
(
self
,
None
,
size
=
size
)
wx
.
Frame
.
__init__
(
self
,
None
,
title
=
"Right-click to add a file"
,
size
=
size
)
self
.
s
=
showstl
(
self
,(
500
,
600
),(
100
,
100
))
self
.
s
=
showstl
(
self
,(
500
,
600
),(
100
,
100
))
if
__name__
==
'__main__'
:
if
__name__
==
'__main__'
:
...
...
printcore.py
View file @
b9ccd433
...
@@ -86,6 +86,8 @@ class printcore():
...
@@ -86,6 +86,8 @@ class printcore():
pass
pass
if
self
.
loud
:
if
self
.
loud
:
print
"RECV: "
,
line
.
rstrip
()
print
"RECV: "
,
line
.
rstrip
()
if
(
line
.
startswith
(
'DEBUG_'
)):
continue
if
(
line
.
startswith
(
'start'
)
or
line
.
startswith
(
'ok'
)):
if
(
line
.
startswith
(
'start'
)
or
line
.
startswith
(
'ok'
)):
self
.
clear
=
True
self
.
clear
=
True
if
(
line
.
startswith
(
'start'
)
or
line
.
startswith
(
'ok'
)
or
"T:"
in
line
):
if
(
line
.
startswith
(
'start'
)
or
line
.
startswith
(
'ok'
)
or
"T:"
in
line
):
...
...
stltool.py
View file @
b9ccd433
...
@@ -24,6 +24,22 @@ m=[
...
@@ -24,6 +24,22 @@ m=[
[
0
,
0
,
0
,
1
]
[
0
,
0
,
0
,
1
]
]
]
def
emitstl
(
filename
,
facets
=
[],
objname
=
"stltool_export"
):
if
filename
is
None
:
return
f
=
open
(
filename
,
"w"
)
f
.
write
(
"solid "
+
objname
+
"
\n
"
)
for
i
in
facets
:
f
.
write
(
" facet normal "
+
" "
.
join
(
map
(
str
,
i
[
0
]))
+
"
\n
outer loop
\n
"
)
for
j
in
i
[
1
]:
f
.
write
(
" vertex "
+
" "
.
join
(
map
(
str
,
j
))
+
"
\n
"
)
f
.
write
(
" endloop"
+
"
\n
"
)
f
.
write
(
" endfacet"
+
"
\n
"
)
f
.
write
(
"endsolid "
+
objname
+
"
\n
"
)
f
.
close
()
class
stl
:
class
stl
:
def
__init__
(
self
,
filename
=
None
):
def
__init__
(
self
,
filename
=
None
):
self
.
facet
=
[[
0
,
0
,
0
],[[
0
,
0
,
0
],[
0
,
0
,
0
],[
0
,
0
,
0
]]]
self
.
facet
=
[[
0
,
0
,
0
],[[
0
,
0
,
0
],[
0
,
0
,
0
],[
0
,
0
,
0
]]]
...
@@ -112,7 +128,7 @@ class stl:
...
@@ -112,7 +128,7 @@ class stl:
f
.
write
(
" vertex "
+
" "
.
join
(
map
(
str
,
j
))
+
"
\n
"
)
f
.
write
(
" vertex "
+
" "
.
join
(
map
(
str
,
j
))
+
"
\n
"
)
f
.
write
(
" endloop"
+
"
\n
"
)
f
.
write
(
" endloop"
+
"
\n
"
)
f
.
write
(
" endfacet"
+
"
\n
"
)
f
.
write
(
" endfacet"
+
"
\n
"
)
f
.
write
(
"endsolid
exported"
+
"
\n
"
)
f
.
write
(
"endsolid
"
+
self
.
name
+
"
\n
"
)
f
.
flush
()
f
.
flush
()
def
parseline
(
self
,
l
):
def
parseline
(
self
,
l
):
...
@@ -156,5 +172,5 @@ if __name__=="__main__" and 0:
...
@@ -156,5 +172,5 @@ if __name__=="__main__" and 0:
break
break
print
i
,
len
(
working
)
print
i
,
len
(
working
)
emitstl
(
"sphereout.stl"
,
s
.
facets
,
"emitted_object"
)
#stl("../prusamendel/stl/mendelplate.stl")
#stl("../prusamendel/stl/mendelplate.stl")
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