RayCrafterdocumentation

Simple ray tracing with off-the-shelf optics. Very early software: expect rough edges.

Install and start

You do not need to know Python. You install one small tool, called uv, and then a single command downloads and starts RayCrafter. Do the uv step once; after that, starting RayCrafter is one line.

On a Mac

  1. Open Terminal. Press Cmd + Space, type Terminal and press Return.
  2. Copy the line below, paste it into the Terminal window and press Return:
    curl -LsSf https://astral.sh/uv/install.sh | sh
    It takes a few seconds and prints a message saying uv was installed.
  3. Close the Terminal window and open a new one. This is needed so the Mac finds the new tool.
  4. Check it worked by typing uv --version and pressing Return. You should see a version number.

On Windows

  1. Open PowerShell. Click the Start button, type PowerShell and press Enter. (Administrator rights are not needed.)
  2. Copy the line below, paste it into the window (right-click pastes in PowerShell) and press Enter:
    powershell -ExecutionPolicy ByPass -c "irm https://astral.sh/uv/install.ps1 | iex"
  3. Close PowerShell and open a new one. This is needed so Windows finds the new tool.
  4. Check it worked by typing uv --version and pressing Enter. You should see a version number.

If your organisation blocks this, uv can also be installed with winget install --id=astral-sh.uv -e, or ask your IT support. More options are in the uv installation guide.

Start RayCrafter

In a Terminal (Mac) or PowerShell (Windows) window, type:

uvx raycrafter

and press Return. The first time, uv downloads RayCrafter and everything it needs, including a suitable version of Python. That can take a minute or two. Messages appear in the window while RayCrafter loads, and then the RayCrafter window opens.

The first run can be slow. The first time rays are traced, RayCrafter may spend several minutes compiling its maths code. It tells you when this is happening. The result is saved, so later starts are quick.

To start it again later, open a new Terminal or PowerShell window and type uvx raycrafter again. To make sure you have the newest release, use uvx raycrafter@latest. To stop RayCrafter from the terminal, press Ctrl+C in that window.

If you already use Python

RayCrafter is on PyPI and needs Python 3.12 or later:

pip install raycrafter
raycrafter

This also gives you the Python API. To let AI agents use RayCrafter, install the extra described on the AI agents page.

Optional: STEP export

Exporting STEP files for CAD needs an extra library, about a 60 MB download. To start RayCrafter with it using uv:

uvx --from "raycrafter[cad]" raycrafter

Or with pip:

pip install "raycrafter[cad]"

Try the newest version (from GitHub)

The version on PyPI is the released one. The main branch on GitHub can have newer changes that are not released yet. To run that version instead, type this in a Terminal (Mac) or PowerShell (Windows) window and press Return:

uvx --from git+https://github.com/raycrafter-optical-design/raycrafter@main raycrafter

uv downloads the current code from GitHub and starts it, just as above. Expect behaviour to differ from the released version. This needs git on your computer. On a Mac, if git is missing, a window may offer to install the Command Line Tools; accept, then try again.

If something goes wrong