mirror of
git://projects.qi-hardware.com/cae-tools.git
synced 2024-12-23 03:02:25 +02:00
For convenience, record maximum Z size in the face structure.
- solidify/face.h (struct face), solidify/face.c (read_file): keep the mesh's maximum Z size in sz, similar to sx and sy - solidify/povray.c (povray_face): use f->sz insead of calculating it
This commit is contained in:
parent
17824f4cb4
commit
d9ddd52427
@ -136,6 +136,7 @@ static struct face *read_file(const char *name)
|
|||||||
|
|
||||||
f->sx = f->a->max_x-f->a->min_x+1;
|
f->sx = f->a->max_x-f->a->min_x+1;
|
||||||
f->sy = f->a->max_y-f->a->min_y+1;
|
f->sy = f->a->max_y-f->a->min_y+1;
|
||||||
|
f->sz = f->a->max_z-f->a->min_z+1;
|
||||||
|
|
||||||
f->cx = (f->a->min_x+f->a->max_x)/2;
|
f->cx = (f->a->min_x+f->a->max_x)/2;
|
||||||
f->cy = (f->a->min_y+f->a->max_y)/2;
|
f->cy = (f->a->min_y+f->a->max_y)/2;
|
||||||
|
@ -20,7 +20,7 @@
|
|||||||
struct face {
|
struct face {
|
||||||
struct array *a;
|
struct array *a;
|
||||||
double x_step, y_step, z_step;
|
double x_step, y_step, z_step;
|
||||||
int sx, sy; /* size */
|
int sx, sy, sz; /* size */
|
||||||
int cx, cy; /* center */
|
int cx, cy; /* center */
|
||||||
int z_ref;
|
int z_ref;
|
||||||
double fx, fy; /* inclination factor */
|
double fx, fy; /* inclination factor */
|
||||||
|
@ -73,7 +73,6 @@ static void sanitize(const char *s, char *res)
|
|||||||
static void povray_face(const struct face *f, const char *side,
|
static void povray_face(const struct face *f, const char *side,
|
||||||
const char *prefix, int flip, double dist)
|
const char *prefix, int flip, double dist)
|
||||||
{
|
{
|
||||||
int sz = f->a->max_z-f->a->min_z;
|
|
||||||
double a;
|
double a;
|
||||||
|
|
||||||
/*
|
/*
|
||||||
@ -99,7 +98,7 @@ static void povray_face(const struct face *f, const char *side,
|
|||||||
"%s" /* flip bottom face */
|
"%s" /* flip bottom face */
|
||||||
"\t translate <0, 0, %g> /* half the distance between faces */\n"
|
"\t translate <0, 0, %g> /* half the distance between faces */\n"
|
||||||
"\t}\n", prefix, side,
|
"\t}\n", prefix, side,
|
||||||
f->sx*f->x_step, sz*f->z_step, f->sy*f->y_step,
|
f->sx*f->x_step, (f->sz-1)*f->z_step, f->sy*f->y_step,
|
||||||
-f->sx*f->x_step/2, f->sy*f->y_step/2,
|
-f->sx*f->x_step/2, f->sy*f->y_step/2,
|
||||||
-atan(f->fy)/M_PI*180, -atan(f->fx)/M_PI*180,
|
-atan(f->fy)/M_PI*180, -atan(f->fx)/M_PI*180,
|
||||||
f->a->min_z*f->z_step,
|
f->a->min_z*f->z_step,
|
||||||
|
Loading…
Reference in New Issue
Block a user