Fix crash in several cases when adding bevel on array modifier with merging switched on
authorSergey Sharybin <sergey.vfx@gmail.com>
Sat, 6 Nov 2010 17:19:40 +0000 (17:19 +0000)
committerSergey Sharybin <sergey.vfx@gmail.com>
Sat, 6 Nov 2010 17:19:40 +0000 (17:19 +0000)
Check if edge would be collapsed to single point after mapping in array modifier

source/blender/modifiers/intern/MOD_array.c

index 9916afcfe558aab01977729429ae36c50a4eb1a4..2c672ed8e3314295524eec37f406bc32839462fa 100644 (file)
@@ -436,6 +436,10 @@ static DerivedMesh *arrayModifier_doArray(ArrayModifierData *amd,
                          {
                                  vert1 = calc_mapping(indexMap, inMED.v1, j);
                                  vert2 = calc_mapping(indexMap, inMED.v2, j);
+
+                                 /* edge could collapse to single point after mapping */
+                                 if(vert1 == vert2) continue;
+
                                  /* avoid duplicate edges */
                                  if(!BLI_edgehash_haskey(edges, vert1, vert2)) {
                                          med2 = &medge[numEdges];