Commit 6728d5a6 authored by Phillip Lino Rall's avatar Phillip Lino Rall
Browse files

working on transformation of faces: transform_inner_faces_NE_quad working,...

working on transformation of faces: transform_inner_faces_NE_quad working, next step ,not yet done, is transform_diag_inner_faces_NE_quad
parent 4cdae863
......@@ -360,15 +360,6 @@ D3vector transform_right_lens_diag_SE_quad ( double t1, double t2, double* point
double sign = (curvatureRight_global_data > 0) ? 1 : ((curvatureRight_global_data < 0) ? -1 : 0) ;
double z = offsetZ_global_data+
sign*(-1*( sqrt(pow(curvatureRight_global_data,2)-
((x+actualX)*(x+actualX)+(y+actualY)*(y+actualY)) ) // pow(r_global_data * (1-t) + R_global_data * t,2)) //now direct with x²+y²
+sign *(-curvatureRight_global_data
+( (1-t)*z_left_inner_global_data //z_inner doesn't work anymore
+ t * z_left_outer_global_data))));
z = -z;
z = offsetZ_global_data+
sign*( ( sqrt(pow(curvatureRight_global_data,2)-
((x+actualX)*(x+actualX)+(y+actualY)*(y+actualY)))
+ sign*(-curvatureRight_global_data +( (1-t)*(thickness_global_data-z_right_inner_global_data) + t * (thickness_global_data-z_right_outer_global_data)))));
......@@ -403,7 +394,7 @@ D3vector transform_left_lens_diag_NE_quad ( double t1, double t2, double* pointe
return R_global_data*D3vector ( x,y,z);
}
D3vector transform_inner_quad_NE( double t1, double t2, double* pointer_global_data) {
D3vector transform_diag_inner_faces_NE_quad( double t1, double t2, double* pointer_global_data) {
double R_global_data = pointer_global_data[0];
double r_global_data = pointer_global_data[1];
double curvatureLeft_global_data = pointer_global_data[2];
......@@ -414,36 +405,74 @@ D3vector transform_inner_quad_NE( double t1, double t2, double* pointer_global_d
double z_left_outer_global_data = pointer_global_data[7];
double z_right_inner_global_data = pointer_global_data[8];
double z_right_outer_global_data = pointer_global_data[9];
double temp = t1;
t1 = t2;
t2 = temp;
double t = t2;
bool invertT1T2 = false;
if (invertT1T2)
{
double x = ( sin ( t1*0.5*M_PI )-t1);
double temp = t1;
t1 = t2;
t2 = temp;
}
double t = t2;
x = x*t2;
double y = (cos ( t1*0.5*M_PI )- ( 1-t1 )) ;
y = y*t2;
double actualX = 0 + r_global_data * t1 + 0 * t2 + (R_global_data-r_global_data) * t1 * t2;
double actualY = r_global_data - r_global_data * t1 + (R_global_data-r_global_data) * t2 - (R_global_data-r_global_data) * t1 * t2;
//HERE
double sign = (curvatureRight_global_data > 0) ? 1 : ((curvatureRight_global_data < 0) ? -1 : 0) ;
double radiusSquared = r_global_data + t2 * (R_global_data-r_global_data);
double radiusSquared = r_global_data + (R_global_data-r_global_data)* (t1);
FALSCHE LOL
double z = offsetZ_global_data+
sign*( ( sqrt(pow(curvatureRight_global_data,2)-
radiusSquared)
( radiusSquared))
+ sign*(-curvatureRight_global_data +( (1-t)*(thickness_global_data-z_right_inner_global_data) + t * (thickness_global_data-z_right_outer_global_data)))));
z = 0;
if (( t1 == 0 && t2 == 0)||( t1 == 1 && t2 == 0)||( t1 == 0 && t2 == 1)||( t1 == 1 && t2 == 1))
{
if ( fabs(z) > 1e-10)
{
cout << "stop "<<endl;
}
}
return D3vector ( 0 ,0 ,z);
}
D3vector transform_inner_faces_NE_quad( double t1, double t2, double* pointer_global_data) {
double R_global_data = pointer_global_data[0];
double r_global_data = pointer_global_data[1];
double curvatureLeft_global_data = pointer_global_data[2];
double curvatureRight_global_data = pointer_global_data[3];
double thickness_global_data = pointer_global_data[4];
double offsetZ_global_data = pointer_global_data[5];
double z_left_inner_global_data = pointer_global_data[6];
double z_left_outer_global_data = pointer_global_data[7];
double z_right_inner_global_data = pointer_global_data[8];
double z_right_outer_global_data = pointer_global_data[9];
bool invertT1T2 = false;
if (invertT1T2)
{
double temp = t1;
t1 = t2;
t2 = temp;
}
double t = t2;
double sign = (curvatureRight_global_data > 0) ? 1 : ((curvatureRight_global_data < 0) ? -1 : 0) ;
double radiusSquared = r_global_data* (t1-1)*r_global_data* (t1-1)+r_global_data* (t1)*r_global_data* (t1);
double z = offsetZ_global_data
+sign*(( sqrt(pow(curvatureRight_global_data,2)- radiusSquared) //pow(r_global_data,2) * (t*t + (1-t)*(1-t)))
+sign*(- curvatureRight_global_data + (thickness_global_data-z_right_inner_global_data)) ));
// z = 0;
if (( t1 == 0 && t2 == 0)||( t1 == 1 && t2 == 0)||( t1 == 0 && t2 == 1)||( t1 == 1 && t2 == 1))
{
if ( fabs(x) > 1e-10 || fabs(y) > 1e-10 || fabs(z) > 1e-10)
if ( fabs(z) > 1e-10)
{
cout << "stop "<<endl;
}
......@@ -482,23 +511,13 @@ D3vector transform_right_lens_diag_NE_quad ( double t1, double t2, double* point
double z = offsetZ_global_data+
sign*(-1*( sqrt(pow(curvatureRight_global_data,2)-
((x+actualX)*(x+actualX)+(y+actualY)*(y+actualY)) ) // pow(r_global_data * (1-t) + R_global_data * t,2)) //now direct with x²+y²
+sign *(-curvatureRight_global_data
+( (1-t)*z_left_inner_global_data //z_inner doesn't work anymore
+ t * z_left_outer_global_data))));
z = offsetZ_global_data+
sign*( ( sqrt(pow(curvatureRight_global_data,2)-
((x+actualX)*(x+actualX)+(y+actualY)*(y+actualY)))
+ sign*(-curvatureRight_global_data +( (1-t)*(thickness_global_data-z_right_inner_global_data) + t * (thickness_global_data-z_right_outer_global_data)))));
if (( t1 == 0 && t2 == 0)||( t1 == 1 && t2 == 0)||( t1 == 0 && t2 == 1)||( t1 == 1 && t2 == 1))
{
if ( fabs(x) > 1e-10 || fabs(y) > 1e-10 || fabs(z) > 1e-10)
if ( fabs(z) > 1e-10)
{
cout << "stop "<<endl;
}
......@@ -993,16 +1012,16 @@ LensQuadrangle::LensQuadrangle(double Radius, double radius, double thickness, d
//inner block: corner ids: 0 2 4 6 8 10 12 14
Set_transformation_face(0,2,4,6,transform_left_lens_inner_quad); // z=0 plane
Set_transformation_face(0,2,8,10,transform_inner_quad_NE); //transform_inner_quad_NE transform_inner_quad_NW transform_inner_quad_SW transform_inner_quad_SE
Set_transformation_face(2,4,10,12,transform_quadrangle_NULL);
Set_transformation_face(4,6,12,14,transform_quadrangle_NULL);
Set_transformation_face(0,6,8,14,transform_quadrangle_NULL);
Set_transformation_face(0,2,8,10,transform_inner_faces_NE_quad); //transform_inner_quad_NE transform_inner_quad_NW transform_inner_quad_SW transform_inner_quad_SE
Set_transformation_face(2,4,10,12,transform_inner_faces_NE_quad); //??
Set_transformation_face(4,6,12,14,transform_inner_faces_NE_quad); //??
Set_transformation_face(0,6,8,14,transform_inner_faces_NE_quad); //??
Set_transformation_face(8,10,12,14,transform_right_lens_inner_quad); // z = right plane transform_right_lens_inner_quad
//top-east block: corner ids: 0 1 2 3 8 9 10 11
Set_transformation_face(0,1,2,3,transform_left_lens_diag_NE_quad);
Set_transformation_face(0,1,8,9,transform_quadrangle_NULL);
Set_transformation_face(0,2,8,10,transform_quadrangle_NULL);
Set_transformation_face(0,1,8,9,transform_diag_inner_faces_NE_quad);
Set_transformation_face(0,2,8,10,transform_inner_faces_NE_quad);
Set_transformation_face(2,3,10,11,transform_quadrangle_NULL);
Set_transformation_face(1,3,9,11,transform_outer_boundary_NE); // transform_boundary_NE
Set_transformation_face(8,9,10,11,transform_right_lens_diag_NE_quad);
......@@ -1010,7 +1029,7 @@ LensQuadrangle::LensQuadrangle(double Radius, double radius, double thickness, d
//north-west block: corner ids: 2 3 4 5 10 11 12 13
Set_transformation_face(2,3,4,5,transform_left_lens_diag_NW_quad);//
Set_transformation_face(2,3,10,11,transform_quadrangle_NULL);
Set_transformation_face(2,4,10,12,transform_quadrangle_NULL);
Set_transformation_face(2,4,10,12,transform_inner_faces_NE_quad);
Set_transformation_face(4,5,12,13,transform_quadrangle_NULL);
Set_transformation_face(3,5,11,13,transform_outer_boundary_NW); // transform_boundary_NW
Set_transformation_face(10,11,12,13,transform_right_lens_diag_NW_quad); //
......@@ -1019,7 +1038,7 @@ LensQuadrangle::LensQuadrangle(double Radius, double radius, double thickness, d
//eher: S-W-BLOCK
Set_transformation_face(4,5,6,7,transform_left_lens_diag_SW_quad);
Set_transformation_face(4,5,12,13,transform_quadrangle_NULL);
Set_transformation_face(4,6,12,14,transform_quadrangle_NULL);
Set_transformation_face(4,6,12,14,transform_inner_faces_NE_quad);
Set_transformation_face(6,7,14,15,transform_quadrangle_NULL);
Set_transformation_face(5,7,13,15,transform_outer_boundary_SW); //
Set_transformation_face(12,13,14,15,transform_right_lens_diag_SW_quad);
......@@ -1027,8 +1046,8 @@ LensQuadrangle::LensQuadrangle(double Radius, double radius, double thickness, d
//bottom-east block: corner ids: 0 1 6 7 8 9 14 15
//eher: S-E-BLOCK
Set_transformation_face(0,1,6,7,transform_left_lens_diag_SE_quad);
Set_transformation_face(0,1,8,9,transform_quadrangle_NULL);
Set_transformation_face(0,6,8,14,transform_quadrangle_NULL);
Set_transformation_face(0,1,8,9,transform_diag_inner_faces_NE_quad);
Set_transformation_face(0,6,8,14,transform_inner_faces_NE_quad);
Set_transformation_face(6,7,14,15,transform_quadrangle_NULL);
Set_transformation_face(1,7,9,15,transform_outer_boundary_SE);
Set_transformation_face(8,9,14,15,transform_right_lens_diag_SE_quad);
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment