ofxLaser - How to programmatically set the output box dimensions?

Hi there,

I am writing some laser control software that will be controlled via OSC. The end goal is to have it run headlessly on a raspberry pi, connected to a Helios DAC which is connected to a Laserworld CS-2000RGB FX via an ILDA cable. I am using ofxLaser and ofxOsc addons for this. With what I have written so far I am able to select the DAC, arm the laser, adjust the mask dimensions/intensity, select pattern to render and more all through OSC.

My current issue is that I can not identify exactly which object controls the box dimensions of the laser output so that I can set it up when creating the LaserManager object. I have identified in the UI which box controls the output size, this can be seen in the screen shot below:

I am able to drag the corners of this box to adjust it’s dimensions, but I can’t seem to figure out where I can change them in the code. Does anyone know what object this is in the ofxLaser library?

Thanks!

ok I managed to figure it out. It is controlled with this class:

ofxLaser::Manager.getLaser(0).laserZones[0].zoneTransform

which has a vector<ofPoint> getCorners() method to get all the points of the laserZone.

and to set it I used:
laserManager.getLaser(0).getLaserZoneForZone(&laserManager.getZone(0))->zoneTransform.setDst(ofRectangle(0,0,laserWidth,laserHeight));

not sure why the laser output box is not set to the laser canvas width and height from initialisation, perhaps so that the user is fully aware of the editable nature of the zone in the UI? anyway glad to have figured it out :+1:

Well done for working it out… the reason I didn’t have it as the full area by default is a safety consideration, you don’t really want the laser scanning its entire output area unless you specifically want it.

The remote OSC configuration sounds cool, one word of caution though; if you are configuring the lasers away from your computer (and a stop button) you should disable output if you lose the connection. Otherwise you could be in a situation where you lose a connection to the system and are not able to disable the output.

I’d love to hear more about what you doing so please do share (if not here then privately).

Thanks!

Seb

Well done for working it out… the reason I didn’t have it as the full area by default is a safety consideration, you don’t really want the laser scanning its entire output area unless you specifically want it.

Yeah that makes sense, good to ere on the safe side with this type of hardware! I have seen that there have been many safety considerations through out the whole library, our eyes thank you! :heart_eyes:

The remote OSC configuration sounds cool, one word of caution though; if you are configuring the lasers away from your computer (and a stop button) you should disable output if you lose the connection. Otherwise you could be in a situation where you lose a connection to the system and are not able to disable the output.

That’s a good point, I will add this as a feature, would not want to lose control of the laser.

I’d love to hear more about what you doing so please do share (if not here then privately).

It’s just a small project to enable me to control the laser with my phone through TouchOSC, without having to lug around a computer when bringing it to parties (hence trying to compile it to an RPi). It may become a standalone component to larger A/V shows in the future.

Thanks again for sharing the library and for your help :+1:

1 Like

Here is the project if anyone is interested