compose_tangles#
- compose_tangles(tangle1, tangle2)#
Compose two tangles by connecting matching tangle endpoints.
Both tangles must have endpoints labeled with tangle_endpoint values 0–3. Each label must appear exactly twice across the combined diagram.
- Parameters:
tangle1 (PlanarDiagram | OrientedPlanarDiagram) – First tangle diagram.
tangle2 (PlanarDiagram | OrientedPlanarDiagram) – Second tangle diagram.
- Raises:
ValueError – If endpoint labels are missing or not paired correctly.
- Returns:
The composed tangle diagram.
- Return type: