Output directly working on machine!

It turns out everything was being cut off by the bounds. I temporarily set the width and height to absurd values to make sure it works. I'll have a proper fix in the next commit.
pull/4/head
Reenforcements 2018-12-04 16:53:49 -05:00
rodzic 7647a197ea
commit b298351214
17 zmienionych plików z 335 dodań i 212 usunięć

Wyświetl plik

@ -5,7 +5,11 @@
<change beforePath="$PROJECT_DIR$/.idea/workspace.xml" beforeDir="false" afterPath="$PROJECT_DIR$/.idea/workspace.xml" afterDir="false" />
<change beforePath="$PROJECT_DIR$/LOG.md" beforeDir="false" afterPath="$PROJECT_DIR$/LOG.md" afterDir="false" />
<change beforePath="$PROJECT_DIR$/PECRender/main.py" beforeDir="false" afterPath="$PROJECT_DIR$/PECRender/main.py" afterDir="false" />
<change beforePath="$PROJECT_DIR$/TestOutput/simple.PES" beforeDir="false" afterPath="$PROJECT_DIR$/TestOutput/simple.PES" afterDir="false" />
<change beforePath="$PROJECT_DIR$/TestOutput/simple.PES" beforeDir="false" />
<change beforePath="$PROJECT_DIR$/TestOutput/simple2.PES" beforeDir="false" />
<change beforePath="$PROJECT_DIR$/TestOutput/simple3.PES" beforeDir="false" />
<change beforePath="$PROJECT_DIR$/TestOutput/simpleTry.PES" beforeDir="false" />
<change beforePath="$PROJECT_DIR$/TestOutput/two.PES" beforeDir="false" afterPath="$PROJECT_DIR$/TestOutput/two.PES" afterDir="false" />
<change beforePath="$PROJECT_DIR$/Tests/debugPicture.png" beforeDir="false" afterPath="$PROJECT_DIR$/Tests/debugPicture.png" afterDir="false" />
<change beforePath="$PROJECT_DIR$/src/PES.py" beforeDir="false" afterPath="$PROJECT_DIR$/src/PES.py" afterDir="false" />
<change beforePath="$PROJECT_DIR$/src/main.py" beforeDir="false" afterPath="$PROJECT_DIR$/src/main.py" afterDir="false" />
@ -18,9 +22,10 @@
<option name="LAST_RESOLUTION" value="IGNORE" />
</component>
<component name="CoverageDataManager">
<SUITE FILE_PATH="coverage/PES_Embroidery$PESDump.coverage" NAME="PESDump Coverage Results" MODIFIED="1543957085304" SOURCE_PROVIDER="com.intellij.coverage.DefaultCoverageFileProvider" RUNNER="coverage.py" COVERAGE_BY_TEST_ENABLED="true" COVERAGE_TRACING_ENABLED="false" WORKING_DIRECTORY="$PROJECT_DIR$/PESDump" />
<SUITE FILE_PATH="coverage/PES_Embroidery$svgImport.coverage" NAME="svgImport Coverage Results" MODIFIED="1541478220694" SOURCE_PROVIDER="com.intellij.coverage.DefaultCoverageFileProvider" RUNNER="coverage.py" COVERAGE_BY_TEST_ENABLED="true" COVERAGE_TRACING_ENABLED="false" WORKING_DIRECTORY="$PROJECT_DIR$/src/learning" />
<SUITE FILE_PATH="coverage/PES_Embroidery$main.coverage" NAME="main Coverage Results" MODIFIED="1543896611963" SOURCE_PROVIDER="com.intellij.coverage.DefaultCoverageFileProvider" RUNNER="coverage.py" COVERAGE_BY_TEST_ENABLED="true" COVERAGE_TRACING_ENABLED="false" WORKING_DIRECTORY="$PROJECT_DIR$/src" />
<SUITE FILE_PATH="coverage/PES_Embroidery$PECRender_main.coverage" NAME="PECRender-main Coverage Results" MODIFIED="1543896674134" SOURCE_PROVIDER="com.intellij.coverage.DefaultCoverageFileProvider" RUNNER="coverage.py" COVERAGE_BY_TEST_ENABLED="true" COVERAGE_TRACING_ENABLED="false" WORKING_DIRECTORY="$PROJECT_DIR$/PECRender" />
<SUITE FILE_PATH="coverage/PES_Embroidery$main.coverage" NAME="main Coverage Results" MODIFIED="1543959393649" SOURCE_PROVIDER="com.intellij.coverage.DefaultCoverageFileProvider" RUNNER="coverage.py" COVERAGE_BY_TEST_ENABLED="true" COVERAGE_TRACING_ENABLED="false" WORKING_DIRECTORY="$PROJECT_DIR$/src" />
<SUITE FILE_PATH="coverage/PES_Embroidery$PECRender_main.coverage" NAME="PECRender-main Coverage Results" MODIFIED="1543959347245" SOURCE_PROVIDER="com.intellij.coverage.DefaultCoverageFileProvider" RUNNER="coverage.py" COVERAGE_BY_TEST_ENABLED="true" COVERAGE_TRACING_ENABLED="false" WORKING_DIRECTORY="$PROJECT_DIR$/PECRender" />
<SUITE FILE_PATH="coverage/PES_Embroidery$getColors.coverage" NAME="getColors Coverage Results" MODIFIED="1542917684965" SOURCE_PROVIDER="com.intellij.coverage.DefaultCoverageFileProvider" RUNNER="coverage.py" COVERAGE_BY_TEST_ENABLED="true" COVERAGE_TRACING_ENABLED="false" WORKING_DIRECTORY="$PROJECT_DIR$/Colors" />
<SUITE FILE_PATH="coverage/PES_Embroidery$main__1_.coverage" NAME="PESDump Coverage Results" MODIFIED="1543893622615" SOURCE_PROVIDER="com.intellij.coverage.DefaultCoverageFileProvider" RUNNER="coverage.py" COVERAGE_BY_TEST_ENABLED="true" COVERAGE_TRACING_ENABLED="false" WORKING_DIRECTORY="$PROJECT_DIR$/PESDump" />
</component>
@ -40,36 +45,36 @@
<usages-collector id="statistics.vcs.git.usages" />
<usages-collector id="statistics.file.types.edit">
<counts>
<entry key="Python" value="40282" />
<entry key="Python" value="43372" />
</counts>
</usages-collector>
<usages-collector id="statistics.js.language.service.starts" />
<usages-collector id="statistics.file.types.open">
<counts>
<entry key="Python" value="41" />
<entry key="Python" value="46" />
<entry key="UML" value="1" />
</counts>
</usages-collector>
<usages-collector id="statistics.file.extensions.open">
<counts>
<entry key="JavaScript-modules-diagram//Users/imaustyn/Documents/MiamiUniversity/ECE 487/Project/PES-Embroidery" value="1" />
<entry key="py" value="41" />
<entry key="py" value="46" />
</counts>
</usages-collector>
<usages-collector id="statistics.file.extensions.edit">
<counts>
<entry key="py" value="40282" />
<entry key="py" value="43372" />
</counts>
</usages-collector>
</session>
</component>
<component name="FileEditorManager">
<leaf SIDE_TABS_SIZE_LIMIT_KEY="300">
<file pinned="false" current-in-tab="false">
<file pinned="false" current-in-tab="true">
<entry file="file://$PROJECT_DIR$/src/main.py">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="114">
<caret line="47" column="53" lean-forward="true" selection-start-line="47" selection-start-column="53" selection-end-line="47" selection-end-column="53" />
<state relative-caret-position="301">
<caret line="32" column="15" lean-forward="true" selection-start-line="32" selection-start-column="15" selection-end-line="32" selection-end-column="15" />
<folding>
<element signature="e#0#15#0" expanded="true" />
</folding>
@ -77,18 +82,54 @@
</provider>
</entry>
</file>
<file pinned="false" current-in-tab="false">
<entry file="file://$PROJECT_DIR$/src/svgFunctions.py">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="191">
<caret line="289" column="63" lean-forward="true" selection-start-line="289" selection-start-column="63" selection-end-line="289" selection-end-column="63" />
<folding>
<element signature="e#0#19#0" expanded="true" />
<marker date="1543959281244" expanded="true" signature="143:2224" ph="..." />
</folding>
</state>
</provider>
</entry>
</file>
<file pinned="false" current-in-tab="false">
<entry file="file://$PROJECT_DIR$/src/PES.py">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="1061">
<caret line="285" column="23" selection-start-line="285" selection-start-column="17" selection-end-line="285" selection-end-column="23" />
<state relative-caret-position="132">
<caret line="362" column="45" lean-forward="true" selection-start-line="362" selection-start-column="45" selection-end-line="362" selection-end-column="45" />
<folding>
<element signature="e#0#23#0" expanded="true" />
<marker date="1543895627790" expanded="true" signature="135:325" ph="..." />
<marker date="1543895627790" expanded="true" signature="273:325" ph="..." />
<marker date="1543895627790" expanded="true" signature="502:542" ph="..." />
<marker date="1543895627790" expanded="true" signature="3436:3442" ph="..." />
<marker date="1543895627790" expanded="true" signature="10880:10976" ph="..." />
<marker date="1543958892193" expanded="true" signature="149:339" ph="..." />
<marker date="1543958892193" expanded="true" signature="287:339" ph="..." />
<marker date="1543958892193" expanded="true" signature="516:556" ph="..." />
<marker date="1543958892193" expanded="true" signature="3450:3456" ph="..." />
<marker date="1543958892193" expanded="true" signature="11855:11951" ph="..." />
</folding>
</state>
</provider>
</entry>
</file>
<file pinned="false" current-in-tab="false">
<entry file="file://$PROJECT_DIR$/src/PES_Emb_mathutils.py">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="209">
<caret line="92" column="49" lean-forward="true" selection-start-line="92" selection-start-column="49" selection-end-line="92" selection-end-column="49" />
<folding>
<element signature="e#0#29#0" expanded="true" />
<marker date="1543625107768" expanded="true" signature="139:2608" ph="..." />
<marker date="1543625107768" expanded="true" signature="497:1537" ph="..." />
<marker date="1543625107768" expanded="true" signature="755:887" ph="..." />
<marker date="1543625107768" expanded="true" signature="1607:2401" ph="..." />
<marker date="1543625107768" expanded="true" signature="2659:2735" ph="..." />
<marker date="1543625107768" expanded="true" signature="2801:2806" ph="..." />
<marker date="1543625107768" expanded="true" signature="2801:4181" ph="..." />
<marker date="1543625107768" expanded="true" signature="3323:3324" ph="..." />
<marker date="1543625107768" expanded="true" signature="3730:3893" ph="..." />
<marker date="1543625107768" expanded="true" signature="3935:4054" ph="..." />
<marker date="1543625107768" expanded="true" signature="4091:4181" ph="..." />
</folding>
</state>
</provider>
@ -97,8 +138,8 @@
<file pinned="false" current-in-tab="false">
<entry file="file://$PROJECT_DIR$/PESDump/main.py">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="413">
<caret line="85" column="17" lean-forward="true" selection-start-line="85" selection-start-column="17" selection-end-line="85" selection-end-column="17" />
<state relative-caret-position="327">
<caret line="70" column="30" lean-forward="true" selection-start-line="70" selection-start-column="30" selection-end-line="70" selection-end-column="30" />
<folding>
<element signature="e#0#15#0" expanded="true" />
<marker date="1543888134994" expanded="true" signature="559:825" ph="..." />
@ -107,11 +148,11 @@
</provider>
</entry>
</file>
<file pinned="false" current-in-tab="true">
<file pinned="false" current-in-tab="false">
<entry file="file://$PROJECT_DIR$/PECRender/main.py">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="255">
<caret line="17" column="105" selection-start-line="17" selection-start-column="105" selection-end-line="17" selection-end-column="105" />
<state relative-caret-position="600">
<caret line="40" column="45" lean-forward="true" selection-start-line="40" selection-start-column="45" selection-end-line="40" selection-end-column="45" />
<folding>
<element signature="e#0#10#0" expanded="true" />
</folding>
@ -119,15 +160,6 @@
</provider>
</entry>
</file>
<file pinned="false" current-in-tab="false">
<entry file="file:///usr/local/lib/python2.7/site-packages/pyglet/event.py">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="192">
<caret line="356" selection-start-line="356" selection-end-line="356" />
</state>
</provider>
</entry>
</file>
</leaf>
</component>
<component name="FileTemplateManagerImpl">
@ -139,15 +171,6 @@
</component>
<component name="FindInProjectRecents">
<findStrings>
<find>Stitch</find>
<find>&lt;</find>
<find>Beep</find>
<find>0x9</find>
<find>size</find>
<find>color</find>
<find>starting at coordin</find>
<find>starting at coordinate</find>
<find>58</find>
<find>colors</find>
<find>Color change</find>
<find>colorIndex</find>
@ -165,10 +188,19 @@
<find>End st</find>
<find>End</find>
<find>starting stitches at location</find>
<find>createStitchRoutine</find>
<find>allStitches</find>
<find>maxDist</find>
<find>thumbnail</find>
<find>512</find>
<find>TYPE_JUMP</find>
<find>getCoordinate</find>
<find>encode</find>
<find>PECColors</find>
<find>short</find>
<find>long</find>
<find>PEC</find>
<find>TYPE_LONG</find>
<find>encode</find>
</findStrings>
</component>
<component name="Git.Settings">
@ -186,11 +218,11 @@
<option value="$PROJECT_DIR$/Colors/getColors.py" />
<option value="$PROJECT_DIR$/src/PES_Emb_mathutils.py" />
<option value="$PROJECT_DIR$/src/PES_render_utils.py" />
<option value="$PROJECT_DIR$/src/svgFunctions.py" />
<option value="$PROJECT_DIR$/PESDump/main.py" />
<option value="$PROJECT_DIR$/src/main.py" />
<option value="$PROJECT_DIR$/src/PES.py" />
<option value="$PROJECT_DIR$/PECRender/main.py" />
<option value="$PROJECT_DIR$/src/svgFunctions.py" />
<option value="$PROJECT_DIR$/src/PES.py" />
<option value="$PROJECT_DIR$/src/main.py" />
</list>
</option>
</component>
@ -276,7 +308,7 @@
</list>
</option>
</component>
<component name="RunManager" selected="Python.PECRender-main">
<component name="RunManager" selected="Python.main">
<configuration name="PECRender-main" type="PythonConfigurationType" factoryName="Python" temporary="true">
<module name="PES-Embroidery" />
<option name="INTERPRETER_OPTIONS" value="" />
@ -313,7 +345,7 @@
<option name="ADD_SOURCE_ROOTS" value="true" />
<EXTENSION ID="PythonCoverageRunConfigurationExtension" runner="coverage.py" />
<option name="SCRIPT_NAME" value="$PROJECT_DIR$/PESDump/main.py" />
<option name="PARAMETERS" value="-i &quot;$PROJECT_DIR$/TestOutput/two.PES&quot;" />
<option name="PARAMETERS" value="-i &quot;$PROJECT_DIR$/TestOutput/simple.pes&quot;" />
<option name="SHOW_COMMAND_LINE" value="false" />
<option name="EMULATE_TERMINAL" value="false" />
<option name="MODULE_MODE" value="false" />
@ -357,7 +389,7 @@
<option name="ADD_SOURCE_ROOTS" value="true" />
<EXTENSION ID="PythonCoverageRunConfigurationExtension" runner="coverage.py" />
<option name="SCRIPT_NAME" value="$PROJECT_DIR$/src/main.py" />
<option name="PARAMETERS" value="-i ../Tests/zigzag.svg -o ../TestOutput/simpleTry.PES -d" />
<option name="PARAMETERS" value="-i ../Tests/zigzag.svg -o ../TestOutput/simple.pes -d" />
<option name="SHOW_COMMAND_LINE" value="false" />
<option name="EMULATE_TERMINAL" value="false" />
<option name="MODULE_MODE" value="false" />
@ -425,7 +457,7 @@
<window_info id="Favorites" order="2" side_tool="true" />
<window_info anchor="bottom" id="Message" order="0" />
<window_info anchor="bottom" id="Find" order="1" />
<window_info active="true" anchor="bottom" id="Run" order="2" visible="true" weight="0.39251336" />
<window_info active="true" anchor="bottom" id="Run" order="2" visible="true" weight="0.27058825" />
<window_info anchor="bottom" id="Debug" order="3" weight="0.4" />
<window_info anchor="bottom" id="Cvs" order="4" weight="0.25" />
<window_info anchor="bottom" id="Inspection" order="5" weight="0.4" />
@ -557,27 +589,6 @@
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/src/PES_Emb_mathutils.py">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="-285">
<caret line="82" column="59" selection-start-line="82" selection-start-column="59" selection-end-line="82" selection-end-column="59" />
<folding>
<element signature="e#0#29#0" expanded="true" />
<marker date="1543625107768" expanded="true" signature="139:2608" ph="..." />
<marker date="1543625107768" expanded="true" signature="497:1537" ph="..." />
<marker date="1543625107768" expanded="true" signature="755:887" ph="..." />
<marker date="1543625107768" expanded="true" signature="1607:2401" ph="..." />
<marker date="1543625107768" expanded="true" signature="2659:2735" ph="..." />
<marker date="1543625107768" expanded="true" signature="2801:2806" ph="..." />
<marker date="1543625107768" expanded="true" signature="2801:4181" ph="..." />
<marker date="1543625107768" expanded="true" signature="3323:3324" ph="..." />
<marker date="1543625107768" expanded="true" signature="3730:3893" ph="..." />
<marker date="1543625107768" expanded="true" signature="3935:4054" ph="..." />
<marker date="1543625107768" expanded="true" signature="4091:4181" ph="..." />
</folding>
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/src/PES_render_utils.py">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="390">
@ -607,29 +618,6 @@
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/src/svgFunctions.py">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="734">
<caret line="320" column="44" lean-forward="true" selection-start-line="320" selection-start-column="44" selection-end-line="320" selection-end-column="44" />
<folding>
<element signature="e#0#19#0" expanded="true" />
<marker date="1543699809942" expanded="true" signature="143:2224" ph="..." />
<marker date="1543699809942" expanded="true" signature="12828:12833" ph="..." />
</folding>
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/PESDump/main.py">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="413">
<caret line="85" column="17" lean-forward="true" selection-start-line="85" selection-start-column="17" selection-end-line="85" selection-end-column="17" />
<folding>
<element signature="e#0#15#0" expanded="true" />
<marker date="1543888134994" expanded="true" signature="559:825" ph="..." />
</folding>
</state>
</provider>
</entry>
<entry file="file:///usr/local/lib/python2.7/site-packages/pyglet/event.py">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="192">
@ -637,40 +625,83 @@
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/src/PES.py">
<entry file="file://$PROJECT_DIR$/PESDump/main.py">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="1061">
<caret line="285" column="23" selection-start-line="285" selection-start-column="17" selection-end-line="285" selection-end-column="23" />
<folding>
<element signature="e#0#23#0" expanded="true" />
<marker date="1543895627790" expanded="true" signature="135:325" ph="..." />
<marker date="1543895627790" expanded="true" signature="273:325" ph="..." />
<marker date="1543895627790" expanded="true" signature="502:542" ph="..." />
<marker date="1543895627790" expanded="true" signature="3436:3442" ph="..." />
<marker date="1543895627790" expanded="true" signature="10880:10976" ph="..." />
</folding>
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/src/main.py">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="114">
<caret line="47" column="53" lean-forward="true" selection-start-line="47" selection-start-column="53" selection-end-line="47" selection-end-column="53" />
<state relative-caret-position="327">
<caret line="70" column="30" lean-forward="true" selection-start-line="70" selection-start-column="30" selection-end-line="70" selection-end-column="30" />
<folding>
<element signature="e#0#15#0" expanded="true" />
<marker date="1543888134994" expanded="true" signature="559:825" ph="..." />
</folding>
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/PECRender/main.py">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="255">
<caret line="17" column="105" selection-start-line="17" selection-start-column="105" selection-end-line="17" selection-end-column="105" />
<state relative-caret-position="600">
<caret line="40" column="45" lean-forward="true" selection-start-line="40" selection-start-column="45" selection-end-line="40" selection-end-column="45" />
<folding>
<element signature="e#0#10#0" expanded="true" />
</folding>
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/src/PES_Emb_mathutils.py">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="209">
<caret line="92" column="49" lean-forward="true" selection-start-line="92" selection-start-column="49" selection-end-line="92" selection-end-column="49" />
<folding>
<element signature="e#0#29#0" expanded="true" />
<marker date="1543625107768" expanded="true" signature="139:2608" ph="..." />
<marker date="1543625107768" expanded="true" signature="497:1537" ph="..." />
<marker date="1543625107768" expanded="true" signature="755:887" ph="..." />
<marker date="1543625107768" expanded="true" signature="1607:2401" ph="..." />
<marker date="1543625107768" expanded="true" signature="2659:2735" ph="..." />
<marker date="1543625107768" expanded="true" signature="2801:2806" ph="..." />
<marker date="1543625107768" expanded="true" signature="2801:4181" ph="..." />
<marker date="1543625107768" expanded="true" signature="3323:3324" ph="..." />
<marker date="1543625107768" expanded="true" signature="3730:3893" ph="..." />
<marker date="1543625107768" expanded="true" signature="3935:4054" ph="..." />
<marker date="1543625107768" expanded="true" signature="4091:4181" ph="..." />
</folding>
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/src/svgFunctions.py">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="191">
<caret line="289" column="63" lean-forward="true" selection-start-line="289" selection-start-column="63" selection-end-line="289" selection-end-column="63" />
<folding>
<element signature="e#0#19#0" expanded="true" />
<marker date="1543959281244" expanded="true" signature="143:2224" ph="..." />
</folding>
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/src/PES.py">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="132">
<caret line="362" column="45" lean-forward="true" selection-start-line="362" selection-start-column="45" selection-end-line="362" selection-end-column="45" />
<folding>
<element signature="e#0#23#0" expanded="true" />
<marker date="1543958892193" expanded="true" signature="149:339" ph="..." />
<marker date="1543958892193" expanded="true" signature="287:339" ph="..." />
<marker date="1543958892193" expanded="true" signature="516:556" ph="..." />
<marker date="1543958892193" expanded="true" signature="3450:3456" ph="..." />
<marker date="1543958892193" expanded="true" signature="11855:11951" ph="..." />
</folding>
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/src/main.py">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="301">
<caret line="32" column="15" lean-forward="true" selection-start-line="32" selection-start-column="15" selection-end-line="32" selection-end-column="15" />
<folding>
<element signature="e#0#15#0" expanded="true" />
</folding>
</state>
</provider>
</entry>
</component>
</project>

12
LOG.md
Wyświetl plik

@ -1,3 +1,15 @@
# 12/4
I think the sewing machine might actually follow PES commands and not PEC commands. That's kinda weird, because the PEC commands are supposed to be for the machine and the PES commands for like, desktop embroidery applications. This machine DOES have its own touch screen though, so maybe times have changed.
Ah, well now the design is just showing up as a single little line for some reason. The machine will go back and forth on it until it breaks -_-
I think it's getting caught by the bounds! That's why it goes back and forth against one wall. That's also whhy my embroidered square came out smaller than it should've.
Yep that was it. I don't know whether I should be upset or impressed that they designed their firmware to that level.
I think I also need the short format for most of them otherwise I think it tries to backstitch each time which is too much.
# 12/3
If I write my PES header with TrueSizer's PEC section, the embroidery machine recognizes it. That means I'm not writing the PEC section correctly. Time for some more reverse engineering.

Wyświetl plik

@ -14,8 +14,8 @@ 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/simpleTry.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/simpleTry.PES"
# Global variables
class Global:
@ -225,6 +225,7 @@ class Global:
print("Peek byte: {:02x}".format(peekByte))
if (peekByte & 0x80) > 0:
print("Long")
# Double length
c = struct.unpack(">H", Global.readBytes(f, 2))[0]
#print("Beep: {}".format(hex(c)))
@ -243,6 +244,7 @@ class Global:
c = c_short((c & 0x07FF) + (0xF800 if ((c & 0x0800) > 0) else 0)).value
return c
else:
print("Short")
# Single length coordinate
c = struct.unpack("B", Global.readBytes(f, 1))[0]

Plik binarny nie jest wyświetlany.

Plik binarny nie jest wyświetlany.

Plik binarny nie jest wyświetlany.

Plik binarny nie jest wyświetlany.

Plik binarny nie jest wyświetlany.

Plik binarny nie jest wyświetlany.

Plik binarny nie jest wyświetlany.

Plik binarny nie jest wyświetlany.

Plik binarny nie jest wyświetlany.

Przed

Szerokość:  |  Wysokość:  |  Rozmiar: 4.3 KiB

Po

Szerokość:  |  Wysokość:  |  Rozmiar: 5.2 KiB

Wyświetl plik

@ -1,6 +1,7 @@
from struct import pack
from svgpathtools import *
import math
import random
def encodeU8(num):
return pack("<B", int(num))
@ -138,67 +139,69 @@ class PES:
b.extend(encodeU16(1))
b.extend(encodeU16(1))
# Number of sew segment blocks
b.extend(encodeU16(1))
b.extend([0xFF, 0xFF, 0x00, 0x00])
b.extend(encodeU16(0))
#b.extend([0x00, 0x00, 0x00, 0x00])
# CEmbOne section
b.extend(encodeU16(7))
b.extend("CEmbOne")
# Standard block geometry
left, right, bottom, top = self.shape.bbox()
b.extend(encodeS16(left))
b.extend(encodeS16(top))
b.extend(encodeS16(right))
b.extend(encodeS16(bottom))
b.extend(encodeS16(left))
b.extend(encodeS16(top))
b.extend(encodeS16(right))
b.extend(encodeS16(bottom))
b.extend(encodeFloat(1.0))
b.extend(encodeFloat(0.0))
b.extend(encodeFloat(0.0))
b.extend(encodeFloat(1.0))
b.extend(encodeFloat(0.0))
b.extend(encodeFloat(0.0))
# Nobody knows what this value is but it's usually 1
b.extend(encodeU16(1))
# Coordinate translation?
b.extend(encodeS16(0))
b.extend(encodeS16(0))
# Width/height
b.extend(encodeS16(self.PEC.size.real))
b.extend(encodeS16(self.PEC.size.imag))
# Eight zeros for whatever reason
b.extend([0,0,0,0,0,0,0,0])
# CSewSeg block count (1)
b.extend(encodeU16(1))
# Means that more blocks follow.
b.extend([0xFF, 0xFF, 0x00, 0x00])
# CSewSeg
b.extend(encodeU16(7))
b.extend("CSewSeg")
# Encode stitch list
b.extend(encodeU16(0))
b.extend(encodeU16(1))
b.extend(encodeU16(2))
Stitch(toPoint=(10+10j)).encodeForCSewSeg(b)
Stitch(toPoint=(30 + 30j)).encodeForCSewSeg(b)
# Encode color list
b.extend(encodeU16(1))
b.extend(encodeU16(0))
b.extend(encodeU16(5))
# No more blocks follow
b.extend([0x00, 0x00, 0x00, 0x00])
# b.extend(encodeU16(7))
# b.extend("CEmbOne")
#
# # Standard block geometry
# left, right, bottom, top = self.shape.bbox()
# b.extend(encodeS16(left))
# b.extend(encodeS16(top))
# b.extend(encodeS16(right))
# b.extend(encodeS16(bottom))
# b.extend(encodeS16(left))
# b.extend(encodeS16(top))
# b.extend(encodeS16(right))
# b.extend(encodeS16(bottom))
#
# b.extend(encodeFloat(1.0))
# b.extend(encodeFloat(0.0))
# b.extend(encodeFloat(0.0))
# b.extend(encodeFloat(1.0))
# b.extend(encodeFloat(0.0))
# b.extend(encodeFloat(0.0))
#
# # Nobody knows what this value is but it's usually 1
# b.extend(encodeU16(1))
#
# # Coordinate translation?
# b.extend(encodeS16(0))
# b.extend(encodeS16(0))
#
# # Width/height
# b.extend(encodeS16(self.PEC.size.real))
# b.extend(encodeS16(self.PEC.size.imag))
#
# # Eight zeros for whatever reason
# b.extend([0,0,0,0,0,0,0,0])
# # CSewSeg block count (1)
# b.extend(encodeU16(1))
#
# # Means that more blocks follow.
# b.extend([0xFF, 0xFF, 0x00, 0x00])
#
#
# # CSewSeg
# b.extend(encodeU16(7))
# b.extend("CSewSeg")
# # Encode stitch list
# b.extend(encodeU16(0))
# b.extend(encodeU16(1))
# testStitchCount = 100
# b.extend(encodeU16(testStitchCount))
# for x in range(0, testStitchCount):
# Stitch(toPoint=complex(random.uniform(-100, 100), random.uniform(-100, 100))).encodeForCSewSeg(b)
#
# # Encode color list
# b.extend(encodeU16(1))
# b.extend(encodeU16(0))
# b.extend(encodeU16(10))
#
# # No more blocks follow
# b.extend([0x00, 0x00, 0x00, 0x00])
pecOffset = len(b)
@ -283,8 +286,10 @@ class PEC:
# Width and height
print("Width: {} Height: {}".format(self.size.real, self.size.imag))
b.extend(encodeS16(self.size.real))
b.extend(encodeS16(self.size.imag))
# b.extend(encodeS16(self.size.real))
# b.extend(encodeS16(self.size.imag))
b.extend(encodeS16(1000))
b.extend(encodeS16(1000))
b.extend([0xE0, 0x01])
b.extend([0xB0, 0x01])
@ -303,7 +308,7 @@ class PEC:
for x in range(0, len(self.colors)):
for r in range(0, self.thumbnailHeight):
for p in range(0, self.thumbnailWidth):
b.extend([0x81])
b.extend([0xFF & int(random.uniform(0, 255))])
b[thumbnailMarker:thumbnailMarker+2] = encodeU16(thumbStart - 512 - pecStart)
@ -332,6 +337,7 @@ class CSewSeg:
None
class Stitch:
TYPE_REGULAR = 0xFFFF
TYPE_SHORT = 0x00
TYPE_LONG = 0x8000
TYPE_JUMP = 0x9000
@ -344,10 +350,19 @@ class Stitch:
def __init__(self, toPoint):
assert(isinstance(toPoint, complex))
self.point = toPoint
self.type = Stitch.TYPE_LONG
self.type = Stitch.TYPE_REGULAR
def encode(self, b):
# Decide whether to make long or not.
if self.type == Stitch.TYPE_REGULAR:
if Line(Stitch.lastPoint, self.point).length() > 63:
self.type = Stitch.TYPE_LONG
print("Stitch is over 63 units")
else:
self.type = Stitch.TYPE_SHORT
print("Stitch is under 63 units")
self.encodePoint(self.point - Stitch.lastPoint, b)
Stitch.lastPoint = complex( int(round(self.point.real)), int(round(self.point.imag)))
@ -359,8 +374,13 @@ class Stitch:
if coordinate > 2047 or coordinate < -2047:
raise Exception("Coordinate movement too big: {}".format(coordinate))
total = self.type + ( int(round(coordinate)) & 0xFFF )
b.extend([ ((total & 0xFF00) >> 8), total & 0xFF])
if self.type == Stitch.TYPE_SHORT:
b.extend([ (int(round(coordinate)) & 0x7F) ])
print("Shhort")
else:
total = self.type + ( int(round(coordinate)) & 0xFFF )
b.extend([ ((total & 0xFF00) >> 8), total & 0xFF])
print("Long")
def encodeForCSewSeg(self, b):
b.extend(encodeS16(self.point.real))

Plik binarny nie jest wyświetlany.

Wyświetl plik

@ -26,10 +26,10 @@ paths, attributes = svg
if paths is None:
sys.exit(0)
threadWidth = 3
threadWidth = 10
# Enumerate the shapes in the SVG to find where stitches should go.
levelGroups = []
subshapeLevelGroups = []
fillColors = []
PECColors = []
for i, shape in enumerate(paths):
@ -43,17 +43,26 @@ for i, shape in enumerate(paths):
# Fill color here is only for debugging.
levels = makeStitchLevels(shape, fillColor, debug=args.debug, threadWidth=threadWidth)
# Append the stitches as their own array so we can separate by colors
levelGroups.append(levels)
subshapeLevelGroups.append(levels)
# Make the stitches into a continuous set of commands
PECCommands = createStitchRoutine(levelGroups, fillColors=fillColors, threadWidth=threadWidth)
# Make the stitches into continuous groups.
# This also breaks the long stitches up into little ones.
subshapeLineGroups = createSubshapeLineGroups(subshapeLevelGroups, fillColors=fillColors, threadWidth=threadWidth)
#DEBUG [[[Line(0+0j, 300+0j), Line(300+0j, 300+300j), Line(300+300j, 0+300j) , Line(0+300j, 0+0j)]]]
print(subshapeLineGroups)
PECCommands = createPECStitchRoutines(subshapeLineGroups, fillColors, threadWidth)
left, right, bottom, top = shape.bbox()
# First stitch must be a jump stitch.
PECCommands[0].type = Stitch.TYPE_JUMP
pec = PEC(label="simple", colors=PECColors, commands=PECCommands, size=complex(right - left, top - bottom))
# Render the PEC commands
renderPEC(pec)
#renderPEC(pec)
pes = PES(PEC=pec, shape=shape)
encodedPES = pes.encode()

Wyświetl plik

@ -222,26 +222,29 @@ def pointWithinPoint(p1, p2, dist):
return math.sqrt( math.pow(p1.real - p2.real, 2) + math.pow(p1.imag - p2.imag, 2) ) <= dist
# Take all the stitches we created and actually make
# a continuous set of commands for the machine to follow.
def createStitchRoutine(levelGroups, fillColors, threadWidth=2):
# a continuous set of stitches for the machine to follow
# on a per sub-shape basis.
# This should return a list of sublists, with each sublist
# containing an array of continuous stitch lines.
def createSubshapeLineGroups(subshapeLevelGroups, fillColors, threadWidth=2, maxStitchDistance=10.0):
maxDist = math.sqrt(2 * math.pow(threadWidth,2))
shapeLineGroups = []
subshapeLineGroups = []
lastUsedGroups = []
# For each set of lines corresponding to each SVG shape...
for stitchLevels in levelGroups:
for subshapeLevels in subshapeLevelGroups:
# Find an order of lines that works with (relatively) minimum jumping.
# This requires us to group lines by continuity.
# Each group is stitchable with no jumps.
# Jumps will occur between these groups.
# This holds lists of lines that can be stitched continuously with no jumping.
lineGroups = []
# SVG files can have multiple shapes
# Hold all the line groups in "shapeLineGroups"
shapeLineGroups.append(lineGroups)
# This contains a list of lineGroups, one for each subshape.
subshapeLineGroups.append(lineGroups)
# Each level can contain multiple lines and barriers
for level in stitchLevels:
# Each level can contain multiple lines
for level in subshapeLevels:
newUsedGroups = []
@ -283,20 +286,63 @@ def createStitchRoutine(levelGroups, fillColors, threadWidth=2):
print("Made {} groups for a shape.".format(len(lineGroups)))
GenericRenderer.globalRenderer.clearAll()
curColor = 0
for lineGroups in shapeLineGroups:
# Break up the lines into intermediate stitches.
# We don't want giant stitches traversing the whole object.
# We want little stitches along the way.
def breakUpBigStitchLine(l):
# Not less than one segment
segments = max(1, int( round(l.length() / maxStitchDistance) ) )
increment = 1.0 / float(segments)
lines = []
for x in range(0, segments):
p1 = l.point( x*increment )
p2 = l.point( min((x+1)*increment, 1.0) )
lines.append(Line(start=p1,end=p2))
print(lines)
return lines
# Holds groups for every subshape
shortenedSubshapeLineGroups = []
for lineGroups in subshapeLineGroups:
# Holds the groups for a single subshhape
shortenedLineGroups = []
shortenedSubshapeLineGroups.append(shortenedLineGroups)
for lineGroup in lineGroups:
curColor += 1
currentColor = PES.colors[curColor % len(PES.colors)]
# Holds shortened lines for a single continuous region
shortenedLines = []
shortenedLineGroups.append(shortenedLines)
lastLine = None
for line in lineGroup:
GenericRenderer.globalRenderer.addLine(line, currentColor[1], currentColor[2], currentColor[3])
if lastLine is not None:
# Make a line connecting this line and the previous one.
l = Line(lastLine.end, line.start)
shortenedLines.extend( breakUpBigStitchLine(l) )
shortenedLines.extend(breakUpBigStitchLine(line))
lastLine = line
# Render the lines
GenericRenderer.globalRenderer.clearAll()
curColor = 0
for lineGroups in shortenedSubshapeLineGroups:
for lineGroup in lineGroups:
curColor += 1
currentColor = PES.colors[curColor % len(PES.colors)]
for line in lineGroup:
# Add slight color variation to be able to see individual stitches.
variation = 50
c1 = min(255, max(0, currentColor[1] + int(round(random.uniform(-variation, variation))) ))
c2 = min(255, max(0, currentColor[2] + int(round(random.uniform(-variation, variation)))))
c3 = min(255, max(0, currentColor[3] + int(round(random.uniform(-variation, variation)))))
GenericRenderer.globalRenderer.addLine(line, c1, c2, c3)
return shortenedSubshapeLineGroups
def createPECStitchRoutines(subshapeLineGroups, fillColors, threadWidth):
# Add color change, convert lines to stitches and add jump commands
allStitches = []
PECCommands = []
maxDist = math.sqrt(2 * math.pow(threadWidth, 2))
for i, shapeLineGroup in enumerate(shapeLineGroups):
for i, subshapeLineGroup in enumerate(subshapeLineGroups):
# Create the color change command.
fillColor = fillColors[i]
colorData = PES.getClosestColor(fillColor)
@ -304,27 +350,30 @@ def createStitchRoutine(levelGroups, fillColors, threadWidth=2):
# First color is automatically set.
if i != 0:
colorChange = ColorChange(colorIndex=colorData[0], indexInColorList=i )
allStitches.append(colorChange)
PECCommands.append(colorChange)
for singleLineGroup in shapeLineGroup:
for singleLineGroup in subshapeLineGroup:
# Was the last command a stitch?
if len(allStitches) > 0 and isinstance(allStitches[-1], Stitch):
lastStitch = allStitches[-1]
if len(PECCommands) > 0 and isinstance(PECCommands[-1], Stitch):
lastStitch = PECCommands[-1]
# Is the distance greater than the minimum?
if pointWithinPoint(lastStitch.point, singleLineGroup[0].start, maxDist) is not True:
# Jump to the location of this shape.
jump = Stitch( singleLineGroup[0].start )
jump.type = Stitch.TYPE_JUMP
allStitches.append(jump)
PECCommands.append(jump)
if len(singleLineGroup) > 0:
PECCommands.append(Stitch(singleLineGroup[0].start))
for singleLine in singleLineGroup:
s = Stitch(singleLine.start)
allStitches.append(s)
# s = Stitch(singleLine.start)
# PECCommands.append(s)
s = Stitch(singleLine.end)
allStitches.append(s)
PECCommands.append(s)
print("Created {} stitches.".format(len(allStitches)))
return allStitches
print("Created {} PEC commands (most are stitches.)".format(len(PECCommands)))
return PECCommands
def renderPEC(pec):

Plik binarny nie jest wyświetlany.