insert_endpoint#
- insert_endpoint(k, target_endpoint, adjacent_endpoint, **attr)#
Insert one endpoint into a node’s incidence list (shifting others CCW).
This is a low-level primitive. It does not automatically update the twin at the other node; it simply places the given adjacent endpoint object into the target position.
- Parameters:
k (PlanarDiagram) – Diagram to modify (in place).
target_endpoint (tuple) –
(node, pos)
where to place the new endpoint.adjacent_endpoint (tuple | Endpoint) – The endpoint object (or tuple convertible to one) to insert into the node’s incidence list at
(node, pos)
.**attr – Attributes merged into the endpoint at insertion.
- Raises:
ValueError – If target node is not a vertex.
- Return type:
None