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
50c2c434
Commit
50c2c434
authored
Sep 15, 2011
by
Travis Howse
Browse files
Options
Browse Files
Download
Plain Diff
Merge remote-tracking branch 'kliment/master'
Conflicts: plater.py
parents
4053291e
0da65f14
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
24 additions
and
24 deletions
+24
-24
plater.py
plater.py
+22
-22
pronterface.py
pronterface.py
+2
-2
No files found.
plater.py
View file @
50c2c434
...
...
@@ -16,7 +16,7 @@ class stlwrap:
class
showstl
(
wx
.
Window
):
def
__init__
(
self
,
parent
,
size
,
pos
):
wx
.
Window
.
__init__
(
self
,
parent
,
size
=
size
,
pos
=
pos
)
self
.
l
=
wx
.
List
Ctrl
(
self
,
style
=
wx
.
LC_LIST
,
size
=
(
300
,
130
),
pos
=
(
0
,
size
[
1
]
-
130
))
self
.
l
=
wx
.
List
Box
(
self
,
size
=
(
300
,
130
),
pos
=
(
0
,
size
[
1
]
-
130
))
self
.
eb
=
wx
.
Button
(
self
,
label
=
"Export"
,
pos
=
(
300
,
size
[
1
]
-
130
))
self
.
sb
=
wx
.
Button
(
self
,
label
=
"Snap to Z=0"
,
pos
=
(
300
,
size
[
1
]
-
105
))
self
.
cb
=
wx
.
Button
(
self
,
label
=
"Put at 100,100"
,
pos
=
(
300
,
size
[
1
]
-
80
))
...
...
@@ -42,26 +42,26 @@ class showstl(wx.Window):
self
.
prevsel
=-
1
def
center
(
self
,
event
):
i
=
self
.
l
.
Get
FirstSelected
()
i
=
self
.
l
.
Get
Selection
()
if
i
!=
-
1
:
m
=
self
.
models
[
self
.
l
.
Get
ItemText
(
i
)]
m
=
self
.
models
[
self
.
l
.
Get
String
(
i
)]
m
.
offsets
=
[
100
,
100
,
m
.
offsets
[
2
]]
self
.
Refresh
()
def
snap
(
self
,
event
):
i
=
self
.
l
.
Get
FirstSelected
()
i
=
self
.
l
.
Get
Selection
()
if
i
!=
-
1
:
m
=
self
.
models
[
self
.
l
.
Get
ItemText
(
i
)]
m
=
self
.
models
[
self
.
l
.
Get
String
(
i
)]
m
.
offsets
[
2
]
=-
1.0
*
min
(
m
.
facetsminz
)[
0
]
#print m.offsets[2]
self
.
Refresh
()
def
delete
(
self
,
event
):
i
=
self
.
l
.
Get
FirstSelected
()
i
=
self
.
l
.
Get
Selection
()
if
i
!=
-
1
:
del
self
.
models
[
self
.
l
.
Get
ItemText
(
i
)]
self
.
l
.
Delete
Item
(
i
)
self
.
l
.
Select
(
self
.
l
.
Get
Item
Count
()
-
1
)
del
self
.
models
[
self
.
l
.
Get
String
(
i
)]
self
.
l
.
Delete
(
i
)
self
.
l
.
Select
(
self
.
l
.
GetCount
()
-
1
)
self
.
Refresh
()
def
export
(
self
,
event
):
...
...
@@ -89,7 +89,7 @@ class showstl(wx.Window):
newrow
=
0
max
=
[
0
,
0
]
for
i
in
self
.
models
:
self
.
models
[
i
]
.
offsets
[
2
]
=-
1.0
*
min
(
self
.
models
[
i
]
.
facetsminz
)[
0
]
self
.
models
[
i
]
.
offsets
[
2
]
=-
1.0
*
self
.
models
[
i
]
.
dims
[
4
]
x
=
abs
(
self
.
models
[
i
]
.
dims
[
0
]
-
self
.
models
[
i
]
.
dims
[
1
])
y
=
abs
(
self
.
models
[
i
]
.
dims
[
2
]
-
self
.
models
[
i
]
.
dims
[
3
])
centre
=
[
x
/
2
,
y
/
2
]
...
...
@@ -179,24 +179,24 @@ class showstl(wx.Window):
m
.
bitmap
.
SetMask
(
wx
.
Mask
(
m
.
bitmap
,
wx
.
Colour
(
0
,
0
,
0
,
255
)))
#print time.time()-t
self
.
l
.
Append
(
[
stlwrap
(
self
.
models
[
newname
],
newname
)]
)
i
=
self
.
l
.
Get
FirstSelected
()
if
i
!=
-
1
:
self
.
l
.
Select
(
i
,
0
)
self
.
l
.
Append
(
newname
)
i
=
self
.
l
.
Get
Selection
()
if
i
==
wx
.
NOT_FOUND
:
self
.
l
.
Select
(
0
)
self
.
l
.
Select
(
self
.
l
.
Get
Item
Count
()
-
1
)
self
.
l
.
Select
(
self
.
l
.
GetCount
()
-
1
)
self
.
Refresh
()
#print time.time()-t
def
move
(
self
,
event
):
if
event
.
ButtonUp
(
wx
.
MOUSE_BTN_LEFT
):
if
(
self
.
initpos
is
not
None
):
i
=
self
.
l
.
Get
FirstSelected
()
if
i
!=
-
1
:
i
=
self
.
l
.
Get
Selection
()
if
i
!=
wx
.
NOT_FOUND
:
p
=
event
.
GetPositionTuple
()
#print (p[0]-self.initpos[0]),(p[1]-self.initpos[1])
t
=
time
.
time
()
m
=
self
.
models
[
self
.
l
.
Get
ItemText
(
i
)]
m
=
self
.
models
[
self
.
l
.
Get
String
(
i
)]
m
.
offsets
=
[
m
.
offsets
[
0
]
+
0.5
*
(
p
[
0
]
-
self
.
initpos
[
0
]),
m
.
offsets
[
1
]
-
0.5
*
(
p
[
1
]
-
self
.
initpos
[
1
]),
m
.
offsets
[
2
]]
#self.models[self.l.GetItemText(i)]=self.models[self.l.GetItemText(i)].translate([0.5*(p[0]-self.initpos[0]),0.5*(p[1]-self.initpos[1]),0])
#print time.time()-t
...
...
@@ -220,10 +220,10 @@ class showstl(wx.Window):
def
rotateafter
(
self
):
if
(
self
.
i
!=
self
.
previ
):
i
=
self
.
l
.
Get
FirstSelected
()
if
i
!=
-
1
:
i
=
self
.
l
.
Get
Selection
()
if
i
!=
wx
.
NOT_FOUND
:
#o=self.models[self.l.GetItemText(i)].offsets
self
.
models
[
self
.
l
.
Get
ItemText
(
i
)]
.
rot
+=
5
*
(
self
.
i
-
self
.
previ
)
self
.
models
[
self
.
l
.
Get
String
(
i
)]
.
rot
+=
5
*
(
self
.
i
-
self
.
previ
)
#self.models[self.l.GetItemText(i)].offsets=o
self
.
previ
=
self
.
i
self
.
Refresh
()
...
...
@@ -234,7 +234,7 @@ class showstl(wx.Window):
def
rot
(
self
,
event
):
z
=
event
.
GetWheelRotation
()
s
=
self
.
l
.
Get
FirstSelected
()
s
=
self
.
l
.
Get
Selection
()
if
self
.
prevsel
!=
s
:
self
.
i
=
0
self
.
prevsel
=
s
...
...
pronterface.py
View file @
50c2c434
...
...
@@ -727,7 +727,7 @@ class PronterWindow(wx.Frame,pronsole.pronsole):
n
=
button
.
custombutton
self
.
custombuttons
[
n
]
=
None
self
.
cbutton_save
(
n
,
None
)
while
self
.
custombuttons
[
-
1
]
is
None
:
while
len
(
self
.
custombuttons
)
and
self
.
custombuttons
[
-
1
]
is
None
:
del
self
.
custombuttons
[
-
1
]
self
.
cbuttons_reload
()
...
...
@@ -1008,7 +1008,7 @@ class PronterWindow(wx.Frame,pronsole.pronsole):
except
:
pass
dlg
=
wx
.
FileDialog
(
self
,
_
(
"Open file to print"
),
basedir
,
style
=
wx
.
FD_OPEN
|
wx
.
FD_FILE_MUST_EXIST
)
dlg
.
SetWildcard
(
_
(
"STL and GCODE files (;*.gcode;*.g;*.stl;*.STL;)"
))
dlg
.
SetWildcard
(
_
(
"STL and GCODE files (;*.gcode;*.g
co;*.g
;*.stl;*.STL;)"
))
if
(
filename
is
not
None
or
dlg
.
ShowModal
()
==
wx
.
ID_OK
):
if
filename
is
not
None
:
name
=
filename
...
...
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