Giter VIP home page Giter VIP logo

opticsworkbench's Introduction

WorkbenchIcon Optics Workbench

Geometrical optics for FreeCAD.
Performs simple raytracing through your FreeCAD objects.

Total alerts Language grade: Python

screenshot

Installation

Manual Installation

cd ~/.FreeCAD/Mod/ 
git clone https://github.com/chbergmann/OpticsWorkbench.git

When you restart FreeCAD, "Optics Workbench" workbench should now show up in the workbench dropdown list.

Getting started

  • Create some FreeCAD design objects. For 2D simulation Sketches will do the job.
  • Select one or more of your design objects and then create Optical Mirror to let your objects act as mirrors
  • Select one or more of your design objects and then create Optical Absorber to let your objects act as black walls for the light rays
  • Select one or more of your design objects and then create Optical Lenses to let your objects act as lenses. Lenses should be closed shapes. Select a material in the Lens properties or provide a refraction index.
  • Add some source of light (Ray, Beam).

Tools

RayIcon Ray (monochrome)

A single ray for raytracing
Parameters:

  • Power: On or Off
  • Spherical: False=Beam in one direction, True=Radial or spherical rays
  • BeamNrColumns: Number of rays in a beam per row
  • BeamNrRows: Number of rays in a beam per column
  • BeamDistance: Distance between two beams
  • HideFirstPart: Hide the first part of every ray that comes from the source and goes to the first point of reflection/refraction/nirvana
  • MaxRayLength: Maximum length of a ray
  • MaxNrReflections: Maximum number of reflections. This prevents endless loops if the ray is inside a mirror box.

SunRayIcon Ray (sun light)

A bunch of rays with different wavelengths of visible light.
The rays overlap. If they hit a lens, they will be dispersed. See the Example - Dispersion.

2D Beam 2D Beam

A row of multiple rays for raytracing
Parameters: see Ray. BeamNrColumns must be > 1 to get a beam

Radial Beam 2D Radial Beam

Rays coming from one point going to all directions in a 2D plane
Parameters: see Ray. BeamNrColumns must be > 1 and BeamNrRows=1 and Spherical=True to get a radial beam

Spherical Beam Spherical Beam

Rays coming from one point going to all directions
Parameters: see Ray. BeamNrColumns and BeamNrRows must be > 1 Spherical=True to get a spherical beam

Optical Mirror Optical Mirror

The FreeCAD objects in parameter Base will act as mirrors
Select some FreeCAD objects, then create Optical Mirror

Optical Absorber Optical Absorber

The FreeCAD objects in parameter Base will swallow the rays of light
Select some FreeCAD objects, then create Optical Absorber

Optical Lens Optical Lens

The FreeCAD objects in parameter Base will act as lenses
Select some FreeCAD objects, then create Optical Lens
The Refration Index has to be provided. The parameter Material contains a list with pre defined refraction indexes.

Off Switch off lights

Switches off all Rays and Beams

On (Re)start simulation

Switches on and recalculates all Rays and Beams

Example Example - 2D

generates the screenshot above

Example Example - 3D

screenshot

Example Example - Dispersion

screenshot

Issues and Troubleshooting

see issues on Github

Discussion

Please offer feedback or connect with the developer via the dedicated FreeCAD forum thread.

License

GNU Lesser General Public License v3.0 (LICENSE)

opticsworkbench's People

Contributors

chbergmann avatar wohltat avatar luzpaz 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.