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
1289d3c2
Commit
1289d3c2
authored
Apr 05, 2014
by
Guillaume Seguin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Pythonic file handling in stlplater.export_to
parent
c3799528
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
23 additions
and
24 deletions
+23
-24
stlplater.py
printrun/stlplater.py
+23
-24
No files found.
printrun/stlplater.py
View file @
1289d3c2
...
@@ -314,7 +314,7 @@ class StlPlater(Plater):
...
@@ -314,7 +314,7 @@ class StlPlater(Plater):
self
.
s
.
drawmodel
(
model
,
2
)
self
.
s
.
drawmodel
(
model
,
2
)
def
export_to
(
self
,
name
):
def
export_to
(
self
,
name
):
sf
=
open
(
name
.
replace
(
"."
,
"_"
)
+
".scad"
,
"w"
)
with
open
(
name
.
replace
(
"."
,
"_"
)
+
".scad"
,
"w"
)
as
sf
:
facets
=
[]
facets
=
[]
for
model
in
self
.
models
.
values
():
for
model
in
self
.
models
.
values
():
r
=
model
.
rot
r
=
model
.
rot
...
@@ -335,7 +335,6 @@ class StlPlater(Plater):
...
@@ -335,7 +335,6 @@ class StlPlater(Plater):
if
any
(
o
):
if
any
(
o
):
model
=
model
.
translate
(
o
)
model
=
model
.
translate
(
o
)
facets
+=
model
.
facets
facets
+=
model
.
facets
sf
.
close
()
stltool
.
emitstl
(
name
,
facets
,
"plater_export"
)
stltool
.
emitstl
(
name
,
facets
,
"plater_export"
)
print
_
(
"Wrote plate to
%
s"
)
%
name
print
_
(
"Wrote plate to
%
s"
)
%
name
...
...
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