I’m trying to create a bunch of circles with different numbers of vertices in each circle, but with the same edge length. The only way I can think to do this is through the definition of the diameter, but I can’t get anything to work. Can anyone help me? (My attempt is around line 26) Here is my script so far:
#Test import Blender as b import math #Just initializing the variables maxverts = 0 #This is th the length I'd like for all of my edges. sidelength = 1 scn = b.Scene.GetCurrent() #Until the user gives an acceptable number of max verts (in the range that Blender allows), while (maxverts > 100) or (maxverts < 3): #keep asking for the maximum number of vertices. maxverts = input("What's the max number of verts you want?" ) #Create an empty mesh. mesh = b.Mesh.New() obj = scn.objects.new(mesh) #Now make the meshes #The first numer of vertices is three. vertnumber = 3 #At this point, I make a list of all of the objects in the scene. objectlist =  while vertnumber <= maxverts: #This is a formula from geometry, look it up on google if you forgot. angle = ((180.0 * (vertnumber - 2))/ vertnumber) #This is my best guess at something that I think should work (but doesn't) diameter = math.cos(angle / 2) * sidelength print math.cos(angle/2) print "ANGLE =", angle, "and the vertnumber is", vertnumber, ". OH! Also, the diameter is", diameter #make a new circle mesh. mesh2 = b.Mesh.Primitives.Circle(vertnumber, diameter) #make it an object, obj2 = scn.objects.new(mesh2) #and append it to the list of created objects. objectlist.append(obj2) #Also, increase the number of vertices created for the next circle. vertnumber = vertnumber + 1 #Merge all of the objects in the object list into one object, obj.join(objectlist) #and then delete all of the individual objects. for object in objectlist: scn.objects.unlink(object) b.Redraw() print "DOne"