how do I rotate the mesh around its center using the bmesh.rotate
import bpy
import bmesh
import mathutils
tech_list = ["TechA"]
for tech in tech_list:
# these lines create the bmesh with the techA as text
bpy.data.curves.new(type="FONT", name='label').body = tech
label = bpy.data.objects.new("label", bpy.data.curves['label'])
meshed_up = bmesh.new()
meshed_up.from_mesh(label.to_mesh())
# this transform_matrix places the mesh in the correct position
# But still mirrored :(
transform_matrix = mathutils.Matrix.Rotation(1.5708, 4, 'Z').to_4x4()
transform_matrix = mathutils.Matrix.Rotation(3.1415, 4, 'X').to_4x4() @ transform_matrix
# transform_matrix = mathutils.Matrix.Rotation(selet center of mesh, not X-axis)
meshed_up.transform(transform_matrix)
# and then we create a mesh for object and link and clean
label_mesh = bpy.data.meshes.new("label")
meshed_up.to_mesh(label_mesh)
meshed_up.free()
bpy.data.curves.remove(bpy.data.curves['label'])
label_object = bpy.data.objects.new(tech, label_mesh)
bpy.context.collection.objects.link(label_object)
# EOF
As you can see, so far all is well but the label is still mirrored, it should now be rotated in place 3.14 radians around its own x-axis, but I don't know how