fix for problem with too low epsilon when calculating thickness, also increase limits.

This commit is contained in:
Campbell Barton 2013-04-18 17:23:02 +00:00
parent 5c72a19c09
commit 5502c74a1a
2 changed files with 6 additions and 6 deletions

@ -45,6 +45,7 @@
#include "BLI_math.h"
#include "BLI_jitter.h"
#include "BLI_bitmap.h"
#include "BKE_cdderivedmesh.h"
#include "BKE_mesh.h"
@ -1622,7 +1623,7 @@ static void statvis_calc_thickness(
/* result */
unsigned char (*r_face_colors)[4])
{
const float eps_offset = FLT_EPSILON * 10.0f;
const float eps_offset = 0.00001f;
float *face_dists = (float *)r_face_colors; /* cheating */
const bool use_jit = samples < 32;
float jit_ofs[32][2];
@ -1984,7 +1985,6 @@ void BKE_editmesh_statvis_calc(BMEditMesh *em, DerivedMesh *dm,
/* -------------------------------------------------------------------- */
/* Editmesh Vert Coords */
#include "BLI_bitmap.h"
struct CageUserData {
int totvert;
float (*cos_cage)[3];

@ -2051,16 +2051,16 @@ static void rna_def_statvis(BlenderRNA *brna)
prop = RNA_def_property(srna, "thickness_min", PROP_FLOAT, PROP_DISTANCE);
RNA_def_property_float_sdna(prop, NULL, "thickness_min");
RNA_def_property_float_default(prop, 0.5f);
RNA_def_property_range(prop, 0.0f, 100.0);
RNA_def_property_ui_range(prop, 0.0f, 10.0, 0.001, 3);
RNA_def_property_range(prop, 0.0f, 1000.0);
RNA_def_property_ui_range(prop, 0.0f, 100.0, 0.001, 3);
RNA_def_property_ui_text(prop, "Thickness Min", "Minimum for measuring thickness");
RNA_def_property_update(prop, 0, "rna_EditMesh_update");
prop = RNA_def_property(srna, "thickness_max", PROP_FLOAT, PROP_DISTANCE);
RNA_def_property_float_sdna(prop, NULL, "thickness_max");
RNA_def_property_float_default(prop, 0.5f);
RNA_def_property_range(prop, 0.0f, 100.0);
RNA_def_property_ui_range(prop, 0.0f, 10.0, 0.001, 3);
RNA_def_property_range(prop, 0.0f, 1000.0);
RNA_def_property_ui_range(prop, 0.0f, 100.0, 0.001, 3);
RNA_def_property_ui_text(prop, "Thickness Max", "Maximum for measuring thickness");
RNA_def_property_update(prop, 0, "rna_EditMesh_update");