Let a lightray bounce around inside a cube whose faces
are (internal) mirrors.
If its slopes are rational, it will eventually form a cycle.
For example, starting with a point $p_0$ in the interior
of the $-Y$ face of an axis-aligned cube, and initially heading in a direction 
$v_0=(1,1,1)$, the ray will rejoin $p_0$ after 5 reflections,
forming a hexagon.
The figure below shows a more complicated 16-cycle.

<br />
![alt text][1]
<br />

Assume that $p_0$ and $v_0$ are chosen so that 
(a) the ray never directly hits an edge or corner of the cube,
and (b) the ray path never self-intersects inside the cube.

> Can every knot type be realized by a lightray reflecting inside in a cube?

The figure above is an unknot.
I believe (but am not certain) the 31-cycle below is knotted:
<br />
![alt text][2]
<br />

Any such knotted path is a _stick_ representation of the knot,
but perhaps the many unsolved problems in stick representations
are not relevant to this situation.
My question is related to the probability of random knots
forming under various models, but usually those models are
aimed at polymers or DNA.  I have not seen this lightray model
explored, but would be interested to know of related models.

The choice of $(p_0,v_0)$ allows considerable freedom to "design"
a knot, but it seems difficult to control the structure of the path
to achieve a particular result.
I've explored tiling space by reflected cubes so
that the lightray may be viewed as a straight segment between
two images of $p_0$, but this viewpoint is not yielding
me insights.

If anyone has ideas, however partial, I would appreciate hearing them.
Thanks!

<b>Edit</b>.
I have not been able to yet access the
Jones-Przytycki paper that Pierre cites, but knowing the
keywords he kindly provided, I did
find related work by
Christoph Lamm 
(["There are infinitely many Lissajous knots"
_Manuscripta Mathematica_
<b>93</b>(1): 29-37
(1997)][3])
that provides useful information:

1. _Theorem_: Billiard knots in a cube are isotopic to Lissajous knots.
Bill Thurston sketched a proof in the comments.

2. As Pierre said, many knots are unachievable in these models.  In particular,
algebraic knots cannot be achieved.
The technical result is this. 
_Theorem_: The Alexander polynomial of a billiard knot is a square
mod 2.

3. In 1997, there were several intriguing open problems, including
these two. (a) Is every knot a billiard knot in some convex polyhedron?
(b) Can the unknot be achieved in every convex polyhedron that supports periodic paths?


  [1]: http://cs.smith.edu/~orourke/MathOverflow/UnKnotRay.jpg
  [2]: http://cs.smith.edu/~orourke/MathOverflow/Bounces30.jpg
  [3]: http://www.springerlink.com/content/67427263811l501q/