[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [31333] branches/soc-2010-rohith291991/ intern/comiso/intern: Nearly there.

Rohith B V rohith291991 at gmail.com
Sat Aug 14 14:57:46 CEST 2010


Revision: 31333
          http://projects.blender.org/plugins/scmsvn/viewcvs.php?view=rev&root=bf-blender&revision=31333
Author:   rohith291991
Date:     2010-08-14 14:57:45 +0200 (Sat, 14 Aug 2010)

Log Message:
-----------
Nearly there. Few hours of coding remain.

Modified Paths:
--------------
    branches/soc-2010-rohith291991/intern/comiso/intern/CMesh.cpp
    branches/soc-2010-rohith291991/intern/comiso/intern/uv.cpp

Modified: branches/soc-2010-rohith291991/intern/comiso/intern/CMesh.cpp
===================================================================
--- branches/soc-2010-rohith291991/intern/comiso/intern/CMesh.cpp	2010-08-14 05:33:20 UTC (rev 31332)
+++ branches/soc-2010-rohith291991/intern/comiso/intern/CMesh.cpp	2010-08-14 12:57:45 UTC (rev 31333)
@@ -238,9 +238,9 @@
 			e[0][2]=mesh->verts[v6].co[2]-mesh->verts[v5].co[2];
 
 			normal[0]=e[1].cross(e[0]);
-			normal[0].normalize() ;
+			normal[0].normalize();
 
-				v1=mesh->faces[mesh->faces[i].neighbors[j]].v[0];
+			v1=mesh->faces[mesh->faces[i].neighbors[j]].v[0];
 			v2=mesh->faces[mesh->faces[i].neighbors[j]].v[1];
 		
 			v5=mesh->faces[mesh->faces[i].neighbors[j]].v[2];
@@ -259,7 +259,7 @@
 
 		//	printf("dot1 %lf\ndot2 %lf\n",normal[0].dot(edge),normal[1].dot(edge));
 
-		double dot=normal[0].dot(normal[1]);
+		    double dot=normal[0].dot(normal[1]);
 			if(dot>=1)
 				dot=1;
 			else if(dot<=-1)
@@ -267,8 +267,7 @@
 			angle=acos(dot);
 			
 			int ev[2];
-			
-			
+						
 	      for(int k=0;k<3;k++)
 			  {
 			  if(mesh->faces[i].v[k]==v3)
@@ -282,6 +281,7 @@
 		  if((ev[0]+2)%3!=ev[1])
 			  {
 			  signe=-1;
+			  printf("TEST1\n");
 			  }
 
 
@@ -311,7 +311,8 @@
 			angle=acos(dot);
 			
 			if(normal[0].dot(e[2].cross(e[1]))<0)
-				sign=-1;
+				{sign=-1;
+				printf("TEST2\n");}
 			angle=angle*sign;
 
 			int sign2=1;
@@ -319,8 +320,10 @@
 			totkappa+= angle;
 
 			if(mesh->edges[mesh->faces[i].edges[j]].faces[0]!=i)
-				{count++;
+				{
+				count++;
 				sign2=-1;
+				printf("TEST3\n");
 				}
 
 			angle=angle*sign2;
@@ -329,11 +332,15 @@
 			//printf("angle: %lf\n",angle);
 
 			//TODO check for correctness
+double oldk=mesh->edges[mesh->faces[i].edges[j]].kappa;
 
-			printf("old kappa%lf\n",mesh->edges[mesh->faces[i].edges[j]].kappa);
+			
 			mesh->edges[mesh->faces[i].edges[j]].kappa=angle;//acos((x1*x3+y1*y3+z1*z3)/sqrt((x1*x1+y1*y1+z1*z1)*(x3*x3+y3*y3+z3*z3)));
 			
-			printf("new kappa%lf\n",mesh->edges[mesh->faces[i].edges[j]].kappa);
+double newk=mesh->edges[mesh->faces[i].edges[j]].kappa	;
+            if(fabs(newk+oldk)<10e-7)
+				{printf("new kappa%lf\n",newk);
+			printf("old kappa%lf\n\n",oldk);}
 		
 
 			solver.mdata[t].i=i;

Modified: branches/soc-2010-rohith291991/intern/comiso/intern/uv.cpp
===================================================================
--- branches/soc-2010-rohith291991/intern/comiso/intern/uv.cpp	2010-08-14 05:33:20 UTC (rev 31332)
+++ branches/soc-2010-rohith291991/intern/comiso/intern/uv.cpp	2010-08-14 12:57:45 UTC (rev 31333)
@@ -389,7 +389,7 @@
 
 		}
 	h/=totedge;
-h*=0.3;
+h*=0.15;
 	// std::cout<<h<<"\n";
 	double hh = h * h ;
 
@@ -779,11 +779,11 @@
 					{
 					minu=u[j];
 					}
-				if(u[j]<minv)
+				if(v[j]<minv)
 					{
 					minv=v[j];
 					}
-				if(v[j]>maxu)
+				if(u[j]>maxu)
 					{
 					maxu=u[j];
 					}
@@ -792,15 +792,14 @@
 					maxv=v[j];
 					}
 
-
 				}
 			
-			if((minu-(int)minu)<1e-10)
+			if(fabs(minu-(int)minu)<1e-10)
 			uStart=minu;
 			else
 				uStart=(int)(minu+1);
 
-			if((minv-(int)minv)<1e-10)
+			if(fabs(minv-(int)minv)<1e-10)
 			vStart=minv;
 			else
 			vStart=(int)(minv+1);
@@ -943,7 +942,7 @@
 				result->edges[ec].v[1]=vc-1;
 				ec++;
 
-				/*
+				
 
 		//Take care of all internal points
 
@@ -955,7 +954,7 @@
 			
 			}
 
-	
+	int check=0;
 		for(int j=uStart;j<uStart+uRange;j++)
 	{
 			for(int k=vStart;k<vStart+vRange;k++)
@@ -970,7 +969,7 @@
 				z=A[2]*j+B[2]*k+C[2];	
 
 
-
+				check=1;
 				//Add point to CMesh
 				
 				
@@ -999,7 +998,11 @@
 				}
 			}
 	
-
+		//printf("CHECK: %d\n",check);
+        if(check==0)
+			{
+			printf("%lf %lf %lf %lf %lf %lf %d %d %d %d\n\n",u[0],v[0],u[1],v[1],u[2],v[2],uStart,uRange,vStart,vRange);
+			}
 	//Add relevant edge connectivities to CMesh
 		int m1=(uRange-1)*vRange;
 		int m2=(vRange-1)*uRange;
@@ -1085,7 +1088,7 @@
 			}
 				//for loop
 				// Include points where edges meet triangle border
-*/
+
 			}
 		
 			result->numVerts=vc;





More information about the Bf-blender-cvs mailing list