subdivide_endpoint_by_crossing#

subdivide_endpoint_by_crossing(k, endpoint, crossing_position, **attr)#

Insert a new crossing on the arc incident to endpoint.

The new crossing connects at crossing_position and its opposite position (+2 mod 4) to the twin. This is a specialized subdivision producing a 4-valent crossing instead of a 2-valent vertex.

Parameters:
  • k (PlanarDiagram) – Planar diagram to modify (in place).

  • endpoint (Endpoint | tuple) – An Endpoint instance or a pair (node, position).

  • crossing_position (int) – Position (0..3), normalized mod 4, where the endpoint is attached.

  • **attr – Attributes for the new crossing.

Returns:

The name of the newly created crossing node.

Return type:

str