Skip to content

Commit fa1fd51

Browse files
committed
todos
1 parent 3663d28 commit fa1fd51

File tree

1 file changed

+12
-2
lines changed

1 file changed

+12
-2
lines changed

examples/ansys/spaceclaim_tess/tesseract_api.py

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
from pathlib import Path, WindowsPath
99
from tempfile import TemporaryDirectory
1010

11+
import trimesh
1112
from pydantic import BaseModel, Field
1213
from tesseract_core.runtime import Array, Float32
1314

@@ -159,6 +160,7 @@ def apply(inputs: InputSchema) -> OutputSchema:
159160
cwd = os.getcwd()
160161
output_file = os.path.join(cwd, "grid_fin.stl")
161162

163+
# TODO: lets make sure the parameters are transformed into a correct dict to be used in the script
162164
keyvalues = inputs.grid_parameters.copy()
163165
keyvalues["__output__"] = output_file
164166

@@ -169,8 +171,16 @@ def apply(inputs: InputSchema) -> OutputSchema:
169171

170172
# Update temp spaceclaim script and use to generate .stl
171173
# update_script = _find_and_replace_keys_in_archive(copied_file_path, keyvalues)
172-
spaceclaim_result = run_spaceclaim(spaceclaim_exe, copied_file_path)
174+
# spaceclaim_result = run_spaceclaim(spaceclaim_exe, copied_file_path)
173175

176+
# TODO: lets read the .stl file using trimesh
177+
mesh = trimesh.load(output_file)
174178
return OutputSchema(
175-
placeholder_output=f"Subprocess return code: {spaceclaim_result}"
179+
mesh=TriangularMesh(
180+
points=Array(mesh.vertices.astype("float32")),
181+
faces=Array(mesh.faces.astype("float32")),
182+
)
176183
)
184+
# return OutputSchema(
185+
# placeholder_output=f"Subprocess return code: {spaceclaim_result}"
186+
# )

0 commit comments

Comments
 (0)