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:
@@ -13,6 +13,8 @@
|
||||
#ifndef FACE_H
|
||||
#define FACE_H
|
||||
|
||||
#include <math.h>
|
||||
|
||||
#include "array.h"
|
||||
#include "matrix.h"
|
||||
|
||||
@@ -34,6 +36,30 @@ static inline double face_z0(const struct face *f, int x, int y)
|
||||
}
|
||||
|
||||
|
||||
static inline double fx_to_angle(const struct face *f)
|
||||
{
|
||||
return atan(f->fx)/M_PI*180;
|
||||
}
|
||||
|
||||
|
||||
static inline double fy_to_angle(const struct face *f)
|
||||
{
|
||||
return atan(f->fy)/M_PI*180;
|
||||
}
|
||||
|
||||
|
||||
static inline void fx_from_angle(struct face *f, double a)
|
||||
{
|
||||
f->fx = tan(a/180*M_PI);
|
||||
}
|
||||
|
||||
|
||||
static inline void fy_from_angle(struct face *f, double a)
|
||||
{
|
||||
f->fy = tan(a/180*M_PI);
|
||||
}
|
||||
|
||||
|
||||
struct face *read_face(const char *name);
|
||||
|
||||
#endif /* !FACE_H */
|
||||
|
||||
Reference in New Issue
Block a user