Releases: EmbroidePy/pyembroidery
TBF Writer Flip Corrections
The coord system for TBF writing was flipped wrongly. It should have been flipped -y to make it consistent with all the other writers. And make it consistent with the reader.
What's Changed
Full Changelog: 1.5.0...1.5.1
Do not pass silently, for IOErrors.
Breaking Changes
IOErrors are raised on failure to read or write the data, including non-existent entries, or formats without writers.
What's Changed
- Update README.md by @aurishhammadhafeez in #147
- Fix typos by @luzpaz in #155
- Add in unittest/funding info by @tatarize in #159
- Fancy View by @tatarize in #154
- Fix unittest for main branch (name changed) by @tatarize in #160
- Added shorthand api for json by @yuelikestocode in #161
- fix division by zero error if max_pos === 0 by @gemini133 in #163
- Add TBF Writer, improve TBF-Reader by @tatarize in #166
- Don't pass silently when trying to write unsupported extension by @ali-sajjad-rizavi in #164
- Throw errors on file read/write if errors occur by @tatarize in #167
New Contributors
- @aurishhammadhafeez made their first contribution in #147
- @luzpaz made their first contribution in #155
- @yuelikestocode made their first contribution in #161
- @gemini133 made their first contribution in #163
- @ali-sajjad-rizavi made their first contribution in #164
Full Changelog: 1.4.36...1.5.0
Generic Writer: Importing
Generic Writer: Dynamic Values
What's Changed
Note the formatting of "needle_set"
, which provides a None
key for the dictionary of with the key
and default
values. The key in question is transmuted the same way the other lines are. So this would work well for needle_set number, or specific line numbers, but not so well for general x,y
positions.
gcode_writer_dict = {
"scale": (0.1, -0.1),
"thread_change_command": NEEDLE_SET,
"write_speeds": True,
"pattern_start": "G21 G90 F6000 (mm units, absolute positioning, speed)\n",
"thread_entry": "(Thread{thread_index}: {thread_color} {thread_description} {thread_brand} {thread_catalog_number})\n",
"color_start": "G00 X{x:.3f} Y{y:.3f} (Starting new location)\n",
"stitch": "G01 X{x:.3f} Y{y:.3f}\n",
"slow": "F1000\n",
"fast": "F6000\n",
"needle_set": {None: ("{cmd_needle}", "default value {cmd_needle}\n"), "1": "G0A51\n", "2": "G0B8\n"},
"end": "M30\n",
}
file = "file-generic.gcode"
EmbPattern.write_embroidery(
GenericWriter,
pattern,
file,
gcode_writer_dict,
)
Full Changelog: 1.4.34...1.4.35
Generic Writer
Based on the ideas established by vpype-gcode
this adds a generic writer for writing generic formatting.
gcode_writer_dict = {
"scale": (-0.1, -0.1),
"pattern_start": "(STITCH_COUNT: {stitch_total})\n"
"(THREAD_COUNT: {color_change_count})\n"
"(EXTENTS_LEFT: {extents_left:.3f})\n"
"(EXTENTS_TOP: {extends_top:.3f})\n"
"(EXTENTS_RIGHT: {extends_right:.3f})\n"
"(EXTENTS_BOTTOM: {extends_bottom:.3f})\n"
"(EXTENTS_WIDTH: {extends_width:.3f})\n"
"(EXTENTS_HEIGHT: {extends_height:.3f})\n"
"(COMMAND_STITCH: {stitch_count})\n"
"(COMMAND_COLOR_CHANGE: {color_change_count})\n"
"(COMMAND_TRIM: {trim_count})\n"
"(COMMAND_STOP: {stop_count})\n"
"(COMMAND_END: {end_count})\n",
"metadata_entry": "({metadata_key}: {metadata_value})\n",
"thread_entry": "(Thread{thread_index}: {thread_color} {thread_description} {thread_brand} {thread_catalog_number})\n",
"stitch": "G00 X{x:.3f} Y{y:.3f}\nG00 Z{z:.1f}\n",
"color_change": "M00\n",
"stop": "M00\n",
"end": "M30\n",
}
EmbPattern.write_embroidery(
GenericWriter,
pattern,
"myfile.gcode,
gcode_writer_dict,
)
For example this creates a duplicate of the gcode writer within pyembroidery currently.
#135 fixed missing zhs extensions in supported format catalog
- Imported fix.
- Added test to avoid error in the future.
Pec/Pes Corrections
PEC files are actually started 4 bytes earlier than I previously believed and the weird encoded extend is actually a jump stitch at the start. This is corrected for loading and saving.
Zhs Embroidery Format Reader
- Includes Zhs Embroidery Format reader.
Jef Stops
Maintaince
- Delete erroneous
__init__.py
- Apply Black
- Apply isort