Default color set
Reading color from file
pull/4/head
Reenforcements 2018-11-22 15:40:42 -05:00
rodzic bf947df998
commit 5a06828d97
9 zmienionych plików z 472 dodań i 141 usunięć

Wyświetl plik

@ -3,8 +3,9 @@
<component name="ChangeListManager">
<list default="true" id="0b5af789-e47c-4138-bdb9-8fa765481e1e" name="Default Changelist" comment="">
<change beforePath="$PROJECT_DIR$/.idea/workspace.xml" beforeDir="false" afterPath="$PROJECT_DIR$/.idea/workspace.xml" afterDir="false" />
<change beforePath="$PROJECT_DIR$/PECRender/main.py" beforeDir="false" afterPath="$PROJECT_DIR$/PECRender/main.py" afterDir="false" />
<change beforePath="$PROJECT_DIR$/src/PES_Emb_mathutils.py" beforeDir="false" afterPath="$PROJECT_DIR$/src/PES_Emb_mathutils.py" afterDir="false" />
<change beforePath="$PROJECT_DIR$/README.md" beforeDir="false" afterPath="$PROJECT_DIR$/README.md" afterDir="false" />
<change beforePath="$PROJECT_DIR$/Tests/simplePath.svg" beforeDir="false" afterPath="$PROJECT_DIR$/Tests/simplePath.svg" 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" />
<change beforePath="$PROJECT_DIR$/src/svgFunctions.py" beforeDir="false" afterPath="$PROJECT_DIR$/src/svgFunctions.py" afterDir="false" />
</list>
@ -16,8 +17,9 @@
</component>
<component name="CoverageDataManager">
<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="1542909151130" 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$main.coverage" NAME="main Coverage Results" MODIFIED="1542919062341" 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="1542678577371" 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="PECRender-main Coverage Results" MODIFIED="1542509072203" SOURCE_PROVIDER="com.intellij.coverage.DefaultCoverageFileProvider" RUNNER="coverage.py" COVERAGE_BY_TEST_ENABLED="true" COVERAGE_TRACING_ENABLED="false" WORKING_DIRECTORY="$PROJECT_DIR$/PECRender" />
</component>
<component name="FUSProjectUsageTrigger">
@ -36,25 +38,25 @@
<usages-collector id="statistics.vcs.git.usages" />
<usages-collector id="statistics.file.types.edit">
<counts>
<entry key="Python" value="20405" />
<entry key="Python" value="23003" />
</counts>
</usages-collector>
<usages-collector id="statistics.js.language.service.starts" />
<usages-collector id="statistics.file.types.open">
<counts>
<entry key="Python" value="21" />
<entry key="Python" value="23" />
<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="21" />
<entry key="py" value="23" />
</counts>
</usages-collector>
<usages-collector id="statistics.file.extensions.edit">
<counts>
<entry key="py" value="20405" />
<entry key="py" value="23003" />
</counts>
</usages-collector>
</session>
@ -64,8 +66,8 @@
<file pinned="false" current-in-tab="false">
<entry file="file://$PROJECT_DIR$/src/main.py">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="307">
<caret line="33" column="12" lean-forward="true" selection-start-line="33" selection-start-column="12" selection-end-line="33" selection-end-column="12" />
<state relative-caret-position="282">
<caret line="31" column="41" lean-forward="true" selection-start-line="31" selection-start-column="41" selection-end-line="31" selection-end-column="41" />
<folding>
<element signature="e#0#15#0" expanded="true" />
</folding>
@ -74,81 +76,58 @@
</entry>
</file>
<file pinned="false" current-in-tab="false">
<entry file="file://$PROJECT_DIR$/src/PES_render_utils.py">
<entry file="file://$PROJECT_DIR$/src/svgFunctions.py">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="390">
<caret line="26" column="13" lean-forward="true" selection-start-line="26" selection-start-column="13" selection-end-line="26" selection-end-column="13" />
<state relative-caret-position="1575">
<caret line="105" column="33" lean-forward="true" selection-start-line="105" selection-start-column="33" selection-end-line="105" selection-end-column="33" />
<folding>
<element signature="e#0#13#0" expanded="true" />
<marker date="1542906615593" expanded="true" signature="129:130" ph="..." />
<marker date="1542906615593" expanded="true" signature="129:135" ph="..." />
<marker date="1542906615593" expanded="true" signature="1186:1387" ph="..." />
<marker date="1542906615593" expanded="true" signature="1414:1509" ph="..." />
<element signature="e#0#19#0" expanded="true" />
<marker date="1542919038136" expanded="true" signature="421:759" ph="..." />
<marker date="1542919038136" expanded="true" signature="832:833" ph="..." />
<marker date="1542919038136" expanded="true" signature="832:896" ph="..." />
<marker date="1542919038136" expanded="true" signature="4293:4298" ph="..." />
</folding>
</state>
</provider>
</entry>
</file>
<file pinned="false" current-in-tab="false">
<entry file="file://$PROJECT_DIR$/PECRender/main.py">
<entry file="file://$PROJECT_DIR$/Colors/getColors.py">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="68">
<caret line="43" column="22" selection-start-line="43" selection-start-column="22" selection-end-line="43" selection-end-column="22" />
<state relative-caret-position="513">
<caret line="78" column="15" lean-forward="true" selection-start-line="78" selection-start-column="15" selection-end-line="78" selection-end-column="15" />
<folding>
<element signature="e#0#10#0" expanded="true" />
<marker date="1542908086234" expanded="true" signature="272:446" ph="..." />
<marker date="1542908086234" expanded="true" signature="6331:6335" 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="353">
<caret line="163" lean-forward="true" selection-start-line="163" selection-end-line="163" />
<folding>
<element signature="e#0#23#0" expanded="true" />
<marker date="1542903616715" expanded="true" signature="121:198" ph="..." />
<marker date="1542903616715" expanded="true" signature="375:415" ph="..." />
<marker date="1542903616715" expanded="true" signature="1510:3144" ph="..." />
<marker date="1542903616715" expanded="true" signature="3322:3400" ph="..." />
<marker date="1542903616715" expanded="true" signature="3414:3453" ph="..." />
<marker date="1542903616715" expanded="true" signature="3652:3657" ph="..." />
<element signature="e#0#9#0" expanded="true" />
</folding>
</state>
</provider>
</entry>
</file>
<file pinned="false" current-in-tab="true">
<entry file="file://$PROJECT_DIR$/src/svgFunctions.py">
<entry file="file://$PROJECT_DIR$/src/PES.py">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="420">
<caret line="84" column="61" selection-start-line="84" selection-start-column="61" selection-end-line="84" selection-end-column="61" />
<state relative-caret-position="400">
<caret line="102" column="48" selection-start-line="102" selection-start-column="48" selection-end-line="102" selection-end-column="48" />
<folding>
<element signature="e#0#19#0" expanded="true" />
<marker date="1542909370179" expanded="true" signature="374:375" ph="..." />
<marker date="1542909370179" expanded="true" signature="374:438" ph="..." />
<element signature="e#0#23#0" expanded="true" />
<marker date="1542919229810" expanded="true" signature="133:210" ph="..." />
<marker date="1542919229810" expanded="true" signature="387:427" ph="..." />
<marker date="1542919229810" expanded="true" signature="3372:3633" ph="..." />
<marker date="1542919229810" expanded="true" signature="4664:6341" ph="..." />
<marker date="1542919229810" expanded="true" signature="6519:6597" ph="..." />
<marker date="1542919229810" expanded="true" signature="6611:6650" ph="..." />
<marker date="1542919229810" expanded="true" signature="6868:6873" ph="..." />
<marker date="1542919229810" expanded="true" signature="7157:7163" ph="..." />
</folding>
</state>
</provider>
</entry>
</file>
<file pinned="false" current-in-tab="false">
<entry file="file:///usr/local/lib/python2.7/site-packages/svgpathtools/path.py">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="199">
<caret line="1120" column="8" selection-start-line="1120" selection-start-column="8" selection-end-line="1120" selection-end-column="8" />
</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="297">
<caret line="31" column="69" selection-start-line="31" selection-start-column="69" selection-end-line="31" selection-end-column="69" />
<state relative-caret-position="443">
<caret line="74" column="8" lean-forward="true" selection-start-line="74" selection-start-column="8" selection-end-line="74" selection-end-column="8" />
<folding>
<element signature="e#0#29#0" expanded="true" />
<marker date="1542908071934" expanded="true" signature="112:1695" ph="..." />
@ -171,6 +150,36 @@
</provider>
</entry>
</file>
<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="68">
<caret line="43" column="22" selection-start-line="43" selection-start-column="22" selection-end-line="43" selection-end-column="22" />
<folding>
<element signature="e#0#10#0" expanded="true" />
<marker date="1542908086234" expanded="true" signature="272:446" ph="..." />
<marker date="1542908086234" expanded="true" signature="6331:6335" ph="..." />
</folding>
</state>
</provider>
</entry>
</file>
<file pinned="false" current-in-tab="false">
<entry file="file://$PROJECT_DIR$/src/PES_render_utils.py">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="362">
<caret line="26" column="13" lean-forward="true" selection-start-line="26" selection-start-column="13" selection-end-line="26" selection-end-column="13" />
<folding>
<element signature="e#0#13#0" expanded="true" />
<marker date="1542906615593" expanded="true" signature="129:130" ph="..." />
<marker date="1542906615593" expanded="true" signature="129:135" ph="..." />
<marker date="1542906615593" expanded="true" signature="1186:1387" ph="..." />
<marker date="1542906615593" expanded="true" signature="1414:1509" ph="..." />
</folding>
</state>
</provider>
</entry>
</file>
</leaf>
</component>
<component name="FileTemplateManagerImpl">
@ -182,7 +191,6 @@
</component>
<component name="FindInProjectRecents">
<findStrings>
<find>DIFF</find>
<find>Big:</find>
<find>starting</find>
<find>0x8</find>
@ -197,7 +205,6 @@
<find>getCoordinate</find>
<find>sdfsd</find>
<find>getStartAndEndPointsOfLineInBox</find>
<find>makeStitchLines</find>
<find>getBoxDiagonalLength</find>
<find>InfLine</find>
<find>to_svg</find>
@ -207,7 +214,13 @@
<find>invertSlope</find>
<find>intersectionPath</find>
<find>readBytes</find>
<find>Blue</find>
<find>Stitch</find>
<find>Teal</find>
<find>imag</find>
<find>attributesattributes</find>
<find>loadVectorGraphic</find>
<find>makeStitchLines</find>
</findStrings>
</component>
<component name="Git.Settings">
@ -222,12 +235,13 @@
<option value="$PROJECT_DIR$/src/svg.py" />
<option value="$PROJECT_DIR$/src/PES-Emb-mathutils.py" />
<option value="$PROJECT_DIR$/src/utilities.py" />
<option value="$PROJECT_DIR$/src/PES.py" />
<option value="$PROJECT_DIR$/src/main.py" />
<option value="$PROJECT_DIR$/src/PES_render_utils.py" />
<option value="$PROJECT_DIR$/src/PES_Emb_mathutils.py" />
<option value="$PROJECT_DIR$/PECRender/main.py" />
<option value="$PROJECT_DIR$/Colors/getColors.py" />
<option value="$PROJECT_DIR$/src/main.py" />
<option value="$PROJECT_DIR$/src/svgFunctions.py" />
<option value="$PROJECT_DIR$/src/PES.py" />
</list>
</option>
</component>
@ -258,6 +272,11 @@
<item name="PES-Embroidery" type="b2602c69:ProjectViewProjectNode" />
<item name="PES-Embroidery" type="462c0819:PsiDirectoryNode" />
</path>
<path>
<item name="PES-Embroidery" type="b2602c69:ProjectViewProjectNode" />
<item name="PES-Embroidery" type="462c0819:PsiDirectoryNode" />
<item name="Colors" type="462c0819:PsiDirectoryNode" />
</path>
<path>
<item name="PES-Embroidery" type="b2602c69:ProjectViewProjectNode" />
<item name="PES-Embroidery" type="462c0819:PsiDirectoryNode" />
@ -325,6 +344,28 @@
<option name="INPUT_FILE" value="" />
<method v="2" />
</configuration>
<configuration name="getColors" type="PythonConfigurationType" factoryName="Python" temporary="true">
<module name="PES-Embroidery" />
<option name="INTERPRETER_OPTIONS" value="" />
<option name="PARENT_ENVS" value="true" />
<envs>
<env name="PYTHONUNBUFFERED" value="1" />
</envs>
<option name="SDK_HOME" value="" />
<option name="WORKING_DIRECTORY" value="$PROJECT_DIR$/Colors" />
<option name="IS_MODULE_SDK" value="true" />
<option name="ADD_CONTENT_ROOTS" value="true" />
<option name="ADD_SOURCE_ROOTS" value="true" />
<EXTENSION ID="PythonCoverageRunConfigurationExtension" runner="coverage.py" />
<option name="SCRIPT_NAME" value="$PROJECT_DIR$/Colors/getColors.py" />
<option name="PARAMETERS" value="" />
<option name="SHOW_COMMAND_LINE" value="false" />
<option name="EMULATE_TERMINAL" value="false" />
<option name="MODULE_MODE" value="false" />
<option name="REDIRECT_INPUT" value="false" />
<option name="INPUT_FILE" value="" />
<method v="2" />
</configuration>
<configuration name="main" type="PythonConfigurationType" factoryName="Python">
<module name="PES-Embroidery" />
<option name="INTERPRETER_OPTIONS" value="" />
@ -373,9 +414,11 @@
<item itemvalue="Python.main" />
<item itemvalue="Python.svgImport" />
<item itemvalue="Python.PECRender-main" />
<item itemvalue="Python.getColors" />
</list>
<recent_temporary>
<list>
<item itemvalue="Python.getColors" />
<item itemvalue="Python.PECRender-main" />
<item itemvalue="Python.svgImport" />
</list>
@ -398,7 +441,7 @@
<frame x="0" y="23" width="1680" height="1027" extended-state="0" />
<editor active="true" />
<layout>
<window_info content_ui="combo" id="Project" order="0" weight="0.27106228" />
<window_info content_ui="combo" id="Project" order="0" visible="true" weight="0.15873016" />
<window_info id="Structure" order="1" side_tool="true" weight="0.25" />
<window_info id="Favorites" order="2" side_tool="true" />
<window_info anchor="bottom" id="Message" order="0" />
@ -450,6 +493,17 @@
<component name="VcsContentAnnotationSettings">
<option name="myLimit" value="2678400000" />
</component>
<component name="XDebuggerManager">
<breakpoint-manager>
<breakpoints>
<line-breakpoint enabled="true" suspend="THREAD" type="python-line">
<url>file://$PROJECT_DIR$/src/svgFunctions.py</url>
<line>18</line>
<option name="timeStamp" value="6" />
</line-breakpoint>
</breakpoints>
</breakpoint-manager>
</component>
<component name="editorHistoryManager">
<entry file="uml://JavaScript-modules-diagram//Users/imaustyn/Documents/MiamiUniversity/ECE 487/Project/PES-Embroidery">
<provider selected="true" editor-type-id="UmlEditorProvider">
@ -493,13 +547,6 @@
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/src/utilities.py">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="165">
<caret line="11" selection-start-line="11" selection-end-line="11" />
</state>
</provider>
</entry>
<entry file="file:///usr/local/lib/python2.7/site-packages/svgpathtools/bezier.py">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="387">
@ -514,39 +561,20 @@
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/src/main.py">
<entry file="file://$PROJECT_DIR$/src/PES_render_utils.py">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="307">
<caret line="33" column="12" lean-forward="true" selection-start-line="33" selection-start-column="12" selection-end-line="33" selection-end-column="12" />
<state relative-caret-position="362">
<caret line="26" column="13" lean-forward="true" selection-start-line="26" selection-start-column="13" selection-end-line="26" selection-end-column="13" />
<folding>
<element signature="e#0#15#0" expanded="true" />
<element signature="e#0#13#0" expanded="true" />
<marker date="1542906615593" expanded="true" signature="129:130" ph="..." />
<marker date="1542906615593" expanded="true" signature="129:135" ph="..." />
<marker date="1542906615593" expanded="true" signature="1186:1387" ph="..." />
<marker date="1542906615593" expanded="true" signature="1414:1509" ph="..." />
</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="297">
<caret line="31" column="69" selection-start-line="31" selection-start-column="69" selection-end-line="31" selection-end-column="69" />
<folding>
<element signature="e#0#29#0" expanded="true" />
<marker date="1542908071934" expanded="true" signature="112:1695" ph="..." />
<marker date="1542908071934" expanded="true" signature="401:624" ph="..." />
<marker date="1542908071934" expanded="true" signature="694:1488" ph="..." />
<marker date="1542908071934" expanded="true" signature="1746:1822" ph="..." />
<marker date="1542908071934" expanded="true" signature="1893:1898" ph="..." />
<marker date="1542908071934" expanded="true" signature="1893:2374" ph="..." />
</folding>
</state>
</provider>
</entry>
<entry file="file:///usr/local/lib/python2.7/site-packages/svgpathtools/path.py">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="199">
<caret line="1120" column="8" selection-start-line="1120" selection-start-column="8" selection-end-line="1120" selection-end-column="8" />
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/PECRender/main.py">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="68">
@ -559,44 +587,84 @@
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/src/PES_render_utils.py">
<entry file="file:///usr/local/lib/python2.7/site-packages/svgpathtools/path.py">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="390">
<caret line="26" column="13" lean-forward="true" selection-start-line="26" selection-start-column="13" selection-end-line="26" selection-end-column="13" />
<state relative-caret-position="199">
<caret line="1120" column="8" selection-start-line="1120" selection-start-column="8" selection-end-line="1120" selection-end-column="8" />
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/src/utilities.py">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="165">
<caret line="11" selection-start-line="11" selection-end-line="11" />
</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="443">
<caret line="74" column="8" lean-forward="true" selection-start-line="74" selection-start-column="8" selection-end-line="74" selection-end-column="8" />
<folding>
<element signature="e#0#13#0" expanded="true" />
<marker date="1542906615593" expanded="true" signature="129:130" ph="..." />
<marker date="1542906615593" expanded="true" signature="129:135" ph="..." />
<marker date="1542906615593" expanded="true" signature="1186:1387" ph="..." />
<marker date="1542906615593" expanded="true" signature="1414:1509" ph="..." />
<element signature="e#0#29#0" expanded="true" />
<marker date="1542908071934" expanded="true" signature="112:1695" ph="..." />
<marker date="1542908071934" expanded="true" signature="401:624" ph="..." />
<marker date="1542908071934" expanded="true" signature="694:1488" ph="..." />
<marker date="1542908071934" expanded="true" signature="1746:1822" ph="..." />
<marker date="1542908071934" expanded="true" signature="1893:1898" ph="..." />
<marker date="1542908071934" expanded="true" signature="1893:2374" ph="..." />
</folding>
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/src/PES.py">
<entry file="file://$PROJECT_DIR$/src/main.py">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="353">
<caret line="163" lean-forward="true" selection-start-line="163" selection-end-line="163" />
<state relative-caret-position="282">
<caret line="31" column="41" lean-forward="true" selection-start-line="31" selection-start-column="41" selection-end-line="31" selection-end-column="41" />
<folding>
<element signature="e#0#23#0" expanded="true" />
<marker date="1542903616715" expanded="true" signature="121:198" ph="..." />
<marker date="1542903616715" expanded="true" signature="375:415" ph="..." />
<marker date="1542903616715" expanded="true" signature="1510:3144" ph="..." />
<marker date="1542903616715" expanded="true" signature="3322:3400" ph="..." />
<marker date="1542903616715" expanded="true" signature="3414:3453" ph="..." />
<marker date="1542903616715" expanded="true" signature="3652:3657" ph="..." />
<element signature="e#0#15#0" expanded="true" />
</folding>
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/src/svgFunctions.py">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="420">
<caret line="84" column="61" selection-start-line="84" selection-start-column="61" selection-end-line="84" selection-end-column="61" />
<state relative-caret-position="1575">
<caret line="105" column="33" lean-forward="true" selection-start-line="105" selection-start-column="33" selection-end-line="105" selection-end-column="33" />
<folding>
<element signature="e#0#19#0" expanded="true" />
<marker date="1542909370179" expanded="true" signature="374:375" ph="..." />
<marker date="1542909370179" expanded="true" signature="374:438" ph="..." />
<marker date="1542919038136" expanded="true" signature="421:759" ph="..." />
<marker date="1542919038136" expanded="true" signature="832:833" ph="..." />
<marker date="1542919038136" expanded="true" signature="832:896" ph="..." />
<marker date="1542919038136" expanded="true" signature="4293:4298" ph="..." />
</folding>
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/Colors/getColors.py">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="513">
<caret line="78" column="15" lean-forward="true" selection-start-line="78" selection-start-column="15" selection-end-line="78" selection-end-column="15" />
<folding>
<element signature="e#0#9#0" expanded="true" />
</folding>
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/src/PES.py">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="400">
<caret line="102" column="48" selection-start-line="102" selection-start-column="48" selection-end-line="102" selection-end-column="48" />
<folding>
<element signature="e#0#23#0" expanded="true" />
<marker date="1542919229810" expanded="true" signature="133:210" ph="..." />
<marker date="1542919229810" expanded="true" signature="387:427" ph="..." />
<marker date="1542919229810" expanded="true" signature="3372:3633" ph="..." />
<marker date="1542919229810" expanded="true" signature="4664:6341" ph="..." />
<marker date="1542919229810" expanded="true" signature="6519:6597" ph="..." />
<marker date="1542919229810" expanded="true" signature="6611:6650" ph="..." />
<marker date="1542919229810" expanded="true" signature="6868:6873" ph="..." />
<marker date="1542919229810" expanded="true" signature="7157:7163" ph="..." />
</folding>
</state>
</provider>

115
Colors/getColors.py 100644
Wyświetl plik

@ -0,0 +1,115 @@
import re
import sys
# This file converts the color table for PES version 1 into something I can use in Python
all = """
1 007 Prussian Blue A `#1a0a94`
2 000 Blue A `#0f75ff`
3 534 Teal Green A `#00934c`
4 070 Corn Flower Blue A `#babdfe`
5 800 Red A `#ec0000`
6 000 Reddish Brown A `#e4995a`
7 620 Magenta A `#cc48ab`
8 810 Light Lilac A `#fdc4fa`
9 000 Lilac A `#dd84cd`
10 502 Mint Green A `#6bd38a`
11 214 Deep Gold A `#e4a945`
12 208 Orange A `#ffbd42`
13 000 Yellow A `#ffe600`
14 513 Lime Green A `#6cd900`
15 328 Brass A `#c1a941`
16 005 Silver A `#b5ad97`
17 000 Russet Brown A `#ba9c5f`
18 000 Cream Brown A `#faf59e`
19 704 Pewter A `#808080`
20 900 Black A `#000000`
21 000 Ultramarine A `#001cdf`
22 000 Royal Purple A `#df00b8`
23 707 Dark Gray A `#626262`
24 058 Dark Brown A `#69260d`
25 086 Deep Rose A `#ff0060`
26 323 Light Brown A `#bf8200`
27 079 Salmon Pink A `#f39178`
28 000 Vermilion A `#ff6805`
29 001 White A `#f0f0f0`
30 000 Violet A `#c832cd`
31 000 Seacrest A `#b0bf9b`
32 019 Sky Blue A `#65bfeb`
33 000 Pumpkin A `#ffba04`
34 010 Cream Yellow A `#fff06c`
35 000 Khaki A `#feca15`
36 000 Clay Brown A `#f38101`
37 000 Leaf Green A `#37a923`
38 405 Peacock Blue A `#23465f`
39 000 Gray A `#a6a695`
40 000 Warm Gray A `#cebfa6`
41 000 Dark Olive A `#96aa02`
42 307 Linen A `#ffe3c6`
43 000 Pink A `#ff99d7`
44 000 Deep Green A `#007004`
45 000 Lavender A `#edccfb`
46 000 Wisteria Violet A `#c089d8`
47 843 Beige A `#e7d9b4`
48 000 Carmine A `#e90e86`
49 000 Amber Red A `#cf6829`
50 000 Olive Green A `#408615`
51 107 Dark Fuchsia A `#db1797`
52 209 Tangerine A `#ffa704`
53 017 Light Blue A `#b9ffff`
54 507 Emerald Green A `#228927`
55 614 Purple A `#b612cd`
56 515 Moss Green A `#00aa00`
57 124 Flesh Pink A `#fea9dc`
58 000 Harvest Gold A `#fed510`
59 000 Electric Blue A `#0097df`
60 205 Lemon Yellow A `#ffff84`
61 027 Fresh Green A `#cfe774`
62 000 Applique Material A `#ffc864`
63 000 Applique Position A `#ffc8c8`
64 000 Applique A `#ffc8c8`"""
p = "(\\d+)\\t(\\d+)\\t([^\\t]+)\\tA\\t`#(\\S{6})`"
lines = re.findall(p, all)
colors = []
for line in lines:
last = line[-1]
print(last)
r = int(last[0:2], 16)
g = int(last[2:4], 16)
b = int(last[4:6], 16)
color = (line[2], r, g, b)
colors.append(color)
# Print so it can be pasted into Python source
sys.stdout.write("colors = [")
for color in colors:
sys.stdout.write("{}".format(color))
if color is not colors[-1]:
sys.stdout.write(", \n")
sys.stdout.write("]")

Wyświetl plik

@ -0,0 +1,6 @@
# References
Colors for PES version 1 were taken from [here.](https://edutechwiki.unige.ch/en/Embroidery_format_PEC#Stitch)

Wyświetl plik

@ -5,11 +5,35 @@
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
xmlns:svg="http://www.w3.org/2000/svg"
xmlns="http://www.w3.org/2000/svg"
xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
width="210mm"
height="297mm"
viewBox="0 0 744.09448819 1052.3622047"
id="svg2"
version="1.1">
version="1.1"
inkscape:version="0.91 r13725"
sodipodi:docname="simplePath.svg">
<sodipodi:namedview
pagecolor="#ffffff"
bordercolor="#666666"
borderopacity="1"
objecttolerance="10"
gridtolerance="10"
guidetolerance="10"
inkscape:pageopacity="0"
inkscape:pageshadow="2"
inkscape:window-width="995"
inkscape:window-height="681"
id="namedview6"
showgrid="false"
inkscape:zoom="0.22425739"
inkscape:cx="-274.53123"
inkscape:cy="526.1811"
inkscape:window-x="0"
inkscape:window-y="0"
inkscape:window-maximized="0"
inkscape:current-layer="svg2" />
<defs
id="defs4" />
<metadata
@ -20,12 +44,12 @@
<dc:format>image/svg+xml</dc:format>
<dc:type
rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
<dc:title></dc:title>
<dc:title />
</cc:Work>
</rdf:RDF>
</metadata>
<path
id="path3335"
d="m 220,288.3622 c 0,0 247,-91 232,7 -15,98 -232,-7 -232,-7 z"
style="fill:none;fill-rule:evenodd;stroke:#000000;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1" />
style="fill:#0000ff;fill-rule:evenodd;stroke:#000000;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1;fill-opacity:1" />
</svg>

Przed

Szerokość:  |  Wysokość:  |  Rozmiar: 956 B

Po

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

Wyświetl plik

@ -1,5 +1,6 @@
from struct import pack
from svgpathtools import Line
import math
def encodeU8(num):
return pack("<B", num)
@ -26,11 +27,86 @@ The PES object and all the objects that follow it
are for easy encoding to the PES format.
'''
class PES:
colors = [('Prussian Blue', 26, 10, 148),
('Blue', 15, 117, 255),
('Teal Green', 0, 147, 76),
('Corn Flower Blue', 186, 189, 254),
('Red', 236, 0, 0),
('Reddish Brown', 228, 153, 90),
('Magenta', 204, 72, 171),
('Light Lilac', 253, 196, 250),
('Lilac', 221, 132, 205),
('Mint Green', 107, 211, 138),
('Deep Gold', 228, 169, 69),
('Orange', 255, 189, 66),
('Yellow', 255, 230, 0),
('Lime Green', 108, 217, 0),
('Brass', 193, 169, 65),
('Silver', 181, 173, 151),
('Russet Brown', 186, 156, 95),
('Cream Brown', 250, 245, 158),
('Pewter', 128, 128, 128),
('Black', 0, 0, 0),
('Ultramarine', 0, 28, 223),
('Royal Purple', 223, 0, 184),
('Dark Gray', 98, 98, 98),
('Dark Brown', 105, 38, 13),
('Deep Rose', 255, 0, 96),
('Light Brown', 191, 130, 0),
('Salmon Pink', 243, 145, 120),
('Vermilion', 255, 104, 5),
('White', 240, 240, 240),
('Violet', 200, 50, 205),
('Seacrest', 176, 191, 155),
('Sky Blue', 101, 191, 235),
('Pumpkin', 255, 186, 4),
('Cream Yellow', 255, 240, 108),
('Khaki', 254, 202, 21),
('Clay Brown', 243, 129, 1),
('Leaf Green', 55, 169, 35),
('Peacock Blue', 35, 70, 95),
('Gray', 166, 166, 149),
('Warm Gray', 206, 191, 166),
('Dark Olive', 150, 170, 2),
('Linen', 255, 227, 198),
('Pink', 255, 153, 215),
('Deep Green', 0, 112, 4),
('Lavender', 237, 204, 251),
('Wisteria Violet', 192, 137, 216),
('Beige', 231, 217, 180),
('Carmine', 233, 14, 134),
('Amber Red', 207, 104, 41),
('Olive Green', 64, 134, 21),
('Dark Fuchsia', 219, 23, 151),
('Tangerine', 255, 167, 4),
('Light Blue', 185, 255, 255),
('Emerald Green', 34, 137, 39),
('Purple', 182, 18, 205),
('Moss Green', 0, 170, 0),
('Flesh Pink', 254, 169, 220),
('Harvest Gold', 254, 213, 16),
('Electric Blue', 0, 151, 223),
('Lemon Yellow', 255, 255, 132),
('Fresh Green', 207, 231, 116),
('Applique Material', 255, 200, 100),
('Applique Position', 255, 200, 200),
('Applique', 255, 200, 200)]
def __init__(self):
@classmethod
def getClosestColor(cls, color):
# Black by default
closest = 19
for cur in cls.colors:
red = math.pow( cur[1] - color[0], 2)
green = math.pow(cur[1] - color[0], 2)
blue = math.pow(cur[1] - color[0], 2)
dist = math.sqrt( red + green + blue )
def __init__(self, stitchCommands=[]):
self.magic = "#PES"
self.version = "0001"
self.sections = []
self.stitchCommands = []
def encode(self):
b = bytearray()
@ -61,10 +137,10 @@ class PES:
return b
class PEC:
def __init__(self):
def __init__(self, stitchCommands=[]):
self.label = "default"
self.numberOfColors = 1
self.stitches = []
self.stitchCommands = stitchCommands
def encode(self, b):
@ -115,7 +191,7 @@ class PEC:
b.extend([0x00] * 4)
for stitch in self.stitches:
for stitch in self.stitchCommands:
stitch.encode(b)
# End of stitch list
@ -147,6 +223,7 @@ class CSewSeg:
None
class Stitch:
TYPE_ERROR = 0
TYPE_LONG = 0x8000
TYPE_JUMP = 0x9000
TYPE_TRIM = 0xA000
@ -155,16 +232,21 @@ class Stitch:
# Initialize a new stitch from the previous location
# to the new location.
def __init__(self, line):
assert(line is Line)
assert(type(line) is Line)
self.line = line
self.type = Stitch.TYPE_LONG
self.previous = line.start
self.new = line.end
def encode(self, b):
None
def length(self):
return self.line.length()
# Flips the start and end points of a stitch
def reverse(self):
self.line = Line(start=self.line.end, end=self.line.start)

Plik binarny nie jest wyświetlany.

Wyświetl plik

@ -22,15 +22,23 @@ if args.debug:
# Load the SVG file from disk
svg = loadVectorGraphic(args.inputFile)
paths, attributes = svg
if paths is None or attributes is None:
if paths is None:
sys.exit(0)
# Enumerate the shapes in the SVG to find where stitches should go.
for shape in paths:
print(shape)
stitchLines = makeStitchLines(shape)
basicStitches = []
for i, shape in enumerate(paths):
fillColor = getColorOfPathAtIndex(attributes,i)
print("Doing shape {} with fill color {}".format(shape, fillColor))
stitchLines = makeStitchLines(shape,fillColor)
# Append the stitches as their own array so we can separate by colors
basicStitches.append(stitchLines)
pes = PES()
# Make the stitches into a continuous set of commands
stitchCommands = createStitchRoutine(basicStitches)
pes = PES(stitchCommands=stitchCommands)
pes.encode()
if args.debug:

Wyświetl plik

@ -2,18 +2,38 @@ import svgpathtools
from PES_Emb_mathutils import *
from PES_render_utils import *
from PES import Stitch
import re
import numpy
def loadVectorGraphic(filename):
svg = None
attributes = None
try:
svg = svgpathtools.svg2paths(filename)
svg, attributes = svgpathtools.svg2paths(filename)
except:
print("Couldn't load SVG file. Perhaps it doesn't exist?")
return svg
return svg, attributes
def makeStitchLines(shape, threadWidth=0.04, slope=1):
def getColorOfPathAtIndex(attributes, index):
color = (0, 0, 0)
if attributes is None:
return color
try:
m = re.search("fill:#(\S{6})", attributes[index]["style"])
last = m.group(1)
r = int(last[0:2], 16)
g = int(last[2:4], 16)
b = int(last[4:6], 16)
color = (r, g, b)
except:
None
return color
def makeStitchLines(shape, fillColor=(0,0,0), threadWidth=0.04, slope=1):
"""
:type shape: svgpathtools.CubicBezier
@ -81,14 +101,22 @@ def makeStitchLines(shape, threadWidth=0.04, slope=1):
end = l.point(intersections[i+1][1][0])
# Create a stitch for the given start and end points
l = Line(start=start, end=end)
# Choose a stitch format based on the last stitch
s = Stitch(line=l)
stitchLines.append(s)
# Draw lines
GenericRenderer.globalRenderer.addLine(l, 255, 0, 50)
# Draw debug lines
GenericRenderer.globalRenderer.addLine(l, fillColor[0], fillColor[1], fillColor[2])
return stitchLines
return stitchLines
# Take all the stitches we created and actually make
# a continuous set of commands for the machine to follow.
def createStitchRoutine(basicStitches):
for shapeStitches in basicStitches:
for stitch in shapeStitches:
# Remove lines that are super short
if stitch.length() < 5.0:
continue

Plik binarny nie jest wyświetlany.