Skip to content
peteruithoven edited this page Feb 22, 2013 · 25 revisions

Besides reading design files like eps, svg etc. VisiCut can now also read and execute a javascript like language from a .ls file.

Usage

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.

Laserscript

Methods

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);

Sandbox

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);
}