COMPOUND ​
Combines one or several line drawing commands to form a shape.
Syntax ​
COMPOUND intValue .
Parameters ​
<main-parameter>
(intValue) - The amount of following line drawing commands that are combined into a shape.
Details ​
The style of this command is defined by the PEN
command for the outline and the FILL
command to fill the shape.
A compound can combine LINE
, POLYLINE
and CURVE
commands to form a shape.
It is especially useful combined with the CURVE
command, as otherwise a POLYGON
would produce the same result. The number following the keyword COMPOUND
indicates how many of the following elements belong to the compound. The compound's outline results from the elements, where the end point of each element is connected to the start point of the following element, unless the two points are congruent. The last end point is connected to the first start point in such a way that the result is always a closed figure. Please note that the drawing direction of the single elements is important.
See Also ​
Examples ​
Draw a yellow document symbol.
GRAPHREP
# Note: SHADOW is on by default.
FILL color:"lemonchiffon"
COMPOUND 2
LINE x1:1cm y1:-.7cm x2:-1cm y2:-.7cm
CURVE "t" f:(t) g:(-0.2 * sin(3.14 * (t+1)) + 0.7) from:-1 to:1
Draw a violet rectangle with inwards rounded corners.
GRAPHREP
SHADOW off
FILL color:"plum"
COMPOUND 4
CURVE "t" fx:(0.8-0.3 * sin(t)) fy:(0.8-0.3 * cos(t)) from:0 to:1.57
CURVE "t" fx:(-0.8-0.3 * sin(t)) fy:(0.8-0.3 * cos(t)) from:4.71 to:6.28
CURVE "t" fx:(-0.8-0.3 * sin(t)) fy:(-0.8-0.3 * cos(t)) from:3.14 to:4.71
CURVE "t" fx:(0.8-0.3 * sin(t)) fy:(-0.8-0.3 * cos(t)) from:1.57 to:3.14
Draw a yellow star shaped symbol based on a curve.
GRAPHREP
SHADOW off
PEN color:"gold"
FILL color:"yellow"
COMPOUND 1
CURVE "t" fx:(sin(t) + 0.1 * sin(8*t)) fy:(cos(t) - 0.1 * cos(8*t)) from:0 to:6.28
Versions and Changes ​
Available since ADOxx 1.3