Python: bend modifier math
There are 2 methods i found how to implement Bend modifier:



First Method(Circle and Spiral). You can tweak parameters of ofset_axys ans offset_rotation:

import bpy
import math
import mathutils
import random
from bpy.props import *
from mathutils import *

point_id = StringProperty(default="")

context = bpy.context
obj = context.scene.objects[0]
f_dist = 1.0
vv = Vector((0.0, 0.0, 1.0))

x_min = obj.data.vertices[0].co.x
x_max = obj.data.vertices[0].co.x
y_min = obj.data.vertices[0].co.y
y_max = obj.data.vertices[0].co.y
z_min = obj.data.vertices[0].co.z
z_max = obj.data.vertices[0].co.z

offset_rotation = 0.2
offset_axis = 5.0
bend_scale = 0.7


for vert in obj.data.vertices:
    if vert.co.x &gt; x_max:
        x_max = vert.co.x
    if vert.co.x &lt; x_min:
        x_min = vert.co.x
    if vert.co.y &gt; y_max:
        y_max = vert.co.y
    if vert.co.y &lt; y_min:
        y_min = vert.co.y
    if vert.co.z &gt; z_max:
        z_max = vert.co.z
    if vert.co.z &lt; z_min:
        z_min = vert.co.z

x_orig = ((x_max-x_min) / 2.0) + x_min
y_orig = ((y_max-y_min) / 2.0) + y_min
z_orig = z_min
rot_origin = Vector((x_orig, y_orig, z_orig))

visual_max = z_max-z_min

for vert in obj.data.vertices:
    vec = vert.co.copy()
    visual_z = vec.z - z_min

    if z_max != 0:
        beta = math.radians(720 * (visual_z/visual_max) )
        if beta != 0:
            final_offset = visual_z * offset_rotation
            if beta &lt; 0:
                final_offset = -final_offset

            vert.co.x -= ((visual_z / beta) + final_offset) * bend_scale
            vert.co.z = rot_origin.z
            #vert.co.z *= 0.5

            rot_mat = Matrix.Rotation(beta, 3, 'Y')
            vert.co = rot_mat * (vert.co - rot_origin) + rot_origin

            #eul = mathutils.Euler((0.0, beta, 0.0), 'XYZ')
            #vert.co.rotate(eul)

            vert.co.x += (visual_z / (beta))*bend_scale

            # offset axys
            vert.co.y += offset_axis * (visual_z/visual_max)


Second Method(Spiral only):

import bpy
import math
import mathutils
import random
from bpy.props import *
from mathutils import *


context = bpy.context
obj = context.scene.objects[0]

z_max = 0
for vert in obj.data.vertices:
    if vert.co.z &gt; z_max:
        z_max = vert.co.z

for vert in obj.data.vertices:
    #print(vert.co.z)
    vec = vert.co.copy()

    beta = math.radians(360 * (vec.z/z_max) )
    if beta &gt; 0:
        # vec2
        vert.co.x = 0
        #vert.co.x -= vec.z / (beta)
        #vert.co.z *= 0.5

        eul = mathutils.Euler((0.0, beta, 0.0), 'XYZ')
        vert.co.rotate(eul)

        #vert.co.x += vec.z / (beta)

        vec2 = vert.co.copy()

        # vec3
        vert.co = vec.copy()
        #vert.co.x -= vec.z / (beta)
        #vert.co.z *= 0.5

        eul = mathutils.Euler((0.0, beta, 0.0), 'XYZ')
        vert.co.rotate(eul)

        #vert.co.x += vec.z / (beta)
        vec3 = vert.co.copy()

        # vec4-5
        vec4 = (vec3 - vec2)
        vec4_len = vec4.length
        vec4 = vec4.normalized()
        vec5 = (Vector((0.0, 0.0, 0.0)) - vec2).normalized()
        angle_fix = vec5.angle(vec4)
        angle_fix *= min(z_max,vec.z*beta/math.radians(60)) / z_max  # 5.0 is for better faloff of rotation_fix
        eul = mathutils.Euler((0.0, angle_fix, 0.0), 'XYZ')
        vec4.rotate(eul)
        vert.co =  vec2 + (vec4.normalized() * vec4_len)