Git Product home page Git Product logo

lasercad's Introduction

LaserCAD

Authors: Clemens Anschütz [email protected] He Zhuang [email protected] Procrastination next level!

In short: LaserCAD helps you quickly prototyping and scripting your optical setup with as few commands as possible in the language of geometric optics and a ton of default values. It approximates the ray tracing and shows you a 3D view of everything in FreeCAD.

The creed is:

  1. Make the common case simple.
  2. The user should be able to set everything in the script, but the default values should also be set so well that it is not necessary.
  3. The code should be designed in such a way that you know where to reprogram something if necessary. (OK, let's see.)

How to use:

  • Install FreeCAD

  • Have any kind of python interpreter and a numpy version.

  • Download the repository to an arbitrary location

git clone https://github.com/klee-mens/LaserCAD.git

Now you can execute e.g. the /tutorial/0_Opening.py in your interpreter. You should get some text output like

The geometric object <Composed_Mount:unnamed> is drawn to the position[108.51854, 264.70476,  80.     ] with the direction [-0.95766,  0.2566 , -0.13053]

and many more lines. When you open the exact same file in FreeCAD and execute it as a macro by pressing on the green arrow or F6 you get a new FreeCAD document with the 3D model looks like this:

Screenshot von 0_Opening.py in Spyder und in FreeCAD

Some notes and tips

After that, you can continue executing the other tutorials and tests. Some may take a few seconds, but most likely, the computation time is less than a minute. In the manual folder, you can find some more or less useful texts about the program and the ideas behind it. Some other documents may follow.

In each executable script, the first lines import the location of LaserCAD in the sys.path list so that python and FreeCAD can find the package. While I am sure that there exists a better way of installing it, ... I have no clue how to do it. So for the moment, make sure that every executable script has these lines on top and is in the work directory or somewhere in the LaserCAD package itself.

For the best support from your python IDE I can recommend copying the LaserCAD folder in your standard python search path, so, for example, side by side with the numpy package.

Some examples

Just to show some of the capabilities of LaserCAD you can see the following examples in the manual under how-to-build-a-white-cell and how-to-build-a-stretcher:

Oopsie-NotFound

StretcherStuff

Have fun!

lasercad's People

Contributors

hezhuang199 avatar klee-mens avatar

Stargazers

 avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  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.