#formes diverses

# %x0,%y0 left low corner
# %x1 %y1 right hight corner
define rect [ %x0 %y0 %x1 %y1 ] {
     Move  %x0 %y0
     Line  %x1 %y0
     Line  %x1 %y1
     Line  %x0 %y1
     Close
}

# %x0,%y0 left low corner
# %h, %w  hight, width
define rect_hw [ %x0 %y0 %w %h ] {
     Move ( ( %x0 %y0 ) )
     Line ( ( %x0   %y0 + %h ) )
     Line ( ( %x0 + %w  %y0 + %h  ) )
     Line ( ( %x0 + %w   %y0  ) )
     Close
}

# %x0,%y0 is centre
# %r      is radius
# MkDrawf knows $pi

define circle_elems [ %x %y %r ] {
  move ( ( %x + %r %y ) )
  arc %x %y $pi/2
  arc %x %y $pi/2
  arc %x %y $pi/2
  arc %x %y $pi/2
  close
}

# test
#path {
#  width 1
#  rect [ 100 100 400 500 ]
#}

#path {
#  width 1
#  rect_hw [ 200 200 100 150 ]
#}


#path {
#  width 1
#  circle_elems [ 250 250 50 ]
#}