Skip to content

Commit

Permalink
FEM: constraint transfrom, coordinate transformation
Browse files Browse the repository at this point in the history
  • Loading branch information
berndhahnebach committed Jun 9, 2020
1 parent 9daeaba commit 7c7275c
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
2 changes: 2 additions & 0 deletions src/Mod/Fem/femsolver/calculix/writer.py
Expand Up @@ -658,6 +658,8 @@ def write_constraints_transform(self, f):
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")
Expand Down
6 changes: 4 additions & 2 deletions src/Mod/Fem/femtools/geomtools.py
Expand Up @@ -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
Expand All @@ -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

0 comments on commit 7c7275c

Please sign in to comment.