Hello,
I’m trying to use bmesh extrusion and Matrix to do some spirale shape like this :
I would like to start from a circle (like it is described on the picture)
Here where I’m stuck:
bm = bmesh.new()
bmesh.ops.create_circle(
bm,
cap_ends=False,
radius=0.5,
segments=24)
edges_ext = [ele for ele in bm.edges
if isinstance(ele, bmesh.types.BMEdge)]
steps = 12
Ry = Matrix.Rotation(-pi/(steps), 4, 'Y')
T = Matrix.Translation((3,0,0))
My = T @ Ry @ T.inverted()
for i in range(steps):
extruded = bmesh.ops.extrude_edge_only(bm, edges=edges_ext)
verts_extruded = [ele for ele in extruded["geom"]
if isinstance(ele, bmesh.types.BMVert)]
edges_extruded = [ele for ele in extruded["geom"]
if isinstance(ele, bmesh.types.BMEdge)]
bmesh.ops.transform(bm, matrix= My, verts=verts_extruded)
edges_ext = edges_extruded
me = bpy.data.meshes.new("Mesh")
bm.to_mesh(me)
bm.free()
obj = bpy.data.objects.new("Object", me)
bpy.context.collection.objects.link(obj)
It seems ok to rotate the circle around a small radius but
I cannot do all the remaining matrix operations on the extruded verts (translate and rotate around big circle)
Any advices or tips or tricks?
Thank you very much