.. page-title: Box example: yin-yang.box yin-yang.box ============ Yin-yang -------- .. figure:: yin-yang.png :align: center You can round the borders of a polygons to the point that they become arcs of circles or ellipses. To run this example you will need the following file(s): `./yin-yang.box <./yin-yang.box>`__. If the example requires more than one file, then you should put them into the same directory. You can then launch Box with ``box -l g ./yin-yang.box``. .. raw:: html
   // Under a shell type: box -l g yin-yang.box
   // ---
   // Here we show how Poly can be used to trace curves
   
   include "g"
   w = Window[][
     b = 0.4  // border
     r = 10.0 // radius
     rr = 2*r, rs = 0.25*r
     \ .Circle[Style[.Border[b]], color.white, (0, 0), rr]
     \ .Poly[color.black, 1, (0, rr), (r, rr), (r, r), (r, 0), (0, 0), (-r, 0),
             (-r, -r), (-r, -rr), (0, -rr), (rr, -rr), (rr, 0), (rr, rr)]
     \ .Circle[Style[.Fill[";"]], rs, (0, r); color.white, rs, (0, -r)]
     .Save["yin-yang.png"]
     .Save["yin-yang.eps"]
   ]