How to extrude faces with a value of its area? I'm trying to extrude faces in edit mode , each face is separated , extruding values is taken from face area , but the resulting extruding values seems not correct 


this is the code 


    import bpy
import bmesh
# Get the active mesh
obj = bpy.context.edit_object
me = obj.data
# Get a BMesh representation
bm = bmesh.from_edit_mesh(me)
lm = list (bm.faces) 
l = len(lm)
print(l)
for f in range (0,l) :

    bm.faces.ensure_lookup_table()
    bpy.ops.mesh.select_all(action='DESELECT')
    bm.faces[f].select=True
    ar = bpy.context.active_object.data.polygons[f].area
    bpy.ops.mesh.extrude_faces_move(MESH_OT_extrude_faces_indiv={"mirror":False}, TRANSFORM_OT_shrink_fatten={"value":ar*-5})
I find the answer 
the problem was in using extrude individual faces command for this operation , when I change it to ordinary extrude for flat objects and extrude faces along normal for curved objects , that solved the problem 
I added scale in the end to give that shape
you can change the multiplayer with ar variable in the extrude command to control extrusion value  




this is the code 

import bpy  #
import bmesh

# Get the active mesh
obj = bpy.context.edit_object
me = obj.data
# Get a BMesh representation
bm = bmesh.from_edit_mesh(me)



for f in bm.faces :
    e = f.index

    bm.faces.ensure_lookup_table()
    bpy.ops.mesh.select_all(action='DESELECT')
    bm.faces[e].select=True

    ar = bpy.context.active_object.data.polygons[e].area
    print (ar)
    bpy.ops.mesh.extrude_region_shrink_fatten(MESH_OT_extrude_region={"use_normal_flip":False, "mirror":False}, TRANSFORM_OT_shrink_fatten={"value":-2*ar })

    bpy.ops.transform.resize(value=(0.6, 0.6, 0.6) )