1# Box objects
2
3A box is a rectangle with a specified width and height.  The default
4width and height are the values of the "`boxwid`" and "`boxht`" variables.
5
6~~~~ pikchr indent
7A: box thick
8line thin color gray left 70% from 2mm left of A.nw
9line same from 2mm left of A.sw
10text "height" at (7/8<previous.start,previous.end>,1/2<1st line,2ndline>)
11line thin color gray from previous text.n up until even with 1st line ->
12line thin color gray from previous text.s down until even with 2nd line ->
13X1: line thin color gray down 50% from 2mm below A.sw
14X2: line thin color gray down 50% from 2mm below A.se
15text "width" at (1/2<X1,X2>,6/8<X1.start,X1.end>)
16line thin color gray from previous text.w left until even with X1 ->
17line thin color gray from previous text.e right until even with X2 ->
18~~~~
19
20If a "`radius`" is specified, then the corners of the box are rounded using
21arcs of the given radius.  The default radius for each new box is the value
22of the "`boxrad`" variable which is initially 0.0.
23
24~~~~ pikchr indent
25A: box thick rad 0.3*boxht
26line thin color gray left 70% from 2mm left of (A.w,A.n)
27line same from 2mm left of (A.w,A.s)
28text "height" at (7/8<previous.start,previous.end>,1/2<1st line,2ndline>)
29line thin color gray from previous text.n up until even with 1st line ->
30line thin color gray from previous text.s down until even with 2nd line ->
31X1: line thin color gray down 50% from 2mm below (A.w,A.s)
32X2: line thin color gray down 50% from 2mm below (A.e,A.s)
33text "width" at (1/2<X1,X2>,6/8<X1.start,X1.end>)
34line thin color gray from previous text.w left until even with X1 ->
35line thin color gray from previous text.e right until even with X2 ->
36X3: line thin color gray right 70% from 2mm right of (A.e,A.s)
37X4: line thin color gray right 70% from A.rad above start of X3
38text "radius" at (6/8<X4.start,X4.end>,1/2<X3,X4>)
39line thin color gray from (previous,X3) down 30% <-
40line thin color gray from (previous text,X4) up 30% <-
41~~~~
42
43## Boundary points:
44
45~~~~ pikchr indent
46A: box thin
47dot ".c" above at A
48dot ".n" above at A.n
49dot " .ne" ljust above at A.ne
50dot " .e" ljust at A.e
51dot " .se" ljust below at A.se
52dot ".s" below at A.s
53dot ".sw " rjust below at A.sw
54dot ".w " rjust at A.w
55dot ".nw " rjust above at A.nw
56
57A: box thin at 2.0*boxwid right of previous box rad 15px
58dot ".c" above at A
59dot ".n" above at A.n
60dot " .ne" ljust above at A.ne
61dot " .e" ljust at A.e
62dot " .se" ljust below at A.se
63dot ".s" below at A.s
64dot ".sw " rjust below at A.sw
65dot ".w " rjust at A.w
66dot ".nw " rjust above at A.nw
67~~~~
68