Skip to content

Commit

Permalink
v2.0.2
Browse files Browse the repository at this point in the history
Flip model by Y-axis. Debatable, but...
  • Loading branch information
baskiton committed Jun 15, 2021
1 parent 71fd53d commit d6924d4
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 8 deletions.
2 changes: 1 addition & 1 deletion include/Executor.h
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ class Executor : public wxThread {
double t_height_max,
double t_height_min,
int t_mask_mode,
const wxColour &t_mask_color,
wxColour t_mask_color,
int t_height_mode,
STLFile::file_type t_f_type
);
Expand Down
2 changes: 1 addition & 1 deletion include/static_text.h
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@


auto ST_NAME = "Image to STL";
auto ST_VERSION = "2.0.1";
auto ST_VERSION = "2.0.2";
auto ST_DESCRIPTION = "Application for converting images to STL (3D model for printing)";
auto ST_COPYRIGHT = "Copyright (c) 2019-2021 Alexander Baskikh";
auto ST_LICENSE_LINK = "https://github.com/baskiton/Img2STL/blob/main++/LICENSE";
Expand Down
15 changes: 9 additions & 6 deletions src/Executor.cpp
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
#include <utility>

#include "wx/image.h"
#include "wx/log.h"
#include "wx/msgqueue.h"
Expand All @@ -8,6 +10,7 @@
#include "ThreadCommands.h"
#include "Worker.h"


Executor::Executor(
Img2STLMainFrame *t_evt_hdlr,
const wxString &t_files_dir,
Expand All @@ -19,7 +22,7 @@ Executor::Executor(
double t_height_max,
double t_height_min,
int t_mask_mode,
const wxColour &t_mask_color,
wxColour t_mask_color,
int t_height_mode,
STLFile::file_type t_f_type
)
Expand All @@ -35,7 +38,7 @@ Executor::Executor(
m_height_max(t_height_max),
m_height_min(t_height_min),
m_mask_mode(t_mask_mode),
m_mask_color(t_mask_color),
m_mask_color(std::move(t_mask_color)),
m_height_mode(t_height_mode),
m_f_type(t_f_type)
{
Expand Down Expand Up @@ -128,11 +131,11 @@ wxThread::ExitCode Executor::Entry() {
if (((x + 1) < img_w) && bw.GetAlpha(x + 1, y)) {
z1 = bw.GetRed(x + 1, y) / height_factor + mod;
}
if (((y + 1) < img_h) && bw.GetAlpha(x, y + 1)) {
z2 = bw.GetRed(x, y + 1) / height_factor + mod;
if (((y - 1) >= 0) && bw.GetAlpha(x, y - 1)) {
z2 = bw.GetRed(x, y - 1) / height_factor + mod;
}

m_q_to_worker.Post(WorkerMessage{WorkerMessage::wMSG_RUN, x, y, z0, z1, z2});
m_q_to_worker.Post(WorkerMessage{WorkerMessage::wMSG_RUN, x, img_h - 1 - y, z0, z1, z2});
}
}

Expand All @@ -149,7 +152,7 @@ wxThread::ExitCode Executor::Entry() {
pb_val += points_per_file;
break;
}
Sleep(100);
Sleep(50);
}

if (!TestDestroy()) {
Expand Down

0 comments on commit d6924d4

Please sign in to comment.