Difference between revisions of "Asymptote: Filling"
m |
|||
(One intermediate revision by the same user not shown) | |||
Line 1: | Line 1: | ||
+ | {{asymptote}} | ||
+ | |||
As explained in [[Asymptote: Drawing]], you can create closed objects such as: | As explained in [[Asymptote: Drawing]], you can create closed objects such as: | ||
Line 7: | Line 9: | ||
</asy> | </asy> | ||
− | Now introducing the | + | Now introducing the '''fill()''' command. You would fill this triangle with green by the following: |
<tt>fill(origin--(5,0)--(3,4)--cycle, green);</tt> | <tt>fill(origin--(5,0)--(3,4)--cycle, green);</tt> |
Latest revision as of 20:32, 3 January 2010
As explained in Asymptote: Drawing, you can create closed objects such as:
draw(origin--(5,0)--(3,4)--cycle);
Now introducing the fill() command. You would fill this triangle with green by the following:
fill(origin--(5,0)--(3,4)--cycle, green);
Note how there is no outline. To create an outline and fill, without making two different statements, use the filldraw() command. Like the order of filldraw, you put the color of the fill before the draw.
filldraw(origin--(5,0)--(3,4)--cycle, green, red+linewidth(1));