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. 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.

// 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
  BBox[bb = rr + 1, (-bb, -bb), (bb, bb)]
  Circle[Style[Border[color.black, 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[color.black, rs, (0, r)]
  Circle[color.white, rs, (0, -r)]

w.Save["yin-yang.png", Window["rgb24", .Res[Dpi[100]]]]

Table Of Contents

This Page

Get The figure description language: Box at SourceForge.net. Fast, secure and Free Open Source software downloads