1
0
mirror of git://projects.qi-hardware.com/cae-tools.git synced 2025-04-21 12:27:27 +03:00

Cleaned up z0 plane input/output. Note: need to change fx in all .sfy files !

- solidify/face.h (fx_to_angle, fy_to_angle, fx_from_angle, fy_from_angle):
  helper functions to get/set the z0 plane inclination
- solidify/povray.c (povray_face), solidify/project.c (read_face_data,
  save_face_data): use helper functions to get/set z0 plane
- solidify/project.c (read_face_data, save_face_data): don't negate fx
This commit is contained in:
Werner Almesberger
2010-09-27 00:54:39 -03:00
parent 12f5aa2188
commit 1638123771
3 changed files with 30 additions and 4 deletions

View File

@@ -72,11 +72,11 @@ static void read_face_data(FILE *file, struct face *f)
if (fscanf(file, "%f", &v) != 1)
return;
f->fx = -tan(v/180*M_PI);
fx_from_angle(f, v);
if (fscanf(file, "%f", &v) != 1)
return;
f->fy = tan(v/180*M_PI);
fy_from_angle(f, v);
if (fscanf(file, "%f", &v) != 1)
return;
@@ -163,7 +163,7 @@ static void save_face_data(FILE *file, const char *name, const struct face *f)
a = 180-a;
if (fprintf(file, "%g %g %g\n%g %g %g\n",
f->z_ref*f->z_step,
-atan(f->fx)/M_PI*180, atan(f->fy)/M_PI*180,
fx_to_angle(f), fy_to_angle(f),
a, f->m.b[0]*f->x_step, f->m.b[1]*f->y_step) < 0) {
perror(name);
exit(1);