This commit is contained in:
2023-07-14 10:12:00 +02:00
parent bb16aaf868
commit 88531da784
16 changed files with 411 additions and 299 deletions
+12 -1
View File
@@ -2,6 +2,7 @@ import os
import sys
import numpy as np
from torch.utils.data import DataLoader
from stl import mesh as mesh_stl
@@ -48,4 +49,14 @@ def text_to_html(lines):
html = ''
for line in lines:
html += "<pre>" + line + "</pre>"
return html
return html
def save_stl(file, mesh, faces):
obj = mesh_stl.Mesh(np.zeros(faces.shape[0], dtype=mesh_stl.Mesh.dtype))
for i, f in enumerate(faces):
for j in range(3):
obj.vectors[i][j] = mesh[f[j],:]
obj.save(file)