Home

Awesome

<img src="https://github.com/damienBloch/inkscape-raytracing/blob/master/pictures/logo.jpeg" height="170" align="right"/>

Inkscape Ray Optics

An extension for Inkscape that makes it easier to draw optical diagrams.

Allows to annotate Inkscape primitives with optical properties and draws beam paths by taking into account reflection and refraction.

Bug reports or suggestions are welcome.

Examples

<img src="./pictures/sphere.svg" width="600">
Beams through a sphere
<img src="./pictures/blue_table.png" width="600">
Optical table planning

How to install

For Linux users this can typically be done with:

cd ~/.config/inkscape/extensions
git clone https://github.com/damienBloch/inkscape-raytracing

Requirements

In addition, this extension also requires the following programs, but they are usually already installed with Inkscape:

If the version of python used by Inkscape doesn't satisfy the requirement, the interpreter can be changed by following these instructions.

How to use

1. For each optical element or group of elements, select it and choose its material with Extensions > Optics > Set material as...:

<img src="./pictures/ray_tracing_1.png" width="800">

The material can be one of the following:

This will automatically write some text in the element description. This text is used to reccord the properties of the elements. It is also possible to directly write the text in the description.

An element can have at most one optical property and will be ignored if it has two or more.

It is possible to add complementary text in the description. If it doesn't have the syntax optics:<something>, the extra text will simply be ignored.

2. Select the elements to render and run the extension with Extensions > Optics > Ray Tracing:

<img src="./pictures/ray_tracing_2.png" width="800">

3. This will trace all the beams originated from a beam element:

<img src="./pictures/ray_tracing_3.png" width="800">

The beams are added to a new sub-layer generated_beams of their parent layer.

Note that the borders of the document blocks the beams and all objects outside the document page will be ignored.

Tips

Known limitations