# Making a Octagon into a Circle using python scripts

Introductions Hello, I'm a brand new blender user... I'm working on a little project that's entirely made up of Python scripts. But I'm having trouble turning an octagon into a circle right now ( I do know that adding vertices would make it better, but is there another way, perhaps something like a code that resembles a subdivision modifier?)... Please help me with my problem...

My Question Is scripting subdivision modifier applicable? Can you show me how to do it with my code if it is possible?

Here is my code

import bpy

verts = [(0,1,0), (0.29,1.70,0), (1,2,0), (1.70,1.70,0), (2,1,0), (1.70,0.29,0), (1,0,0), (0.29,0.29,0)]

faces = [(0,1,2,3,4,5,6,7)]

mesh = bpy.data.meshes.new("octagon")

object = bpy.data.objects.new("octagon", mesh)

mesh.from_pydata(verts,[],faces)

• Hi, and welcome! 1. That's an octagon. 2. It 'is' a circle. as far as polygonal modelling is concerned.. just a low-resolution one. Do you just want to make that into a higher-resolution circle? Or, say, make a curve out of it? Sep 30, 2021 at 9:22
• Oh, I meant octagon... and yes, I do intend to turn it into a higher resolution circle. Sep 30, 2021 at 9:29
• Welcome to BSE. For the interests of your education, feel we should balk at answering your assignment for you, esp. before October 11, lol. Please consider using more subterfuge in future. Does an answer have to involve using the code (or product of) from above, which instead could be the add circle operator with 8 verts. . The more verts the more circular the result. Sep 30, 2021 at 10:46
• Sorry, I will next time... But back to the topic at hand. I understand that adding more vertices will make it more circular, but I'm curious whether there is an easier way to do so (?)... Is scripting subdivision modifier an option ? Can you show me how to do it with my code if it is possible? ​please... Sep 30, 2021 at 11:25
• You should never rely on forums or Q/A web sites for fast responses. It can be hours, sometimes days, before the person who knows and has time sees your question. On the other hand, in this case, the answer is "yes, you can script adding modifiers". Now if you go web search for an example of how to do that, it is a better way of learning than simply asking how. Sep 30, 2021 at 14:15

for ob in bpy.data.objects: