8 c
.stroke(path(moveto(10,20),
9 curveto(12,16,14,15,12,19),
10 rcurveto(-3,2,3,3,-2,4)),
11 [deco
.barrow
.small
, deco
.earrow
.normal
,
13 deco
.arrow(pos
=0.7, reversed=1)])
15 c
.stroke(path(arc(8,15,4,10,70)), [deco
.barrow
.small
, deco
.earrow
.normal
])
16 c
.stroke(path(arc(8,15,3,10,70)), [deco
.barrow
.small
, deco
.earrow
.normal
])
17 c
.stroke(path(arc(8,15,2,10,70)), [deco
.barrow
.small
, deco
.earrow
.normal
])
18 c
.stroke(path(arc(8,15,1,10,70)), [deco
.barrow
.small
, deco
.earrow
.normal
])
19 c
.stroke(path(arc(8,15,0.5,10,70)), [deco
.barrow
.small
, deco
.earrow
.normal
])
23 pal
= color
.lineargradient_rgb(color
.rgb
.red
, color
.rgb
.blue
)
25 c
.stroke(path(moveto(5,10), rlineto(5,0)),
26 [#deco.barrow(size=base/math.sqrt(8)*unit.t_pt, constriction=1),
28 deco
.colorgradient(pal
),
29 deco
.text("start", arclenfrombegin
=0, angle
=90)])
30 c
.stroke(path(moveto(5,10.5), rlineto(5,0)),
31 [deco
.barrow(size
=base
/math
.sqrt(4)*unit
.t_pt
, constriction
=1),
33 deco
.colorgradient(pal
),
34 deco
.text("start+1", arclenfrombegin
=1, angle
=90)])
35 c
.stroke(path(moveto(5,11), rlineto(5,0)),
36 [deco
.barrow(size
=base
/math
.sqrt(2)*unit
.t_pt
, constriction
=1),
38 deco
.colorgradient(pal
),
39 deco
.text("center", angle
=90)])
40 c
.stroke(path(moveto(5,11.5), rlineto(5,0)),
41 [deco
.barrow(size
=base
/math
.sqrt(1)*unit
.t_pt
, constriction
=1),
43 deco
.colorgradient(pal
),
44 deco
.text("end-1", arclenfromend
=1, angle
=90)])
45 c
.stroke(path(moveto(5,12), rlineto(5,0)),
46 [deco
.barrow(size
=base
*math
.sqrt(2)*unit
.t_pt
, constriction
=1),
48 deco
.text("end", arclenfromend
=0, angle
=90)])
49 c
.stroke(path(moveto(5,12.5), rlineto(5,0)),
50 [deco
.barrow(size
=base
*math
.sqrt(4)*unit
.t_pt
, constriction
=1),
52 c
.stroke(path(moveto(5,13), rlineto(5,0)),
53 [deco
.barrow(size
=base
*math
.sqrt(8)*unit
.t_pt
, constriction
=1),
55 c
.stroke(path(moveto(5,13.5), rlineto(5,0)),
56 [deco
.barrow(size
=base
*math
.sqrt(16)*unit
.t_pt
, constriction
=1),
59 lt
= style
.linewidth
.THick
61 c
.stroke(path(moveto(11,10), rlineto(5,0)),
63 deco
.barrow(size
=base
/math
.sqrt(8)*unit
.t_pt
, constriction
=1),
65 deco
.colorgradient(pal
, [style
.linewidth
.THIN
])])
66 c
.stroke(path(moveto(11,10.5), rlineto(5,0)),
68 deco
.barrow(size
=base
/math
.sqrt(4)*unit
.t_pt
, constriction
=1),
70 c
.stroke(path(moveto(11,11), rlineto(5,0)),
72 deco
.barrow(size
=base
/math
.sqrt(2)*unit
.t_pt
, constriction
=1),
74 c
.stroke(path(moveto(11,11.5), rlineto(5,0)),
76 deco
.barrow(size
=base
/math
.sqrt(1)*unit
.t_pt
, constriction
=1),
78 c
.stroke(path(moveto(11,12), rlineto(5,0)),
80 deco
.barrow(size
=base
*math
.sqrt(2)*unit
.t_pt
, constriction
=1),
82 c
.stroke(path(moveto(11,12.5), rlineto(5,0)),
84 deco
.barrow(size
=base
*math
.sqrt(4)*unit
.t_pt
, constriction
=1),
85 deco
.earrow
.Large(attrs
=[deco
.stroked([style
.linestyle
.dashed
]), deco
.filled
.clear
])])
86 c
.stroke(path(moveto(11,13), rlineto(5,0)),
88 deco
.barrow(size
=base
*math
.sqrt(8)*unit
.t_pt
, constriction
=1),
89 deco
.earrow
.LArge(attrs
=[style
.linestyle
.dashed
, color
.rgb
.green
])])
90 c
.stroke(path(moveto(11,13.5), rlineto(5,0)),
92 deco
.barrow(size
=base
*math
.sqrt(16)*unit
.t_pt
, constriction
=1),
93 deco
.earrow
.LARge(attrs
=[color
.rgb
.red
,
94 deco
.stroked([style
.linejoin
.round]),
95 deco
.filled([color
.rgb
.blue
])])])
98 p
= rect(0, 0, 5, 0.5).transformed(trafo
.rotate(60))
99 c
.draw(p
, [deco
.linehatched45
.normal
])
100 c
.fill(p
, [trafo
.translate(2,0), deco
.linehatched(0.1, 60, cross
=1)]) # should not be filled, but hatched
101 c
.stroke(p
, [trafo
.translate(4,0), deco
.linehatched90
.normal
])
102 c
.draw(p
, [trafo
.translate(6,0), deco
.linehatched(0.1, 30, strokestyles
=[color
.rgb
.red
, style
.linewidth
.normal
], cross
=1)])
105 p
= line(0, 0, 5, 0).transformed(trafo
.rotate(60))
106 c
.stroke(p
, [deco
.brace(dist
=-0.1, stretch
=1.1), deco
.text(r
"hallo", textdist
=20*unit
.x_pt
, relangle
=-90), trafo
.translate(8,0)])
108 tr
= trafo
.translate(12, 0)
109 c
.draw(line(0,0,0,4), [deco
.leftbrace
, tr
])
110 c
.draw(line(4,0,4,4), [deco
.rightbrace
, tr
])
111 c
.draw(line(0,0,4,0), [deco
.belowbrace
, tr
])
112 c
.stroke(line(0,4,4,4), [deco
.abovebrace
, tr
, style
.linewidth
.THin
])
114 tr
= trafo
.translate(12.5, 0.5)
115 c
.stroke(line(0,0,3,0), [deco
.straightbrace
, tr
, color
.rgb
.red
])
116 c
.draw(line(3,0,3,3), [deco
.straightbrace(fillattrs
=[color
.rgb
.blue
]), tr
])
117 c
.draw(line(3,3,0,3), [deco
.straightbrace
, tr
])
118 c
.draw(line(0,3,0,0), [deco
.straightbrace
, tr
])
124 c
.writeEPSfile("test_arrow", page_paperformat
=document
.paperformat
.A4
, page_rotated
=0, page_fittosize
=1)
125 c
.writePDFfile("test_arrow", page_paperformat
=document
.paperformat
.A4
)
126 c
.writeSVGfile("test_arrow", page_paperformat
=document
.paperformat
.A4
)