cloning
link-mesh-array.py
link-mesh.py

mesh fabrication
staircase.py
triangle-donut.py
vertexAccumulator.py
randomSquareArray.py
meshFromBathymetry.py
cylinders-from-list-of-radii.py
binary-image-to-mesh.py
sphere-minecraft-schematic.py
spikify.py
add-to-mesh.py
mobius-strip.py
split-copy-mesh.py

fabricating other objects
create-text.py
text-from-file.py
create-camera.py
create-bezier.py
helix-bezier.py

material slots
cube-copy-blue.py
cube-turns-red.py
red-blue-per-object.py

animation and fcurves
csv-to-fcurve-loc-rot.py
csv-to-fcurve.py
pop-in-material.py
spike-wiggle-2.py
spike-wiggle.py
sweep-animate-size.py
animate-cycles-lamp-strength.py

incorporating python libraries
exec-text-library.py
exec-external-python.py
import-python.py

constraints
camera-track-object.py
text-track-camera.py

shape keys
explore-shape-keys.py
shape-key-fin.py
docking-tube.py

animating curve bevel
data-graph.py

drivers
scan-drivers.py
copy-drivers.py
driver-fin.py
driver-multi-chain.py

UV layers
barber-pole.py
expand-uv-to-fit.py
uv-from-geometry-cubic.py
flip-texture-v-coordinate.py

modifiers
hook-modifier-curve.py
rounded-prisms.py
make-tile.py
remove-action-modifiers.py

NLAs
explore-NLAs.py
spinning-frogs.py

video sequence editor (VSE)
create-vse-image-strips.py
slide-show.py
vse-strip-gap.py

images and textures
image-on-mesh.py
image-to-material-node.py
load-image-texture.py
texture-one-cube-face.py
condense-duplicate-images.py

analytic geometry
animate-random-spin.py
camera-cone-exp-2.py
camera-cone-exp.py
compute-circle-center.py
dihedral-angle-from-xy.py
extrude-edge-along-custom-axis.py
orientation-matrix.py
two-spheres.py
bezier-interpolate.py
rotate-to-match.py

node trees
change-diffuse-to-emission-node.py

etc
add-plane-from-selected-vertices.py
adjust-all-materials.py
all-nodes-cycles-materials.py
bit_shift.py
bone-orientation-demo.py
cannonball-packing.py
comb.py
convert-quaternion-keyframes-to-euler.py
copy-location-from-vertex-group.py
create-cycles-material.py
demonstrate-decomposition-instability.py
dump-point-cache.py
dump-screen-layout-info.py
expand-nla-strips.py
explore-edge-bevel-weight.py
find-action-users.py
find-green-rectangle.py
find-new-objects.py
fix-scene-layers.py
generate-makefile.py
link-external-data-blocks.py
list-referenced-files.py
material-readout.py
movie-card-stack.py
movies-on-faces.py
next-file-name.py
object-font-from-regular-font.py
operator-mesh-gridify.py
particle-animator.py
particle_loop.py
pose-match.py
pose-sequence-to-fbx.py
prepare-texture-bake.py
raining-physics.py
random-pebble-material.py
reverse-keyframes.py
scale-parallelogram.py
screenshot-sequence.py
select-objects-in-modifiers.py
select-vertices.py
shift-layers.py
snapshot-keyframes-as-mesh.py
sphere-project-texture.py
squish-mesh-axis.py
subdivide-fcurve.py
thicken-texture.py
transform-selected.py
voronoi-madness.py

import bpy
import bmesh
import math

def makeTile(name, x0,y0, coords, thickness, mat):
    

    scales = ( 1, 0.8, 0.7)
    zs = (0, thickness, thickness)

    nu = len(coords)
    nv = len(scales)

    verts = []
    faces = []

    for v in range(nv):
        for u in range(nu):
            x = coords[u][0] * scales[v]
            y = coords[u][1] * scales[v]
            z = zs[v]
            verts.append( [x,y,z] )

            if (v+1 < nv):
                v0 = u + v*nu
                u1 = (u+1)%nu
                v1 = u1 + v*nu
                v2 = v0+nu
                v3 = v1+nu
                faces.append( [v0,v1, v3,v2] )

    f2 = []
    for u in range(nu):
        f2.append( u + (nv-1)*nu)
    faces.append(f2)

    mesh  = bpy.data.meshes.new(name)
    mesh.from_pydata(verts, [], faces)

    #

    mesh.materials.append(mat)

    #

    obj = bpy.data.objects.new(name, mesh)
    obj.location=(x0,y0,0)

    #

    mod = obj.modifiers.new("roundy", "SUBSURF")
    mod.levels=2
    mod.render_levels=4

    #

    bm = bmesh.new()
    bm.from_mesh(mesh)
    cr = bm.edges.layers.crease.active
    if cr is None:
        cr = bm.edges.layers.crease.new()
    for e in bm.edges:
        i1 = e.verts[0].index
        i2 = e.verts[1].index
        if (i1 < nu and i2<nu # outside edge ring
            or abs(i2-i1)==nu # inter-ring edges
            or math.floor(i2/nu) == nv-1 and math.floor(i1/nu)==nv-1): # next-to-last ring
            print( "crease %d,%d" %(e.verts[0].index, e.verts[1].index) )
            e[cr] = 1

    bm.to_mesh(mesh)

    bpy.context.scene.objects.link(obj)

    return obj

#
#

thickness = 0.2

mat = bpy.data.materials[0]

makeTile("science", -15.74745679709348,-0.4606170470102633, [
        (1.768304689396432,-3.031247732542071), 
        (2.183217951748338,-0.797683011601334), 
        (2.3986194510274927,1.825145492744447), 
        (1.8806814533957539,2.299295081858279), 
        (-3.113111468761204,-1.879233791115971), 
        (-3.925333035436239,-2.8069322074180505), 
        (-3.1231678138802508,-3.2260911215115047), 
        (1.1437476334384193,-3.284721904235564), 
        (1.768304689396432,-3.03124773254207), 
        ] , thickness, mat)
makeTile("superstition", 13.980640184908879,2.7826284960035927, [
        (0.48352592071769607,-2.827132010369648), 
        (1.0205046757670893,1.1829375379236327), 
        (-1.505914511659931,1.538112182229531), 
        (-1.3148451990803327,-1.6767640040230187), 
        (0.4835259207176925,-2.827132010369649), 
        ] , thickness, mat)

Blender python API quick-start

Syntax highlighting by Pygments.