Update suitable examples and tests to use blank mode
[shapes.git] / examples / doc / blockdraw-tutorial-conpoint.shape
blob9b17ed5e53b53c050413e3a1c0d85fa0c55ce0a8
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 /**
25  ** This block just serve as something to select connection point on.
26  ** A connection point is a point on the boundary of the object where connection paths should attach.
27  **/
28 F: [putblockOrigin IO..•page [longblock [Graphics..TeX `$F_{\mathrm{y}}(s)$´]]]
30 /**
31  ** In the first two examples, the connection point is bound to a variable called "z" before we use it,
32  ** just to make clear what is the important part of this example; how this point is indicated in the
33  ** figure is non-standard in this example as we usually would connect the point with a point on another block.
34  **/
36   z: [leftpoint F 2 2]
37   IO..•page << [@connectpainter [Geometry..reverse z--(+(~1cm,0))]]
40   z: [rightpoint F 2 1]
41   IO..•page << [@connectpainter z--(+(1cm,0))]
44 /**
45  ** The number of points on a side defaults to 1, as does the index of the point on that side.
46  **/
47 IO..•page << [@connectpainter [Geometry..reverse [bottompoint F]--(+(0,~1cm))]]
49 /**
50  ** OK, we've seen the pattern now, binding the connection point to a variable before using it seems unncessary.
51  **/
52 IO..•page << [@connectpainter [toppoint F 3 1]--(+(0,5mm))]
53       << [@connectpainter [toppoint F 3 2]--(+(0,7mm))]
54       << [@connectpainter [toppoint F 3 3]--(+(0,9mm))]