quilt_knit.swatch.course_wise_merging.Course_Seam_Search_Space module
Module containing the Course_Seam_Search_Space class.
- class Course_Seam_Search_Space(left_swatch, right_swatch)[source]
Bases:
Seam_Search_SpaceNetwork of potential linking instructions between swatches to form a vertical seam along the courses.
- left_swatch_boundaries_by_course_index
Left-swatch course indices keyed to the boundary of that course.
- Type:
- right_swatch_boundaries_by_course_index
Right-swatch boundaries keyed to the boundary of that course.
- Type:
- remove_boundaries_beyond_course_connections(course_wise_connection, remove_left_swatch=True, remove_right_swatch=True)[source]
Removes boundary instructions from the search space that occur outside the range of courses in the course-wise connection.
- Parameters:
course_wise_connection (Course_Wise_Connection) – The connection to narrow the search space to.
remove_left_swatch (bool, optional) – Whether to remove boundary instructions in left swatch from the search space. Defaults to True.
remove_right_swatch (bool, optional) – Whether to remove boundary instructions in right swatch from the search space. Defaults to True.
- Return type:
- available_connections(boundary_instruction)
- Parameters:
boundary_instruction (Wale_Boundary_Instruction) – The boundary instruction to find the available connections to.
- Returns:
A list of all available connections to the given instruction. If this is an exit, only entrance instructions will be returned. If it is an entrance, only exits will be returned.
- Return type:
- remove_boundary(instruction)
Removes any boundary instruction associated with the given instruction from the search space. If the instruction does not belong to a boundary, nothing happens.
- Parameters:
instruction (Knitout_Line) – The boundary instruction to remove from the search space.
- Returns:
The boundary instruction that was removed or None, if no boundary was found by that instruction.
- Return type:
Swatch_Boundary_Instruction | None