I am creating my own spin script as opposed to using the spin tool because no matter what settings I use for the center axis, when calling bpy.ops.mesh.spin(…), it still would spin the mesh around the cursor. I have been able to create my own style using a bit of trigonometry. The problem I am now having is that I have created all the vertices coordinates into a list, but I do not know how I can add this list to the existing mesh. I have tried using bpy.ops.mesh.extrude_region_move(…) but, because I need the new coordinates of the extruded vertex to calculate the next spin, I get an error stating index out of range. So this is where I came up with keeping track of the new spin calculations and saved it into a verts list. Here is my code…
verts = []
#please note selVerts has already been calculated and is not included
for sel in selVerts :
v1 = sel.co.copy()
v2 = bpy.data.objects['Point'].location
verts.append([])
for i in range(4) :
v = v2-v1
q = v.to_track_quat('X', 'Z')
qMat = q.to_matrix()
fVec = qMat * Vector((1,0,0))
myTrans = fVec * v.magnitude
rotForward=Vector((0,-1,0))
rotAng = qMat*rotForward
qMat.rotate(Euler(rotAng*radians(22.5), 'XYZ'))
locForward=Vector((-1,0,0))
wordForward = qMat * locForward
myTrans += wordForward * v.magnitude
v1 += myTrans
verts[-1].append(v1.copy())
any idea how I could add these new vertices to an existing mesh would be a big help