diff --git a/.idea/workspace.xml b/.idea/workspace.xml
index fa54004..016c372 100644
--- a/.idea/workspace.xml
+++ b/.idea/workspace.xml
@@ -2,7 +2,11 @@
+
+
+
+
@@ -15,8 +19,8 @@
-
-
+
+
@@ -24,37 +28,37 @@
-
+
-
+
-
+
-
+
-
+
-
+
-
+
@@ -64,8 +68,8 @@
-
-
+
+
@@ -73,16 +77,16 @@
-
+
-
-
+
+
-
-
-
+
+
+
@@ -91,15 +95,15 @@
-
-
+
+
-
-
-
-
-
+
+
+
+
+
@@ -108,7 +112,7 @@
-
+
@@ -129,26 +133,22 @@
-
+
-
-
+
+
-
-
+
-
-
+
+
-
-
-
-
-
+
+
@@ -164,9 +164,6 @@
- getClosest
- image
- fe
width
label
FF
@@ -182,7 +179,6 @@
getCoordinate
PECColors
short
- long
PEC
TYPE_LONG
encode
@@ -190,10 +186,14 @@
maxStitchDistance
prepend
createSubshapeLineGroups
- inver
- print
- closest
subshapeLineGroups
+ closest
+ print
+ long
+ svg
+ inver
+ ColorChange
+ indexInColorList
@@ -212,10 +212,10 @@
-
-
+
+
@@ -238,7 +238,6 @@
-
@@ -274,6 +273,7 @@
+
@@ -301,7 +301,7 @@
-
+
@@ -382,7 +382,7 @@
-
+
@@ -444,7 +444,7 @@
-
+
@@ -574,13 +574,6 @@
-
-
-
-
-
-
-
@@ -619,18 +612,14 @@
-
-
-
-
-
-
+
+
-
+
@@ -649,53 +638,60 @@
-
+
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/PECRender/main.py b/PECRender/main.py
index 5272bd4..116a89f 100644
--- a/PECRender/main.py
+++ b/PECRender/main.py
@@ -14,7 +14,7 @@ pyglet.gl.glClearColor(0.4,0.4,0.4,1)
#filepath = "/Users/imaustyn/Documents/MiamiUniversity/ECE 487/Project/Understanding2/tux.pes"
#filepath = "/Users/imaustyn/Downloads/Circle embroidery designs/Circle.pes"
-filepath = "/Users/imaustyn/Documents/MiamiUniversity/ECE 487/Project/PES-Embroidery/TestOutput/simple.PES"
+filepath = "/Users/imaustyn/Documents/MiamiUniversity/ECE 487/Project/PES-Embroidery/TestOutput/ugliestApple.PES"
#filepath = "/Users/imaustyn/Documents/MiamiUniversity/ECE 487/Project/PES-Embroidery/TestOutput/simpleTry.PES"
# Global variables
diff --git a/TestOutput/simple.pes b/TestOutput/simple.pes
new file mode 100644
index 0000000..63504b0
Binary files /dev/null and b/TestOutput/simple.pes differ
diff --git a/TestOutput/ugliestApple.pes b/TestOutput/ugliestApple.pes
new file mode 100644
index 0000000..982ba20
Binary files /dev/null and b/TestOutput/ugliestApple.pes differ
diff --git a/Tests/debugPicture.png b/Tests/debugPicture.png
index 773069f..f9cb949 100644
Binary files a/Tests/debugPicture.png and b/Tests/debugPicture.png differ
diff --git a/Tests/test1.svg b/Tests/test1.svg
new file mode 100644
index 0000000..3da623b
--- /dev/null
+++ b/Tests/test1.svg
@@ -0,0 +1,3 @@
+
+
+
\ No newline at end of file
diff --git a/Tests/curves.svg b/Tests/ugliestApple.svg
similarity index 50%
rename from Tests/curves.svg
rename to Tests/ugliestApple.svg
index 7d4c222..6e860b9 100644
--- a/Tests/curves.svg
+++ b/Tests/ugliestApple.svg
@@ -26,7 +26,7 @@
inkscape:pageopacity="0.0"
inkscape:pageshadow="2"
inkscape:zoom="1.7348765"
- inkscape:cx="364.28571"
+ inkscape:cx="280.70627"
inkscape:cy="542.85714"
inkscape:document-units="px"
inkscape:current-layer="layer1"
@@ -44,7 +44,7 @@
image/svg+xml
-
+
@@ -53,9 +53,24 @@
inkscape:groupmode="layer"
id="layer1">
+
+
+
diff --git a/src/PES.py b/src/PES.py
index 49b0c9a..c4bbc7f 100644
--- a/src/PES.py
+++ b/src/PES.py
@@ -402,4 +402,4 @@ class ColorChange:
def encode(self, b):
b.extend([ ColorChange.TYPE_COLOR_CHANGE_left ])
b.extend([ ColorChange.TYPE_COLOR_CHANGE_right ])
- b.extend([ self.indexInColorList & 0xFF ])
\ No newline at end of file
+ b.extend([ (self.indexInColorList-1) & 0xFF ])
\ No newline at end of file
diff --git a/src/PES.pyc b/src/PES.pyc
index 299d620..1170d0a 100644
Binary files a/src/PES.pyc and b/src/PES.pyc differ
diff --git a/src/main.py b/src/main.py
index 4368c44..e172a39 100644
--- a/src/main.py
+++ b/src/main.py
@@ -26,7 +26,7 @@ paths, attributes = svg
if paths is None:
sys.exit(0)
-threadWidth = 3
+threadWidth = 2.5
maxStitchDistance = 10.0
# Enumerate the shapes in the SVG to find where stitches should go.
diff --git a/src/svgFunctions.py b/src/svgFunctions.py
index a174ef6..33c03a1 100644
--- a/src/svgFunctions.py
+++ b/src/svgFunctions.py
@@ -70,8 +70,9 @@ def loadVectorGraphic(filename):
attributes = None
try:
svg, attributes = svgpathtools.svg2paths(filename)
- except:
+ except Exception as e:
print("Couldn't load SVG file. Perhaps it doesn't exist?")
+ print(e.message)
return svg, attributes
diff --git a/src/svgFunctions.pyc b/src/svgFunctions.pyc
index 51ea620..0d17763 100644
Binary files a/src/svgFunctions.pyc and b/src/svgFunctions.pyc differ