An openFrameworks addon for controlling one or more ILDA lasers, it's particularly good at rendering graphics. It currently works with Etherdream, Helios, Laserdock/LaserCube, but more DACs to be added in the future.
Comprehensive multi-laser support, limited only by your CPU.
Every project in the showreel was made with ofxLaser and openFrameworks.
LASERS ARE DANGEROUS - USE THIS SOFTWARE AT YOUR OWN RISK. NEVER LOOK INTO THE BEAM. Always have an emergency stop button at hand and do not let anyone enter the laser exposure area. Check the exposure area for reflective surfaces. Take laser safety training and get licenced to use high power lasers in your location. In the UK I can recommend this one.
Seriously, don't mess around with this stuff. You can really damage your eyes.
Version 1.0 beta is now available. This is a significant upgrade from previous versions.
API changes
The system is primarily designed to render graphics to one or more lasers. Conceptually we have an input canvas, and we draw everything into that. Within the canvas we can define one or more input zones that can be assigned to one or more lasers. The output for the zones can be adjusted for size and perspective.
The default size of the canvas is 800,800 but you can change it using ofxLaser::Manager::setCanvasSize(width, height).
All API calls are via the ofxLaser::Manager object. Declare one in ofApp.h and it will be automatically initialised.
ofxLaser::Manager::update() - update and prepare the system to receive new laser graphics - call this in ofApp::update()
In ofApp::draw() you call all your ofxLaser draw methods (see below). Once you're finished call ofxLaser::Manager::send() to send everything to the laser(s).
ofxLaser::Manager::send() - send everything drawn this time to the lasers ofxLaser::Manager::drawUI() - draw the laser UI system
Note that all drawing methods must be called after update() and before send().
We have three render profiles for each laser, default, fast and detailed, referenced using the following compiler definitions: OFXLASER_PROFILE_DEFAULT OFXLASER_PROFILE_FAST OFXLASER_PROFILE_DETAIL
Use the default profile for most things, use fast for any smooth lines where accuracy doesn't matter, and detail for anything intricate. Bear in mind that the output will get flickery the more detailed you get.
These three profiles can be edited within the app's GUI, and can be defined differently for each laser. You can also save and load scanner presets.
NB you can use ofTranslate, ofScale and any of the built-in transformations with all of the draw methods
Draws a line to the laser(s). returns : void
As above but with separate float values for the start and end coordinates of the line.
Draws a dot to the laser(s). This can also be used to make beam effects. Use the intensity to change the brightness - this changes how long the laser lingers to make the point so is more efficient than darkening the colour.
As above but with separate x and y values instead of a point object.
Draws a circle.
As above but with separate x and y float values.
Draws an ofPolyline to the laser
The ofxLaser::Graphic class can be used to store multiple polylines and can also handle shape occlusion. It can also be used to load and render SVGs. To send the graphic to the laser use the drawLaserGraphic function.
Draws an ofxLaser::Graphic
USB :
Network :
The code in this repository is available under the MIT License.
Copyright (c) 2012-2021 Seb Lee-Delisle seblee.me seblee.co
The current main branch works with openFrameworks v 0.11.x.
Once you have downloaded the openFrameworks source code, add the ofxLaser folder to the addons folder. Either clone the source code using git:
> cd openFrameworks/addons/
> git clone https://github.com/sebleedelisle/ofxLaser.git
Or download the source from GitHub here, unzip the folder, rename it from ofxLaser-main
to ofxLaser
and place it in your openFrameworks/addons
folder.
To run the examples, import them into the project generator, create a new project, and open the project file in your IDE.
Legacy versions (no longer supported):
addons :
ofxOpenCv (comes with oF)
ofxNetwork (comes with oF)
ofxPoco (comes with oF)
Open source libraries (included in source files) DearImGui libusb libsvgtiny clipperlib heliosdac laserdocklib
main branch : openFrameworks 0.11.x
legacy versions (no longer supported) openFrameworks 0.11.x openFrameworks 0.10.1 openFrameworks 0.9.8