get_aligned_vertices

Function
get_aligned_vertices(
    state1: VertexState,
    state2: VertexState,
    vertex_aligner: Optional[VertexAligner] = None,
    mapper: Optional[Mapper] = None,
    rotation_target: float | None = None
) -> Tuple[VertexContours, VertexContours]

Align vertex contours and return aligned contours

This is called once per segment during keystate preprocessing. Returns new VertexContours instances with aligned outer vertices and matched holes. Uses pluggable strategies: - VertexAligner: How to align outer vertex loops (auto-selected by default) - Mapper: How to match holes between states (from config by default)

Parameters

state1
First state in the transition
state2
Second state in the transition
vertex_aligner
Custom vertex alignment strategy (default: auto-select based on closure)
mapper
Custom mapper for hole matching (default: from config)
rotation_target
Target rotation for dynamic alignment (default: None, uses state2.rotation)

Returns

Tuple of (contours1_aligned, contours2_aligned) Raises: ValueError: If states have different num_vertices