fix [#35710] Mesh explodes while using solidify modifier with tubular non-manifold base mesh.
This commit is contained in:
@@ -309,7 +309,7 @@ typedef struct FreestyleFace {
|
|||||||
/* reserve 16 for ME_HIDE */
|
/* reserve 16 for ME_HIDE */
|
||||||
#define ME_EDGERENDER (1<<5)
|
#define ME_EDGERENDER (1<<5)
|
||||||
#define ME_LOOSEEDGE (1<<7)
|
#define ME_LOOSEEDGE (1<<7)
|
||||||
/* #define ME_SEAM_LAST (1<<8) */ /* UNUSED */
|
#define ME_EDGE_TMP_TAG (1 << 8)
|
||||||
#define ME_SHARP (1<<9) /* only reason this flag remains a 'short' */
|
#define ME_SHARP (1<<9) /* only reason this flag remains a 'short' */
|
||||||
|
|
||||||
/* puno = vertexnormal (mface) */
|
/* puno = vertexnormal (mface) */
|
||||||
|
@@ -60,7 +60,7 @@ typedef struct EdgeFaceRef {
|
|||||||
|
|
||||||
BLI_INLINE bool edgeref_is_init(const EdgeFaceRef *edge_ref)
|
BLI_INLINE bool edgeref_is_init(const EdgeFaceRef *edge_ref)
|
||||||
{
|
{
|
||||||
return (edge_ref->f1 != 0) && (edge_ref->f2 != 0);
|
return !((edge_ref->f1 == 0) && (edge_ref->f2 == 0));
|
||||||
}
|
}
|
||||||
|
|
||||||
static void dm_calc_normal(DerivedMesh *dm, float (*temp_nors)[3])
|
static void dm_calc_normal(DerivedMesh *dm, float (*temp_nors)[3])
|
||||||
@@ -128,6 +128,7 @@ static void dm_calc_normal(DerivedMesh *dm, float (*temp_nors)[3])
|
|||||||
else {
|
else {
|
||||||
/* 3+ faces using an edge, we can't handle this usefully */
|
/* 3+ faces using an edge, we can't handle this usefully */
|
||||||
edge_ref->f1 = edge_ref->f2 = -1;
|
edge_ref->f1 = edge_ref->f2 = -1;
|
||||||
|
medge[ml->e].flag |= ME_EDGE_TMP_TAG;
|
||||||
}
|
}
|
||||||
/* --- done --- */
|
/* --- done --- */
|
||||||
}
|
}
|
||||||
@@ -501,6 +502,7 @@ static DerivedMesh *applyModifier(
|
|||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
/* make a face normal layer if not present */
|
/* make a face normal layer if not present */
|
||||||
|
const bool check_non_manifold = (smd->flag & MOD_SOLIDIFY_NORMAL_CALC) != 0;
|
||||||
float (*face_nors)[3];
|
float (*face_nors)[3];
|
||||||
bool face_nors_calc = false;
|
bool face_nors_calc = false;
|
||||||
|
|
||||||
@@ -551,9 +553,20 @@ static DerivedMesh *applyModifier(
|
|||||||
if (angle < FLT_EPSILON) {
|
if (angle < FLT_EPSILON) {
|
||||||
angle = FLT_EPSILON;
|
angle = FLT_EPSILON;
|
||||||
}
|
}
|
||||||
|
|
||||||
vidx = ml[i_this].v;
|
vidx = ml[i_this].v;
|
||||||
vert_accum[vidx] += angle;
|
vert_accum[vidx] += angle;
|
||||||
|
|
||||||
|
/* skip 3+ face user edges */
|
||||||
|
if ((check_non_manifold == false) ||
|
||||||
|
LIKELY(((orig_medge[ml[i_this].e].flag & ME_EDGE_TMP_TAG) == 0) &&
|
||||||
|
((orig_medge[ml[i_next].e].flag & ME_EDGE_TMP_TAG) == 0)))
|
||||||
|
{
|
||||||
vert_angles[vidx] += shell_angle_to_dist(angle_normalized_v3v3(vert_nors[vidx], face_nors[i])) * angle;
|
vert_angles[vidx] += shell_angle_to_dist(angle_normalized_v3v3(vert_nors[vidx], face_nors[i])) * angle;
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
vert_angles[vidx] += angle;
|
||||||
|
}
|
||||||
/* --- end non-angle-calc section --- */
|
/* --- end non-angle-calc section --- */
|
||||||
|
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user