Giter Site home page Giter Site logo

neyuru / raytracing Goto Github PK

View Code? Open in Web Editor NEW
0.0 1.0 0.0 74 KB

A Python script designed to simulate the propagation of rays through heterogeneous media. It models the interaction of rays with different media, allowing the analysis of various scenarios and phenomena such as reflection, refraction, and transmission, providing insights into the behavior of light or other waves in varied environments.

License: MIT License

Python 100.00%

raytracing's Introduction

RayTracing

A Python script designed to simulate the propagation of rays through heterogeneous media. It models the interaction of rays with different media, allowing the analysis of various scenarios and phenomena according to the principle of least time.

Ray Tracing Simulation in Heterogeneous Media

Early versions of this Python script simulates ray propagation in heterogeneous and isotropic media by solving the equations of motion, obtained by Fermat's principle, using a shooting method. Since version v0.3.0 a new method was introduced to enable Ray Tracing in anisotropic media. The simulations and results of this project have been used in several research articles, including "On ray tracing for sharp changing media" published by the Journal of the Acoustical Society of America.

Overview

The script allows users to:

  • Select from predefined scenarios and methods of solution to the equations of motion.
  • Choose to display results or benchmark the selected combination of scenarios/methods by measuring completion times.
  • Find an appropriate DELTA_S which is a crucial parameter related to the step size that a ray would advance in each iteration.

Features

  • Multiple Scenarios: Includes various scenarios like interface, fisheye, vert_heterogeneous and anisotropy.
  • Different Solution Methods: Users can choose different methods to solve the equations of motion.
  • Benchmarking: Allows users to measure completion times for the selected combination of scenarios/methods.
  • Visualization: Provides plots of scenarios and ray parameters. Since v0.3.0 videos can be made for vert_heterogeneous and anisotropy scenarios.

Usage

This script was successfully tested on Python 3.11.9 but should work on other versions as well. It requires the following libraries (with tested versions, but other versions may also work):

  • numpy (1.26.4)
  • scipy (1.12.0)
  • matplotlib (3.8.4)

Additionally, a working installation of Latex is also required for rendering text in plots. To run the script, navigate to the project directory and execute:

python RT_bench.py

The user will be prompted to select an algorithm option, choose whether to find an appropriate DELTA_S, and decide whether to proceed with the benchmarking process.

Related Articles

  • "On ray tracing for sharp changing media" - Journal of the Acoustical Society of America.
  • "Classical and Lagrangian mechanics in ray tracing: an optimizable framework for inhomogeneous media" - Wave Motion (under peer review).

License

This project is open source and available under the MIT License.

Author

Jorge A. Ramos O. jorge.ro at saltillo.tecnm.mx

Citation

If you use this code in your research, please cite it as follows:

@software{jorge_alberto_ramos_oliveira_2024_8387037,
  author       = {Jorge Alberto Ramos Oliveira},
  title        = {Ray Propagation Simulation in Heterogeneous Media},
  month        = jun,
  year         = 2024,
  publisher    = {Zenodo},
  version      = {v0.3.1},
  doi          = {10.5281/zenodo.8387037},
  url          = {https://doi.org/10.5281/zenodo.8387037}
}

raytracing's People

Contributors

neyuru avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.