user: Show practical ways to work with Mapping in a Blender add-on or script – include code.

assistant: ### Topology

Simply matches the elements based on their index. This requires all meshes to have the same
number of elements and those elements to be ordered in the same way. Best suited for
a destination mesh that’s a deformed copy of the source.

### One-To-One Mappings

These mappings always select only one source element for each destination one.

Vertex Data
:   Nearest Vertex
    :   Use the nearest source vertex.

    Nearest Edge Vertex
    :   Use the nearest source vertex on the nearest (by midpoint distance) source edge.

    Nearest Face Vertex
    :   Use the nearest source vertex on the nearest (by midpoint distance) source face.

Edge Data
:   Nearest Vertices
    :   Use the source edge whose vertices are nearest to the destination edge’s.

    Nearest Edge
    :   Use the source edge whose midpoint is nearest to the destination edge’s.

    Nearest Face Edge
    :   Use the nearest source edge on the nearest face (both by midpoint distance).

Face Corner Data
:   A face corner is a vertex in the context of a face. This concept is most commonly used
    in UV maps: each face corner can have its own UV coordinate, or in other words, one 3D vertex
    can correspond to several UV vertices (one per face).

    Nearest Corner and Best Matching Normal
    :   Use the source corner that’s nearest to the destination corner and has the most similar
        split normal.

    Nearest Corner and Best Matching Face Normal
    :   Use the source corner that’s nearest to the destination corner and has the most similar
        face normal.

    Nearest Corner of Nearest Face
    :   Use the nearest source corner on the nearest source face.

Face Data
:   Nearest Face
    :   Use the nearest source face (by midpoint distance).

    Best Normal-Matching
    :   Cast a ray from the destination face’s centerpoint along the face’s normal
        and use the source face found this way.

### Interpolated Mappings

These mappings can match several source elements and interpolate between their values.

Vertex Data
:   Nearest Edge Interpolated
    :   Find the nearest point on the nearest source edge, then use that point to interpolate between
        the values of the edge’s vertices.

    Nearest Face Interpolated
    :   Find the nearest point on the nearest source face, then use that point to interpolate between
        the values of the face’s vertices.

    Projected Face Interpolated
    :   Project the destination vertex along its normal onto a source face,
        then use the projected point to interpolate between the values of the face’s vertices.

Edge Data
:   Projected Edge Interpolated
    :   Find source edges by projecting from a number of points on the destination edge
        (where each point is projected along the interpolated normals of the destination edge’s vertices).
        Then, interpolate between the values of the source edges found this way.

Face Corner Data
:   Nearest Face Interpolated
    :   Find the nearest point on the nearest source face, then use that point to interpolate between
        the values of the face’s corners.

    Projected Face Interpolated
    :   Project the destination corner along its normal onto a source face,
        then use the projected point to interpolate between the values of the face’s corners.

Face Data
:   Projected Face Interpolated
    :   Find source faces by casting rays from a number of points on the destination face along the destination
        face’s normal. Then, interpolate between the values of these source faces.