Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCampbell Barton <ideasman42@gmail.com>2012-03-10 07:25:16 +0400
committerCampbell Barton <ideasman42@gmail.com>2012-03-10 07:25:16 +0400
commitb1b07fb95147ba4f0a4b97909f3adfe4c2c6e6bf (patch)
tree7dc8527c9774a45c29c8dad73b4913be7090f220 /source/blender/bmesh/intern/bmesh_operators.c
parentb8f15a1dd3310fc5dcf1d1ade64ca726e4f08df3 (diff)
Speedup for ngon normal calculation
- BM_mesh_normals_update was looping over all faces to find the largest one, this is no longer needed. - calculating a face normal was looping over every faces corners twice, now only once - using the loops directly (not an iterator). - face vert locations were being copied an array, now use directly. - calculating the normals would copy a float vector for the next point in the face, which was never used (only current and previous used). - was copying vectors to compute the normal, now just assign the float pointers.
Diffstat (limited to 'source/blender/bmesh/intern/bmesh_operators.c')
-rw-r--r--source/blender/bmesh/intern/bmesh_operators.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/source/blender/bmesh/intern/bmesh_operators.c b/source/blender/bmesh/intern/bmesh_operators.c
index 166a3bca37a..eb83d5f6b35 100644
--- a/source/blender/bmesh/intern/bmesh_operators.c
+++ b/source/blender/bmesh/intern/bmesh_operators.c
@@ -1042,6 +1042,12 @@ void *BMO_slot_buffer_elem_first(BMOperator *op, const char *slotname)
return slot->data.buf ? *(void **)slot->data.buf : NULL;
}
+/**
+ * \brief New Iterator
+ *
+ * \param restrictmask restricts the iteration to certain element types
+ * (e.g. combination of BM_VERT, BM_EDGE, BM_FACE), if iterating
+ * over an element buffer (not a mapping). */
void *BMO_iter_new(BMOIter *iter, BMesh *UNUSED(bm), BMOperator *op,
const char *slotname, const char restrictmask)
{