Skip to content

Commit

Permalink
Make knitting match what you see
Browse files Browse the repository at this point in the history
The most important change is to flip the image instead of rotating
it 180 degrees when preparing the pattern.

In KnitProgress we remove the left-to-right reversal that was done to
compensate for the unnecessary mirroring.
  • Loading branch information
jonathanperret committed Jun 27, 2024
1 parent c34da0b commit c810fb8
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 2 deletions.
2 changes: 2 additions & 0 deletions src/main/python/main/ayab/engine/communication.py
Original file line number Diff line number Diff line change
Expand Up @@ -174,6 +174,8 @@ def cnf_line_API6(
color (int): The yarn color to be sent.
flags (int): The flags sent to the controller.
line_data (bytes): The bytearray to be sent to needles.
The leftmost needle is controlled by the least-significant bit of
the first byte.
"""
if self.__ser is None:
return
Expand Down
2 changes: 1 addition & 1 deletion src/main/python/main/ayab/engine/engine.py
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,7 @@ def knit_config(self, image: Image.Image) -> None:
self.__logger.debug(self.config.as_dict())

# start to knit with the bottom first
image = image.transpose(Image.ROTATE_180)
image = image.transpose(Image.FLIP_TOP_BOTTOM)

# TODO: detect if previous conf had the same
# image to avoid re-generating.
Expand Down
1 change: 0 additions & 1 deletion src/main/python/main/ayab/knitprogress.py
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,6 @@ def update_progress(
columns.append(carriage.symbol + " " + direction.symbol)

# graph line of stitches
status.bits.reverse()
midline = len(status.bits) - midline

table_text = (
Expand Down

0 comments on commit c810fb8

Please sign in to comment.