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
e0dcb6a1
Commit
e0dcb6a1
authored
Jun 02, 2014
by
Guillaume Seguin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix build dimensions offsets usage in platers
parent
1c7d89c7
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
10 additions
and
5 deletions
+10
-5
gcodeplater.py
printrun/gcodeplater.py
+1
-0
objectplater.py
printrun/objectplater.py
+3
-1
stlplater.py
printrun/stlplater.py
+6
-4
No files found.
printrun/gcodeplater.py
View file @
e0dcb6a1
...
@@ -97,6 +97,7 @@ class GcodePlater(Plater):
...
@@ -97,6 +97,7 @@ class GcodePlater(Plater):
while
generator_output
is
not
None
:
while
generator_output
is
not
None
:
generator_output
=
generator
.
next
()
generator_output
=
generator
.
next
()
obj
=
gcview
.
GCObject
(
model
)
obj
=
gcview
.
GCObject
(
model
)
obj
.
offsets
=
[
self
.
build_dimensions
[
3
],
self
.
build_dimensions
[
4
],
0
]
obj
.
gcode
=
gcode
obj
.
gcode
=
gcode
obj
.
dims
=
[
gcode
.
xmin
,
gcode
.
xmax
,
obj
.
dims
=
[
gcode
.
xmin
,
gcode
.
xmax
,
gcode
.
ymin
,
gcode
.
ymax
,
gcode
.
ymin
,
gcode
.
ymax
,
...
...
printrun/objectplater.py
View file @
e0dcb6a1
...
@@ -198,7 +198,9 @@ class Plater(wx.Frame):
...
@@ -198,7 +198,9 @@ class Plater(wx.Frame):
print
_
(
"Bed full, sorry sir :("
)
print
_
(
"Bed full, sorry sir :("
)
self
.
Refresh
()
self
.
Refresh
()
return
return
centreoffset
=
[(
bedsize
[
0
]
-
max
[
0
])
/
2
,
(
bedsize
[
1
]
-
max
[
1
])
/
2
]
centerx
=
self
.
build_dimensions
[
0
]
/
2
+
self
.
build_dimensions
[
3
]
centery
=
self
.
build_dimensions
[
1
]
/
2
+
self
.
build_dimensions
[
4
]
centreoffset
=
[
centerx
-
max
[
0
]
/
2
,
centery
-
max
[
1
]
/
2
]
for
i
in
self
.
models
:
for
i
in
self
.
models
:
self
.
models
[
i
]
.
offsets
[
0
]
+=
centreoffset
[
0
]
self
.
models
[
i
]
.
offsets
[
0
]
+=
centreoffset
[
0
]
self
.
models
[
i
]
.
offsets
[
1
]
+=
centreoffset
[
1
]
self
.
models
[
i
]
.
offsets
[
1
]
+=
centreoffset
[
1
]
...
...
printrun/stlplater.py
View file @
e0dcb6a1
...
@@ -350,7 +350,7 @@ class StlPlater(Plater):
...
@@ -350,7 +350,7 @@ class StlPlater(Plater):
print
"Rebasing
%
s"
%
best_match
print
"Rebasing
%
s"
%
best_match
model
=
self
.
models
[
best_match
]
model
=
self
.
models
[
best_match
]
newmodel
=
model
.
rebase
(
best_facet
)
newmodel
=
model
.
rebase
(
best_facet
)
newmodel
.
offsets
=
model
.
offsets
newmodel
.
offsets
=
list
(
model
.
offsets
)
newmodel
.
rot
=
0
newmodel
.
rot
=
0
newmodel
.
scale
=
model
.
scale
newmodel
.
scale
=
model
.
scale
newmodel
.
filename
=
model
.
filename
newmodel
.
filename
=
model
.
filename
...
@@ -436,8 +436,10 @@ class StlPlater(Plater):
...
@@ -436,8 +436,10 @@ class StlPlater(Plater):
self
.
load_stl_into_model
(
name
,
name
)
self
.
load_stl_into_model
(
name
,
name
)
wx
.
CallAfter
(
self
.
Refresh
)
wx
.
CallAfter
(
self
.
Refresh
)
def
load_stl_into_model
(
self
,
path
,
name
,
offset
=
[
0
,
0
,
0
]
,
rotation
=
0
,
scale
=
[
1.0
,
1.0
,
1.0
]):
def
load_stl_into_model
(
self
,
path
,
name
,
offset
=
None
,
rotation
=
0
,
scale
=
[
1.0
,
1.0
,
1.0
]):
model
=
stltool
.
stl
(
path
)
model
=
stltool
.
stl
(
path
)
if
offset
is
None
:
offset
=
[
self
.
build_dimensions
[
3
],
self
.
build_dimensions
[
4
],
0
]
model
.
offsets
=
list
(
offset
)
model
.
offsets
=
list
(
offset
)
model
.
rot
=
rotation
model
.
rot
=
rotation
model
.
scale
=
list
(
scale
)
model
.
scale
=
list
(
scale
)
...
@@ -503,8 +505,8 @@ class StlPlater(Plater):
...
@@ -503,8 +505,8 @@ class StlPlater(Plater):
for
name
,
model
in
models
.
items
():
for
name
,
model
in
models
.
items
():
# FIXME: not sure this is going to work superwell with utf8
# FIXME: not sure this is going to work superwell with utf8
if
model
.
filename
==
filename
:
if
model
.
filename
==
filename
:
model
.
offsets
[
0
]
=
x
model
.
offsets
[
0
]
=
x
+
self
.
build_dimensions
[
3
]
model
.
offsets
[
1
]
=
y
model
.
offsets
[
1
]
=
y
+
self
.
build_dimensions
[
4
]
model
.
rot
=
rot
model
.
rot
=
rot
del
models
[
name
]
del
models
[
name
]
break
break
...
...
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