From c915347c907f5b1729be6d9ba86003c78bd42869 Mon Sep 17 00:00:00 2001 From: Bernd Hahnebach Date: Tue, 9 Jun 2020 06:19:10 +0200 Subject: [PATCH] FEM: constraint transfrom, coordinate transformation --- src/Mod/Fem/femsolver/calculix/writer.py | 2 ++ src/Mod/Fem/femtools/geomtools.py | 6 ++++-- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/src/Mod/Fem/femsolver/calculix/writer.py b/src/Mod/Fem/femsolver/calculix/writer.py index 6f64d4d98e..2bdbf260bc 100644 --- a/src/Mod/Fem/femsolver/calculix/writer.py +++ b/src/Mod/Fem/femsolver/calculix/writer.py @@ -658,6 +658,8 @@ class FemInputWriterCcx(writerbase.FemInputWriter): f.write("\n***********************************************************\n") f.write("** Transform Constraints\n") f.write("** written by {} function\n".format(sys._getframe().f_code.co_name)) + # coords values rounded and converted to strings in the geom tools method + # TODO round and string conversation should happen here for trans_object in self.transform_objects: trans_obj = trans_object["Object"] f.write("** " + trans_obj.Label + "\n") diff --git a/src/Mod/Fem/femtools/geomtools.py b/src/Mod/Fem/femtools/geomtools.py index 80ad805eb0..0bb6a63b4d 100644 --- a/src/Mod/Fem/femtools/geomtools.py +++ b/src/Mod/Fem/femtools/geomtools.py @@ -222,6 +222,7 @@ def get_rectangular_coords( b_y = B[1] * cos(z_rot) - B[0] * sin(z_rot) A = [a_x, a_y, a_z] B = [b_x, b_y, b_z] + # TODO: round and string conversation should happen in the method which uses the return value A_coords = str(round(A[0], 4)) + "," + str(round(A[1], 4)) + "," + str(round(A[2], 4)) B_coords = str(round(B[0], 4)) + "," + str(round(B[1], 4)) + "," + str(round(B[2], 4)) coords = A_coords + "," + B_coords @@ -242,7 +243,8 @@ def get_cylindrical_coords( Bz = base[2] - 10 * vec[2] A = [Ax, Ay, Az] B = [Bx, By, Bz] - A_coords = str(A[0]) + "," + str(A[1]) + "," + str(A[2]) - B_coords = str(B[0]) + "," + str(B[1]) + "," + str(B[2]) + # TODO: round and string conversation should happen in the method which uses the return value + A_coords = str(round(A[0])) + "," + str(round(A[1])) + "," + str(round(A[2])) + B_coords = str(round(B[0])) + "," + str(round(B[1])) + "," + str(round(B[2])) coords = A_coords + "," + B_coords return coords