class DRAWKNOT_PIC_ALG
****
Convert knot diagram to Tpic graphic data for plainTeX, AmS-TeX, LaTex.

I assume as follows in this version. Use 'mm' as a unit length. Diagram is scaled into the box of (width,height) with margin of 'margin'.

(xofs(mm),yofs(mm)) is offset from top-left in LaTeX picture.

To use this, copy to LaTeX file as picture environment. top-left is origin of LaTeX/picture and tpic. But, note their direction. picture: right to positive, under to negative tpic : right to positive, under to positive In tpic , unit length is 1/1000 in.


Flattened version is here



Public


Readonly Shareds
shared widthTeX,heightTeX:FLT;
**** size of picture
shared kxmin, kxmax, kymin, kymax, kwidth:INT;
****
shared kxmin, kxmax, kymin, kymax, kwidth:INT;
****
shared kxmin, kxmax, kymin, kymax, kwidth:INT;
****
shared kxmin, kxmax, kymin, kymax, kwidth:INT;
****
shared kxmin, kxmax, kymin, kymax, kwidth:INT;
****
shared scale:FLT;
**** scaling
shared widthTeX,heightTeX:FLT;
**** size of picture
shared xofsTP, yofsTP:FLT;
**** (left,top) of knot
shared xofsTP, yofsTP:FLT;
**** (left,top) of knot

Writable Shareds
shared widthTeX,heightTeX:FLT;
**** size of picture
shared kxmin, kxmax, kymin, kymax, kwidth:INT;
****
shared kxmin, kxmax, kymin, kymax, kwidth:INT;
****
shared kxmin, kxmax, kymin, kymax, kwidth:INT;
****
shared kxmin, kxmax, kymin, kymax, kwidth:INT;
****
shared kxmin, kxmax, kymin, kymax, kwidth:INT;
****
shared scale:FLT;
**** scaling
shared widthTeX,heightTeX:FLT;
**** size of picture
shared xofsTP, yofsTP:FLT;
**** (left,top) of knot
shared xofsTP, yofsTP:FLT;
**** (left,top) of knot

Features
DrawKnotPic(Knot:KNOT, width, height, margin, scalingMode:INT)
DrawKnotPic(Knot:KNOT, width, height, margin, scalingMode:INT,smoothDraw:BOOL)
****
__width,_height,_margin_:_unit_length_1mm
JIS standard fat line : 0.3-0.8mm medium line : 0.2-0.4mm thin line : <0.2mm
SetScale(Knot:KNOT, width, height, margin, scalingMode:INT)
arrowPic(gx0, gy0, gx1, gy1:INT)
**** Draw arrow at the center of pt.0 and pt.1
circle(x, y, r, incol:INT)
flush(inout Bridge:KNOT,smoothDraw:BOOL)
setCol(col:INT)
setPa(x, y:INT)
spc:STR
**** TeX special command.
unitLen:FLT
**** Note that unit length of tpic is 0.001in = 0.001*25.4mm.
xposTP(x:INT):STR
yposTP(y:INT):STR

The Sather Home Page