https://github.com/tsvikas/torch-raytrace
Ray tracing from scratch with PyTorch for educational and illustrative purposes.
https://github.com/tsvikas/torch-raytrace
Last synced: 10 months ago
JSON representation
Ray tracing from scratch with PyTorch for educational and illustrative purposes.
- Host: GitHub
- URL: https://github.com/tsvikas/torch-raytrace
- Owner: tsvikas
- License: mit
- Created: 2025-04-03T01:38:40.000Z (over 1 year ago)
- Default Branch: main
- Last Pushed: 2025-04-03T03:21:04.000Z (over 1 year ago)
- Last Synced: 2025-04-03T03:22:29.988Z (over 1 year ago)
- Language: Python
- Size: 419 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# torch-raytrace
[![Tests][tests-badge]][tests-link]
[![uv][uv-badge]][uv-link]
[![Ruff][ruff-badge]][ruff-link]
[![Black][black-badge]][black-link]
[![codecov][codecov-badge]][codecov-link]
\
[![Made Using tsvikas/python-template][template-badge]][template-link]
## Overview
Ray tracing from scratch with PyTorch for educational and illustrative purposes.
## Usage
Install the package using pip, or with a dependency manager like uv:
```bash
pip install git+https://github.com/tsvikas/torch-raytrace.git
```
and import the package in your code:
```python
import raytrace
axis, rays, triangles, screen = raytrace.plot_render.render_pikachu()
raytrace.plot_render.plot_render(axis, rays, triangles, screen)
```

## Development
### Getting started
- install [git][install-git], [uv][install-uv].
- git clone this repo: `git clone https://github.com/tsvikas/torch-raytrace.git`
- run `uv run just prepare`
### Tests and code quality
- use `uv run just format` to format the code.
- use `uv run just lint` to see linting errors.
- use `uv run just test` to run tests.
- use `uv run just check` to run all the checks (format, lint, test, and pre-commit).
- Run a specific tool directly, with `uv run pytest`/`ruff`/`mypy`/`black`/...
[black-badge]: https://img.shields.io/badge/code%20style-black-000000.svg
[black-link]: https://github.com/psf/black
[codecov-badge]: https://codecov.io/gh/tsvikas/torch-raytrace/graph/badge.svg
[codecov-link]: https://codecov.io/gh/tsvikas/torch-raytrace
[install-git]: https://git-scm.com/book/en/v2/Getting-Started-Installing-Git
[install-uv]: https://docs.astral.sh/uv/getting-started/installation/
[ruff-badge]: https://img.shields.io/endpoint?url=https://raw.githubusercontent.com/astral-sh/ruff/main/assets/badge/v2.json
[ruff-link]: https://github.com/astral-sh/ruff
[template-badge]: https://img.shields.io/badge/%F0%9F%9A%80_Made_Using-tsvikas%2Fpython--template-gold
[template-link]: https://github.com/tsvikas/python-template
[tests-badge]: https://github.com/tsvikas/torch-raytrace/actions/workflows/ci.yml/badge.svg
[tests-link]: https://github.com/tsvikas/torch-raytrace/actions/workflows/ci.yml
[uv-badge]: https://img.shields.io/endpoint?url=https://raw.githubusercontent.com/astral-sh/uv/main/assets/badge/v0.json
[uv-link]: https://github.com/astral-sh/uv