Technical documentation of the Python objects that underly PLink. Of interest only to Marc, Nathan, or similar folks.
A graphical link drawing tool based on the one embedded in Jeff Weeks’ original SnapPea program.
Return the standard meridian-longitude coordinates of the blackboard longitude (i.e. the peripheral element obtained by following the top of a tubular neighborhood of the knot).
Displays the meridian-longitude coordinates of the blackboard longitudes of the components of the link
Displays an alphabetical Dowker-Thistlethwaite code, as used in the knot tabulations.
Return the Dowker-Thistlethwaite code as a list of tuples of even integers. Requires that all components be closed.
If alpha is set to True, this method returns the alphabetical Dowker-Thistlethwaite code as used in Oliver Goodman’s Snap and in the tabulations by Jim Hoste and Morwen Thistlethwaite.
If return_sizes is set to True, a list of the number of crossings in each component is returned (this is for use by Gauss_code).
Displays a Dowker-Thistlethwaite code as a list of tuples of signed even integers.
Return a Gauss code for the link. The Gauss code is computed from a DT code, so the Gauss code will use the same indexing of crossings as is used for the DT code. Requires that all components be closed.
Displays a Gauss code as a list of tuples of signed integers.
Return the PD (Planar Diagram) code for the link projection, as a list of 4-tuples.
Displays a PD code as a list of 4-tuples.
Constructs a python simulation of a SnapPea KLPProjection (Kernel Link Projection) structure. See Jeff Weeks’ SnapPea file link_projection.h for definitions. Here the KLPCrossings are modeled by dictionaries. This method requires that all components be closed. A side effect is that the KLP attributes of all crossings are updated.
The following excerpt from link_projection.h describes the main convention:
If you view a crossing (from above) so that the strands go in the direction of the positive x- and y-axes, then the strand going in the x-direction is the KLPStrandX, and the strand going in the y-direction is the KLPStrandY. Note that this definition does not depend on which is the overstrand and which is the understrand:
KLPStrandY
^
|
----+---> KLPStrandX
|
|
Returns a string containing the contents of a SnapPea link projection file.
Recolors and redraws all components, in DT order, and displays the legend linking colors to cusp indices.
Returns a list of components, given as lists of arrows. The closed components are sorted in DT order if they have been marked. The others are sorted by age.
Returns a list of lists of ECrossings, one per component, where the corresponding crossings are ordered consecutively through the component. Requires that all components be closed.
Event handler for mouse double-clicks.
Handler for keypress events.
Changes crossings to make the projection alternating. Requires that all components be closed.
Handler for mouse motion events.
Returns a list of lists of polylines, one per component, that make up the drawing of the link diagram. Each polyline is a list of coordinates [(x0,y0), (x1,y1), ...] Isolated vertices are ignored.
Display the DT hit counters next to each crossing. Crossings that need to be flipped for the planar embedding have an asterisk.
Event handler for mouse clicks.
Returns a list of crossing components which have been sorted and cyclically permuted, following the scheme used in “standard” DT codes.
The sorting process also sets the hit counters on all crossings, for use in computing DT and Gauss codes, and sets the component attribute of each arrow in each component.
Requires that all components be closed.
An arrow in a PL link diagram.
Prepare the arrow for the garbage collector.
Return a list of segments that make up this arrow, each segment being a list of 4 coordinates [x0,y0,x1,y1]. The first segment starts at the start vertex, and the last one ends at the end vertex. Otherwise, endpoints are either near crossings where this arrow goes under, leaving a gap between the endpoint and the crossing point. If the split_at_overcrossings flag is True, then the segments are also split at overcrossings, with no gap.
A pair of crossing arrows in a PL link diagram.
Count the crossing, using DT conventions. Return True on the first hit if the count is odd and the crossing is shared by two components of the diagram. As a side effect, set the flipped attribute on the first hit.