This construction can simulate optical systems consisting of mirrors and glas pieces. The surfaces are segments or conics.
Green surfaces are mirrors, blue indicates a glas surface.
The conics are by default parabolas but can be modified to any conic; just change the definition of the points.
The script supports an arbitrary number of optical elements; these can be create by tool buttons and are recognized by naming conventions.