diff --git a/.idea/workspace.xml b/.idea/workspace.xml index df1c3ce..3ed0555 100644 --- a/.idea/workspace.xml +++ b/.idea/workspace.xml @@ -2,8 +2,7 @@ - - + + + + DIFF + color + Big: + starting + + @@ -470,14 +478,15 @@ - - + + - - - - + + + + + diff --git a/PECRender/main.py b/PECRender/main.py index 376f3e5..52021f7 100644 --- a/PECRender/main.py +++ b/PECRender/main.py @@ -15,25 +15,80 @@ filepath = "/Users/imaustyn/Documents/MiamiUniversity/ECE 487/Project/Understand class Global: pauseEmbroidery = False batch = pyglet.graphics.Batch() - x1 = 0 - y1 = 0 - x2 = 0 - y2 = 0 + x = 0 + y = 0 file = None + scale = 1.0 @classmethod def addLine(cls, x1, y1, x2, y2, r, g, b): cls.batch.add(2, pyglet.gl.GL_LINES, None, - ('v2i', (x1, y1, x2, y2)), + ('v2f', (x1 / cls.scale, y1 / cls.scale, x2 / cls.scale, y2 / cls.scale)), ('c3B', (r,g,b, r,g,b)) ) + print("Stitch from ({}, {}) to ({}, {})".format(x1, y1, x2, y2) ) + cls.x = x2 + cls.y = y2 @classmethod def readPECHeader(cls): if cls.file is None: return - + f = cls.file # type: file + print(f.read(8)) + PECOffset = struct.unpack(" 0: + + if single == 0xFF: + print("End stitches") + break + + while True: + x = getCoordinate() + y = getCoordinate() + + cls.addLine(Global.x, Global.y, Global.x + x, Global.y + y, int(random.uniform(0,255)), int(random.uniform(0,255)), int(random.uniform(0,255))) + + + + + +