Skip to content

Commit

Permalink
round outputs to 8
Browse files Browse the repository at this point in the history
  • Loading branch information
jeknirsch committed Oct 11, 2024
1 parent df1fc84 commit 198cac2
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion pyGCodeDecode/abaqus_file_generator.py
Original file line number Diff line number Diff line change
Expand Up @@ -61,9 +61,12 @@ def generate_abaqus_event_series(
scaling = simulation.get_scaling_factor(output_unit_system=output_unit_system)

# write to file
round_to = 8
with open(filepath, "w") as outfile:
for time, pos in zip(time, pos):
outfile.write(f"{time},{scaling*pos[0]},{scaling*pos[1]},{round(scaling*pos[2], 5)},{pos[3]}\n")
outfile.write(
f"{time},{round(scaling*pos[0], round_to)},{round(scaling*pos[1], round_to)},{round(scaling*pos[2], round_to)},{pos[3]}\n"
)
event_series_list.append((time, scaling * pos[0], scaling * pos[1], scaling * pos[2], pos[3]))

custom_print(f"ABAQUS event series written to: \n{outfile.name}")
Expand Down

0 comments on commit 198cac2

Please sign in to comment.