mirror of
git://projects.qi-hardware.com/ben-scans.git
synced 2024-11-22 06:43:10 +02:00
2cc9a9e505
- solidify/face.h (struct face): record the x, y, and z step sizes - solidify/face.c (load_file, read_file): moved file I/O from read_file to load_file - solidify/face.c (adjust_step, read_file): before populating the array, determine the x/y and z step sizes - solidify/solidify.c (main): verify that both faces have the same step sizes - solidify/solidify.c (main): don't use hard-coded z step size - solidify/solidify.c (main): move call to setlocale() next to gtk_init(), to make it clear whose damage we're trying to control
40 lines
857 B
C
40 lines
857 B
C
/*
|
|
* face.h - Data structure and handling of one face of a part
|
|
*
|
|
* Written 2010 by Werner Almesberger
|
|
* Copyright 2010 by Werner Almesberger
|
|
*
|
|
* This program is free software; you can redistribute it and/or modify
|
|
* it under the terms of the GNU General Public License as published by
|
|
* the Free Software Foundation; either version 2 of the License, or
|
|
* (at your option) any later version.
|
|
*/
|
|
|
|
#ifndef FACE_H
|
|
#define FACE_H
|
|
|
|
#include "array.h"
|
|
#include "matrix.h"
|
|
|
|
|
|
struct face {
|
|
struct array *a;
|
|
double x_step, y_step, z_step;
|
|
int sx, sy; /* size */
|
|
int cx, cy; /* center */
|
|
int z_ref;
|
|
double fx, fy; /* inclination factor */
|
|
struct matrix m;
|
|
};
|
|
|
|
|
|
static inline double face_z0(const struct face *f, int x, int y)
|
|
{
|
|
return f->z_ref+f->fx*(x-f->sx/2)+f->fy*(y-f->sy/2);
|
|
}
|
|
|
|
|
|
struct face *read_face(const char *name);
|
|
|
|
#endif /* !FACE_H */
|