diff -r c82943fb205f -r cce0af6351f0 printrun-src/printrun/stltool.py --- a/printrun-src/printrun/stltool.py Tue Jan 19 20:45:09 2021 +0100 +++ b/printrun-src/printrun/stltool.py Wed Jan 20 10:15:13 2021 +0100 @@ -42,13 +42,14 @@ return numpy.append(v, w) def applymatrix(facet, matrix = I): - return genfacet(map(lambda x: matrix.dot(homogeneous(x))[:3], facet[1])) + return genfacet([matrix.dot(homogeneous(x))[:3] for x in facet[1]]) -def ray_triangle_intersection(ray_near, ray_dir, (v1, v2, v3)): +def ray_triangle_intersection(ray_near, ray_dir, v123): """ Möller–Trumbore intersection algorithm in pure python Based on http://en.wikipedia.org/wiki/M%C3%B6ller%E2%80%93Trumbore_intersection_algorithm """ + v1, v2, v3 = v123 eps = 0.000001 edge1 = v2 - v1 edge2 = v3 - v1 @@ -99,7 +100,7 @@ return if binary: with open(filename, "wb") as f: - buf = "".join(["\0"] * 80) + buf = b"".join([b"\0"] * 80) buf += struct.pack(" i: @@ -385,6 +386,6 @@ else: break - print i, len(working) + print(i, len(working)) emitstl("../../Downloads/frame-vertex-neo-foot-x4-a.stl", s.facets, "emitted_object") # stl("../prusamendel/stl/mendelplate.stl")