thanks for the tips, codemanx. I think, I found the solution for my problem. This is not very efficient, but at least I have solved it for my purposes. I first project the point into a 2d-triangle, check whether the point is in this triangle and then I transform it to its real locatoin

```
import bpy
import mathutils.geometry as mug
def map3dPointTo3d(o1, o2, point):
''' maps a 3d-point on a given object on another object. Both objects must have the
same topology '''
# get point, normal and face of closest point to particle
p, n, f = o1.closest_point_on_mesh(point)
# get the vertices of the first triangle of the polygon from both objects
A1 = o1.data.vertices[o1.data.polygons[f].vertices[0]].co
B1 = o1.data.vertices[o1.data.polygons[f].vertices[1]].co
C1 = o1.data.vertices[o1.data.polygons[f].vertices[2]].co
# project the point on a 2d-surface and check, whether we are in the right triangle
t1 = mathutils.Vector();
t2 = mathutils.Vector((1.0, 0.0, 0.0))
t3 = mathutils.Vector((0.0, 1.0, 0.0))
p_test = mug.barycentric_transform(p,A1,B1,C1,t1, t2, t3)
# if the point is on the 2d-triangle, proceed with the real barycentric_transform
if mug.intersect_point_tri_2d(p_test.to_2d(), t1.xy, t2.xy, t3.xy) == 1:
A2 = o2.data.vertices[o2.data.polygons[f].vertices[0]].co
B2 = o2.data.vertices[o2.data.polygons[f].vertices[1]].co
C2 = o2.data.vertices[o2.data.polygons[f].vertices[2]].co
# convert 3d-coordinates of the point
p_new = mug.barycentric_transform(p,A1,B1,C1,A2,B2,C2)
else:
# use the other triangle
A1 = o1.data.vertices[o1.data.polygons[f].vertices[0]].co
B1 = o1.data.vertices[o1.data.polygons[f].vertices[2]].co
C1 = o1.data.vertices[o1.data.polygons[f].vertices[3]].co
A2 = o2.data.vertices[o2.data.polygons[f].vertices[0]].co
B2 = o2.data.vertices[o2.data.polygons[f].vertices[2]].co
C2 = o2.data.vertices[o2.data.polygons[f].vertices[3]].co
# convert 3d-coordinates of the point
p_new = mug.barycentric_transform(p,A1,B1,C1,A2,B2,C2)
### TODO ###
### triangle check could be made more efficient ###
return p_new
```