Please write down in detail what you really want to do.
[quote]I wonder if it would be possible to create a simulation with a polygonal prism, for example with 4, 5 or even 6 faces. This would be nice, even if there would be some form restrictions.[/quote]
You were asking extendsion from prism to polygon, so I created the simulation [url=http://www.phy.ntnu.edu.tw/ntnujava/index.php?topic=1434]Ray tracing (polygon: range from 3-32 faces)[/url]
I can only guest what you might want.
You can try out [url=http://www.phy.ntnu.edu.tw/ntnujava/index.php?topic=121.0]Lens (thick lens) and Mirror[/url] or other similar applet if you just need simulation for concave lens.
It might be easier to add some control points to set up concave/convex lens if that is when you want to play with.
It will be much easier if you can provide all the information so that the created simulation can best fit with what you need! Waiting for your information!