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

Correct z0 for z vs. xy scale differences. Now things work as planned !

- solidify/face.h (z0_scale, fx_to_angle, fy_to_angle, fx_from_angle,
  fy_from_angle): correct for z vs. xy scale differences
- solidify/overlap.c (merge_matrix): correct z0 shrinkage for z vs. xy
  scale differences
This commit is contained in:
Werner Almesberger
2010-09-27 02:39:25 -03:00
parent 1638123771
commit 6acca4ea4a
2 changed files with 13 additions and 6 deletions

View File

@@ -36,27 +36,33 @@ static inline double face_z0(const struct face *f, int x, int y)
}
static inline double z0_scale(const struct face *f)
{
return f->z_step/f->x_step;
}
static inline double fx_to_angle(const struct face *f)
{
return atan(f->fx)/M_PI*180;
return atan(f->fx*z0_scale(f))/M_PI*180;
}
static inline double fy_to_angle(const struct face *f)
{
return atan(f->fy)/M_PI*180;
return atan(f->fy*z0_scale(f))/M_PI*180;
}
static inline void fx_from_angle(struct face *f, double a)
{
f->fx = tan(a/180*M_PI);
f->fx = tan(a/180*M_PI)/z0_scale(f);
}
static inline void fy_from_angle(struct face *f, double a)
{
f->fy = tan(a/180*M_PI);
f->fy = tan(a/180*M_PI)/z0_scale(f);
}