barycentric transform utility geometry function.
authorCampbell Barton <ideasman42@gmail.com>
Sun, 27 Dec 2009 01:32:58 +0000 (01:32 +0000)
committerCampbell Barton <ideasman42@gmail.com>
Sun, 27 Dec 2009 01:32:58 +0000 (01:32 +0000)
commitfde4686d77dd72ccfa88febdea360136bfd17a36
tree52a715e72488c70457f5c29a74e24c0e3977e470
parent9c82e1efc32bdff04c3136ef5a2959ed73711ca7
barycentric transform utility geometry function.
From 2 triangles and 1 point, the relative position between the point and the first triangle is applied to the second triangle to find the target point.
the barycentric weights are calculated in 2D space with a signed area so values outside the triangle bounds are supported.

wrapped by python:
 pt_to = Geometry.BarycentricTransform(pt_from, t1a, t1b, t1c, t2a, t1b, t1c)

NOTE:
- moved some barycentric weight functions out of projection painting into the math lib.
- ended up making some of the math functions use const args.
TODO:
- support exceptional cases. zero area tries and similar.
source/blender/blenlib/BLI_math_geom.h
source/blender/blenlib/BLI_math_rotation.h
source/blender/blenlib/BLI_math_vector.h
source/blender/blenlib/intern/math_geom.c
source/blender/blenlib/intern/math_rotation.c
source/blender/blenlib/intern/math_vector.c
source/blender/blenlib/intern/math_vector_inline.c
source/blender/editors/sculpt_paint/paint_image.c
source/blender/python/generic/Geometry.c