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
5fc81cad
Commit
5fc81cad
authored
Aug 12, 2013
by
Guillaume Seguin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Speedup stl plater by only loading files once when multiple copies are added
parent
999fa8cf
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
13 additions
and
2 deletions
+13
-2
plater.py
printrun/plater.py
+13
-2
No files found.
printrun/plater.py
View file @
5fc81cad
...
@@ -30,6 +30,7 @@ import sys
...
@@ -30,6 +30,7 @@ import sys
import
re
import
re
import
traceback
import
traceback
import
subprocess
import
subprocess
from
copy
import
copy
from
printrun
import
stltool
from
printrun
import
stltool
from
printrun.objectplater
import
Plater
from
printrun.objectplater
import
Plater
...
@@ -270,8 +271,18 @@ class StlPlater(Plater):
...
@@ -270,8 +271,18 @@ class StlPlater(Plater):
path
=
os
.
path
.
split
(
name
)[
0
]
path
=
os
.
path
.
split
(
name
)[
0
]
self
.
basedir
=
path
self
.
basedir
=
path
if
name
.
lower
()
.
endswith
(
".stl"
):
if
name
.
lower
()
.
endswith
(
".stl"
):
#Filter out the path, just show the STL filename.
for
model
in
self
.
models
.
values
():
self
.
load_stl_into_model
(
name
,
name
)
if
model
.
filename
==
name
:
newmodel
=
copy
(
model
)
newmodel
.
offsets
=
list
(
model
.
offsets
)
newmodel
.
rot
=
model
.
rot
newmodel
.
scale
=
list
(
model
.
scale
)
self
.
add_model
(
name
,
newmodel
)
self
.
s
.
drawmodel
(
newmodel
,
2
)
break
else
:
#Filter out the path, just show the STL filename.
self
.
load_stl_into_model
(
name
,
name
)
self
.
Refresh
()
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
=
[
0
,
0
,
0
],
rotation
=
0
,
scale
=
[
1.0
,
1.0
,
1.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