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
ab91d1b6
Commit
ab91d1b6
authored
Apr 03, 2014
by
Guillaume Seguin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Use gcode reported dims to fit on object
parent
a965554f
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
12 additions
and
2 deletions
+12
-2
gcview.py
printrun/gcview.py
+6
-2
actors.py
printrun/gl/libtatlin/actors.py
+6
-0
No files found.
printrun/gcview.py
View file @
ab91d1b6
...
...
@@ -15,7 +15,6 @@
# You should have received a copy of the GNU General Public License
# along with Printrun. If not, see <http://www.gnu.org/licenses/>.
import
wx
from
.
import
gcoder
...
...
@@ -37,6 +36,11 @@ def create_model(light):
else
:
return
actors
.
GcodeModel
()
def
gcode_dims
(
g
):
return
((
g
.
xmin
,
g
.
xmax
,
g
.
width
),
(
g
.
ymin
,
g
.
ymax
,
g
.
depth
),
(
g
.
zmin
,
g
.
zmax
,
g
.
height
))
def
set_model_colors
(
model
,
root
):
for
field
in
dir
(
model
):
if
field
.
startswith
(
"color_"
):
...
...
@@ -212,7 +216,7 @@ class GcodeViewPanel(wxGLPanel):
if
not
self
.
parent
.
model
or
not
self
.
parent
.
model
.
loaded
:
return
self
.
canvas
.
SetCurrent
(
self
.
context
)
dims
=
self
.
parent
.
model
.
dims
dims
=
gcode_dims
(
self
.
parent
.
model
.
gcode
)
self
.
reset_mview
(
1.0
)
center_x
=
(
dims
[
0
][
0
]
+
dims
[
0
][
1
])
/
2
center_y
=
(
dims
[
1
][
0
]
+
dims
[
1
][
1
])
/
2
...
...
printrun/gl/libtatlin/actors.py
View file @
ab91d1b6
...
...
@@ -333,6 +333,8 @@ class GcodeModel(Model):
use_vbos
=
True
loaded
=
False
gcode
=
None
path_halfwidth
=
0.2
path_halfheight
=
0.2
...
...
@@ -343,6 +345,7 @@ class GcodeModel(Model):
def
load_data
(
self
,
model_data
,
callback
=
None
):
t_start
=
time
.
time
()
self
.
gcode
=
model_data
self
.
count_travel_indices
=
count_travel_indices
=
[
0
]
self
.
count_print_indices
=
count_print_indices
=
[
0
]
...
...
@@ -741,8 +744,11 @@ class GcodeModelLight(Model):
use_vbos
=
True
loaded
=
False
gcode
=
None
def
load_data
(
self
,
model_data
,
callback
=
None
):
t_start
=
time
.
time
()
self
.
gcode
=
model_data
self
.
layer_idxs_map
=
{}
self
.
layer_stops
=
[
0
]
...
...
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