1 /** This file is part of Shapes.
3 ** Shapes is free software: you can redistribute it and/or modify
4 ** it under the terms of the GNU General Public License as published by
5 ** the Free Software Foundation, either version 3 of the License, or
8 ** Shapes is distributed in the hope that it will be useful,
9 ** but WITHOUT ANY WARRANTY; without even the implied warranty of
10 ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 ** GNU General Public License for more details.
13 ** You should have received a copy of the GNU General Public License
14 ** along with Shapes. If not, see <http://www.gnu.org/licenses/>.
16 ** Copyright 2008, 2010 Henrik Tidefelt
19 rot: [rotate3D (1,1,1) 30°]
21 screwSeg: (~1cm,1cm,~1cm)<(~1cm,0cm,~1cm)>(~1cm,~1cm,~1cm)--(1cm,~1cm,~2cm)<(1cm,0cm,~2cm)>(1cm,1cm,~2cm)
22 deeper: \ n → [shift (0cm,0cm,n*~2cm)]
23 screw: [scale3D 1.5] [] (1cm,~1cm,0cm)<(1cm,0cm,0cm)>(1cm,1cm,0cm)--screwSeg--[[deeper 1] screwSeg]--[[deeper 2] screwSeg]--cycle
27 •world << @width:0.3bp & @stroking:[gray 0.5] | [stroke screw]
32 paintLeg: \ pth → ( [stroke pth] & ( @nonstroking:RGB_BLACK | [fill [shift pth.end.p][][immerse [circle 1.5bp]]] ) )
35 [[range '0 markCount-'1].foldl
38 sl: [screw (markStart + i*(1/markCount))*[abs screw]]
42 << @stroking:RGB_RED | [paintLeg sl.p--(+(len*sl.T))]
43 << @stroking:RGB_GREEN | [paintLeg sl.p--(+(len*sl.N))]
44 << @stroking:RGB_BLUE | [paintLeg sl.p--(+([if i = '0 ~1 1]*len*sl.B))]
45 << [shift sl.p+(~2mm,3mm,0mm)] [] [facing [center_x [TeX [sprintf `\textbf{%d}´ i+'1]]]] )
49 •world << [shift (~1.5cm,~1.5cm,0cm)] [] [facing [center_x [TeX `Odd one out!´]]]
56 world: [scale3D 0.4]*[rotate3D (1,1,1) 30°] [] ../world
57 •page << world >> [shift (0.5*eyew,0cm,lift)] >> view >> [shift (~0.5*eyew,0cm)]
58 •page << world >> [shift (~0.5*eyew,0cm,lift)] >> view >> [shift (0.5*eyew,0cm)]