Modeling with Python I am new with Python programming, especially in Blender. I would like to know the possibilities of modeling with some scripts. I am currently modeling an object around a scan. I have to scan an object (with the Isense scanner), then modelize something aroung this object with blender.

I have more than 100 models to make and the base is always the same:


Create a point field that will stick the scanne (nearly always a kind of tube but the size differs sometimes)
Create a alveolar structure on this model (Voronoi diagram)


Do you know how I could do this ?
For your first step you don't need to use python, create a base and save it, then you can use that file as a starting point for each new object you create.

The simplest way to create a mesh object using python would be to define a list of vertices and faces that make up the mesh.

import bpy

verts = [(-1,  1,   0),
         ( 1,  1,   0),
         ( 2, -3,   0),
         (-2, -1,   0),
         (-1,  1.5, 1),
         ( 1,  1.5, 1),
        ]

# faces are a list of indices to each vertex from the above list
faces = [[0, 1, 2, 3], [0, 1, 5, 4]]

mesh = bpy.data.meshes.new(name="New Mesh")
mesh.from_pydata(verts, [], faces)
obj = bpy.data.objects.new('New object', mesh)
bpy.context.scene.objects.link(obj)


You might want to get familiar with the bmesh module which is used to perform most of the modelling tasks we do on mesh objects. The linked page contains an example of creating and editing a mesh.

As you don't know python very well yet I would suggest first trying out the sverchok addon. It uses nodes to generate mesh objects. The links on sverchoks home page are getting old so you may want to start with this playlist to get an idea of what you can do.