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
7f880dc3
Commit
7f880dc3
authored
Dec 30, 2011
by
Václav 'Ax' Hůla
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
load_scad line parsing rewrite (bit of robustness, future proofing of import_stl vs. import)
parent
1a90feb2
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
12 additions
and
9 deletions
+12
-9
plater.py
plater.py
+12
-9
No files found.
plater.py
View file @
7f880dc3
...
...
@@ -7,11 +7,8 @@ try:
except
:
glview
=
False
def
translate
(
l
):
return
l
def
rotate
(
l
):
return
l
def
import_stl
(
s
):
return
s
def
evalme
(
s
):
return
eval
(
s
[
s
.
find
(
"("
)
+
1
:
s
.
find
(
")"
)])
class
stlwrap
:
def
__init__
(
self
,
obj
,
name
=
None
):
...
...
@@ -321,14 +318,20 @@ class stlwin(wx.Frame):
def
load_scad
(
self
,
event
,
name
):
lf
=
open
(
name
)
s
=
[
i
.
replace
(
"
\n
"
,
""
)
.
replace
(
"
\r
"
,
""
)
.
replace
(
";"
,
""
)
for
i
in
lf
]
s
=
[
i
.
replace
(
"
\n
"
,
""
)
.
replace
(
"
\r
"
,
""
)
.
replace
(
";"
,
""
)
for
i
in
lf
if
"stl"
in
i
]
lf
.
close
()
for
i
in
s
:
parts
=
i
.
split
()
translate_list
=
eval
(
parts
[
0
])
rotate_list
=
eval
(
parts
[
1
])
stl_file
=
eval
(
parts
[
2
])
for
part
in
parts
:
if
'translate'
in
part
:
translate_list
=
evalme
(
part
)
for
part
in
parts
:
if
'rotate'
in
part
:
rotate_list
=
evalme
(
part
)
for
part
in
parts
:
if
'import'
in
part
:
stl_file
=
evalme
(
part
)
newname
=
os
.
path
.
split
(
stl_file
.
lower
())[
1
]
c
=
1
...
...
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