Fix T37691: Screw modifier created zero length normals
This commit is contained in:
parent
4b206af1c9
commit
d7033d5637
Notes:
blender-bot
2023-02-14 11:31:08 +01:00
Referenced by issue #37860, Bad curve viewport rendering Referenced by issue #37861, Bevel factor feature errors on rendering Referenced by issue #37691, F12 rendering creates artifacts on geometry created with Screw Modifier
|
@ -746,12 +746,23 @@ static DerivedMesh *applyModifier(ModifierData *md, Object *ob,
|
|||
}
|
||||
}
|
||||
|
||||
/* vc_no_tmp2 - is a line 90d from the pivot to the vec
|
||||
/* tmp_vec2 - is a line 90d from the pivot to the vec
|
||||
* This is used so the resulting normal points directly away from the middle */
|
||||
cross_v3_v3v3(tmp_vec2, axis_vec, vc->co);
|
||||
|
||||
/* edge average vector and right angle to the pivot make the normal */
|
||||
cross_v3_v3v3(vc->no, tmp_vec1, tmp_vec2);
|
||||
if (UNLIKELY(is_zero_v3(tmp_vec2))) {
|
||||
/* we're _on_ the axis, so copy it based on our winding */
|
||||
if (vc->e[0]->v2 == i) {
|
||||
negate_v3_v3(vc->no, axis_vec);
|
||||
}
|
||||
else {
|
||||
copy_v3_v3(vc->no, axis_vec);
|
||||
}
|
||||
}
|
||||
else {
|
||||
/* edge average vector and right angle to the pivot make the normal */
|
||||
cross_v3_v3v3(vc->no, tmp_vec1, tmp_vec2);
|
||||
}
|
||||
|
||||
}
|
||||
else {
|
||||
|
|
Loading…
Reference in New Issue