I am doing some modeling to illustrate a specific math geometry. I want to create a tilted line through a point cable_aufpunkt.
import bpy
import numpy as np
cabel_rot_x = 5 * np.pi / 180 # 5° rotation around x axis
cable_rot_y = 3 * np.pi / 180 # 3° rotation around y axis
cable_len = 20 # in meter
cable_radius = .03
cable_depth = .5
cable_dist = .55
cable_aufpunkt = np.array([cable_dist, cable_depth, 0])
bpy.ops.mesh.primitive_cylinder_add(location=cable_aufpunkt,
scale=(cable_radius, cable_radius, cable_len),
rotation=(cabel_rot_x, cable_rot_y, np.pi / 2))
However, this line does not touch the point which I specified as location. It got rotated away from it by the rotation=(). I would like for the object to revolve around its median point. How can I do that? Is that even possible at creation time, or do I need to move and rotate it after creating it?
bpy.ops.transform.rotate(value=3.14)(~pi to rotate 180 degrees) – high_byte Oct 16 '21 at 19:51