diff --git a/CMakeLists.txt b/CMakeLists.txt index 520b913c1..18a3be3a3 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -152,7 +152,7 @@ if(SLIC3R_STATIC) # set(Boost_USE_STATIC_RUNTIME ON) endif() #set(Boost_DEBUG ON) -set(Boost_COMPILER "-vc120") +# set(Boost_COMPILER "-vc120") find_package(Boost REQUIRED COMPONENTS system filesystem thread log locale regex) if(Boost_FOUND) include_directories(${Boost_INCLUDE_DIRS}) diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 32d2c5b03..21ee023d1 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -80,7 +80,7 @@ elseif (MSVC) # Manifest is provided through slic3r.rc, don't generate your own. set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} /MANIFEST:NO") else () - target_link_libraries(slic3r -ldl -lstdc++) + target_link_libraries(slic3r ${CMAKE_DL_LIBS} -lstdc++) endif () # Add the Slic3r GUI library, libcurl, OpenGL and GLU libraries. diff --git a/src/avrdude/CMakeLists.txt b/src/avrdude/CMakeLists.txt index d88563368..ad0835ec0 100644 --- a/src/avrdude/CMakeLists.txt +++ b/src/avrdude/CMakeLists.txt @@ -66,7 +66,7 @@ set(AVRDUDE_SOURCES avrdude-slic3r.hpp avrdude-slic3r.cpp ) -if (WIN32) +if (MSVC) set(AVRDUDE_SOURCES ${AVRDUDE_SOURCES} windows/unistd.cpp windows/getopt.c diff --git a/src/avrdude/main.c b/src/avrdude/main.c index ebda0ba19..9ada27be3 100644 --- a/src/avrdude/main.c +++ b/src/avrdude/main.c @@ -43,7 +43,7 @@ #include #include -#if !defined(WIN32NATIVE) +#if !defined(WIN32NATIVE) || defined(__GNUC__) # include # include # include diff --git a/src/libslic3r/PrintConfig.cpp b/src/libslic3r/PrintConfig.cpp index 1e8f26d38..96c492292 100644 --- a/src/libslic3r/PrintConfig.cpp +++ b/src/libslic3r/PrintConfig.cpp @@ -2515,7 +2515,15 @@ void PrintConfigDef::init_sla_params() def->sidetext = L("mm"); def->cli = ""; 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->label = L("Pad wall thickness"); @@ -2542,7 +2550,7 @@ void PrintConfigDef::init_sla_params() def->default_value = new ConfigOptionFloat(50.0); def = this->add("pad_edge_radius", coFloat); - def->label = L("pad edge radius"); + def->label = L("Pad edge radius"); def->tooltip = L(""); def->sidetext = L("mm"); def->cli = ""; diff --git a/src/libslic3r/PrintConfig.hpp b/src/libslic3r/PrintConfig.hpp index 8c9fb0056..54d6274a9 100644 --- a/src/libslic3r/PrintConfig.hpp +++ b/src/libslic3r/PrintConfig.hpp @@ -960,6 +960,7 @@ protected: OPT_PTR(support_base_height); OPT_PTR(support_critical_angle); OPT_PTR(support_max_bridge_length); + OPT_PTR(support_object_elevation); OPT_PTR(pad_wall_thickness); OPT_PTR(pad_wall_height); OPT_PTR(pad_max_merge_distance); diff --git a/src/libslic3r/SLA/SLASupportTree.cpp b/src/libslic3r/SLA/SLASupportTree.cpp index 029c45069..55e0c5010 100644 --- a/src/libslic3r/SLA/SLASupportTree.cpp +++ b/src/libslic3r/SLA/SLASupportTree.cpp @@ -510,7 +510,9 @@ struct Pad { Pad(const TriangleMesh& object_support_mesh, const ExPolygons& baseplate, 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; base_plate(object_support_mesh, basep, @@ -1092,7 +1094,7 @@ bool SLASupportTree::generate(const PointSet &points, cfg.head_back_radius_mm, cfg.head_front_radius_mm, cfg.head_width_mm, - cfg.head_penetraiton_mm, + cfg.head_penetration_mm, nmls.row(i), // dir head_pos.row(i) // displacement ); @@ -1460,7 +1462,7 @@ bool SLASupportTree::generate(const PointSet &points, Head base_head(cfg.head_back_radius_mm, cfg.head_front_radius_mm, cfg.head_width_mm, - cfg.head_penetraiton_mm, + cfg.head_penetration_mm, {0.0, 0.0, 1.0}, {headend(X), headend(Y), headend(Z) - gh}); @@ -1659,10 +1661,10 @@ const TriangleMesh &SLASupportTree::add_pad(const SliceLayer& baseplate, TriangleMesh mm; merged_mesh(mm); PoolConfig pcfg; -// pcfg.min_wall_thickness_mm = min_wall_thickness_mm; -// pcfg.min_wall_height_mm = min_wall_height_mm; -// pcfg.max_merge_distance_mm = max_merge_distance_mm; -// pcfg.edge_radius_mm = edge_radius_mm; + pcfg.min_wall_thickness_mm = min_wall_thickness_mm; + pcfg.min_wall_height_mm = min_wall_height_mm; + pcfg.max_merge_distance_mm = max_merge_distance_mm; + pcfg.edge_radius_mm = edge_radius_mm; return m_impl->create_pad(mm, baseplate, pcfg).tmesh; } diff --git a/src/libslic3r/SLA/SLASupportTree.hpp b/src/libslic3r/SLA/SLASupportTree.hpp index cf61f07b0..6295a45b0 100644 --- a/src/libslic3r/SLA/SLASupportTree.hpp +++ b/src/libslic3r/SLA/SLASupportTree.hpp @@ -33,7 +33,7 @@ struct SupportConfig { double head_front_radius_mm = 0.2; // 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. double head_back_radius_mm = 0.5; diff --git a/src/libslic3r/SLAPrint.cpp b/src/libslic3r/SLAPrint.cpp index 27566365c..aad86e9a1 100644 --- a/src/libslic3r/SLAPrint.cpp +++ b/src/libslic3r/SLAPrint.cpp @@ -85,7 +85,7 @@ SLAPrint::ApplyStatus SLAPrint::apply(const Model &model, // Temporary: just to have to correct layer height for the rasterization DynamicPrintConfig config(config_in); config.normalize(); - auto lh = config.opt("layer_height"); + //auto lh = config.opt("layer_height"); // Temporary quick fix, just invalidate everything. { @@ -102,7 +102,10 @@ SLAPrint::ApplyStatus SLAPrint::apply(const Model &model, // Generate new SLAPrintObjects. for (ModelObject *model_object : m_model.objects) { 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); for (ModelInstance *oinst : model_object->instances) { Point tr = Point::new_scale(oinst->get_offset()(X), @@ -172,14 +175,14 @@ void SLAPrint::process() sla::SupportConfig scfg; SLAPrintObjectConfig& c = po.m_config; -// scfg.head_front_radius_mm = c.support_head_front_radius.getFloat(); -// scfg.head_back_radius_mm = c.support_head_back_radius.getFloat(); -// scfg.head_penetraiton_mm = c.support_head_penetraiton.getFloat(); -// scfg.head_width_mm = c.support_head_width.getFloat(); -// scfg.object_elevation_mm = c.support_object_elevation.getFloat(); -// scfg.tilt = c.support_critical_angle.getFloat() * 180.0 / PI; -// scfg.max_bridge_length_mm = c.support_max_bridge_length.getFloat(); -// scfg.pillar_radius_mm = c.support_pillar_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_penetration_mm = c.support_head_penetration.getFloat(); + scfg.head_width_mm = c.support_head_width.getFloat(); + scfg.object_elevation_mm = c.support_object_elevation.getFloat(); + scfg.tilt = c.support_critical_angle.getFloat() * PI / 180.0 ; + scfg.max_bridge_length_mm = c.support_max_bridge_length.getFloat(); + scfg.pillar_radius_mm = c.support_pillar_radius.getFloat(); sla::Controller ctl; 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 elevation = po.m_config.support_object_elevation.getFloat(); + std::cout << "Pad height " << h << std::endl; + sla::ExPolygons bp; - if(elevation < h/2) - sla::base_plate(po.transformed_mesh(), bp, - float(h/2), float(lh)); + if(elevation < h/2) sla::base_plate(po.transformed_mesh(), bp, + float(h/2), float(lh)); po.m_supportdata->support_tree_ptr->add_pad(bp, wt, h, md, er); } diff --git a/src/slic3r/GUI/Preset.cpp b/src/slic3r/GUI/Preset.cpp index 1599af0c4..541e5c79b 100644 --- a/src/slic3r/GUI/Preset.cpp +++ b/src/slic3r/GUI/Preset.cpp @@ -411,6 +411,7 @@ const std::vector& Preset::sla_print_options() "support_base_height", "support_critical_angle", "support_max_bridge_length", + "support_object_elevation", "pad_wall_thickness", "pad_wall_height", "pad_max_merge_distance", diff --git a/src/slic3r/GUI/Tab.cpp b/src/slic3r/GUI/Tab.cpp index 4c9e56bbd..dcd5f33fc 100644 --- a/src/slic3r/GUI/Tab.cpp +++ b/src/slic3r/GUI/Tab.cpp @@ -3005,6 +3005,7 @@ void TabSLAPrint::build() optgroup->append_single_option_line("support_pillar_radius"); optgroup->append_single_option_line("support_base_radius"); 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->append_single_option_line("support_critical_angle"); diff --git a/src/slic3r/GUI/wxExtensions.cpp b/src/slic3r/GUI/wxExtensions.cpp index 5d0b44d47..b80976e65 100644 --- a/src/slic3r/GUI/wxExtensions.cpp +++ b/src/slic3r/GUI/wxExtensions.cpp @@ -308,7 +308,7 @@ bool PrusaCollapsiblePaneMSW::Create(wxWindow *parent, wxWindowID id, const wxSt m_pPane = new wxPanel(this, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxTAB_TRAVERSAL | wxNO_BORDER, wxT("wxCollapsiblePanePane")); - wxColour& clr = wxSystemSettings::GetColour(wxSYS_COLOUR_WINDOW); + wxColour&& clr = wxSystemSettings::GetColour(wxSYS_COLOUR_WINDOW); m_pDisclosureTriangleButton->SetBackgroundColour(clr); this->SetBackgroundColour(clr); m_pPane->SetBackgroundColour(clr);