I'd like to recursively draw tangles (=knots with open ends). So, the fundamental object O is a crossing, having some fixed size, say fitting into Rectangle[{{-100,-100},{100,100}}]
, e.g. {Line[{{-100, 100}, {100, -100}}], Line[{{-100, -100}, {-50, -50}}], Line[{{50, 50}, {100, 100}}]}
.
I must be able to "add" any two objects O1,O2 (rescale object O1 to fit into Rectangle[{{-100,-100},{0,100}}]
, object O2 to fit into Rectangle[{{0,100},{100,100}}]
- i.e. O1 is compressed into the left and O2 into the right half of the rectangle - merge and store as a new graphic object "O1+O2") and "rotate" any object O1 (rotate O1 around 0,0 by 90 degrees). In both cases the new object fits into the rectangle above again. Visually:
(I assume this can be reused?!)
(EDIT: I think I have an own idea: Since my graphic objects are just lists of Line[[{x1,y1},{x2,y2}}]]
statements, I could simply map the contractions over them, I just have to handle when a statement is "left" or "right". I always have trouble with multiple slot syntax, but I guess I manage that...)