Skip to content

Commit 833c7e4

Browse files
author
Tristan
committed
fixed core functions for python3 compatibility
1 parent 864e78c commit 833c7e4

File tree

2 files changed

+6
-4
lines changed

2 files changed

+6
-4
lines changed

stl_tools/__init__.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
1-
from numpy2stl import numpy2stl
2-
from text2png import text2png, text2array
1+
from .numpy2stl import numpy2stl
2+
from .text2png import text2png, text2array

stl_tools/numpy2stl.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -43,10 +43,12 @@ def writeSTL(facets, file_name, ascii=False):
4343
f = open(file_name, 'wb')
4444
if ascii:
4545
lines = _build_ascii_stl(facets)
46-
f.write("\n".join(lines))
46+
lines_ = "\n".join(lines).encode("UTF-8")
47+
f.write(lines_)
4748
else:
4849
data = _build_binary_stl(facets)
49-
f.write("".join(data))
50+
data = b"".join(data)
51+
f.write(data)
5052

5153
f.close()
5254

0 commit comments

Comments
 (0)