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
cf62dc25
Commit
cf62dc25
authored
Aug 07, 2011
by
Keegi
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
preview extrusion width as setting
parent
3813ea29
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
9 additions
and
6 deletions
+9
-6
gviz.py
gviz.py
+4
-4
pronterface.py
pronterface.py
+5
-2
No files found.
gviz.py
View file @
cf62dc25
import
wx
,
time
class
window
(
wx
.
Frame
):
def
__init__
(
self
,
f
,
size
=
(
600
,
600
),
bedsize
=
(
200
,
200
),
grid
=
(
10
,
50
)):
def
__init__
(
self
,
f
,
size
=
(
600
,
600
),
bedsize
=
(
200
,
200
),
grid
=
(
10
,
50
)
,
extrusion_width
=
0.5
):
wx
.
Frame
.
__init__
(
self
,
None
,
title
=
"Layer view (Use shift+mousewheel to switch layers)"
,
size
=
(
size
[
0
],
size
[
1
]))
self
.
p
=
gviz
(
self
,
size
=
size
,
bedsize
=
bedsize
,
grid
=
grid
)
self
.
p
=
gviz
(
self
,
size
=
size
,
bedsize
=
bedsize
,
grid
=
grid
,
extrusion_width
=
extrusion_width
)
s
=
time
.
time
()
for
i
in
f
:
self
.
p
.
addgcode
(
i
)
...
...
@@ -53,7 +53,7 @@ class window(wx.Frame):
elif
z
<
0
:
self
.
p
.
zoom
(
event
.
GetX
(),
event
.
GetY
(),
1
/
1.2
)
class
gviz
(
wx
.
Panel
):
def
__init__
(
self
,
parent
,
size
=
(
200
,
200
),
bedsize
=
(
200
,
200
),
grid
=
(
10
,
50
)):
def
__init__
(
self
,
parent
,
size
=
(
200
,
200
),
bedsize
=
(
200
,
200
),
grid
=
(
10
,
50
)
,
extrusion_width
=
0.5
):
wx
.
Panel
.
__init__
(
self
,
parent
,
-
1
,
size
=
(
size
[
0
],
size
[
1
]))
self
.
size
=
size
self
.
bedsize
=
bedsize
...
...
@@ -66,7 +66,7 @@ class gviz(wx.Panel):
self
.
pens
=
{}
self
.
layers
=
[]
self
.
layerindex
=
0
self
.
filament_width
=
0.5
# set it to 0 to disable scaling lines with zoom
self
.
filament_width
=
extrusion_width
# set it to 0 to disable scaling lines with zoom
self
.
scale
=
[
min
(
float
(
size
[
0
])
/
bedsize
[
0
],
float
(
size
[
1
])
/
bedsize
[
1
])]
*
2
penwidth
=
max
(
1.0
,
self
.
filament_width
*
((
self
.
scale
[
0
]
+
self
.
scale
[
1
])
/
2.0
))
self
.
translate
=
[
0.0
,
0.0
]
...
...
pronterface.py
View file @
cf62dc25
...
...
@@ -49,6 +49,7 @@ class PronterWindow(wx.Frame,pronsole.pronsole):
self
.
settings
.
bed_size_y
=
200.
self
.
settings
.
preview_grid_step1
=
10.
self
.
settings
.
preview_grid_step2
=
50.
self
.
settings
.
preview_extrusion_width
=
0.5
self
.
filename
=
filename
os
.
putenv
(
"UBUNTU_MENUPROXY"
,
"0"
)
wx
.
Frame
.
__init__
(
self
,
None
,
title
=
"Printer Interface"
,
size
=
size
);
...
...
@@ -515,11 +516,13 @@ class PronterWindow(wx.Frame,pronsole.pronsole):
lls
.
Add
((
10
,
0
),
pos
=
(
0
,
11
),
span
=
(
1
,
1
))
self
.
gviz
=
gviz
.
gviz
(
self
.
panel
,(
300
,
300
),
bedsize
=
(
self
.
settings
.
bed_size_x
,
self
.
settings
.
bed_size_y
),
grid
=
(
self
.
settings
.
preview_grid_step1
,
self
.
settings
.
preview_grid_step2
))
grid
=
(
self
.
settings
.
preview_grid_step1
,
self
.
settings
.
preview_grid_step2
),
extrusion_width
=
self
.
settings
.
preview_extrusion_width
)
self
.
gviz
.
showall
=
1
self
.
gwindow
=
gviz
.
window
([],
bedsize
=
(
self
.
settings
.
bed_size_x
,
self
.
settings
.
bed_size_y
),
grid
=
(
self
.
settings
.
preview_grid_step1
,
self
.
settings
.
preview_grid_step2
))
grid
=
(
self
.
settings
.
preview_grid_step1
,
self
.
settings
.
preview_grid_step2
),
extrusion_width
=
self
.
settings
.
preview_extrusion_width
)
self
.
gviz
.
Bind
(
wx
.
EVT_LEFT_DOWN
,
self
.
showwin
)
self
.
gwindow
.
Bind
(
wx
.
EVT_CLOSE
,
lambda
x
:
self
.
gwindow
.
Hide
())
cs
=
self
.
centersizer
=
wx
.
GridBagSizer
()
...
...
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