-
Notifications
You must be signed in to change notification settings - Fork 117
LaserScript
Besides reading design files like eps, svg etc. VisiCut can now also read and execute a javascript like language from a .ls file.
As this currently still under development you'll have to install a NightlyBuild version of Visicut: http://137.226.142.25:5080/wwwshare/VisiCutNightly/
You can open a .ls file like you do other files. For mapping you can select the Everything Cut profile. You could position and/or resize it. Press execute.
If order is important you can alter the cut profile's Optimization setting from Nearest to file. You can find this under Edit > Settings > Manage Laserprofiles... > cut. You could also add a new Line Profile for this.
move(x,y);
Move to a x, y coordinate.
line(x,y);
Lasercut a line from the previous position (set with line or move) to a new x,y coordinate.
set(property, value);
Use for setting properties like speed and power e.g.:
set("power",50);
set("speed",50);
For security reasons you can only use a subset of Java. The Math class is accessible, so you do for example:
var five = Math.abs(-5);
In the future it will be posible to disable this limit in preferences.
##Example
var space = 5;
var lineHeight = 5;
var numLines = 5;
var x = 0;
var speedStep = 100/(numLines-1);
set("power",100);
for (var i = 0; i < numLines; i++)
{
setSpeed("speed",i*speedStep)
line(x,lineHeight);
move(x+=space,0);
}