mirror of
https://github.com/SoftFever/OrcaSlicer.git
synced 2025-07-11 08:47:52 -06:00
Adding object elevation param.
Quick attempt to build with MinGW 7.3. Successful compile, failed linking
This commit is contained in:
parent
ad8c7c9f97
commit
87d49cf82f
12 changed files with 45 additions and 28 deletions
|
@ -152,7 +152,7 @@ if(SLIC3R_STATIC)
|
||||||
# set(Boost_USE_STATIC_RUNTIME ON)
|
# set(Boost_USE_STATIC_RUNTIME ON)
|
||||||
endif()
|
endif()
|
||||||
#set(Boost_DEBUG ON)
|
#set(Boost_DEBUG ON)
|
||||||
set(Boost_COMPILER "-vc120")
|
# set(Boost_COMPILER "-vc120")
|
||||||
find_package(Boost REQUIRED COMPONENTS system filesystem thread log locale regex)
|
find_package(Boost REQUIRED COMPONENTS system filesystem thread log locale regex)
|
||||||
if(Boost_FOUND)
|
if(Boost_FOUND)
|
||||||
include_directories(${Boost_INCLUDE_DIRS})
|
include_directories(${Boost_INCLUDE_DIRS})
|
||||||
|
|
|
@ -80,7 +80,7 @@ elseif (MSVC)
|
||||||
# Manifest is provided through slic3r.rc, don't generate your own.
|
# Manifest is provided through slic3r.rc, don't generate your own.
|
||||||
set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} /MANIFEST:NO")
|
set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} /MANIFEST:NO")
|
||||||
else ()
|
else ()
|
||||||
target_link_libraries(slic3r -ldl -lstdc++)
|
target_link_libraries(slic3r ${CMAKE_DL_LIBS} -lstdc++)
|
||||||
endif ()
|
endif ()
|
||||||
|
|
||||||
# Add the Slic3r GUI library, libcurl, OpenGL and GLU libraries.
|
# Add the Slic3r GUI library, libcurl, OpenGL and GLU libraries.
|
||||||
|
|
|
@ -66,7 +66,7 @@ set(AVRDUDE_SOURCES
|
||||||
avrdude-slic3r.hpp
|
avrdude-slic3r.hpp
|
||||||
avrdude-slic3r.cpp
|
avrdude-slic3r.cpp
|
||||||
)
|
)
|
||||||
if (WIN32)
|
if (MSVC)
|
||||||
set(AVRDUDE_SOURCES ${AVRDUDE_SOURCES}
|
set(AVRDUDE_SOURCES ${AVRDUDE_SOURCES}
|
||||||
windows/unistd.cpp
|
windows/unistd.cpp
|
||||||
windows/getopt.c
|
windows/getopt.c
|
||||||
|
|
|
@ -43,7 +43,7 @@
|
||||||
#include <ctype.h>
|
#include <ctype.h>
|
||||||
#include <sys/types.h>
|
#include <sys/types.h>
|
||||||
|
|
||||||
#if !defined(WIN32NATIVE)
|
#if !defined(WIN32NATIVE) || defined(__GNUC__)
|
||||||
# include <sys/time.h>
|
# include <sys/time.h>
|
||||||
# include <sys/types.h>
|
# include <sys/types.h>
|
||||||
# include <sys/stat.h>
|
# include <sys/stat.h>
|
||||||
|
|
|
@ -2515,7 +2515,15 @@ void PrintConfigDef::init_sla_params()
|
||||||
def->sidetext = L("mm");
|
def->sidetext = L("mm");
|
||||||
def->cli = "";
|
def->cli = "";
|
||||||
def->min = 0;
|
def->min = 0;
|
||||||
def->default_value = new ConfigOptionFloat();
|
def->default_value = new ConfigOptionFloat(15.0);
|
||||||
|
|
||||||
|
def = this->add("support_object_elevation", coFloat);
|
||||||
|
def->label = L("Object elevation");
|
||||||
|
def->tooltip = L("How much the supports should lift up the supported object.");
|
||||||
|
def->sidetext = L("mm");
|
||||||
|
def->cli = "";
|
||||||
|
def->min = 0;
|
||||||
|
def->default_value = new ConfigOptionFloat(5.0);
|
||||||
|
|
||||||
def = this->add("pad_wall_thickness", coFloat);
|
def = this->add("pad_wall_thickness", coFloat);
|
||||||
def->label = L("Pad wall thickness");
|
def->label = L("Pad wall thickness");
|
||||||
|
@ -2542,7 +2550,7 @@ void PrintConfigDef::init_sla_params()
|
||||||
def->default_value = new ConfigOptionFloat(50.0);
|
def->default_value = new ConfigOptionFloat(50.0);
|
||||||
|
|
||||||
def = this->add("pad_edge_radius", coFloat);
|
def = this->add("pad_edge_radius", coFloat);
|
||||||
def->label = L("pad edge radius");
|
def->label = L("Pad edge radius");
|
||||||
def->tooltip = L("");
|
def->tooltip = L("");
|
||||||
def->sidetext = L("mm");
|
def->sidetext = L("mm");
|
||||||
def->cli = "";
|
def->cli = "";
|
||||||
|
|
|
@ -960,6 +960,7 @@ protected:
|
||||||
OPT_PTR(support_base_height);
|
OPT_PTR(support_base_height);
|
||||||
OPT_PTR(support_critical_angle);
|
OPT_PTR(support_critical_angle);
|
||||||
OPT_PTR(support_max_bridge_length);
|
OPT_PTR(support_max_bridge_length);
|
||||||
|
OPT_PTR(support_object_elevation);
|
||||||
OPT_PTR(pad_wall_thickness);
|
OPT_PTR(pad_wall_thickness);
|
||||||
OPT_PTR(pad_wall_height);
|
OPT_PTR(pad_wall_height);
|
||||||
OPT_PTR(pad_max_merge_distance);
|
OPT_PTR(pad_max_merge_distance);
|
||||||
|
|
|
@ -510,7 +510,9 @@ struct Pad {
|
||||||
Pad(const TriangleMesh& object_support_mesh,
|
Pad(const TriangleMesh& object_support_mesh,
|
||||||
const ExPolygons& baseplate,
|
const ExPolygons& baseplate,
|
||||||
double ground_level,
|
double ground_level,
|
||||||
const PoolConfig& cfg) : zlevel(ground_level + cfg.min_wall_height_mm/2)
|
const PoolConfig& pcfg) :
|
||||||
|
cfg(pcfg),
|
||||||
|
zlevel(ground_level + cfg.min_wall_height_mm/2)
|
||||||
{
|
{
|
||||||
ExPolygons basep;
|
ExPolygons basep;
|
||||||
base_plate(object_support_mesh, basep,
|
base_plate(object_support_mesh, basep,
|
||||||
|
@ -1092,7 +1094,7 @@ bool SLASupportTree::generate(const PointSet &points,
|
||||||
cfg.head_back_radius_mm,
|
cfg.head_back_radius_mm,
|
||||||
cfg.head_front_radius_mm,
|
cfg.head_front_radius_mm,
|
||||||
cfg.head_width_mm,
|
cfg.head_width_mm,
|
||||||
cfg.head_penetraiton_mm,
|
cfg.head_penetration_mm,
|
||||||
nmls.row(i), // dir
|
nmls.row(i), // dir
|
||||||
head_pos.row(i) // displacement
|
head_pos.row(i) // displacement
|
||||||
);
|
);
|
||||||
|
@ -1460,7 +1462,7 @@ bool SLASupportTree::generate(const PointSet &points,
|
||||||
Head base_head(cfg.head_back_radius_mm,
|
Head base_head(cfg.head_back_radius_mm,
|
||||||
cfg.head_front_radius_mm,
|
cfg.head_front_radius_mm,
|
||||||
cfg.head_width_mm,
|
cfg.head_width_mm,
|
||||||
cfg.head_penetraiton_mm,
|
cfg.head_penetration_mm,
|
||||||
{0.0, 0.0, 1.0},
|
{0.0, 0.0, 1.0},
|
||||||
{headend(X), headend(Y), headend(Z) - gh});
|
{headend(X), headend(Y), headend(Z) - gh});
|
||||||
|
|
||||||
|
@ -1659,10 +1661,10 @@ const TriangleMesh &SLASupportTree::add_pad(const SliceLayer& baseplate,
|
||||||
TriangleMesh mm;
|
TriangleMesh mm;
|
||||||
merged_mesh(mm);
|
merged_mesh(mm);
|
||||||
PoolConfig pcfg;
|
PoolConfig pcfg;
|
||||||
// pcfg.min_wall_thickness_mm = min_wall_thickness_mm;
|
pcfg.min_wall_thickness_mm = min_wall_thickness_mm;
|
||||||
// pcfg.min_wall_height_mm = min_wall_height_mm;
|
pcfg.min_wall_height_mm = min_wall_height_mm;
|
||||||
// pcfg.max_merge_distance_mm = max_merge_distance_mm;
|
pcfg.max_merge_distance_mm = max_merge_distance_mm;
|
||||||
// pcfg.edge_radius_mm = edge_radius_mm;
|
pcfg.edge_radius_mm = edge_radius_mm;
|
||||||
return m_impl->create_pad(mm, baseplate, pcfg).tmesh;
|
return m_impl->create_pad(mm, baseplate, pcfg).tmesh;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -33,7 +33,7 @@ struct SupportConfig {
|
||||||
double head_front_radius_mm = 0.2;
|
double head_front_radius_mm = 0.2;
|
||||||
|
|
||||||
// How much the pinhead has to penetrate the model surface
|
// How much the pinhead has to penetrate the model surface
|
||||||
double head_penetraiton_mm = 0.5;
|
double head_penetration_mm = 0.5;
|
||||||
|
|
||||||
// Radius of the back side of the 3d arrow.
|
// Radius of the back side of the 3d arrow.
|
||||||
double head_back_radius_mm = 0.5;
|
double head_back_radius_mm = 0.5;
|
||||||
|
|
|
@ -85,7 +85,7 @@ SLAPrint::ApplyStatus SLAPrint::apply(const Model &model,
|
||||||
// Temporary: just to have to correct layer height for the rasterization
|
// Temporary: just to have to correct layer height for the rasterization
|
||||||
DynamicPrintConfig config(config_in);
|
DynamicPrintConfig config(config_in);
|
||||||
config.normalize();
|
config.normalize();
|
||||||
auto lh = config.opt<ConfigOptionFloat>("layer_height");
|
//auto lh = config.opt<ConfigOptionFloat>("layer_height");
|
||||||
|
|
||||||
// Temporary quick fix, just invalidate everything.
|
// Temporary quick fix, just invalidate everything.
|
||||||
{
|
{
|
||||||
|
@ -102,7 +102,10 @@ SLAPrint::ApplyStatus SLAPrint::apply(const Model &model,
|
||||||
// Generate new SLAPrintObjects.
|
// Generate new SLAPrintObjects.
|
||||||
for (ModelObject *model_object : m_model.objects) {
|
for (ModelObject *model_object : m_model.objects) {
|
||||||
auto po = new SLAPrintObject(this, model_object);
|
auto po = new SLAPrintObject(this, model_object);
|
||||||
po->m_config.layer_height.set(lh);
|
|
||||||
|
// po->m_config.layer_height.set(lh);
|
||||||
|
po->m_config.apply(config, true);
|
||||||
|
|
||||||
m_objects.emplace_back(po);
|
m_objects.emplace_back(po);
|
||||||
for (ModelInstance *oinst : model_object->instances) {
|
for (ModelInstance *oinst : model_object->instances) {
|
||||||
Point tr = Point::new_scale(oinst->get_offset()(X),
|
Point tr = Point::new_scale(oinst->get_offset()(X),
|
||||||
|
@ -172,14 +175,14 @@ void SLAPrint::process()
|
||||||
sla::SupportConfig scfg;
|
sla::SupportConfig scfg;
|
||||||
SLAPrintObjectConfig& c = po.m_config;
|
SLAPrintObjectConfig& c = po.m_config;
|
||||||
|
|
||||||
// scfg.head_front_radius_mm = c.support_head_front_radius.getFloat();
|
scfg.head_front_radius_mm = c.support_head_front_radius.getFloat();
|
||||||
// scfg.head_back_radius_mm = c.support_head_back_radius.getFloat();
|
scfg.head_back_radius_mm = c.support_head_back_radius.getFloat();
|
||||||
// scfg.head_penetraiton_mm = c.support_head_penetraiton.getFloat();
|
scfg.head_penetration_mm = c.support_head_penetration.getFloat();
|
||||||
// scfg.head_width_mm = c.support_head_width.getFloat();
|
scfg.head_width_mm = c.support_head_width.getFloat();
|
||||||
// scfg.object_elevation_mm = c.support_object_elevation.getFloat();
|
scfg.object_elevation_mm = c.support_object_elevation.getFloat();
|
||||||
// scfg.tilt = c.support_critical_angle.getFloat() * 180.0 / PI;
|
scfg.tilt = c.support_critical_angle.getFloat() * PI / 180.0 ;
|
||||||
// scfg.max_bridge_length_mm = c.support_max_bridge_length.getFloat();
|
scfg.max_bridge_length_mm = c.support_max_bridge_length.getFloat();
|
||||||
// scfg.pillar_radius_mm = c.support_pillar_radius.getFloat();
|
scfg.pillar_radius_mm = c.support_pillar_radius.getFloat();
|
||||||
|
|
||||||
sla::Controller ctl;
|
sla::Controller ctl;
|
||||||
ctl.statuscb = [this](unsigned st, const std::string& msg) {
|
ctl.statuscb = [this](unsigned st, const std::string& msg) {
|
||||||
|
@ -216,10 +219,11 @@ void SLAPrint::process()
|
||||||
double lh = po.m_config.layer_height.getFloat();
|
double lh = po.m_config.layer_height.getFloat();
|
||||||
double elevation = po.m_config.support_object_elevation.getFloat();
|
double elevation = po.m_config.support_object_elevation.getFloat();
|
||||||
|
|
||||||
|
std::cout << "Pad height " << h << std::endl;
|
||||||
|
|
||||||
sla::ExPolygons bp;
|
sla::ExPolygons bp;
|
||||||
if(elevation < h/2)
|
if(elevation < h/2) sla::base_plate(po.transformed_mesh(), bp,
|
||||||
sla::base_plate(po.transformed_mesh(), bp,
|
float(h/2), float(lh));
|
||||||
float(h/2), float(lh));
|
|
||||||
|
|
||||||
po.m_supportdata->support_tree_ptr->add_pad(bp, wt, h, md, er);
|
po.m_supportdata->support_tree_ptr->add_pad(bp, wt, h, md, er);
|
||||||
}
|
}
|
||||||
|
|
|
@ -411,6 +411,7 @@ const std::vector<std::string>& Preset::sla_print_options()
|
||||||
"support_base_height",
|
"support_base_height",
|
||||||
"support_critical_angle",
|
"support_critical_angle",
|
||||||
"support_max_bridge_length",
|
"support_max_bridge_length",
|
||||||
|
"support_object_elevation",
|
||||||
"pad_wall_thickness",
|
"pad_wall_thickness",
|
||||||
"pad_wall_height",
|
"pad_wall_height",
|
||||||
"pad_max_merge_distance",
|
"pad_max_merge_distance",
|
||||||
|
|
|
@ -3005,6 +3005,7 @@ void TabSLAPrint::build()
|
||||||
optgroup->append_single_option_line("support_pillar_radius");
|
optgroup->append_single_option_line("support_pillar_radius");
|
||||||
optgroup->append_single_option_line("support_base_radius");
|
optgroup->append_single_option_line("support_base_radius");
|
||||||
optgroup->append_single_option_line("support_base_height");
|
optgroup->append_single_option_line("support_base_height");
|
||||||
|
optgroup->append_single_option_line("support_object_elevation");
|
||||||
|
|
||||||
optgroup = page->new_optgroup(_(L("Connection of the support sticks and junctions")));
|
optgroup = page->new_optgroup(_(L("Connection of the support sticks and junctions")));
|
||||||
optgroup->append_single_option_line("support_critical_angle");
|
optgroup->append_single_option_line("support_critical_angle");
|
||||||
|
|
|
@ -308,7 +308,7 @@ bool PrusaCollapsiblePaneMSW::Create(wxWindow *parent, wxWindowID id, const wxSt
|
||||||
m_pPane = new wxPanel(this, wxID_ANY, wxDefaultPosition, wxDefaultSize,
|
m_pPane = new wxPanel(this, wxID_ANY, wxDefaultPosition, wxDefaultSize,
|
||||||
wxTAB_TRAVERSAL | wxNO_BORDER, wxT("wxCollapsiblePanePane"));
|
wxTAB_TRAVERSAL | wxNO_BORDER, wxT("wxCollapsiblePanePane"));
|
||||||
|
|
||||||
wxColour& clr = wxSystemSettings::GetColour(wxSYS_COLOUR_WINDOW);
|
wxColour&& clr = wxSystemSettings::GetColour(wxSYS_COLOUR_WINDOW);
|
||||||
m_pDisclosureTriangleButton->SetBackgroundColour(clr);
|
m_pDisclosureTriangleButton->SetBackgroundColour(clr);
|
||||||
this->SetBackgroundColour(clr);
|
this->SetBackgroundColour(clr);
|
||||||
m_pPane->SetBackgroundColour(clr);
|
m_pPane->SetBackgroundColour(clr);
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue