Skip to content

Commit

Permalink
Merge remote-tracking branch 'remotes/local/dev' into superslicer_var…
Browse files Browse the repository at this point in the history
…iant
  • Loading branch information
supermerill committed Mar 5, 2025
2 parents bafb3ab + 97e3528 commit ea0d709
Show file tree
Hide file tree
Showing 12 changed files with 1,584 additions and 90 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ deps/build-linux/*
**/.idea/
.pkg_cache
CMakeUserPresets.json
**/bad_*
# MacOS Ignores
.DS_Store

2 changes: 1 addition & 1 deletion resources/profiles
Submodule profiles updated 397 files
2 changes: 1 addition & 1 deletion src/libslic3r/Config.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -952,7 +952,7 @@ class ConfigOptionVector : public ConfigOptionVectorBase
this->m_enabled.erase(this->m_enabled.begin() + n, this->m_enabled.end());
} else if (n > this->m_values.size()) {
if (this->m_values.empty()) {
if (opt_default == nullptr)
if (opt_default == nullptr || opt_default->size() == 0)
this->m_values.resize(n, this->default_value);
else if (opt_default->type() != this->type())
throw ConfigurationError("ConfigOptionVector::resize(): Extending with an incompatible type.");
Expand Down
12 changes: 6 additions & 6 deletions src/libslic3r/GCode.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -7086,6 +7086,7 @@ void GCodeGenerator::_add_object_change_labels(std::string& gcode) {
// if m_new_z_target, then the ramping lift will be written. if not, then there isn't anything to ensure a good z
if(!m_new_z_target && BOOL_EXTRUDER_CONFIG(travel_ramping_lift) && m_spiral_vase_layer <= 0) {
gcode += m_writer.get_travel_to_z_gcode(m_writer.get_position().z(), "ensure z is right");
m_writer.set_lift(0);
}
}
}
Expand Down Expand Up @@ -7352,13 +7353,12 @@ void GCodeGenerator::write_travel_to(std::string &gcode, Polyline& travel, std::
double layer_change_diff = m_layer->print_z - m_writer.get_unlifted_position().z();
// move layer_change_diff into lift & z_diff_layer_and_lift
z_diff_layer_and_lift += layer_change_diff;
} else {
// do a strait z-move (as we can't see the preious point.
gcode += m_writer.get_travel_to_z_gcode(m_layer->print_z, "strait z-move, as the travel is undefined.");
no_ramping = true;
}
} else {
assert(!m_new_z_target);
}
if (travel.size() <= 1) {
// do a strait z-move (as we can't see the previous point.
gcode += m_writer.travel_to_z(m_layer->print_z, "strait z-move, as the travel is undefined.");
no_ramping = true;
}
// register get_extra_lift for our ramping lift (ramping lift + lift_min)
if (m_writer.get_extra_lift() != 0) {
Expand Down
6 changes: 3 additions & 3 deletions src/libslic3r/LayerRegion.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1191,11 +1191,11 @@ void LayerRegion::prepare_fill_surfaces()
this->region().config().fill_density.value == 0))) {
for (Surface &surface : m_fill_surfaces)
if (surface.has_pos_top())
surface.surface_type = (
//this->layer()->object()->config().infill_only_where_needed &&
surface.surface_type =
/*( this->layer()->object()->config().infill_only_where_needed &&
!this->region().config().infill_dense.value
&& this->region().config().fill_pattern != ipLightning) ?
stPosInternal | stDensVoid : stPosInternal | stDensSparse;
stPosInternal | stDensVoid :*/ stPosInternal | stDensSparse;
}
if (this->region().config().bottom_solid_layers == 0) {
for (Surface &surface : m_fill_surfaces)
Expand Down
10 changes: 4 additions & 6 deletions src/libslic3r/Preset.cpp
Original file line number Diff line number Diff line change
@@ -1,10 +1,6 @@
///|/ Copyright (c) Prusa Research 2017 - 2023 Oleksandra Iushchenko @YuSanka, Lukáš Matěna @lukasmatena, Tomáš Mészáros @tamasmeszaros, Lukáš Hejl @hejllukas, Vojtěch Bubník @bubnikv, Pavel Mikuš @Godrak, David Kocík @kocikdav, Enrico Turri @enricoturri1966, Vojtěch Král @vojtechkral
///|/ Copyright (c) 2021 Martin Budden
///|/ Copyright (c) 2021 Ilya @xorza
///|/ Copyright (c) 2019 John Drake @foxox
///|/ Copyright (c) 2018 Martin Loidl @LoidlM
///|/ Copyright (c) SuperSlicer 2025 Durand rémi @supermerill
///|/
///|/ PrusaSlicer is released under the terms of the AGPLv3 or higher
///|/ SuperSlicer is released under the terms of the AGPLv3 or higher
///|/
#include <cassert>

Expand Down Expand Up @@ -50,6 +46,8 @@

using boost::property_tree::ptree;

// todo: arc_fitting and mlin_gcode_resolution switch from print to printer

namespace Slic3r {

ConfigFileType guess_config_file_type(const ptree &tree)
Expand Down
244 changes: 183 additions & 61 deletions src/libslic3r/PrintConfig.cpp

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion src/libslic3r/Semver.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,6 @@

namespace Slic3r {

Semver SEMVER { SLIC3R_VERSION };
Semver SEMVER { SLIC3R_VERSION_FULL };

}
24 changes: 14 additions & 10 deletions src/libslic3r/Semver.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -115,18 +115,22 @@ class Semver

~Semver() { ::semver_free(&ver); }

// const accessors
int maj() const { return ver.counter_size > 0 ? ver.counters[0] : 0; }
int min() const { return ver.counter_size > 1 ? ver.counters[1] : 0; }
//int counter() const { return ver.counter_size > 2 ? ver.counters[2] : 0; }
//int patch() const { return ver.counter_size > 3 ? ver.counters[3] : 0; }
const char* prerelease() const { return ver.prerelease; }
const char* metadata() const { return ver.metadata; }
// const accessors
int maj() const { return ver.counter_size > 0 ? ver.counters[0] : 0; }
int min() const { return ver.counter_size > 1 ? ver.counters[1] : 0; }
int counter() const { return ver.counter_size > 2 ? ver.counters[2] : 0; }
int patch() const { return ver.counter_size > 3 ? ver.counters[3] : 0; }
bool has_maj() const { return ver.counter_size > 0; }
bool has_min() const { return ver.counter_size > 1; }
bool has_counter() const { return ver.counter_size > 2; }
bool has_patch() const { return ver.counter_size > 3; }
const char *prerelease() const { return ver.prerelease; }
const char *metadata() const { return ver.metadata; }

// Setters
//void set_maj(int maj) { if(ver.counter_size > 0) ver.counters[0] = maj; }
//void set_min(int min) { if (ver.counter_size > 1) ver.counters[1] = min; }
//void set_counter(int count) { if (ver.counter_size > 2) ver.counters[2] = count; }
void set_maj(int maj) { if(ver.counter_size > 0) ver.counters[0] = maj; }
void set_min(int min) { if (ver.counter_size > 1) ver.counters[1] = min; }
void set_counter(int count) { if (ver.counter_size > 2) ver.counters[2] = count; }
void set_patch(int patch) { if (ver.counter_size > 3) ver.counters[3] = patch; }
void set_metadata(std::optional<std::string> meta)
{
Expand Down
2 changes: 1 addition & 1 deletion src/slic3r/GUI/ConfigWizard.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -173,7 +173,7 @@ BundleMap BundleMap::load()
// Fresh index should be in archive_dir, otherwise look for it in cache
// Then if not in archive or cache - it could be 3rd party profile that user just copied to vendor folder (both ini and cache)

fs::path idx_path (archive_dir / (id + ".idx"));
fs::path idx_path (cache_dir / (id + ".idx"));
if (!boost::filesystem::exists(idx_path)) {
BOOST_LOG_TRIVIAL(error) << format("Missing index %1% when loading bundle %2%. Going to search for it in cache folder.", idx_path.string(), id);
idx_path = fs::path(cache_dir / (id + ".idx"));
Expand Down
15 changes: 15 additions & 0 deletions src/test-utils/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -12,3 +12,18 @@ endif ()
if (WIN32)
prusaslicer_copy_dlls(stl_to_cpp)
endif()



# test your vendor config, helping to convert from prusaslicer.
add_executable(convert_config convert_config.cpp)

if (CMAKE_SYSTEM_NAME STREQUAL "Linux")
target_link_libraries(convert_config libslic3r xcb)
else ()
target_link_libraries(convert_config libslic3r)
endif ()

if (WIN32)
prusaslicer_copy_dlls(convert_config)
endif()
Loading

0 comments on commit ea0d709

Please sign in to comment.