Commit df20d201 authored by Enzo's avatar Enzo
Browse files

salut les zamis

parent 3a04efe1
......@@ -359,7 +359,7 @@
1616946758 /home/enzo/Documents/kitc-phelma/4projetcordesvocales/u2-dessin.h
1616949748 source:/home/enzo/Documents/kitc-phelma/4projetcordesvocales/u2-dessin.cpp
1616952557 source:/home/enzo/Documents/kitc-phelma/4projetcordesvocales/u2-dessin.cpp
<iostream>
<FL/Fl.H>
<FL/fl_draw.H>
......
......@@ -133,29 +133,38 @@ void zoneDessinDessinerRessorts(double x[], double y[]) {
///création du ressort intermédiaire
double pente = calculPente(x[1], x[2], y[1], y[2]);
double h = (L_ZONE - X_ZONE)/10;
double h = (L_ZONE - X_ZONE)/35;
double alpha = atan(pente);
nbr2dents2 = 6;
nbr2dents2 = 10;
double l = x[2] - x[1];
double dl = l/float(nbr2dents2);
xgap = -h*sin(alpha);
ygap = h*cos(alpha);
double dl = l/float(nbr2dents2+2);
double hx = -h*sin(alpha);
double hy = h*cos(alpha);
double x_fin;
double y_fin;
fl_begin_complex_polygon();
fl_line(x[1], y[1], x[1] + xgap, y[1] + ygap);
for (i = 0; i < (nbr2dents2-1); i++)
fl_line(x[1], y[1], x[1] + dl, y[1] + pente * dl);
fl_line(x[1] + dl, y[1] + pente * dl, x[1] + 2 * dl + hx, y[1] + pente * (2 * dl) + hy);
for (i = 1; i < (nbr2dents2/2); i++)
{
if (i%2 == 0)
if (i%2 != 0)
{
fl_line(x[1] + (i+1) * dl + xgap, y[1] + (i+1) * dl + ygap, x[1] + (i+2) * dl - xgap, y[1] + (i+2) * dl - ygap);
fl_line(x[1] + 2* i * dl + hx, y[1] + pente * 2 * i * dl + hy, x[1] + 2 * (i+1) * dl - hx, y[1] + pente * 2 * (i+1) * dl - hy);
x_fin =x[1] + 2 * (i+1) * dl - hx;
y_fin =y[1] + pente * 2 * (i+1) * dl - hy;
}
else
{
fl_line(x[1] + (i+1) * dl - xgap, y[1] + (i+1) * dl - ygap, x[1] + (i+2) * dl + xgap, y[1] + (i+2) * dl + ygap);
fl_line(x[1] + 2 * i * dl - hx, y[1] + pente * 2 * i * dl - hy, x[1] + 2 * (i+1) * dl + hx, y[1] + pente * 2 * (i+1) * dl + hy);
x_fin =x[1] + 2 * (i+1) * dl + hx;
y_fin =y[1] + pente * 2 * (i+1) * dl + hy;
}
}
fl_line(x[1] + nbr2dents2 * dl - xgap, y[1] + nbr2dents2 * dl - ygap, x[2], y[2]);
fl_line(x_fin, y_fin, x[1] + (nbr2dents2+1) * dl + hx, y[1] + pente * (nbr2dents2+1) * dl);
fl_line(x[1] + (nbr2dents2+1) * dl + hx, y[1] + pente * (nbr2dents2+1) * dl, x[2], y[2]);
fl_end_complex_polygon();
}
......
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