88from pathlib import Path , WindowsPath
99from tempfile import TemporaryDirectory
1010
11+ import trimesh
1112from pydantic import BaseModel , Field
1213from 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