Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 19 additions & 0 deletions Changelog.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,25 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

## [Unreleased]

## 7.78.5

### Added
- Drag + drop a file now adds that file to the "Recent Files" list.

### Fixed
- Infill of closed loops should now be properly filled. Was occasionally failing the in/out test and creating a mess.
- MickeyMoe1992 now properly obeys the margin limits, same as the other converters.
- Render hints are now forced to enable antialiasing, etc.

## 7.78.3

### Added
- Added Generator "Registration Marks"
- Added "Zoom to fit machine"

### Removed
- Hid the Donatello panel at startup for a less confusing new user experience.

## 7.78.0

### Added
Expand Down
15 changes: 10 additions & 5 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

<groupId>com.marginallyclever</groupId>
<artifactId>Makelangelo</artifactId>
<version>7.78.3</version>
<version>7.78.5</version>
<name>Makelangelo</name>
<description>Makelangelo Software is a Java program that prepares art for CNC plotters. It is especially designed for the Makelangelo Robot.
It pairs really well with Marlin-polargraph, the code in the brain of the robot that receives instructions and moves the motors.</description>
Expand Down Expand Up @@ -364,6 +364,11 @@ It pairs really well with Marlin-polargraph, the code in the brain of the robot
<artifactId>jssc</artifactId>
<version>2.9.5</version>
</dependency>
<dependency>
<groupId>org.scijava</groupId>
<artifactId>native-lib-loader</artifactId>
<version>2.5.0</version>
</dependency>
<!-- https://mvnrepository.com/artifact/org.apache.httpcomponents/httpclient -->
<dependency>
<groupId>org.apache.httpcomponents</groupId>
Expand All @@ -386,7 +391,7 @@ It pairs really well with Marlin-polargraph, the code in the brain of the robot
<dependency>
<groupId>org.apache.commons</groupId>
<artifactId>commons-compress</artifactId>
<version>1.26.1</version>
<version>1.28.0</version>
</dependency>
<!-- https://mvnrepository.com/artifact/de.sciss/jrpicam -->
<dependency>
Expand Down Expand Up @@ -428,7 +433,7 @@ It pairs really well with Marlin-polargraph, the code in the brain of the robot
<dependency>
<groupId>commons-validator</groupId>
<artifactId>commons-validator</artifactId>
<version>1.7</version>
<version>1.10.1</version>
</dependency>
<!-- https://mvnrepository.com/artifact/org.apache.xmlgraphics/batik-xml -->
<dependency>
Expand Down Expand Up @@ -542,12 +547,12 @@ It pairs really well with Marlin-polargraph, the code in the brain of the robot
<dependency>
<groupId>ch.qos.logback</groupId>
<artifactId>logback-core</artifactId>
<version>1.5.18</version>
<version>1.5.27</version>
</dependency>
<dependency>
<groupId>ch.qos.logback</groupId>
<artifactId>logback-classic</artifactId>
<version>1.5.18</version>
<version>1.5.27</version>
</dependency>
<!-- donatello -->
<dependency>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
import java.awt.*;

/**
* HSB color class. Each component is 0...1
* {@link ColorHSB} stores a color by its Hue, Saturation, and Brightness. Each component is 0...1
*
* @author Dan Royer
* @since 2022-08-31
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,12 +42,7 @@ public void addColor(Color c) {
*/
@Deprecated(forRemoval = true)
public void removeColor(Color c) {
for (final Iterator<Color> colorsIterator = colors.iterator(); colorsIterator.hasNext(); ) {
final Color nextColor = colorsIterator.next();
if (nextColor.equals(c)) {
colorsIterator.remove();
}
}
colors.removeIf(nextColor -> nextColor.equals(c));
}


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@
*
* @author Dan Royer
*/
@Deprecated
public class ColorRGB {
public int red;
public int green;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@
import com.marginallyclever.convenience.FileAccess;
import com.marginallyclever.donatello.Donatello;
import com.marginallyclever.donatello.nodefactorypanel.NodeFactoryPanel;
import com.marginallyclever.makelangelo.actions.ZoomToFitMachineAction;
import com.marginallyclever.makelangelo.applicationsettings.MetricsPreferences;
import com.marginallyclever.makelangelo.donatelloimpl.DockableEditNodePanel;
import com.marginallyclever.makelangelo.donatelloimpl.DonatelloDropTarget;
Expand Down Expand Up @@ -367,4 +366,8 @@ public PlotterSettingsManager getPlotterSettingsManager() {
public void onPlotterSettingsUpdate(PlotterSettings lastSelectedProfile) {
previewPanel.onPlotterSettingsUpdate(lastSelectedProfile);
}

public RecentFiles getRecentFiles() {
return mainMenuBar.getRecentFiles();
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@

import javax.vecmath.Point2d;
import java.awt.*;
import java.awt.geom.Rectangle2D;
import java.util.Arrays;
import java.util.PriorityQueue;

Expand Down Expand Up @@ -70,28 +71,31 @@ public void start(Paper paper, TransformedImage image) {
FilterDesaturate bw = new FilterDesaturate(myImage);
img = bw.filter();

double d = Math.max(0.1,turtle.getDiameter());
// use fast marching method to compute arrival times
if(recalculateFFM) {
ffm = computeArrivalTimes();
ffm = computeArrivalTimes(d);
}

Rectangle2D.Double rect = myPaper.getMarginRectangle();
px = rect.getMinX();
py = rect.getMinY();

turtle = new Turtle();
turtle.setStroke(Color.BLACK,settings.getDouble(PlotterSettings.DIAMETER));
px = myPaper.getMarginRectangle().getMinX();
py = myPaper.getMarginRectangle().getMinY();

extractContours(ffm, minSpacing);
extractContours(ffm, minSpacing,d);

//CropTurtle.run(turtle,rect);
fireConversionFinished();
recalculateFFM=true;
}

/**
* Extract iso-contours for the given levels from a scalar field.
* @param T scalar field (arrival times)
* @param spacing spacing between contours
*/
public void extractContours(double[][] T, double spacing) {
public void extractContours(double[][] T, double spacing,double d) {
int h = T[0].length;

// Find min and max values in T
Expand All @@ -115,6 +119,7 @@ public void extractContours(double[][] T, double spacing) {
for (double level = min; level <= max; level += step) {
turtle = new Turtle(Color.BLACK,settings.getDouble(PlotterSettings.DIAMETER));
marchingSquares(T,level);
turtle.scale(d,d);
var result = reorderHelper.splitAndReorderTurtle(turtle);
sum.add(result);
}
Expand Down Expand Up @@ -274,9 +279,8 @@ public int compareTo(Node o) {
* Computes the arrival times using the Fast Marching Method (FMM).
* @return
*/
public double[][] computeArrivalTimes() {
public double[][] computeArrivalTimes(double d) {
var rect = myPaper.getMarginRectangle();
double d = Math.max(0.1,turtle.getDiameter());
int w = (int)Math.ceil(rect.getWidth()/d);
int h = (int)Math.ceil(rect.getHeight()/d);
int minX = (int)rect.getMinX();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,9 +31,9 @@ public TransformedImage filter() {
for (int y = 0; y < h; ++y) {
for (int x = 0; x < w; ++x) {
ColorRGB diff = new ColorRGB(aa.getRGB(x, y));
diff.red = (int)Math.max(0,Math.min(255,diff.red * scale));
diff.green = (int)Math.max(0,Math.min(255,diff.green * scale));
diff.blue = (int)Math.max(0,Math.min(255,diff.blue * scale));
diff.red = (int) Math.clamp(diff.red * scale, 0, 255);
diff.green = (int) Math.clamp(diff.green * scale, 0, 255);
diff.blue = (int) Math.clamp(diff.blue * scale, 0, 255);
rr.setRGB(x, y, diff.toInt());
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -195,11 +195,7 @@ private void parsePolylineElement(Element pathNodes) {
}

myTurtle.add(t);
if(isFilled(element)) {
var filler = new InfillTurtle();
filler.setPenDiameter(myTurtle.getDiameter());
myTurtle.add(filler.run(t));
}
if(isFilled(element)) fillTurtle(t);
}

/**
Expand Down Expand Up @@ -402,11 +398,13 @@ private void parseRectElement(Element element) {
arcTurtle(t, x1,y2, rx,ry, Math.PI * -1.5,Math.PI * -1.0,m);
arcTurtle(t, x1,y1, rx,ry, Math.PI * -1.0,Math.PI * -0.5,m);
myTurtle.add(t);
if(isFilled(element)) {
var filler = new InfillTurtle();
filler.setPenDiameter(myTurtle.getDiameter());
myTurtle.add(filler.run(t));
}
if(isFilled(element)) fillTurtle(t);
}

private void fillTurtle(Turtle t) {
var filler = new InfillTurtle();
filler.setPenDiameter(myTurtle.getDiameter());
myTurtle.add(filler.run(t));
}

/**
Expand Down Expand Up @@ -457,11 +455,7 @@ private void parseCircleElement(Element element) {
//logger.debug("circ={}", circ);
printEllipse(t, m, cx, cy, r, r, circ);
myTurtle.add(t);
if(isFilled(element)) {
var filler = new InfillTurtle();
filler.setPenDiameter(myTurtle.getDiameter());
myTurtle.add(filler.run(t));
}
if(isFilled(element)) fillTurtle(t);
}

private void parseEllipseElement(Element element) {
Expand All @@ -482,11 +476,7 @@ private void parseEllipseElement(Element element) {
steps = Math.min(60,steps);
printEllipse(t, m, cx, cy, rx, ry, steps);
myTurtle.add(t);
if(isFilled(element)) {
var filler = new InfillTurtle();
filler.setPenDiameter(myTurtle.getDiameter());
myTurtle.add(filler.run(t));
}
if(isFilled(element)) fillTurtle(t);
}

private void printEllipse(Turtle t, Matrix3d m, double cx, double cy, double rx, double ry, double steps) {
Expand Down Expand Up @@ -533,11 +523,7 @@ private void parsePathElement(Element paths) throws Exception {
}
}
myTurtle.add(t);
if(isFilled(element)) {
var filler = new InfillTurtle();
filler.setPenDiameter(myTurtle.getDiameter());
myTurtle.add(filler.run(t));
}
if(isFilled(element)) fillTurtle(t);
}

private void doCubicCurveAbs(SVGPathSeg item, Matrix3d m,Turtle t) {
Expand Down
Loading