Ben NanoNote 3D scans
Sign in or create your account | Project List | Help
Ben NanoNote 3D scans Git Source Tree
Root/
Source at commit 2cc9a9e5056d4452202900de752d42b8f702557c created 13 years 6 months ago. By Werner Almesberger, Step sizes are now auto-determined, allowing use of files of any resolution. | |
---|---|
1 | /* |
2 | * face.h - Data structure and handling of one face of a part |
3 | * |
4 | * Written 2010 by Werner Almesberger |
5 | * Copyright 2010 by Werner Almesberger |
6 | * |
7 | * This program is free software; you can redistribute it and/or modify |
8 | * it under the terms of the GNU General Public License as published by |
9 | * the Free Software Foundation; either version 2 of the License, or |
10 | * (at your option) any later version. |
11 | */ |
12 | |
13 | #ifndef FACE_H |
14 | #define FACE_H |
15 | |
16 | #include "array.h" |
17 | #include "matrix.h" |
18 | |
19 | |
20 | struct face { |
21 | struct array *a; |
22 | double x_step, y_step, z_step; |
23 | int sx, sy; /* size */ |
24 | int cx, cy; /* center */ |
25 | int z_ref; |
26 | double fx, fy; /* inclination factor */ |
27 | struct matrix m; |
28 | }; |
29 | |
30 | |
31 | static inline double face_z0(const struct face *f, int x, int y) |
32 | { |
33 | return f->z_ref+f->fx*(x-f->sx/2)+f->fy*(y-f->sy/2); |
34 | } |
35 | |
36 | |
37 | struct face *read_face(const char *name); |
38 | |
39 | #endif /* !FACE_H */ |
40 |
Branches:
master