58 for (
int i = 0; i < n_pat; i++)
67 a2 = profile_pos_[++i];
68 while ((a2 <= a)&&(i<profile_pos_.size()));
75 for (
int i = 0; i < n_pat; i++)
92 std::cerr <<
"profiles should be ordered along the path" << std::endl;
93 std::cerr <<
"ref0 " << ref0 << std::endl;
94 std::cerr <<
"ref1 " << ref1 << std::endl;
100 double a1 =
path_.
a()[ref1];
101 double a2 =
path_.
a()[ref1+1];
108 double gia_f(
double a,
double a1,
double a2,
bool path_is_closed)
113 return (a-a1)/(a2-a1);
116 double base = (1-a1)+a2;
118 return 1.+(a-a2)/base;
124 return (a-a1)/(a2-a1);
143 a_point x1 = pat1.
x_axis();
144 a_point y1 = pat1.
y_axis();
145 a_point z1 = pat1.
z_axis();
147 a_point gap1_2D(x1*gap1_3D,y1*gap1_3D,0.);
154 a_point y2 = pat2.
y_axis();
155 a_point z2 = pat2.
z_axis();
157 a_point gap2_2D(
x2*gap2_3D,y2*gap2_3D,0.);
165 a_point dx3 = average_rot(dx1,dx2,f);
166 a_point dy3 = average_rot(dy1,dy2,f);
167 a_point dz3 = average_rot(dz1,dz2,f);
174 a_point ref1_2D = *pat1[rz1]+mz1*(*pat1[rz1+1]-*pat1[rz1]);
175 a_point ref2_2D = *pat2[rz2]+mz2*(*pat2[rz2+1]-*pat2[rz2]);
177 a_point gap_2D = average(gap1_2D,gap2_2D,f);
178 a_point ref_2D = average(ref1_2D,ref2_2D,f);
180 a_point p =
path_(a);
186 a_point x = (x0*dx3.x()+y0*dy3.x()+z0*dz3.x()).normalise();
187 a_point y = (x0*dx3.y()+y0*dy3.y()+z0*dz3.y()).normalise();
189 a_point ref_3D = ref_2D.x()*x+ref_2D.y()*y;
190 a_point gap_3D = gap_2D.x()*x+gap_2D.y()*y;
192 a_point prov = p+gap_3D-ref_3D;
215 a_point gap_2D(x*gap_3D,y*gap_3D,0.);
224 a_point ref_2D = *(*patn)[r2]+m2*(*(*patn)[r2+1]-*(*patn)[r2]);
225 a_point pa =
path_(0.);
231 a_point dxa = (x0*dx.x()+y0*dy.x()+z0*dz.x()).normalise();
232 a_point dya = (x0*dx.y()+y0*dy.y()+z0*dz.y()).normalise();
234 a_point ref_3D = ref_2D.x()*dxa+ref_2D.y()*dya;
235 a_point gapn_3D = gap_2D.x()*dxa+gap_2D.y()*dya;
236 a_point prov = pa+gap_3D-ref_3D;
237 patn->place3D(prov,dxa,dya);
248 a_point ref_2D = *(*patn)[r2]+m2*(*(*patn)[r2+1]-*(*patn)[r2]);
249 a_point pb =
path_(1.);
255 a_point dxb = (x0*dx.x()+y0*dy.x()+z0*dz.x()).normalise();
256 a_point dyb = (x0*dx.y()+y0*dy.y()+z0*dz.y()).normalise();
261 a_point ref_3D = ref_2D.x()*dxb+ref_2D.y()*dyb;
262 a_point gapn_3D = gap_2D.x()*dxb+gap_2D.y()*dyb;
263 a_point prov = pb+gap_3D-ref_3D;
264 patn->place3D(prov,dxb,dyb);
322 o << imax*jmax << std::endl;
326 if (is_closed_volume)
327 o << imax*jmax+2 << std::endl;
329 o << imax*jmax << std::endl;
333 std::ostringstream out;
334 for (
int i = 0; i < imax; i++)
336 a_point * p0 =
path_[i];
339 if (((i==0)||(i==imax-1))&&(is_closed_volume))
343 for (
int j = 0; j < jmax; j++)
345 a_point * x = pat[j];
347 o << *x << std::endl;
350 out << mid << std::endl;
354 for (
int j = 0; j < jmax; j++)
355 o << *pat[j] << std::endl;
369 o << imax*(jmax+1) << std::endl;
371 for (
int i = 0; i < imax; i++)
373 a_point * p0 =
path_[i];
378 for (
int j = 0; j < jmax; j++)
380 a_point * x = pat[j];
382 o << *x << std::endl;
385 o << mid << std::endl;
392 bool is_closed_volume =
false;
393 this->
output_pts(o,imax,jmax,is_closed_volume);
396 o << imax*(jmax-1)*2 << std::endl;
398 o << (imax-1)*(jmax-1)*2 << std::endl;
399 for (
int i = 0; i < imax-1; i++)
401 for (
int j = 0; j < jmax-1; j++)
403 int i1 = i*jmax+j;
int i2 = i1+1;
404 int j1 = i1+jmax;
int j2 = j1+1;
405 o << i1 <<
"\t" << j2 <<
"\t" << j1 << std::endl;
406 o << i1 <<
"\t" << i2 <<
"\t" << j2 << std::endl;
411 for (
int j = 0; j < jmax-1; j++)
413 int i1 = (imax-1)*jmax+j;
int i2 = i1+1;
414 int j1 = j;
int j2 = j1+1;
415 o << i1 <<
"\t" << j2 <<
"\t" << j1 << std::endl;
416 o << i1 <<
"\t" << i2 <<
"\t" << j2 << std::endl;
424 bool is_closed_volume =
true;
425 this->
output_pts(o,imax,jmax,is_closed_volume);
427 o << imax*jmax*2 << std::endl;
428 for (
int i = 0; i < imax-1; i++)
430 for (
int j = 0; j < jmax-1; j++)
432 int i1 = i*jmax+j;
int i2 = i1+1;
433 int j1 = i1+jmax;
int j2 = j1+1;
434 o << i1 <<
"\t" << j2 <<
"\t" << j1 << std::endl;
435 o << i1 <<
"\t" << i2 <<
"\t" << j2 << std::endl;
437 int i1 = (i+1)*jmax-1;
int i2 = i*jmax;
438 int j1 = i1+jmax;
int j2 = i2+jmax;
439 o << i1 <<
"\t" << j2 <<
"\t" << j1 << std::endl;
440 o << i1 <<
"\t" << i2 <<
"\t" << j2 << std::endl;
445 for (
int j = 0; j < jmax-1; j++)
447 int i1 = (imax-1)*jmax+j;
int i2 = i1+1;
448 int j1 = j;
int j2 = j1+1;
449 o << i1 <<
"\t" << j2 <<
"\t" << j1 << std::endl;
450 o << i1 <<
"\t" << i2 <<
"\t" << j2 << std::endl;
452 int i1 = imax*jmax-1;
int i2 = i1-jmax+1;
453 int j1 = jmax-1;
int j2 = 0;
454 o << i1 <<
"\t" << j2 <<
"\t" << j1 << std::endl;
455 o << i1 <<
"\t" << i2 <<
"\t" << j2 << std::endl;
460 for (
int j = 0; j < jmax-1; j++)
462 o << imax*jmax <<
"\t" << j+1 <<
"\t" << j << std::endl;
463 o << imax*jmax+1 <<
"\t" << (imax-1)*jmax+j <<
"\t" << (imax-1)*jmax+j+1 << std::endl;
465 o << imax*jmax <<
"\t" << 0 <<
"\t" << jmax-1 << std::endl;
466 o << imax*jmax+1 <<
"\t" << (imax-1)*jmax+jmax-1 <<
"\t" << (imax-1)*jmax << std::endl;
473 bool is_closed_volume =
true;
476 o << (imax-1)*jmax << std::endl;
477 for (
int i = 0; i < imax-1; i++)
479 int k1 = i*(jmax+1)+jmax;
480 int k2 = (i+1)*(jmax+1)+jmax;
481 for (
int j = 0; j < jmax; j++)
483 int i1 = i*(jmax+1)+j;
489 int j1 = i1 + jmax + 1;
490 int j2 = i2 + jmax + 1;
491 o << k1 <<
"\t" << i1 <<
"\t" << i2 <<
"\t" << k2 <<
"\t" << j1 <<
"\t" << j2 << std::endl;
496 o <<
"to complete" << std::endl;
511 for (
int i = 0; i < n_pats; i++)
516 pat->construct_axis();
527 o << n_pats << std::endl;
528 for (
int i = 0; i < n_pats; i++)
a_curve_lin interpolate(const a_curve_lin &pat1, const a_curve_lin &pat2, double a)
double gia_f(double a, double a1, double a2, bool path_is_closed)
std::istream & operator>>(std::istream &in, a_rib &r)
std::ostream & operator<<(std::ostream &o, const a_rib &r)
a curve with linear interpolation
a_point dx_axis(double a) const
a_point dz_axis(double a) const
std::vector< double > & a()
a_point dy_axis(double a) const
double dist2(const a_point &, int &ref, double &m) const
void set_horiz(const a_point &p)
a_segment shortest(const a_curve &fn, int &ref1, int &ref2, double &m1, double &m2) const
a_curve & place3D(a_point &origin, a_point &x_axis, a_point &y_axis)
a_point get_horiz() const
a_curve & construct_axis()
bool is_closed() const
!!!!!!
void output_tri_closed(std::ostream &o) const
std::vector< double > profile_pos_
void output_vol(std::ostream &o) const
std::vector< a_curve_lin * > profiles_
void output_pts_vol(std::ostream &o, int &imax, int &jmax) const
void extrapolate_1profile_setup()
void output_pts(std::ostream &o, int &imax, int &jmax, bool is_closed_volume) const
a_curve_lin gia_profile(double a, int ref1, int ref2) const
void construct_profile_pos()
void extrapolate_profiles_setup()
a_curve_lin profile(double a) const
void output_tri_open(std::ostream &o) const