#! /usr/bin/python3 # =================================================================== # draw a polygon (window coordinates) # =================================================================== import transformation_matrix as tm import coordinate_conversion as cc import user_interface as ui from graphics import * import numpy as np import os, sys win_width = 801 win_height = 801 # ---- polygon point array/list (window coordinates) win_points = [ Point(200,100), Point(500,200), Point(500,400), Point(600,600), Point(300,500) ] # ---- draw polygon win = GraphWin("Demo Polygon (Window Coordinates)", win_width, win_height) win.setBackground("white") p = Polygon(win_points) p.setWidth(1) ##p.setOutline('black') p.setOutline('red') p.setFill('red') p.draw(win) # ---- wait to continue ui.pause() win.close() print()