Fixed bug with wrong position of support in wall mounted railing

The problem was that that support's disk was not rotated according to the railing path.
This commit is contained in:
Andrej730
2023-04-28 11:42:25 +05:00
parent 1ef3a54fe1
commit b5d24334fd
2 changed files with 20 additions and 2 deletions
@@ -568,3 +568,18 @@ class ShapeBuilder:
"position_z_axis": Vector((0, -1, 0)),
"extrusion_vector": Vector((0, 0, -1)),
}
def rotate_extrusion_kwargs_by_z(self, kwargs, angle, counter_clockwise=False):
"""shortcut to rotate extrusion kwargs by z axis
`kwargs` expected to have `position_x_axis` and `position_z_axis` keys
`angle` is a rotation value in radians
by default rotation is clockwise, to make it counter clockwise use `counter_clockwise` flag
"""
rot = Matrix.Rotation(-angle, 3, "Z")
kwargs = kwargs.copy() # prevent mutation of original kwargs
kwargs["position_x_axis"].rotate(rot)
kwargs["position_z_axis"].rotate(rot)
return kwargs