mirror of
https://github.com/SoftFever/OrcaSlicer.git
synced 2025-10-23 00:31:11 -06:00
Merge branch 'master' into fs_QuadricEdgeCollapse
This commit is contained in:
commit
5ac2809426
31 changed files with 123 additions and 684 deletions
|
@ -1087,7 +1087,12 @@ void GCodeProcessor::apply_config(const DynamicPrintConfig& config)
|
|||
}
|
||||
}
|
||||
|
||||
if (m_flavor == gcfMarlinLegacy || m_flavor == gcfMarlinFirmware) {
|
||||
bool use_machine_limits = false;
|
||||
const ConfigOptionEnum<MachineLimitsUsage>* machine_limits_usage = config.option<ConfigOptionEnum<MachineLimitsUsage>>("machine_limits_usage");
|
||||
if (machine_limits_usage != nullptr)
|
||||
use_machine_limits = machine_limits_usage->value != MachineLimitsUsage::Ignore;
|
||||
|
||||
if (use_machine_limits && (m_flavor == gcfMarlinLegacy || m_flavor == gcfMarlinFirmware)) {
|
||||
const ConfigOptionFloats* machine_max_acceleration_x = config.option<ConfigOptionFloats>("machine_max_acceleration_x");
|
||||
if (machine_max_acceleration_x != nullptr)
|
||||
m_time_processor.machine_limits.machine_max_acceleration_x.values = machine_max_acceleration_x->values;
|
||||
|
@ -1171,8 +1176,13 @@ void GCodeProcessor::apply_config(const DynamicPrintConfig& config)
|
|||
m_time_processor.machines[i].travel_acceleration = (max_travel_acceleration > 0.0f) ? max_travel_acceleration : DEFAULT_TRAVEL_ACCELERATION;
|
||||
}
|
||||
|
||||
if (m_time_processor.machine_limits.machine_max_acceleration_x.values.size() > 1)
|
||||
enable_stealth_time_estimator(true);
|
||||
if (m_flavor == gcfMarlinLegacy || m_flavor == gcfMarlinFirmware) {
|
||||
const ConfigOptionBool* silent_mode = config.option<ConfigOptionBool>("silent_mode");
|
||||
if (silent_mode != nullptr) {
|
||||
if (silent_mode->value && m_time_processor.machine_limits.machine_max_acceleration_x.values.size() > 1)
|
||||
enable_stealth_time_estimator(true);
|
||||
}
|
||||
}
|
||||
|
||||
const ConfigOptionBool* use_volumetric_e = config.option<ConfigOptionBool>("use_volumetric_e");
|
||||
if (use_volumetric_e != nullptr)
|
||||
|
|
|
@ -1418,6 +1418,7 @@ const std::vector<std::string>& PhysicalPrinter::printer_options()
|
|||
static std::vector<std::string> s_opts;
|
||||
if (s_opts.empty()) {
|
||||
s_opts = {
|
||||
"preset_name", // temporary option to compatibility with older Slicer
|
||||
"preset_names",
|
||||
"printer_technology",
|
||||
"host_type",
|
||||
|
@ -1481,6 +1482,15 @@ void PhysicalPrinter::update_preset_names_in_config()
|
|||
values.clear();
|
||||
for (auto preset : preset_names)
|
||||
values.push_back(preset);
|
||||
|
||||
// temporary workaround for compatibility with older Slicer
|
||||
{
|
||||
std::string name;
|
||||
for (auto el : preset_names)
|
||||
name += el + ";";
|
||||
name.pop_back();
|
||||
config.set_key_value("preset_name", new ConfigOptionString(name));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -352,18 +352,12 @@ bool Print::has_brim() const
|
|||
return std::any_of(m_objects.begin(), m_objects.end(), [](PrintObject *object) { return object->has_brim(); });
|
||||
}
|
||||
|
||||
#if ENABLE_SEQUENTIAL_LIMITS
|
||||
bool Print::sequential_print_horizontal_clearance_valid(const Print& print, Polygons* polygons)
|
||||
#else
|
||||
static inline bool sequential_print_horizontal_clearance_valid(const Print &print)
|
||||
#endif // ENABLE_SEQUENTIAL_LIMITS
|
||||
{
|
||||
Polygons convex_hulls_other;
|
||||
#if ENABLE_SEQUENTIAL_LIMITS
|
||||
if (polygons != nullptr)
|
||||
polygons->clear();
|
||||
std::vector<size_t> intersecting_idxs;
|
||||
#endif // ENABLE_SEQUENTIAL_LIMITS
|
||||
|
||||
std::map<ObjectID, Polygon> map_model_object_to_convex_hull;
|
||||
for (const PrintObject *print_object : print.objects()) {
|
||||
|
@ -408,7 +402,6 @@ static inline bool sequential_print_horizontal_clearance_valid(const Print &prin
|
|||
// instance.shift is a position of a centered object, while model object may not be centered.
|
||||
// Convert the shift from the PrintObject's coordinates into ModelObject's coordinates by removing the centering offset.
|
||||
convex_hull.translate(instance.shift - print_object->center_offset());
|
||||
#if ENABLE_SEQUENTIAL_LIMITS
|
||||
// if output needed, collect indices (inside convex_hulls_other) of intersecting hulls
|
||||
for (size_t i = 0; i < convex_hulls_other.size(); ++i) {
|
||||
if (!intersection((Polygons)convex_hulls_other[i], (Polygons)convex_hull).empty()) {
|
||||
|
@ -420,15 +413,10 @@ static inline bool sequential_print_horizontal_clearance_valid(const Print &prin
|
|||
}
|
||||
}
|
||||
}
|
||||
#else
|
||||
if (!intersection(convex_hulls_other, (Polygons)convex_hull).empty())
|
||||
return false;
|
||||
#endif // ENABLE_SEQUENTIAL_LIMITS
|
||||
convex_hulls_other.emplace_back(std::move(convex_hull));
|
||||
}
|
||||
}
|
||||
|
||||
#if ENABLE_SEQUENTIAL_LIMITS
|
||||
if (!intersecting_idxs.empty()) {
|
||||
// use collected indices (inside convex_hulls_other) to update output
|
||||
std::sort(intersecting_idxs.begin(), intersecting_idxs.end());
|
||||
|
@ -438,7 +426,6 @@ static inline bool sequential_print_horizontal_clearance_valid(const Print &prin
|
|||
}
|
||||
return false;
|
||||
}
|
||||
#endif // ENABLE_SEQUENTIAL_LIMITS
|
||||
return true;
|
||||
}
|
||||
|
||||
|
|
|
@ -583,9 +583,7 @@ public:
|
|||
const PrintRegion& get_print_region(size_t idx) const { return *m_print_regions[idx]; }
|
||||
const ToolOrdering& get_tool_ordering() const { return m_wipe_tower_data.tool_ordering; }
|
||||
|
||||
#if ENABLE_SEQUENTIAL_LIMITS
|
||||
static bool sequential_print_horizontal_clearance_valid(const Print& print, Polygons* polygons = nullptr);
|
||||
#endif // ENABLE_SEQUENTIAL_LIMITS
|
||||
|
||||
protected:
|
||||
// Invalidates the step, and its depending steps in Print.
|
||||
|
|
|
@ -317,6 +317,12 @@ void PrintConfigDef::init_common_params()
|
|||
def->mode = comAdvanced;
|
||||
def->set_default_value(new ConfigOptionStrings());
|
||||
|
||||
// temporary workaround for compatibility with older Slicer
|
||||
{
|
||||
def = this->add("preset_name", coString);
|
||||
def->set_default_value(new ConfigOptionString());
|
||||
}
|
||||
|
||||
def = this->add("printhost_authorization_type", coEnum);
|
||||
def->label = L("Authorization Type");
|
||||
// def->tooltip = L("");
|
||||
|
|
|
@ -66,8 +66,6 @@
|
|||
// Enable to push object instances under the bed
|
||||
#define ENABLE_ALLOW_NEGATIVE_Z (1 && ENABLE_2_4_0_ALPHA0)
|
||||
#define DISABLE_ALLOW_NEGATIVE_Z_FOR_SLA (1 && ENABLE_ALLOW_NEGATIVE_Z)
|
||||
// Enable visualization of objects clearance for sequential prints
|
||||
#define ENABLE_SEQUENTIAL_LIMITS (1 && ENABLE_2_4_0_ALPHA0)
|
||||
// Enable delayed rendering of transparent volumes
|
||||
#define ENABLE_DELAYED_TRANSPARENT_VOLUMES_RENDERING (1 && ENABLE_2_4_0_ALPHA0)
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue