mirror of
https://github.com/SoftFever/OrcaSlicer.git
synced 2025-12-05 16:51:07 -07:00
fix compile errors
This commit is contained in:
parent
f362b12e72
commit
5079b74dc3
5 changed files with 79 additions and 78 deletions
|
|
@ -12,25 +12,55 @@
|
||||||
|
|
||||||
namespace Slic3r {
|
namespace Slic3r {
|
||||||
|
|
||||||
|
|
||||||
|
/* IG For reference only. Defined in Extrusion Entity hpp. Do not uncomment:
|
||||||
|
|
||||||
|
// Each ExtrusionRole value identifies a distinct set of { extruder, speed }
|
||||||
|
enum ExtrusionRole : uint8_t {
|
||||||
|
erNone,
|
||||||
|
erPerimeter,
|
||||||
|
erExternalPerimeter,
|
||||||
|
erOverhangPerimeter,
|
||||||
|
erInternalInfill,
|
||||||
|
erSolidInfill,
|
||||||
|
erTopSolidInfill,
|
||||||
|
erBottomSurface,
|
||||||
|
erIroning,
|
||||||
|
erBridgeInfill,
|
||||||
|
erInternalBridgeInfill,
|
||||||
|
erGapFill,
|
||||||
|
erSkirt,
|
||||||
|
erBrim,
|
||||||
|
erSupportMaterial,
|
||||||
|
erSupportMaterialInterface,
|
||||||
|
erSupportTransition,
|
||||||
|
erWipeTower,
|
||||||
|
erCustom,
|
||||||
|
// Extrusion role for a collection with multiple extrusion roles.
|
||||||
|
erMixed,
|
||||||
|
erCount
|
||||||
|
};
|
||||||
|
|
||||||
|
*/
|
||||||
|
|
||||||
// Convert a rich bitmask based ExtrusionRole to a less expressive ordinal GCodeExtrusionRole.
|
// Convert a rich bitmask based ExtrusionRole to a less expressive ordinal GCodeExtrusionRole.
|
||||||
// GCodeExtrusionRole is to be serialized into G-code and deserialized by G-code viewer,
|
// GCodeExtrusionRole is to be serialized into G-code and deserialized by G-code viewer,
|
||||||
GCodeExtrusionRole extrusion_role_to_gcode_extrusion_role(ExtrusionRole role)
|
GCodeExtrusionRole extrusion_role_to_gcode_extrusion_role(ExtrusionRole role)
|
||||||
{
|
{
|
||||||
if (role == ExtrusionRole::None) return GCodeExtrusionRole::None;
|
if (role == erNone) return GCodeExtrusionRole::None;
|
||||||
if (role.is_perimeter()) {
|
if (role == erOverhangPerimeter) return GCodeExtrusionRole::OverhangPerimeter;
|
||||||
return role.is_bridge() ? GCodeExtrusionRole::OverhangPerimeter :
|
if (role == erExternalPerimeter) return GCodeExtrusionRole::ExternalPerimeter;
|
||||||
role.is_external() ? GCodeExtrusionRole::ExternalPerimeter : GCodeExtrusionRole::Perimeter;
|
if (role == erPerimeter) return GCodeExtrusionRole::Perimeter;
|
||||||
}
|
if (role == erInternalInfill) return GCodeExtrusionRole::InternalInfill;
|
||||||
if (role == ExtrusionRole::InternalInfill) return GCodeExtrusionRole::InternalInfill;
|
if (role == erSolidInfill) return GCodeExtrusionRole::SolidInfill;
|
||||||
if (role == ExtrusionRole::SolidInfill) return GCodeExtrusionRole::SolidInfill;
|
if (role == erTopSolidInfill) return GCodeExtrusionRole::TopSolidInfill;
|
||||||
if (role == ExtrusionRole::TopSolidInfill) return GCodeExtrusionRole::TopSolidInfill;
|
if (role == erIroning) return GCodeExtrusionRole::Ironing;
|
||||||
if (role == ExtrusionRole::Ironing) return GCodeExtrusionRole::Ironing;
|
if (role == erBridgeInfill) return GCodeExtrusionRole::BridgeInfill;
|
||||||
if (role == ExtrusionRole::BridgeInfill) return GCodeExtrusionRole::BridgeInfill;
|
if (role == erGapFill) return GCodeExtrusionRole::GapFill;
|
||||||
if (role == ExtrusionRole::GapFill) return GCodeExtrusionRole::GapFill;
|
if (role == erSkirt) return GCodeExtrusionRole::Skirt;
|
||||||
if (role == ExtrusionRole::Skirt) return GCodeExtrusionRole::Skirt;
|
if (role == erSupportMaterial) return GCodeExtrusionRole::SupportMaterial;
|
||||||
if (role == ExtrusionRole::SupportMaterial) return GCodeExtrusionRole::SupportMaterial;
|
if (role == erSupportMaterialInterface) return GCodeExtrusionRole::SupportMaterialInterface;
|
||||||
if (role == ExtrusionRole::SupportMaterialInterface) return GCodeExtrusionRole::SupportMaterialInterface;
|
if (role == erWipeTower) return GCodeExtrusionRole::WipeTower;
|
||||||
if (role == ExtrusionRole::WipeTower) return GCodeExtrusionRole::WipeTower;
|
|
||||||
assert(false);
|
assert(false);
|
||||||
return GCodeExtrusionRole::None;
|
return GCodeExtrusionRole::None;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -7,6 +7,7 @@
|
||||||
#define slic3r_ExtrusionRole_hpp_
|
#define slic3r_ExtrusionRole_hpp_
|
||||||
|
|
||||||
#include "enum_bitmask.hpp"
|
#include "enum_bitmask.hpp"
|
||||||
|
#include "ExtrusionEntity.hpp"
|
||||||
|
|
||||||
#include <string>
|
#include <string>
|
||||||
#include <string_view>
|
#include <string_view>
|
||||||
|
|
@ -44,64 +45,7 @@ static_assert(int(ExtrusionRoleModifier::Count) <= 16, "ExtrusionRoleModifier: t
|
||||||
using ExtrusionRoleModifiers = enum_bitmask<ExtrusionRoleModifier>;
|
using ExtrusionRoleModifiers = enum_bitmask<ExtrusionRoleModifier>;
|
||||||
ENABLE_ENUM_BITMASK_OPERATORS(ExtrusionRoleModifier);
|
ENABLE_ENUM_BITMASK_OPERATORS(ExtrusionRoleModifier);
|
||||||
|
|
||||||
struct ExtrusionRole : public ExtrusionRoleModifiers
|
|
||||||
{
|
|
||||||
constexpr ExtrusionRole(const ExtrusionRoleModifier bit) : ExtrusionRoleModifiers(bit) {}
|
|
||||||
constexpr ExtrusionRole(const ExtrusionRoleModifiers bits) : ExtrusionRoleModifiers(bits) {}
|
|
||||||
|
|
||||||
static constexpr const ExtrusionRoleModifiers None{};
|
|
||||||
// Internal perimeter, not bridging.
|
|
||||||
static constexpr const ExtrusionRoleModifiers Perimeter{ ExtrusionRoleModifier::Perimeter };
|
|
||||||
// External perimeter, not bridging.
|
|
||||||
static constexpr const ExtrusionRoleModifiers ExternalPerimeter{ ExtrusionRoleModifier::Perimeter | ExtrusionRoleModifier::External };
|
|
||||||
// Perimeter, bridging. To be or'ed with ExtrusionRoleModifier::External for external bridging perimeter.
|
|
||||||
static constexpr const ExtrusionRoleModifiers OverhangPerimeter{ ExtrusionRoleModifier::Perimeter | ExtrusionRoleModifier::Bridge };
|
|
||||||
// Sparse internal infill.
|
|
||||||
static constexpr const ExtrusionRoleModifiers InternalInfill{ ExtrusionRoleModifier::Infill };
|
|
||||||
// Solid internal infill.
|
|
||||||
static constexpr const ExtrusionRoleModifiers SolidInfill{ ExtrusionRoleModifier::Infill | ExtrusionRoleModifier::Solid };
|
|
||||||
// Top solid infill (visible).
|
|
||||||
//FIXME why there is no bottom solid infill type?
|
|
||||||
static constexpr const ExtrusionRoleModifiers TopSolidInfill{ ExtrusionRoleModifier::Infill | ExtrusionRoleModifier::Solid | ExtrusionRoleModifier::External };
|
|
||||||
// Ironing infill at the top surfaces.
|
|
||||||
static constexpr const ExtrusionRoleModifiers Ironing{ ExtrusionRoleModifier::Infill | ExtrusionRoleModifier::Solid | ExtrusionRoleModifier::Ironing | ExtrusionRoleModifier::External };
|
|
||||||
// Visible bridging infill at the bottom of an object.
|
|
||||||
static constexpr const ExtrusionRoleModifiers BridgeInfill{ ExtrusionRoleModifier::Infill | ExtrusionRoleModifier::Solid | ExtrusionRoleModifier::Bridge | ExtrusionRoleModifier::External };
|
|
||||||
// static constexpr const ExtrusionRoleModifiers InternalBridgeInfill{ ExtrusionRoleModifier::Infill | ExtrusionRoleModifier::Solid | ExtrusionRoleModifier::Bridge };
|
|
||||||
// Gap fill extrusion, currently used for any variable width extrusion: Thin walls outside of the outer extrusion,
|
|
||||||
// gap fill in between perimeters, gap fill between the inner perimeter and infill.
|
|
||||||
//FIXME revise GapFill and ThinWall types, split Gap Fill to Gap Fill and ThinWall.
|
|
||||||
static constexpr const ExtrusionRoleModifiers GapFill{ ExtrusionRoleModifier::Thin }; // | ExtrusionRoleModifier::External };
|
|
||||||
// static constexpr const ExtrusionRoleModifiers ThinWall{ ExtrusionRoleModifier::Thin };
|
|
||||||
static constexpr const ExtrusionRoleModifiers Skirt{ ExtrusionRoleModifier::Skirt };
|
|
||||||
// Support base material, printed with non-soluble plastic.
|
|
||||||
static constexpr const ExtrusionRoleModifiers SupportMaterial{ ExtrusionRoleModifier::Support };
|
|
||||||
// Support interface material, printed with soluble plastic.
|
|
||||||
static constexpr const ExtrusionRoleModifiers SupportMaterialInterface{ ExtrusionRoleModifier::Support | ExtrusionRoleModifier::External };
|
|
||||||
// Wipe tower material.
|
|
||||||
static constexpr const ExtrusionRoleModifiers WipeTower{ ExtrusionRoleModifier::Wipe };
|
|
||||||
// Extrusion role for a collection with multiple extrusion roles.
|
|
||||||
static constexpr const ExtrusionRoleModifiers Mixed{ ExtrusionRoleModifier::Mixed };
|
|
||||||
|
|
||||||
bool is_perimeter() const { return this->ExtrusionRoleModifiers::has(ExtrusionRoleModifier::Perimeter); }
|
|
||||||
bool is_external_perimeter() const { return this->is_perimeter() && this->is_external(); }
|
|
||||||
bool is_infill() const { return this->ExtrusionRoleModifiers::has(ExtrusionRoleModifier::Infill); }
|
|
||||||
bool is_solid_infill() const { return this->is_infill() && this->ExtrusionRoleModifiers::has(ExtrusionRoleModifier::Solid); }
|
|
||||||
bool is_external() const { return this->ExtrusionRoleModifiers::has(ExtrusionRoleModifier::External); }
|
|
||||||
bool is_bridge() const { return this->ExtrusionRoleModifiers::has(ExtrusionRoleModifier::Bridge); }
|
|
||||||
|
|
||||||
bool is_support() const { return this->ExtrusionRoleModifiers::has(ExtrusionRoleModifier::Support); }
|
|
||||||
bool is_support_base() const { return this->is_support() && ! this->is_external(); }
|
|
||||||
bool is_support_interface() const { return this->is_support() && this->is_external(); }
|
|
||||||
bool is_mixed() const { return this->ExtrusionRoleModifiers::has(ExtrusionRoleModifier::Mixed); }
|
|
||||||
};
|
|
||||||
|
|
||||||
// Special flags describing loop
|
|
||||||
enum ExtrusionLoopRole {
|
|
||||||
elrDefault,
|
|
||||||
elrContourInternalPerimeter,
|
|
||||||
elrSkirt,
|
|
||||||
};
|
|
||||||
|
|
||||||
// Be careful when editing this list as many parts of the code depend
|
// Be careful when editing this list as many parts of the code depend
|
||||||
// on the values of these ordinars, for example
|
// on the values of these ordinars, for example
|
||||||
|
|
|
||||||
|
|
@ -138,6 +138,20 @@ public:
|
||||||
static const std::vector<std::string>& get() { return Colors; }
|
static const std::vector<std::string>& get() { return Colors; }
|
||||||
};
|
};
|
||||||
|
|
||||||
|
struct LayerResult {
|
||||||
|
std::string gcode;
|
||||||
|
size_t layer_id;
|
||||||
|
// Is spiral vase post processing enabled for this layer?
|
||||||
|
bool spiral_vase_enable { false };
|
||||||
|
// Should the cooling buffer content be flushed at the end of this layer?
|
||||||
|
bool cooling_buffer_flush { false };
|
||||||
|
// Is indicating if this LayerResult should be processed, or it is just inserted artificial LayerResult.
|
||||||
|
// It is used for the pressure equalizer because it needs to buffer one layer back.
|
||||||
|
bool nop_layer_result { false };
|
||||||
|
|
||||||
|
static LayerResult make_nop_layer_result() { return {"", std::numeric_limits<coord_t>::max(), false, false, true}; }
|
||||||
|
};
|
||||||
|
|
||||||
class GCode {
|
class GCode {
|
||||||
public:
|
public:
|
||||||
GCode() :
|
GCode() :
|
||||||
|
|
|
||||||
|
|
@ -56,8 +56,10 @@ PressureEqualizer::PressureEqualizer(const Slic3r::GCodeConfig &config) : m_use_
|
||||||
// Volumetric rate of a 0.45mm x 0.2mm extrusion at 60mm/s XY movement: 0.45*0.2*60*60=5.4*60 = 324 mm^3/min
|
// Volumetric rate of a 0.45mm x 0.2mm extrusion at 60mm/s XY movement: 0.45*0.2*60*60=5.4*60 = 324 mm^3/min
|
||||||
// Volumetric rate of a 0.45mm x 0.2mm extrusion at 20mm/s XY movement: 0.45*0.2*20*60=1.8*60 = 108 mm^3/min
|
// Volumetric rate of a 0.45mm x 0.2mm extrusion at 20mm/s XY movement: 0.45*0.2*20*60=1.8*60 = 108 mm^3/min
|
||||||
// Slope of the volumetric rate, changing from 20mm/s to 60mm/s over 2 seconds: (5.4-1.8)*60*60/2=60*60*1.8 = 6480 mm^3/min^2 = 1.8 mm^3/s^2
|
// Slope of the volumetric rate, changing from 20mm/s to 60mm/s over 2 seconds: (5.4-1.8)*60*60/2=60*60*1.8 = 6480 mm^3/min^2 = 1.8 mm^3/s^2
|
||||||
m_max_volumetric_extrusion_rate_slope_positive = float(config.max_volumetric_extrusion_rate_slope_positive.value) * 60.f * 60.f;
|
|
||||||
m_max_volumetric_extrusion_rate_slope_negative = float(config.max_volumetric_extrusion_rate_slope_negative.value) * 60.f * 60.f;
|
//---IG
|
||||||
|
m_max_volumetric_extrusion_rate_slope_positive = 0.1;//float(config.max_volumetric_extrusion_rate_slope_positive.value) * 60.f * 60.f;
|
||||||
|
m_max_volumetric_extrusion_rate_slope_negative = 0.1;//float(config.max_volumetric_extrusion_rate_slope_negative.value) * 60.f * 60.f;
|
||||||
|
|
||||||
for (ExtrusionRateSlope &extrusion_rate_slope : m_max_volumetric_extrusion_rate_slopes) {
|
for (ExtrusionRateSlope &extrusion_rate_slope : m_max_volumetric_extrusion_rate_slopes) {
|
||||||
extrusion_rate_slope.negative = m_max_volumetric_extrusion_rate_slope_negative;
|
extrusion_rate_slope.negative = m_max_volumetric_extrusion_rate_slope_negative;
|
||||||
|
|
|
||||||
|
|
@ -31,14 +31,25 @@ public:
|
||||||
constexpr enum_bitmask(option_type o) : m_bits(mask_value(o)) {}
|
constexpr enum_bitmask(option_type o) : m_bits(mask_value(o)) {}
|
||||||
|
|
||||||
// Set the bit corresponding to the given option.
|
// Set the bit corresponding to the given option.
|
||||||
constexpr enum_bitmask operator|(option_type t) { return enum_bitmask(m_bits | mask_value(t)); }
|
constexpr enum_bitmask operator|(option_type t) const { return enum_bitmask(m_bits | mask_value(t)); }
|
||||||
|
|
||||||
// Combine with another enum_bitmask of the same type.
|
// Combine with another enum_bitmask of the same type.
|
||||||
constexpr enum_bitmask operator|(enum_bitmask<option_type> t) { return enum_bitmask(m_bits | t.m_bits); }
|
constexpr enum_bitmask operator|(enum_bitmask<option_type> t) const { return enum_bitmask(m_bits | t.m_bits); }
|
||||||
|
|
||||||
|
// Set the bit corresponding to the given option.
|
||||||
|
constexpr void operator|=(option_type t) { m_bits = enum_bitmask(m_bits | mask_value(t)); }
|
||||||
|
|
||||||
|
// Combine with another enum_bitmask of the same type.
|
||||||
|
constexpr void operator|=(enum_bitmask<option_type> t) { m_bits = enum_bitmask(m_bits | t.m_bits); }
|
||||||
|
|
||||||
// Get the value of the bit corresponding to the given option.
|
// Get the value of the bit corresponding to the given option.
|
||||||
constexpr bool operator&(option_type t) { return m_bits & mask_value(t); }
|
constexpr bool operator&(option_type t) const { return m_bits & mask_value(t); }
|
||||||
constexpr bool has(option_type t) { return m_bits & mask_value(t); }
|
constexpr bool has(option_type t) const { return m_bits & mask_value(t); }
|
||||||
|
|
||||||
|
constexpr bool operator==(const enum_bitmask r) const { return m_bits == r.m_bits; }
|
||||||
|
constexpr bool operator!=(const enum_bitmask r) const { return m_bits != r.m_bits; }
|
||||||
|
// For sorting by the enum values.
|
||||||
|
constexpr bool lower(const enum_bitmask r) const { return m_bits < r.m_bits; }
|
||||||
|
|
||||||
private:
|
private:
|
||||||
underlying_type m_bits = 0;
|
underlying_type m_bits = 0;
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue