[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [52543] trunk/blender/source/blender: More fixes to parallel tests to make them less sensitive, prevents assert failures.
Howard Trickey
howard.trickey at gmail.com
Sun Nov 25 14:52:15 CET 2012
Revision: 52543
http://projects.blender.org/scm/viewvc.php?view=rev&root=bf-blender&revision=52543
Author: howardt
Date: 2012-11-25 13:52:13 +0000 (Sun, 25 Nov 2012)
Log Message:
-----------
More fixes to parallel tests to make them less sensitive, prevents assert failures.
Also made bl_debug_draw_edge_add better (don't draw edges in one continuous line).
Modified Paths:
--------------
trunk/blender/source/blender/bmesh/tools/bmesh_bevel.c
trunk/blender/source/blender/editors/space_view3d/view3d_draw.c
Modified: trunk/blender/source/blender/bmesh/tools/bmesh_bevel.c
===================================================================
--- trunk/blender/source/blender/bmesh/tools/bmesh_bevel.c 2012-11-25 13:17:40 UTC (rev 52542)
+++ trunk/blender/source/blender/bmesh/tools/bmesh_bevel.c 2012-11-25 13:52:13 UTC (rev 52543)
@@ -319,12 +319,7 @@
sub_v3_v3v3(dir1, v->co, BM_edge_other_vert(e1->e, v)->co);
sub_v3_v3v3(dir2, BM_edge_other_vert(e2->e, v)->co, v->co);
- /* get normal to plane where meet point should be */
- cross_v3_v3v3(norm_v, dir2, dir1);
- normalize_v3(norm_v);
- if (!on_right)
- negate_v3(norm_v);
- if (is_zero_v3(norm_v)) {
+ if (angle_v3v3(dir1, dir2) < 100.0f * (float)BEVEL_EPSILON) {
/* special case: e1 and e2 are parallel; put offset point perp to both, from v.
* need to find a suitable plane.
* if offsets are different, we're out of luck: just use e1->offset */
@@ -339,6 +334,12 @@
copy_v3_v3(meetco, off1a);
}
else {
+ /* get normal to plane where meet point should be */
+ cross_v3_v3v3(norm_v, dir2, dir1);
+ normalize_v3(norm_v);
+ if (!on_right)
+ negate_v3(norm_v);
+
/* get vectors perp to each edge, perp to norm_v, and pointing into face */
if (f) {
copy_v3_v3(norm_v, f->no);
@@ -612,7 +613,7 @@
else
sub_v3_v3v3(dir, e->e->v2->co, e->e->v1->co);
normalize_v3(dir);
- if (fabsf(angle_v3v3(vva, vvb) - (float)M_PI) > (float)BEVEL_EPSILON) {
+ if (fabsf(angle_v3v3(vva, vvb) - (float)M_PI) > 100.f *(float)BEVEL_EPSILON) {
copy_v3_v3(vaadj, va);
madd_v3_v3fl(vaadj, dir, -len_v3(vva) * cosf(angle_v3v3(vva, dir)));
copy_v3_v3(vbadj, vb);
Modified: trunk/blender/source/blender/editors/space_view3d/view3d_draw.c
===================================================================
--- trunk/blender/source/blender/editors/space_view3d/view3d_draw.c 2012-11-25 13:17:40 UTC (rev 52542)
+++ trunk/blender/source/blender/editors/space_view3d/view3d_draw.c 2012-11-25 13:52:13 UTC (rev 52543)
@@ -3237,12 +3237,16 @@
#ifdef DEBUG_DRAW
/* debug drawing */
#define _DEBUG_DRAW_QUAD_TOT 1024
+#define _DEBUG_DRAW_EDGE_TOT 1024
static float _bl_debug_draw_quads[_DEBUG_DRAW_QUAD_TOT][4][3];
static int _bl_debug_draw_quads_tot = 0;
+static float _bl_debug_draw_edges[_DEBUG_DRAW_QUAD_TOT][2][3];
+static int _bl_debug_draw_edges_tot = 0;
void bl_debug_draw_quad_clear(void)
{
_bl_debug_draw_quads_tot = 0;
+ _bl_debug_draw_edges_tot = 0;
}
void bl_debug_draw_quad_add(const float v0[3], const float v1[3], const float v2[3], const float v3[3])
{
@@ -3260,16 +3264,14 @@
}
void bl_debug_draw_edge_add(const float v0[3], const float v1[3])
{
- if (_bl_debug_draw_quads_tot >= _DEBUG_DRAW_QUAD_TOT) {
- printf("%s: max edge count hit %d!", __func__, _bl_debug_draw_quads_tot);
+ if (_bl_debug_draw_quads_tot >= _DEBUG_DRAW_EDGE_TOT) {
+ printf("%s: max edge count hit %d!", __func__, _bl_debug_draw_edges_tot);
}
else {
- float *pt = &_bl_debug_draw_quads[_bl_debug_draw_quads_tot][0][0];
+ float *pt = &_bl_debug_draw_edges[_bl_debug_draw_edges_tot][0][0];
copy_v3_v3(pt, v0); pt += 3;
copy_v3_v3(pt, v1); pt += 3;
- copy_v3_v3(pt, v0); pt += 3;
- copy_v3_v3(pt, v1); pt += 3;
- _bl_debug_draw_quads_tot++;
+ _bl_debug_draw_edges_tot++;
}
}
static void bl_debug_draw(void)
@@ -3286,5 +3288,22 @@
}
glEnd();
}
+ if (_bl_debug_draw_edges_tot) {
+ int i;
+ cpack(0x00FFFF00);
+ glBegin(GL_LINES);
+ for (i = 0; i < _bl_debug_draw_edges_tot; i ++) {
+ glVertex3fv(_bl_debug_draw_edges[i][0]);
+ glVertex3fv(_bl_debug_draw_edges[i][1]);
+ }
+ glEnd();
+ glPointSize(4.0);
+ glBegin(GL_POINTS);
+ for (i = 0; i < _bl_debug_draw_edges_tot; i ++) {
+ glVertex3fv(_bl_debug_draw_edges[i][0]);
+ glVertex3fv(_bl_debug_draw_edges[i][1]);
+ }
+ glEnd();
+ }
}
#endif
More information about the Bf-blender-cvs
mailing list