Skip to content

Commit

Permalink
try fix build
Browse files Browse the repository at this point in the history
  • Loading branch information
supermerill committed Mar 22, 2024
2 parents fb26f35 + fe198c2 commit d59bfb9
Show file tree
Hide file tree
Showing 65 changed files with 1,625 additions and 606 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/ccpp_mac_arm.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ on:
jobs:
build:

runs-on: macos-11
runs-on: macos-14

steps:
- uses: actions/checkout@v3
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/ccpp_mac_arm_debug.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ on:
jobs:
build:

runs-on: macos-11
runs-on: macos-14

steps:
- uses: actions/checkout@v2
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/ccpp_mac_arm_rc.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ on:
jobs:
build:

runs-on: macos-11
runs-on: macos-14

steps:
- uses: actions/checkout@v2
Expand Down
1 change: 1 addition & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -206,6 +206,7 @@ if(WIN32)
endif()

if (APPLE)
add_compile_options(-D_LIBCPP_ENABLE_CXX17_REMOVED_UNARY_BINARY_FUNCTION)
message("OS X SDK Path: ${CMAKE_OSX_SYSROOT}")
if (CMAKE_OSX_DEPLOYMENT_TARGET)
message("OS X Deployment Target: ${CMAKE_OSX_DEPLOYMENT_TARGET}")
Expand Down
2 changes: 1 addition & 1 deletion deps/TIFF/TIFF.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ if (APPLE)
if (${CMAKE_OSX_ARCHITECTURES} MATCHES "arm")
prusaslicer_add_cmake_project(TIFF
URL https://gitlab.com/libtiff/libtiff/-/archive/v4.3.0/libtiff-v4.3.0.zip
URL_HASH SHA256=a1db6826ea1b8b08eaf168973abb29b8a143fb744c1b24cc6967cb12f5e6e81f
URL_HASH SHA256=4fca1b582c88319f3ad6ecd5b46320eadaf5eb4ef6f6c32d44caaae4a03d0726
DEPENDS ${ZLIB_PKG} ${PNG_PKG} dep_JPEG
CMAKE_ARGS
-Dlzma:BOOL=OFF
Expand Down
2 changes: 1 addition & 1 deletion resources/profiles
Submodule profiles updated 2 files
+0 −1 Basic.ini
+1 −1 Voron.ini
97 changes: 97 additions & 0 deletions resources/ui_layout/default/freq_fff.as
Original file line number Diff line number Diff line change
@@ -0,0 +1,97 @@
// quick settings brim

float last_brim_val = 5;

int s_brim_get()
{
float bw = get_float("brim_width");
if (bw > 0) {
last_brim_val = bw;
return 1;
}
return 0;
}

void s_brim_set(bool new_val)
{
if(new_val) {
float bw = get_float("brim_width");
set_float("brim_width", last_brim_val);
} else {
set_float("brim_width", 0);
}
}

// quick settings support

int s_support_fff_get(string &out get_val)
{
bool support_material = get_bool("support_material");
if (!support_material) { // None
return 0;
}
bool support_material_auto = get_bool("support_material_auto");
if (!support_material_auto) { // For support enforcers only
return 2;
}
bool support_material_buildplate_only = get_bool("support_material_buildplate_only");
if (support_material_buildplate_only) { // Support on build plate only
return 1;
}
// everywhere
return 3;
}

void s_support_fff_set(string &in new_val, int idx)
{
if(idx == 0) { // None
back_initial_value("support_material_buildplate_only");
back_initial_value("support_material_auto");
set_bool("support_material", false);
} else if(idx == 1) { // Support on build plate only
set_bool("support_material_buildplate_only", true);
set_bool("support_material_auto", true);
set_bool("support_material", true);
} else if(idx == 2) { // For support enforcers only
set_bool("support_material_buildplate_only", false);
set_bool("support_material_auto", false);
set_bool("support_material", true);
} else if(idx == 3) { // everywhere
set_bool("support_material_buildplate_only", false);
set_bool("support_material_auto", true);
set_bool("support_material", true);
}
}


// quick settings bed type (nematx)

int s_bed_fff_get(string &out get_val)
{
int bed_temperature = get_int("bed_temperature");
int fl_bed_temperature = get_int("first_layer_bed_temperature");
if (bed_temperature == fl_bed_temperature) {
if (bed_temperature == 130) {
return 1; //glue
}
if (bed_temperature == 170) {
return 2; //noglue
}
}
return 0; // custom
}

void s_bed_fff_set(string &in new_val, int idx)
{
if(idx == 0) { // custom
back_initial_value("bed_temperature");
back_initial_value("first_layer_bed_temperature");
} else if(idx == 1) { // glue
set_int("bed_temperature", 130);
set_int("first_layer_bed_temperature", 130);
} else if(idx == 2) { // noglue
set_int("bed_temperature", 170);
set_int("first_layer_bed_temperature", 170);
}
}

File renamed without changes.
2 changes: 2 additions & 0 deletions resources/ui_layout/default/print.ui
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,7 @@ group:label_width$12:Overhangs
line:Extrusion direction
setting:sidetext_width$2:overhangs_reverse
setting:label_width$12:width$5:overhangs_reverse_threshold
setting:label$All perimeters:sidetext_width$2:perimeter_reverse
end_line
group:sidetext_width$5:Advanced
setting:width$25:no_perimeter_unsupported_algo
Expand Down Expand Up @@ -169,6 +170,7 @@ group:title_width$0:Infill
setting:tags$Advanced$Expert$Prusa:label_left:label_width$6:label$Sparse:width$8:sidetext_width$1:fill_density
setting:tags$Advanced$Expert$Prusa:label_width$0:label$_:fill_pattern
setting:label$_:width$18:infill_connection
setting:label$Aligned:fill_aligned_z
end_line
line:_
setting:label$Connection length:label_width$25:sidetext_width$7:width$12:infill_anchor_max
Expand Down
6 changes: 6 additions & 0 deletions resources/ui_layout/example/freq_fff.ui
Original file line number Diff line number Diff line change
Expand Up @@ -13,3 +13,9 @@ group:freq_settings_event:no_title:no_search:
setting:simple:script:bool:depends$brim_width:label$Brim:tooltip$Set the brim. Will be set to 5mm if nothing was previously set.:s_brim
freq_purging_volumes
end_line
line:
setting:simple:script:enum$hot$Hot$mild$Mild$cold$Cold:depends$bed_temperature$first_layer_bed_temperature:label$Bed temp:tooltip$Choose the bed you want.:full_width:s_bed_temp_fff
end_line
line:
setting:simple:script:enum$normal$Default$45$45°$custom$Custom:depends$init_z_rotate:label$Import angle:tooltip$The angle at which the parts are imported:full_width:s_orientation_fff
end_line
52 changes: 52 additions & 0 deletions resources/ui_layout/example/print.as
Original file line number Diff line number Diff line change
Expand Up @@ -412,3 +412,55 @@ void s_noperi_set(string &out set_val, int idx)
if (idx == 0) set_int("no_perimeter_unsupported_algo",0);
else set_string("no_perimeter_unsupported_algo", "filled");
}

// quick settings bed temp
int s_bed_temp_fff_get(string &out get_val)
{
int bed_temperature = get_int("bed_temperature");
int fl_bed_temperature = get_int("first_layer_bed_temperature");
if (bed_temperature >= 70 && fl_bed_temperature >= 70) {
return 0; //hot
}
if (bed_temperature >= 45 && fl_bed_temperature >= 45) {
return 1; //mild
}
return 2; // cold
}
void s_bed_temp_fff_set(string &in new_val, int idx)
{
if(idx == 0) { // hot
set_int("bed_temperature", 70);
set_int("first_layer_bed_temperature", 75);
} else if(idx == 1) { // mild
set_int("bed_temperature", 45);
set_int("first_layer_bed_temperature", 50);
} else if(idx == 2) { // cold
set_int("bed_temperature", 0);
set_int("first_layer_bed_temperature", 0);
}
}


// quick settings orientation
int s_orientation_fff_get(string &out get_val)
{
float orientation = get_float("init_z_rotate");
if (orientation == 0) {
return 0; // normal
}
if (orientation == 45) {
return 1; // 45°
}
return 3; // custom
}
void s_orientation_fff_set(string &in new_val, int idx)
{
if(idx == 0) { // normal
set_float("init_z_rotate", 0);
} else if(idx == 1) { // 45°
set_float("init_z_rotate", 45);
} else if(idx == 2) { // reset
back_initial_value("init_z_rotate");
}
}

3 changes: 3 additions & 0 deletions src/libslic3r/AppConfig.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -302,6 +302,9 @@ void AppConfig::set_defaults()
if (get("font_size").empty())
set("font_size", "0");

if (get("gcodeviewer_decimals").empty())
set("gcodeviewer_decimals", "2");

//get default color from the ini file

//try to load colors from ui file
Expand Down
7 changes: 7 additions & 0 deletions src/libslic3r/Arachne/utils/ExtrusionLine.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -224,6 +224,13 @@ static inline Slic3r::ThickPolyline to_thick_polyline(const ClipperLib_Z::Path &
out.points_width.emplace_back(it->z());
}
}
// Don't create 1-element polyline.
if(out.points.size() <2)
return {};

assert(out.points.back().coincides_with_epsilon(Point{ path.back().x(), path.back().y() }));
out.points.back() = Point{ path.back().x(), path.back().y() };

assert(out.points.front().x() == path.front().x());
assert(out.points.front().y() == path.front().y());
assert(out.points.back().x() == path.back().x());
Expand Down
10 changes: 9 additions & 1 deletion src/libslic3r/Config.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -2245,8 +2245,9 @@ class ConfigBase : public ConfigOptionResolver
// but it carries the defaults of the configuration values.

ConfigBase() = default;
#ifndef _DEBUG
~ConfigBase() override = default;

#endif
// to get to the config more generic than this one, if available
const ConfigBase* parent = nullptr;

Expand Down Expand Up @@ -2382,6 +2383,13 @@ class ConfigBase : public ConfigOptionResolver
static std::map<t_config_option_key, std::string> load_gcode_string_legacy(const char* str);
static size_t load_from_gcode_string_legacy(ConfigBase& config, const char* str, ConfigSubstitutionContext& substitutions);

#ifdef _DEBUG
//little dirty test to be sure it exists (not needed, but it's good for testing)
int32_t m_exists = 0x55555555;
bool exists() { return m_exists == 0x55555555; }
~ConfigBase() override { m_exists = 0; }
#endif

private:
// Set a configuration value from a string.
bool set_deserialize_raw(const t_config_option_key& opt_key_src, const std::string& value, ConfigSubstitutionContext& substitutions, bool append);
Expand Down
29 changes: 23 additions & 6 deletions src/libslic3r/ExtrusionEntity.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -462,12 +462,24 @@ class ExtrusionLoop : public ExtrusionEntity
ExtrusionPaths paths;

ExtrusionLoop(ExtrusionLoopRole role = elrDefault) : m_loop_role(role) , ExtrusionEntity(false) {}
ExtrusionLoop(const ExtrusionPaths &paths, ExtrusionLoopRole role = elrDefault) : paths(paths), m_loop_role(role), ExtrusionEntity(false) { assert(this->first_point().coincides_with_epsilon(this->paths.back().polyline.back())); }
ExtrusionLoop(ExtrusionPaths &&paths, ExtrusionLoopRole role = elrDefault) : paths(std::move(paths)), m_loop_role(role), ExtrusionEntity(false) { assert(this->first_point().coincides_with_epsilon(this->paths.back().polyline.back())); }
ExtrusionLoop(const ExtrusionPath &path, ExtrusionLoopRole role = elrDefault) : m_loop_role(role), ExtrusionEntity(false)
{ this->paths.push_back(path); }
ExtrusionLoop(ExtrusionPath &&path, ExtrusionLoopRole role = elrDefault) : m_loop_role(role), ExtrusionEntity(false)
{ this->paths.emplace_back(std::move(path)); }
ExtrusionLoop(const ExtrusionPaths &paths, ExtrusionLoopRole role = elrDefault) : paths(paths), m_loop_role(role), ExtrusionEntity(false) {
assert(!this->paths.empty());
assert(this->first_point().coincides_with_epsilon(this->paths.back().polyline.back()));
}
ExtrusionLoop(ExtrusionPaths &&paths, ExtrusionLoopRole role = elrDefault) : paths(std::move(paths)), m_loop_role(role), ExtrusionEntity(false) {
assert(!this->paths.empty());
assert(this->first_point().coincides_with_epsilon(this->paths.back().polyline.back()));
}
ExtrusionLoop(const ExtrusionPath &path, ExtrusionLoopRole role = elrDefault) : m_loop_role(role), ExtrusionEntity(false) {
this->paths.push_back(path);
assert(!this->paths.empty());
assert(this->first_point().coincides_with_epsilon(this->paths.back().polyline.back()));
}
ExtrusionLoop(ExtrusionPath &&path, ExtrusionLoopRole role = elrDefault) : m_loop_role(role), ExtrusionEntity(false) {
this->paths.emplace_back(std::move(path));
assert(!this->paths.empty());
assert(this->first_point().coincides_with_epsilon(this->paths.back().polyline.back()));
}
virtual bool is_loop() const override{ return true; }
virtual ExtrusionEntity* clone() const override{ return new ExtrusionLoop (*this); }
// Create a new object, initialize it with this object using the move semantics.
Expand Down Expand Up @@ -617,6 +629,11 @@ struct HasInfillVisitor : public HasRoleVisitor{
struct HasSolidInfillVisitor : public HasRoleVisitor{
void default_use(const ExtrusionEntity &entity) override { found = is_solid_infill(entity.role()); };
};
struct HasThisRoleVisitor : public HasRoleVisitor{
ExtrusionRole role_to_find;
HasThisRoleVisitor(ExtrusionRole role) : role_to_find(role) {}
void default_use(const ExtrusionEntity &entity) override { found = entity.role() == role_to_find; };
};


//call simplify for all paths.
Expand Down
25 changes: 20 additions & 5 deletions src/libslic3r/Fill/Fill.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,6 @@ struct SurfaceFillParams : FillParams

RETURN_COMPARE_NON_EQUAL(anchor_length);
RETURN_COMPARE_NON_EQUAL(fill_exactly);
RETURN_COMPARE_NON_EQUAL(flow.width());
RETURN_COMPARE_NON_EQUAL(flow.height());
RETURN_COMPARE_NON_EQUAL(flow.nozzle_diameter());
RETURN_COMPARE_NON_EQUAL_TYPED(unsigned, flow.bridge());
Expand All @@ -80,7 +79,10 @@ struct SurfaceFillParams : FillParams
RETURN_COMPARE_NON_EQUAL(config->bridge_speed_internal);
RETURN_COMPARE_NON_EQUAL(config->gap_fill_speed);
RETURN_COMPARE_NON_EQUAL(config->print_extrusion_multiplier);
RETURN_COMPARE_NON_EQUAL(max_sparse_infill_spacing);
}
if (config == nullptr || rhs.config == nullptr || max_sparse_infill_spacing == 0)
RETURN_COMPARE_NON_EQUAL(flow.width());
assert(*this == rhs);
return false;
}
Expand Down Expand Up @@ -116,6 +118,7 @@ struct SurfaceFillParams : FillParams
this->fill_exactly == rhs.fill_exactly &&
this->flow == rhs.flow &&
this->role == rhs.role &&
this->max_sparse_infill_spacing == rhs.max_sparse_infill_spacing &&
this->priority == rhs.priority;
}
};
Expand Down Expand Up @@ -282,17 +285,18 @@ std::vector<SurfaceFill> group_fills(const Layer &layer)
//FIXME FLOW decide what to use
// Internal infill. Calculating infill line spacing independent of the current layer height and 1st layer status,
// so that internall infill will be aligned over all layers of the current region.
//params.spacing = layerm.region().flow(*layer.object(), frInfill, layer.object()->config().layer_height, false).spacing();
//params.spacing = layerm.region().flow(*layer.object(), frInfill, layer.heigh, false).spacing();
// it's internal infill, so we can calculate a generic flow spacing
// for all layers, for avoiding the ugly effect of
// misaligned infill on first layer because of different extrusion width and
// layer height
params.spacing = layerm.region().flow(
Flow infill_flow = layerm.region().flow(
*layer.object(),
frInfill,
layer.object()->config().layer_height.value, // TODO: handle infill_every_layers?
layer.height, // TODO: handle infill_every_layers?
layer.id()
).spacing();
);
params.spacing = infill_flow.spacing();

// Anchor a sparse infill to inner perimeters with the following anchor length:
params.anchor_length = float(region_config.infill_anchor);
Expand All @@ -302,6 +306,16 @@ std::vector<SurfaceFill> group_fills(const Layer &layer)
if (region_config.infill_anchor_max.percent)
params.anchor_length_max = float(params.anchor_length_max * 0.01 * params.spacing);
params.anchor_length = std::min(params.anchor_length, params.anchor_length_max);

//sparse infill, compute the max width if needed
if (region_config.fill_aligned_z) {
//don't use fill_aligned_z if the pattern can't use it.
if (params.pattern != ipHilbertCurve && params.pattern != ipArchimedeanChords &&
params.pattern != ipOctagramSpiral && params.pattern != ipScatteredRectilinear &&
params.pattern != ipLightning) {
params.max_sparse_infill_spacing = unscaled(layer.object()->get_sparse_max_spacing());
}
}
}

auto it_params = set_surface_params.find(params);
Expand Down Expand Up @@ -805,6 +819,7 @@ void Layer::make_ironing()
};

std::vector<IroningParams> by_extruder;
// not using layer.height?
double default_layer_height = this->object()->config().layer_height;

for (LayerRegion *layerm : m_regions)
Expand Down
Loading

0 comments on commit d59bfb9

Please sign in to comment.