Updating documentation and examples with new core namespaces
[shapes.git] / examples / doc / bondgraph-bonds.shape
blobd94aa973235638934d81ad07b531ffb51ce732a2
1 /** This file is part of Shapes.
2  **
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
6  ** any later version.
7  **
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.
12  **
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/>.
15  **
16  ** Copyright 2008, 2010, 2014 Henrik Tidefelt
17  **/
19 ##needs ..Applications..Blockdraw
21 ##lookin ..Shapes
22 ##lookin ..Applications..Blockdraw
24 ##unit dx = 8cm
25 ##unit dy = 3.5cm
26 dc: (2.5cm,0)
28 centermark: @stroking:[gray 0.7] | [Graphics..stroke (~1cm,0cm)--(1cm,0cm) & (0cm,~1cm)--(0cm,1cm) ]
30 helper: \ pos dc fun lbl →
31 [[shift pos]
33   j1: sjunction
34   j2: [shift dc] [] pjunction
35   p: [bgconnect j1 j2]
36   centermark & [[shift dc] centermark]
37   & j1 & j2
38   & [fun p]
39   & [[shift 0.5*dc + (0,~1.2cm)] [Layout..shiftoff_wlm lbl Layout..to_bot]]
42 IO..•page << [helper (1dx,3dy) dc [Graphics..stroke head:Graphics..ShapesArrow ...] [Graphics..TeX `\texttt{head:Graphics..ShapesArrow}´]]
44 IO..•page << [helper (1dx,2dy) dc [Graphics..stroke head:[bondgraphArrow doHook:true ...] ...] [Graphics..TeX `\texttt{head:[bondgraphArrow doHook:true ...]}´]]
45 IO..•page << [helper (2dx,2dy) dc [Graphics..stroke head:[bondgraphArrow doCausal:true ...] ...] [Graphics..TeX `\texttt{head:[bondgraphArrow doCausal:true ...]}´]]
47 IO..•page << [helper (1dx,1dy) dc ubond [Graphics..TeX `\texttt{ubond}´]]
48 IO..•page << [helper (2dx,1dy) dc hbond [Graphics..TeX `\texttt{hbond}´]]
49 IO..•page << [helper (3dx,1dy) dc tbond [Graphics..TeX `\texttt{tbond}´]]