diff options
author | Campbell Barton <ideasman42@gmail.com> | 2016-06-12 05:22:38 +0300 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2016-06-12 08:12:34 +0300 |
commit | 65df2fd9976178c98db5401ff4e965047e35afdb (patch) | |
tree | db27849954fa8c6766467b19d979f801db254fa3 /source/blender/bmesh/intern/bmesh_polygon.h | |
parent | 421ec972768b46ba453bb3760b451f05e72a1da6 (diff) |
bmesh py api: expose BM_face_calc_tangent_*
D1988 by @wisaac, with own edits and improvements.
This improves on existing tangent calculation functions too.
- BM_face_calc_tangent_auto: Chooses method based on number of sides, used by manipulator (not exposed to Python).
- BM_face_calc_tangent_edge: from longest edge.
- BM_face_calc_tangent_edge_pair: from longest edge-pair (most useful with quads).
- BM_face_calc_tangent_edge_diagonal: edge farthest from any vertex.
- BM_face_calc_tangent_vert_diagonal: vert farthest from any vertex.
Also optimize BM_vert_tri_calc_tangent_edge* functions to avoid sqrt.
Diffstat (limited to 'source/blender/bmesh/intern/bmesh_polygon.h')
-rw-r--r-- | source/blender/bmesh/intern/bmesh_polygon.h | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/source/blender/bmesh/intern/bmesh_polygon.h b/source/blender/bmesh/intern/bmesh_polygon.h index 8f0df81af73..1e50a504875 100644 --- a/source/blender/bmesh/intern/bmesh_polygon.h +++ b/source/blender/bmesh/intern/bmesh_polygon.h @@ -45,7 +45,11 @@ float BM_face_calc_normal_vcos( float BM_face_calc_normal_subset(const BMLoop *l_first, const BMLoop *l_last, float r_no[3]) ATTR_NONNULL(); float BM_face_calc_area(const BMFace *f) ATTR_WARN_UNUSED_RESULT ATTR_NONNULL(); float BM_face_calc_perimeter(const BMFace *f) ATTR_WARN_UNUSED_RESULT ATTR_NONNULL(); -void BM_face_calc_plane(const BMFace *f, float r_plane[3]) ATTR_NONNULL(); +void BM_face_calc_tangent_edge(const BMFace *f, float r_plane[3]) ATTR_NONNULL(); +void BM_face_calc_tangent_edge_pair(const BMFace *f, float r_plane[3]) ATTR_NONNULL(); +void BM_face_calc_tangent_edge_diagonal(const BMFace *f, float r_plane[3]) ATTR_NONNULL(); +void BM_face_calc_tangent_vert_diagonal(const BMFace *f, float r_plane[3]) ATTR_NONNULL(); +void BM_face_calc_tangent_auto(const BMFace *f, float r_plane[3]) ATTR_NONNULL(); void BM_face_calc_center_bounds(const BMFace *f, float center[3]) ATTR_NONNULL(); void BM_face_calc_center_mean(const BMFace *f, float center[3]) ATTR_NONNULL(); void BM_face_calc_center_mean_vcos( @@ -90,6 +94,7 @@ void BM_face_as_array_vert_quad(BMFace *f, BMVert *r_verts[4]) ATTR_NONNULL(); void BM_face_as_array_loop_tri(BMFace *f, BMLoop *r_loops[3]) ATTR_NONNULL(); void BM_face_as_array_loop_quad(BMFace *f, BMLoop *r_loops[4]) ATTR_NONNULL(); -void BM_vert_tri_calc_plane(BMVert *verts[3], float r_plane[3]); +void BM_vert_tri_calc_tangent_edge(BMVert *verts[3], float r_tangent[3]); +void BM_vert_tri_calc_tangent_edge_pair(BMVert *verts[3], float r_tangent[3]); #endif /* __BMESH_POLYGON_H__ */ |