Difference between revisions of "Asymptote: How to"

(Drawing)
(Filling)
Line 1: Line 1:
 
{{Asymptote}}
 
{{Asymptote}}
=Filling=
+
=Asymptote how to pages=
As explained above, you can create closed objects such as:
+
[[Asymptote: Drawing|Drawing]]
  
<tt>draw(origin--(5,0)--(3,4)--cycle);</tt>
+
[[Asymptote: Filling|Filling]]
 
 
<asy>
 
draw(origin--(5,0)--(3,4)--cycle);
 
</asy>
 
 
 
Now introducing the [b]fill()[/b] command. You would fill this triangle with green by the following:
 
 
 
<tt>fill(origin--(5,0)--(3,4)--cycle, green);</tt>
 
 
 
<asy>
 
fill(origin--(5,0)--(3,4)--cycle, green);
 
</asy>
 
 
 
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.
 
 
 
<tt>filldraw(origin--(5,0)--(3,4)--cycle, green, red+linewidth(1));</tt>
 
 
 
<asy>
 
filldraw(origin--(5,0)--(3,4)--cycle, green, red+linewidth(1));
 
</asy>
 

Revision as of 18:01, 16 July 2009