[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [11664] branches/soc-2007-red_fox/source/ blender/blenkernel/intern/BME_tools.c: Better math now, wire beveling working again.

Levi Schooley redfox at hhofministries.org
Sat Aug 18 23:51:00 CEST 2007


Revision: 11664
          http://projects.blender.org/plugins/scmsvn/viewcvs.php?view=rev&root=bf-blender&revision=11664
Author:   red_fox
Date:     2007-08-18 23:51:00 +0200 (Sat, 18 Aug 2007)

Log Message:
-----------
Better math now, wire beveling working again.

Small changes that should remove most of the artifacts that 
were resulting from higher level of recursive bevels. I still 
can get artifacts on the 4th recursion in some cases, and the 
max limits still aren't working like they should. But it's 
better.

Also, I just noticed wire beveling wasn't working correctly. 
This improves it a bit.

Levi

Modified Paths:
--------------
    branches/soc-2007-red_fox/source/blender/blenkernel/intern/BME_tools.c

Modified: branches/soc-2007-red_fox/source/blender/blenkernel/intern/BME_tools.c
===================================================================
--- branches/soc-2007-red_fox/source/blender/blenkernel/intern/BME_tools.c	2007-08-18 17:40:47 UTC (rev 11663)
+++ branches/soc-2007-red_fox/source/blender/blenkernel/intern/BME_tools.c	2007-08-18 21:51:00 UTC (rev 11664)
@@ -365,14 +365,14 @@
 	/* compare the transform origins to see if we can use the vert co's;
 	 * if they belong to different origins, then we will use the origins to determine
 	 * the vector */
-	VECSUB(vec,vtd2->org,vtd1->org);
-	if (VecLength(vec) > 0.000001) {
-		return 1;
-	}
-	else {
+	if (VecCompare(vtd1->org,vtd2->org,0.000001f)) {
 		VECSUB(vec,v2->co,v1->co);
 		return 0;
 	}
+	else {
+		VECSUB(vec,vtd2->org,vtd1->org);
+		return 1;
+	}
 }
 
 /* "Projects" a vector perpendicular to vec2 against vec1, such that
@@ -450,7 +450,7 @@
 		ne->tflag1 = BME_BEVEL_ORIG; /* mark edge as original, even though it isn't */
 		VECSUB(vec1,v1->co,v->co);
 		VECSUB(vec2,v2->co,v->co);
-		Crossf(t_up_vec,vec2,vec1);
+		Crossf(t_up_vec,vec1,vec2);
 		Normalize(t_up_vec);
 		up_vec = t_up_vec;
 	}
@@ -503,6 +503,7 @@
 	else {
 		maxfactor = BME_bevel_project_vec(vec1,vec2,up_vec,forward,td);
 	}
+	printf("%f\n", maxfactor);
 
 	if (vtd1->loc == NULL) {
 		/* this is a vert with data only for calculating initial weights */
@@ -693,8 +694,8 @@
 	ol = f->loopbase;
 	l = ol->next;
 	for (i=0,ol=f->loopbase,l=ol->next; l->next!=ol; l=l->next) {
-		VECSUB(vec1,l->next->v->co,ol->v->co);
-		VECSUB(vec2,l->v->co,ol->v->co);
+		BME_bevel_get_vec(vec1,l->next->v,ol->v,td);
+		BME_bevel_get_vec(vec2,l->v,ol->v,td);
 		Crossf(vec3,vec2,vec1);
 		VECADD(up_vec,up_vec,vec3);
 		i++;





More information about the Bf-blender-cvs mailing list