From 3b6325d9142a0e99b18408d342722c3fedbc6204 Mon Sep 17 00:00:00 2001 From: Werner Almesberger Date: Mon, 27 Sep 2010 03:34:21 -0300 Subject: [PATCH] Show an exploded view of all parts scanned so far in one image. - sfy/ben.pov: show a stack of all parts scanned so far - sfy/Makefile: replaced $(NAME).inc with general .sfy -> .inc rule - sfy/Makefile (PROJECTS): renamed to PARTS - sfy/Makefile (ben): process ben.pov --- sfy/Makefile | 18 ++++++--- sfy/ben.pov | 109 +++++++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 121 insertions(+), 6 deletions(-) create mode 100644 sfy/ben.pov diff --git a/sfy/Makefile b/sfy/Makefile index ef4f42e..e5487d3 100644 --- a/sfy/Makefile +++ b/sfy/Makefile @@ -1,19 +1,25 @@ -PROJECTS = baseframe batcvr dispbase dispshell kbd lcdframe +PARTS = baseframe batcvr dispbase dispshell kbd lcdframe -.PHONY: run pov clean +.SUFFIXES: .sfy .inc + +.PHONY: run pov ben clean run: $(NAME).sfy ./solidify $(NAME).sfy -$(NAME).inc: $(NAME).sfy - ./solidify -p $(NAME).sfy +.sfy.inc: + ./solidify -p $< pov: $(NAME).pov $(NAME).inc povray +A +P -W1280 -H900 $(NAME).pov +ben: ben.pov $(PARTS:%=%.inc) + povray +A +P -W1280 -H900 ben.pov +# povray +A +P -W640 -H480 ben.pov + $(NAME).pov: template.pov sed 's/NAME/$(NAME)/' template.pov >$@ || { rm -f $@; exit 1; } clean: - rm -f $(PROJECTS:%=%.inc) $(PROJECTS:%=%.pov) *.pgm - rm -f $(PROJECTS:%=%.png) + rm -f $(PARTS:%=%.inc) $(PARTS:%=%.pov) *.pgm + rm -f $(PARTS:%=%.png) diff --git a/sfy/ben.pov b/sfy/ben.pov new file mode 100644 index 0000000..54f6ee7 --- /dev/null +++ b/sfy/ben.pov @@ -0,0 +1,109 @@ +#include "colors.inc" +#include "dispshell.inc" +#include "dispbase.inc" +/* lcdpcb */ +/* lcd */ +#include "lcdframe.inc" +/* screen */ +#include "baseframe.inc" +#include "kbd.inc" +/* pcb */ +/* bottom */ +/* battery */ +#include "batcvr.inc" + +/* + * POV-Ray defaults to a "camera" coordinate system that can be confusing. + * We use a traditional mathematical/engineering view, with a view from + * X-/Y-/Z+ into the X/Y plane. + */ + +camera { + location <30, -150, 90> + look_at <0, 20, 20> + sky z + right -4/3*x +} + +background { color White } + +light_source { + <-200, -300, 200> + color White +} + +light_source { + <100, -500, 50> + color White +} + +/* + * Mark the coordinate axes: + * - a red unit sphere at the center + * - three green spheres at x = 10*i + * - two blue spheres at y = 10*i + * - one yellow sphere at z = 10 + */ + +#declare Finish = finish { + brilliance 2 + phong 0.8 + phong_size 100 + metallic + ambient 0.5 +} + +object { + Part_dispshell + pigment { rgb <0.8, 0.8, 0.8> } + finish { Finish } + rotate <0, 0, 180> + translate <0, 0, 80> +} + +object { + Part_dispbase + pigment { rgb <0.25, 0, 0.75> } + finish { Finish } + rotate <0, 0, 180> + translate <0, 0, 70> +} + +/* lcdpcb 60 <0.5, 0. 0.5> */ +/* lcd 50 <1, 0, 0> */ + +object { + Part_lcdframe + pigment { rgb <0.75, 0, 0.25> } + finish { Finish } + rotate <180, 0, 0> + translate <0, 0, 40> +} + +/* screen 30 <1, 0, 0> */ + +object { + Part_baseframe + pigment { rgb <0.5, 0.5, 0> } + finish { Finish } + translate <0, 0, 20> +} + +object { + Part_kbd + pigment { rgb <0, 1, 0> } + finish { Finish } + translate <0, 0, 10> +} + +/* pcb 0 <0, 0.75, 0.25> */ +/* bottom -10 <0, 0.5, 0.5> */ +/* battery -20 <0, 0.25, 0.75> */ + +object { + Part_batcvr + pigment { rgb <0, 0, 1> } + finish { Finish } + rotate <180, 0, 0> + translate <0, 0, -30> +}