quilt_knit.swatch.Seam_Connection module
Module containing the Seam_Connection class.
- class Seam_Connection(_exit_instruction, _entrance_instruction)[source]
Bases:
objectSuper class of the connections between exit-entrance instruction boundaries for merging swatches.
- Parameters:
_exit_instruction (
Swatch_Boundary_Instruction)_entrance_instruction (
Swatch_Boundary_Instruction)
- property seam_exit: Swatch_Boundary_Instruction
Returns: Swatch_Boundary_Instruction: The instruction that exits the merging swatch.
- property seam_entrance: Swatch_Boundary_Instruction
Returns: Swatch_Boundary_Instruction: The instruction that enters the merging swatch
- __lt__(other)[source]
- Parameters:
other (Seam_Connection) – The other seam connection to compare to.
- Returns:
True if the other seam connection’s exit instruction comes after this exit instruction in their original swatch programs.
- Return type:
Notes
This is reimplemented in the subclasses for more nuanced comparison of connections.
- static sort_connections(connections)[source]
- Parameters:
connections (set[Seam_Connection]) – The list of connections to sort.
- Returns:
The sorted list of connections.
- Return type:
List[Seam_Connection]
- __eq__(other)[source]
- Parameters:
other (Course_Seam_Connection) – The other connection to compare to.
- Returns:
True if both connections connect the same entrance-exit pairs.
- Return type:
- __contains__(item)[source]
- Parameters:
item (Swatch_Boundary_Instruction) – The instruction to find in the connection.
- Returns:
True if the given item is one of the boundary instructions involved in the connection. False, otherwise.
- Return type:
- __init__(_exit_instruction, _entrance_instruction)
- Parameters:
_exit_instruction (
Swatch_Boundary_Instruction)_entrance_instruction (
Swatch_Boundary_Instruction)