# cPy - demonstrates the usage of drawsvg for a polygon and polyline
# Provided by Anthony Vogelaar, Perth Scotland
# rev 0.10  2024-09-17  initial release

# https://pypi.org/project/drawsvg/

import  os;     os.system('clear')
import  drawsvg as  draw

def main():
    d = draw.Drawing(200, 200)
    polygon  = draw.Lines(10,10, 50,10, 10,90, 50,90, stroke="blue",  stroke_width=4, fill="lime", close=True)
    polyline = draw.Lines(60,10, 90,10, 90,90, 60,90, stroke="black", stroke_width=4, fill="yellow")
    d.append(polygon)
    d.append(polyline)
    d.save_svg('test.svg')
    os.system('./svg_viewer.py test.svg')


main()
