From 0e28a0a7d5a746092746623e622f3854af7f1c30 Mon Sep 17 00:00:00 2001 From: daniel watson Date: Thu, 5 May 2016 14:19:49 -0700 Subject: [PATCH] add up to square 2 --- curriculum/makefile | 18 +++++++++++++++++- curriculum/square.scm | 35 ++++++++++++++++++++++++++++++++--- 2 files changed, 49 insertions(+), 4 deletions(-) diff --git a/curriculum/makefile b/curriculum/makefile index af9ec43..3fc8796 100644 --- a/curriculum/makefile +++ b/curriculum/makefile @@ -6,7 +6,23 @@ square.png: square.scad makefile --imgsize=931,634 \ square.scad -square.html: square.scm square.png makefile +square1.png: square1.scad makefile + @openscad \ + --render \ + -o square1.png \ + --camera=0.80,0.88,0.01,0,0,0,9.05 \ + --imgsize=931,634 \ + square1.scad + +square2.png: square2.scad makefile + @openscad \ + --render \ + -o square2.png \ + --camera=0.80,0.88,0.01,0,0,0,9.05 \ + --imgsize=931,634 \ + square2.scad + +square.html: square.scm square.png square1.png square2.png makefile @skribilo square.scm > square.html clean: diff --git a/curriculum/square.scm b/curriculum/square.scm index 04bb47b..a8fa36d 100644 --- a/curriculum/square.scm +++ b/curriculum/square.scm @@ -1,3 +1,32 @@ -(document :title [square] - (chapter :title [square()\;] - (image :file "square.png" :height 400))) +(use-modules (skribilo source c)) + +(document + :title [square] + (chapter + :title (source :language c [square()\;]) + (p [here's the output of ,(prog (source :language c [square()\;]))]) + (figure + :legend "square();" + (image :file "square.png" :height 500)) + (p [openscad draws a square for the code + ,(source :language c [square()\;]).]) + (p [there are a couple other things worth noting here. + square is followed by an open and close parenthesis + ,(source :language c [()]), and then by a semicolon + ,(source :language c [\;])])) + (chapter + :title [square(1)\;] + (p [here's the output of ,(source :language c [square(1)\;])]) + (figure + :legend "square(1);" + (image :file "square1.png" :height 500)) + (p [note that it's identical to the + ,(source :language c [square()\;]) output. this is because + by default, openscad guesses a value of 1 whenever a value + is left unspecified.])) + (chapter + :title [square(2)\;] + (p [here's the output of ,(source :language c [square(2)\;])]) + (figure + :legend "square(2);" + (image :file "square2.png" :height 500)))) -- 2.30.2