Ben NanoNote 3D scans
Sign in or create your account | Project List | Help
Ben NanoNote 3D scans Commit Details
Date: | 2010-09-25 09:40:08 (12 years 11 months ago) |
---|---|
Author: | Werner Almesberger |
Commit: | f0a8bcd95e978480a1ef8a8a8f4a89b46bdc6e0d |
Message: | In POV-Ray output, move faces to more correct Z locations. - solidify/povray.c: update title for renaming - solidify/povray.c (povray_face, povray): flip the bottom face - solidify/povray.c (povray_face, povray): instead of centering the face on Z, shift it to its z0 position - solidify/povray.c (povray_face, povray): split the distance between faces equally among them |
Files: |
solidify/povray.c (4 diffs) |
Change Details
solidify/povray.c | ||
---|---|---|
1 | 1 | /* |
2 | * solid.c - Data structure and handling of a solid made of two opposing faces | |
2 | * povray.c - Generate POV-Ray output | |
3 | 3 | * |
4 | 4 | * Written 2010 by Werner Almesberger |
5 | 5 | * Copyright 2010 by Werner Almesberger |
... | ... | |
70 | 70 | */ |
71 | 71 | |
72 | 72 | static void povray_face(const struct face *f, const char *side, |
73 | const char *prefix) | |
73 | const char *prefix, int flip, double dist) | |
74 | 74 | { |
75 | 75 | int sz = f->a->max_z-f->a->min_z; |
76 | 76 | |
... | ... | |
86 | 86 | "\t scale <%g, %g, %g>\n" |
87 | 87 | "\t rotate <90, 0, 0>\n" |
88 | 88 | "\t translate <%g, %g, %g>\n" |
89 | "\t translate <0, 0, %g>\n" | |
90 | "%s" /* flip bottom face */ | |
91 | "\t translate <0, 0, %g>\n" | |
89 | 92 | "\t}\n", prefix, side, |
90 | 93 | f->sx*f->x_step, sz*f->z_step, f->sy*f->y_step, |
91 | -f->sx*f->x_step/2, f->sy*f->y_step/2, -sz*f->z_step/2); | |
94 | -f->sx*f->x_step/2, f->sy*f->y_step/2, f->a->min_z*f->z_step, | |
95 | -f->z_ref*f->z_step, | |
96 | flip ? "\t rotate <180, 0, 0>\n" : "", | |
97 | dist*f->z_step); | |
92 | 98 | } |
93 | 99 | |
94 | 100 | |
... | ... | |
108 | 114 | |
109 | 115 | sanitize(name, tmp); |
110 | 116 | printf("#declare Part_%s =\n intersection {\n", tmp); |
111 | povray_face(s->a, "top", name); | |
112 | povray_face(s->b, "bot", name); | |
117 | povray_face(s->a, "top", name, 0, s->dist/2); | |
118 | povray_face(s->b, "bot", name, 1, -s->dist/2); | |
113 | 119 | printf(" }\n"); |
114 | 120 | } |
Branches:
master