Reduce mesh resolution in the middle region of skeleton limbs

This commit is contained in:
2015-09-03 20:54:15 +07:00
parent 0ddc05a07e
commit 129e0b8ab5

View File

@@ -2505,13 +2505,17 @@ static double calc_edge_length_threshold(SkinData *data, BMEdge *edge, int sv1,
radius[0] = skin_radius(data->sverts[sv1].radius);
radius[1] = skin_radius(data->sverts[sv2].radius);
len_threshold = 0.5 * (radius[0] + radius[1]);
len_threshold = (radius[0] + radius[1]);
int vflag1 = BM_ELEM_CD_GET_INT(edge->v1, cd_vert_flag_off);
int vflag2 = BM_ELEM_CD_GET_INT(edge->v2, cd_vert_flag_off);
if (vflag1 & SKIN_BM_VERT_ON_CONNECTION || vflag2 & SKIN_BM_VERT_ON_CONNECTION){
/*decrease threshold to increase the resolution for region near connection node*/
len_threshold = 0.5 * len_threshold;
len_threshold = 0.25 * len_threshold;
}
else{
len_threshold = 1.5 * len_threshold;
}
return len_threshold;
}