Skip to content

Commit

Permalink
Video Exporting, MST PFMs, TSP PFMs, Changes to PFM Functionality.
Browse files Browse the repository at this point in the history
  • Loading branch information
SonarSonic committed Nov 5, 2021
1 parent d700618 commit 3d6dfa1
Show file tree
Hide file tree
Showing 50 changed files with 1,837 additions and 1,084 deletions.
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,10 @@
# Change Log

### [v1.1.0-stable](https://github.com/SonarSonic/DrawingBotV3/releases/tag/v1.1.0-stable)
- Added: Two New Path Finding Modules Voronoi Tree and Voronoi TSP.
- Added: Video Exporting for Animations in both H.264 and ProRes 422.
- Changed: Some PFMs which had optimisation disabled by default will now have line sorting enabled to reduce plotting times

### [v1.0.16-stable](https://github.com/SonarSonic/DrawingBotV3/releases/tag/v1.0.16-stable)
- Added: Text to display the current images size, and the size it's being plotted at.
- Added: Rotate / Flip Options for images in Image Processing
Expand Down
5 changes: 5 additions & 0 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,11 @@ dependencies {
compile "org.apache.xmlgraphics:batik-dom:${xml_graphics_version}"
implementation 'com.jhlabs:filters:2.0.235-1'
implementation 'org.joml:joml:1.10.1'
implementation 'org.jcodec:jcodec:0.2.5'
implementation 'org.jcodec:jcodec-javase:0.2.5'
implementation 'org.apache.bcel:bcel:6.5.0'
implementation 'com.aparapi:aparapi:2.0.0'

//compile "org.controlsfx:controlsfx:${controlsfx_version}"

//required for cross platform compatibility, src: https://stackoverflow.com/questions/61579722/making-a-cross-platform-build-of-javafx-using-gradle
Expand Down
2 changes: 1 addition & 1 deletion gradle.properties
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#app version
app_name=DrawingBotV3
app_version=1.0.16
app_version=1.1.0
app_state=stable

#tests
Expand Down
Binary file added libs/LinkTSP-1.0.0.jar
Binary file not shown.
34 changes: 30 additions & 4 deletions src/main/java/drawingbot/DrawingBotV3.java
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
package drawingbot;
import java.awt.image.BufferedImage;
import java.io.File;
import java.time.format.DateTimeFormatter;
import java.util.concurrent.ExecutorService;
import java.util.concurrent.Executors;
import java.util.logging.Level;
Expand Down Expand Up @@ -75,6 +76,14 @@ public class DrawingBotV3 {
public final SimpleStringProperty gcodeStartLayerCode = new SimpleStringProperty();
public final SimpleStringProperty gcodeEndLayerCode = new SimpleStringProperty();

//HPGL SETTINGS
public final SimpleFloatProperty hpglUnits = new SimpleFloatProperty(40);
public final SimpleFloatProperty hpglCurveFlatness = new SimpleFloatProperty(6);
public final SimpleFloatProperty hpglXMin = new SimpleFloatProperty(0);
public final SimpleFloatProperty hpglYMin = new SimpleFloatProperty(11040);
public final SimpleBooleanProperty hpglYAxisFlip = new SimpleBooleanProperty(true);
public final SimpleObjectProperty<EnumImageRotate> hpglRotation = new SimpleObjectProperty<>(EnumImageRotate.R0);

//PRE-PROCESSING\\
public final ObservableList<ObservableImageFilter> currentFilters = FXCollections.observableArrayList();
public final SimpleObjectProperty<EnumImageRotate> imageRotation = new SimpleObjectProperty<>(EnumImageRotate.R0);
Expand Down Expand Up @@ -108,6 +117,7 @@ public class DrawingBotV3 {
public ExecutorService taskService = initTaskService();
public ExecutorService backgroundService = initBackgroundService();
public ExecutorService imageFilteringService = initImageFilteringService();
public ExecutorService parallelPlottingService = initParallelPlottingService();

public TaskMonitor taskMonitor = new TaskMonitor(taskService);

Expand Down Expand Up @@ -169,7 +179,6 @@ public void updateLocalProgress(double progress){
public EnumDistributionType updateDistributionType = null;



public void updateUI(){
if(getActiveTask() != null){
if(getActiveTask().isRunning()){
Expand All @@ -182,7 +191,10 @@ public void updateUI(){
}
controller.labelPlottedShapes.setText(Utils.defaultNF.format(geometryCount));
controller.labelPlottedVertices.setText(Utils.defaultNF.format(vertexCount));
controller.labelElapsedTime.setText(getActiveTask().getElapsedTime()/1000 + " s");

long minutes = (getActiveTask().getElapsedTime() / 1000) / 60;
long seconds = (getActiveTask().getElapsedTime() / 1000) % 60;
controller.labelElapsedTime.setText(minutes + " m " + seconds + " s");
}
}else{
controller.labelElapsedTime.setText("0 s");
Expand Down Expand Up @@ -232,7 +244,7 @@ public void onPlottingTaskStageFinished(PlottingTask task, EnumTaskStage stage){
}

public void onDrawingAreaChanged(){
RENDERER.drawingAreaDirty = true;
RENDERER.croppingDirty = true;
//forces "Plotting Size" to stay updated.
if(DrawingBotV3.INSTANCE.openImage.get() != null){
DrawingBotV3.INSTANCE.openImage.get().resolution.updateAll();
Expand All @@ -248,8 +260,13 @@ public void onDrawingSetChanged(){
observableDrawingSetFlag.set(!observableDrawingSetFlag.get());
}

public void onImageFilterChanged(ObservableImageFilter filter){
filter.dirty.set(true);
RENDERER.imageFilterDirty = true;
}

public void onImageFiltersChanged(){
RENDERER.imageFiltersDirty = true;
RENDERER.imageFiltersChanged = true;
}

public void updatePenDistribution(){
Expand Down Expand Up @@ -451,5 +468,14 @@ public ExecutorService initImageFilteringService(){
return t;
});
}

public ExecutorService initParallelPlottingService(){
return Executors.newFixedThreadPool(5, r -> {
Thread t = new Thread(r, "DrawingBotV3 - Parallel Plotting Service");
t.setDaemon(true);
t.setUncaughtExceptionHandler(exceptionHandler);
return t;
});
}
///////////////////////////////////////////////////////////////////////////////////////////////////////
}
3 changes: 3 additions & 0 deletions src/main/java/drawingbot/FXApplication.java
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
package drawingbot;

import com.aparapi.Kernel;
import com.aparapi.Range;
import drawingbot.api.API;
import drawingbot.api_impl.DrawingBotV3API;
import drawingbot.javafx.observables.ObservableDrawingSet;
Expand All @@ -8,6 +10,7 @@
import drawingbot.javafx.FXController;
import drawingbot.registry.MasterRegistry;
import drawingbot.render.jfx.JavaFXRenderer;
import drawingbot.render.opengl.OpenGLRenderer;
import drawingbot.utils.DBConstants;
import javafx.animation.AnimationTimer;
import javafx.application.Application;
Expand Down
Loading

0 comments on commit 3d6dfa1

Please sign in to comment.