| 
						
						
							
								
							
						
						
					 | 
					@ -145,8 +145,8 @@ inline double distan(P A, P B, int inOut1, int inOut2) | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
						double len = distan1(A, B); | 
					 | 
					 | 
						double len = distan1(A, B); | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					
 | 
					 | 
					 | 
					
 | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
						// 求交判断并赋值惩罚参数
 | 
					 | 
					 | 
						// 求交判断并赋值惩罚参数
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
						// if (intersection_model == 1) 
 | 
					 | 
					 | 
						if (intersection_model == 1) | 
				
			
			
				
				
			
		
	
		
		
			
				
					
					 | 
					 | 
						if (0) | 
					 | 
					 | 
						// if (0)
 | 
				
			
			
				
				
			
		
	
		
		
	
		
		
	
		
		
			
				
					 | 
					 | 
						{ | 
					 | 
					 | 
						{ | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
							LineSegment lineSegment(Vec3f(A.x, A.y, A.z), Vec3f(B.x, B.y, B.z)); | 
					 | 
					 | 
							LineSegment lineSegment(Vec3f(A.x, A.y, A.z), Vec3f(B.x, B.y, B.z)); | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
							static BVH_intersection bvh(mesh); | 
					 | 
					 | 
							static BVH_intersection bvh(mesh); | 
				
			
			
		
	
	
		
		
			
				
					| 
						
						
						
							
								
							
						
					 | 
					@ -154,13 +154,14 @@ inline double distan(P A, P B, int inOut1, int inOut2) | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
							if (hit == 0) | 
					 | 
					 | 
							if (hit == 0) | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
								penalty_par_intersection = 1; | 
					 | 
					 | 
								penalty_par_intersection = 1; | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
							else | 
					 | 
					 | 
							else | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
								penalty_par_intersection = 400; | 
					 | 
					 | 
								penalty_par_intersection = 100; //*原400
 | 
				
			
			
				
				
			
		
	
		
		
	
		
		
			
				
					 | 
					 | 
					 | 
					 | 
					 | 
							cout << "out: len:" << len << " intersection_distance" << intersection_distance << endl; | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
							//----------------------mark-----------------------//
 | 
					 | 
					 | 
							//----------------------mark-----------------------//
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
							// ×¢ÊÍЧ¹ûºÃ
 | 
					 | 
					 | 
							// 注释下面效果可能好
 | 
				
			
			
				
				
			
		
	
		
		
			
				
					
					 | 
					 | 
							// if(len>intersection_distance)
 | 
					 | 
					 | 
							if (len > intersection_distance) | 
				
			
			
				
				
			
		
	
		
		
			
				
					
					 | 
					 | 
							// 	penalty_par_distance=8;
 | 
					 | 
					 | 
								penalty_par_distance = 8; | 
				
			
			
				
				
			
		
	
		
		
			
				
					
					 | 
					 | 
							// else
 | 
					 | 
					 | 
							else | 
				
			
			
				
				
			
		
	
		
		
			
				
					
					 | 
					 | 
							// 	penalty_par_distance=1;
 | 
					 | 
					 | 
								penalty_par_distance = 1; | 
				
			
			
				
				
			
		
	
		
		
	
		
		
	
		
		
	
		
		
	
		
		
	
		
		
			
				
					 | 
					 | 
						} | 
					 | 
					 | 
						} | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					
 | 
					 | 
					 | 
					
 | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
						double len1 = sqrt((A.y - Ycenter) * (A.y - Ycenter) + (A.z - Zcenter) * (A.z - Zcenter)); | 
					 | 
					 | 
						double len1 = sqrt((A.y - Ycenter) * (A.y - Ycenter) + (A.z - Zcenter) * (A.z - Zcenter)); | 
				
			
			
		
	
	
		
		
			
				
					| 
						
							
								
							
						
						
							
								
							
						
						
					 | 
					@ -226,8 +227,8 @@ inline double distan(P A, P B) | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
						angel = min(angel, pi / 2 - angel); | 
					 | 
					 | 
						angel = min(angel, pi / 2 - angel); | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
						double len = distan1(A, B); | 
					 | 
					 | 
						double len = distan1(A, B); | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					
 | 
					 | 
					 | 
					
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
						// if (intersection_model == 1)
 | 
					 | 
					 | 
						if (intersection_model == 1) | 
				
			
			
				
				
			
		
	
		
		
			
				
					
					 | 
					 | 
						if(0) | 
					 | 
					 | 
						// if(0)
 | 
				
			
			
				
				
			
		
	
		
		
	
		
		
	
		
		
			
				
					 | 
					 | 
						{ | 
					 | 
					 | 
						{ | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
							LineSegment lineSegment(Vec3f(A.x, A.y, A.z), Vec3f(B.x, B.y, B.z)); | 
					 | 
					 | 
							LineSegment lineSegment(Vec3f(A.x, A.y, A.z), Vec3f(B.x, B.y, B.z)); | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
							static BVH_intersection bvh(mesh); | 
					 | 
					 | 
							static BVH_intersection bvh(mesh); | 
				
			
			
		
	
	
		
		
			
				
					| 
						
						
						
							
								
							
						
					 | 
					@ -235,7 +236,8 @@ inline double distan(P A, P B) | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
							if (hit == 0) | 
					 | 
					 | 
							if (hit == 0) | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
								penalty_par_intersection = 1; | 
					 | 
					 | 
								penalty_par_intersection = 1; | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
							else | 
					 | 
					 | 
							else | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
								penalty_par_intersection = 400; | 
					 | 
					 | 
								penalty_par_intersection = 100; //*原400
 | 
				
			
			
				
				
			
		
	
		
		
	
		
		
			
				
					 | 
					 | 
					 | 
					 | 
					 | 
							cout << "no_out: len:" << len << " intersection_distance" << intersection_distance << endl; | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
							if (len > intersection_distance) | 
					 | 
					 | 
							if (len > intersection_distance) | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
								penalty_par_distance = 8; | 
					 | 
					 | 
								penalty_par_distance = 8; | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
							else | 
					 | 
					 | 
							else | 
				
			
			
		
	
	
		
		
			
				
					| 
						
							
								
							
						
						
						
					 | 
					
  |