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
b3e27469
Commit
b3e27469
authored
Jul 04, 2013
by
Guillaume Seguin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Change ascii vs binary stl detection criterion
parent
36e597a8
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
8 additions
and
5 deletions
+8
-5
stltool.py
printrun/stltool.py
+8
-5
No files found.
printrun/stltool.py
View file @
b3e27469
...
...
@@ -102,8 +102,14 @@ class stl:
self
.
facetloc
=
0
if
filename
is
None
:
return
self
.
f
=
list
(
open
(
filename
))
if
not
self
.
f
[
0
]
.
startswith
(
"solid"
):
with
open
(
filename
)
as
f
:
data
=
f
.
read
()
if
"facet normal"
in
data
[
1
:
300
]
and
"outer loop"
in
data
[
1
:
300
]:
lines
=
data
.
split
(
"
\n
"
)
for
line
in
lines
:
if
not
self
.
parseline
(
line
):
return
else
:
print
"Not an ascii stl solid - attempting to parse as binary"
f
=
open
(
filename
,
"rb"
)
buf
=
f
.
read
(
84
)
...
...
@@ -130,9 +136,6 @@ class stl:
self
.
facetsmaxz
+=
[(
max
(
map
(
lambda
x
:
x
[
2
],
facet
[
1
])),
facet
)]
f
.
close
()
return
for
i
in
self
.
f
:
if
not
self
.
parseline
(
i
):
return
def
translate
(
self
,
v
=
[
0
,
0
,
0
]):
matrix
=
[
...
...
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