I create a BMesh from a list of vertices like that:
mesh = bpy.data.meshes.new(str(self.shape) + "_Mesh")
obj = bpy.data.objects.new(str(self.shape) + "_Object", mesh)
bm = bmesh.new()
bm.from_mesh(mesh)
for v in self.shape.vertices:
bm.verts.new(v)
bm.verts.index_update()
bm.faces.new(bm.verts)
bm.to_mesh(mesh)
bm.free()
It works, the mesh is created, but the rotation is set to 0,0,0.
Any idea how I can set the roation by the rotation of the first face for instance.
I know I can get the normal like this
bm.faces[0].normal
Best