Skip to content
Permalink
Browse files

Merge pull request #514 from mgmax/ltt

use new LibLaserCut interface: better spline interpolation for LTT laser
  • Loading branch information...
t-oster committed Jul 12, 2019
2 parents 840df7c + 662a9d5 commit 6f87ba78de67ff0bedae43ad31c34f356611b8c1
@@ -763,7 +763,7 @@ private LaserJob prepareJob(String name, Map<LaserProfile, List<LaserProperty>>
}
List<LaserProperty> props = propmap.get(pr);
try {
pr.addToLaserJob(job, set, this.addFocusOffset(props, focusOffset));
pr.addToLaserJob(job, set, this.addFocusOffset(props, focusOffset), this.selectedLaserDevice.getLaserCutter());
} catch (InterruptedException ex) {
throw new RuntimeException("this must not happen");
}
@@ -18,6 +18,7 @@
**/
package com.t_oster.visicut.model;

import com.t_oster.liblasercut.LaserCutter;
import com.t_oster.liblasercut.LaserJob;
import com.t_oster.liblasercut.LaserProperty;
import com.t_oster.liblasercut.platform.Util;
@@ -134,7 +135,7 @@ public void setName(String name)

public abstract void renderPreview(Graphics2D g, GraphicSet objects, MaterialProfile material, AffineTransform mm2px) throws InterruptedException;

public abstract void addToLaserJob(LaserJob job, GraphicSet objects, List<LaserProperty> laserProperties) throws InterruptedException;
public abstract void addToLaserJob(LaserJob job, GraphicSet objects, List<LaserProperty> laserProperties, LaserCutter cutter) throws InterruptedException;

@Override
public String toString()
@@ -18,6 +18,7 @@
**/
package com.t_oster.visicut.model;

import com.t_oster.liblasercut.LaserCutter;
import com.t_oster.liblasercut.LaserJob;
import com.t_oster.liblasercut.LaserProperty;
import com.t_oster.liblasercut.ProgressListener;
@@ -186,7 +187,7 @@ private Color getColorBetween(Color a, Color b, double factor)
}

@Override
public void addToLaserJob(LaserJob job, GraphicSet set, List<LaserProperty> laserProperties)
public void addToLaserJob(LaserJob job, GraphicSet set, List<LaserProperty> laserProperties, LaserCutter cutter)
{
double factor = Util.dpi2dpmm(this.getDPI());
AffineTransform mm2laserPx = AffineTransform.getScaleInstance(factor, factor);
@@ -19,6 +19,7 @@
package com.t_oster.visicut.model;

import com.t_oster.liblasercut.BlackWhiteRaster;
import com.t_oster.liblasercut.LaserCutter;
import com.t_oster.liblasercut.LaserJob;
import com.t_oster.liblasercut.LaserProperty;
import com.t_oster.liblasercut.ProgressListener;
@@ -221,7 +222,7 @@ public void renderPreview(Graphics2D gg, GraphicSet objects, MaterialProfile mat
}

@Override
public void addToLaserJob(LaserJob job, GraphicSet set, List<LaserProperty> laserProperties) throws InterruptedException
public void addToLaserJob(LaserJob job, GraphicSet set, List<LaserProperty> laserProperties, LaserCutter cutter) throws InterruptedException
{
double factor = Util.dpi2dpmm(this.getDPI());
AffineTransform mm2laserPx = AffineTransform.getScaleInstance(factor, factor);
@@ -18,6 +18,7 @@
**/
package com.t_oster.visicut.model;

import com.t_oster.liblasercut.LaserCutter;
import com.t_oster.liblasercut.LaserJob;
import com.t_oster.liblasercut.LaserProperty;
import com.t_oster.liblasercut.VectorPart;
@@ -254,7 +255,7 @@ else if (result == PathIterator.SEG_CLOSE)
}

@Override
public void addToLaserJob(LaserJob job, GraphicSet objects, List<LaserProperty> laserProperties)
public void addToLaserJob(LaserJob job, GraphicSet objects, List<LaserProperty> laserProperties, LaserCutter cutter)
{
if (this.isUseOutline())
{
@@ -301,7 +302,7 @@ public void addToLaserJob(LaserJob job, GraphicSet objects, List<LaserProperty>
sh = objects.getTransform().createTransformedShape(sh);
}
sh = mm2laserpx.createTransformedShape(sh);
conv.addShape(sh, part);
conv.addShape(sh, part, cutter);
}
}
}

0 comments on commit 6f87ba7

Please sign in to comment.
You can’t perform that action at this time.