Skip to content

Commit

Permalink
Fixes: !! hole xy compensation in wrong direction for holes & inner !!
Browse files Browse the repository at this point in the history
also fixes to orca import & fan mover
update to it translation
  • Loading branch information
supermerill committed Jan 29, 2024
2 parents c62503c + f1a91d9 commit d24b494
Show file tree
Hide file tree
Showing 99 changed files with 39,040 additions and 1,025 deletions.
657 changes: 597 additions & 60 deletions resources/localization/it/Slic3r.po

Large diffs are not rendered by default.

580 changes: 4 additions & 576 deletions resources/localization/it/TODO.po

Large diffs are not rendered by default.

1,008 changes: 876 additions & 132 deletions resources/localization/it/it_database.po

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion resources/profiles
Submodule profiles updated 2 files
+2 −0 Basic.idx
+11 −14 Basic.ini
19 changes: 16 additions & 3 deletions src/libslic3r/AppConfig.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -360,9 +360,9 @@ void AppConfig::set_defaults()
if (get("check_blacklisted_library").empty())
set("check_blacklisted_library", "1");
#endif // _WIN32

if (get("compress_png_texture").empty())
set("compress_png_texture", "1");
//disable by default if amd graphic card detected, but can't know before the opengl is launched
//if (get("compress_png_texture").empty())
//set("compress_png_texture", (m_hardware&hGpuAmd) == hGpuAmd ? "0" : "1");

// remove old 'use_legacy_opengl' parameter from this config, if present
if (!get("use_legacy_opengl").empty())
Expand Down Expand Up @@ -458,7 +458,11 @@ void AppConfig::set_defaults()
set("use_rich_tooltip", "0");

if (get("hide_slice_tooltip").empty())
#ifdef _WIN32
set("hide_slice_tooltip", "1");
#else
set("hide_slice_tooltip", "0");
#endif // _WIN32

if (get("show_layer_height_doubleslider").empty())
set("show_layer_height_doubleslider", "1");
Expand Down Expand Up @@ -614,6 +618,15 @@ void AppConfig::set_defaults()
erase("", "object_settings_size");
}

void AppConfig::set_hardware_type(HardwareType hard) {
this->m_hardware = hard;
// Set default that depends on hardware type

//disable by default if amd graphic card detected, but can't know before the opengl is launched
if (get("compress_png_texture").empty() && (m_hardware&hHasGpu) != 0)
set("compress_png_texture", (m_hardware&hGpuAmd) == hGpuAmd ? "0" : "1");
}

void AppConfig::init_ui_layout() {
boost::filesystem::path resources_dir_path = boost::filesystem::path(resources_dir()) / "ui_layout";
if (!boost::filesystem::is_directory(resources_dir_path)) {
Expand Down
27 changes: 26 additions & 1 deletion src/libslic3r/AppConfig.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,25 @@ class AppConfig
Highlight,
};

enum HardwareType : uint8_t
{
//first 4 bits for cpu
hHasCpu = uint8_t(0x0F),
hCpuIntel = 1,
hCpuAmd = 2,
hCpuApple = 3,
hCpuArmGeneric = 4,
hCpuOther = 5,
//last 4 bits for gpu
hHasGpu = uint8_t(0xF0),
hGpuIntel = 1 << 4,
hGpuAmd = 2 << 4,
hGpuApple = 3 << 4,
hGpuArmGeneric = 4 << 4,
hGpuOther = 5 << 4,
hGpuNvidia = 6 << 4,
};

struct ConfigFileInfo {
bool correct_checksum{ false };
bool contains_null{ false };
Expand Down Expand Up @@ -190,12 +209,16 @@ class AppConfig
LayoutEntry get_ui_layout();
std::vector<LayoutEntry> get_ui_layouts() { return m_ui_layout; }

//tags
// Tags
std::vector<Tag> tags() { return m_tags; }

// splashscreen
std::string splashscreen(bool is_editor);

// Hardware
HardwareType hardware() { return m_hardware; }
void set_hardware_type(HardwareType hard);

// Returns true if the user's data directory comes from before Slic3r 1.40.0 (no updating)
bool legacy_datadir() const { return m_legacy_datadir; }
void set_legacy_datadir(bool value) { m_legacy_datadir = value; }
Expand Down Expand Up @@ -281,6 +304,8 @@ class AppConfig
std::vector<Tag> m_tags;
//splashscreen
std::pair<std::string,std::string> m_default_splashscreen;
// hardware type
HardwareType m_hardware;
};

} // namespace Slic3r
Expand Down
4 changes: 4 additions & 0 deletions src/libslic3r/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,10 @@ add_library(libslic3r STATIC
Format/3mf.hpp
Format/AMF.cpp
Format/AMF.hpp
Format/BBConfig.cpp
Format/BBConfig.hpp
Format/bbs_3mf.hpp
Format/bbs_3mf.cpp
Format/OBJ.cpp
Format/OBJ.hpp
Format/objparser.cpp
Expand Down
18 changes: 9 additions & 9 deletions src/libslic3r/Config.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -54,15 +54,15 @@ std::string toString(OptionCategory opt) {
case OptionCategory::filoverride: return L("Filament overrides");
case OptionCategory::customgcode: return L("Custom G-code");
case OptionCategory::general: return L("General");
case OptionCategory::limits: return "Machine limits"; // if not used, no need ot ask for translation
case OptionCategory::mmsetup: return "Single Extruder MM Setup";
case OptionCategory::firmware: return "Firmware";
case OptionCategory::pad: return "Pad";
case OptionCategory::padSupp: return "Pad and Support";
case OptionCategory::limits: return L("Machine limits"); // if not used, no need ot ask for translation
case OptionCategory::mmsetup: return L("Single Extruder MM Setup");
case OptionCategory::firmware: return L("Firmware");
case OptionCategory::pad: return L("Pad");
case OptionCategory::padSupp: return L("Pad and Support");
case OptionCategory::wipe: return L("Wipe Options");
case OptionCategory::milling: return L("Milling");
case OptionCategory::hollowing: return "Hollowing";
case OptionCategory::milling_extruders: return "Milling tools";
case OptionCategory::milling_extruders: return L("Milling tools");
case OptionCategory::fuzzy_skin : return L("Fuzzy skin");
}
return "error";
Expand Down Expand Up @@ -114,7 +114,7 @@ std::string escape_strings_cstyle(const std::vector<std::string> &strs)
bool should_quote = strs.size() == 1 && str.empty();
for (size_t i = 0; i < str.size(); ++ i) {
char c = str[i];
if (c == ' ' || c == ';' || c == '\t' || c == '\\' || c == '"' || c == '\r' || c == '\n') {
if (c == ' ' || c == ';' || c == ',' || c == '\t' || c == '\\' || c == '"' || c == '\r' || c == '\n') {
should_quote = true;
break;
}
Expand Down Expand Up @@ -212,7 +212,7 @@ bool unescape_strings_cstyle(const std::string &str, std::vector<std::string> &o
} else {
for (; i < str.size(); ++ i) {
c = str[i];
if (c == ';')
if (c == ';' || c == ',')
break;
buf.push_back(c);
}
Expand All @@ -229,7 +229,7 @@ bool unescape_strings_cstyle(const std::string &str, std::vector<std::string> &o
return true;
c = str[i];
}
if (c != ';')
if (c != ';' && c != ',')
return false;
if (++ i == str.size()) {
// Emit one additional empty string.
Expand Down
4 changes: 2 additions & 2 deletions src/libslic3r/ExtrusionEntityCollection.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -152,8 +152,8 @@ class ExtrusionEntityCollection : public ExtrusionEntity
throw Slic3r::RuntimeError("Calling length() on a ExtrusionEntityCollection");
return 0.;
}
virtual void visit(ExtrusionVisitor &visitor) { visitor.use(*this); };
virtual void visit(ExtrusionVisitorConst &visitor) const { visitor.use(*this); };
virtual void visit(ExtrusionVisitor &visitor) override { visitor.use(*this); };
virtual void visit(ExtrusionVisitorConst &visitor) const override{ visitor.use(*this); };
};

//// visitors /////
Expand Down
8 changes: 5 additions & 3 deletions src/libslic3r/Fill/Fill.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -692,13 +692,15 @@ void Layer::make_fills(FillAdaptive::Octree* adaptive_fill_octree, FillAdaptive:
fills_by_priority[(size_t)surface_fill.params.priority]->entities()[idx]->visit(compute_volume);
fills_by_priority[(size_t)surface_fill.params.priority]->entities()[idx]->visit(compute_volume_no_gap_fill);
}
ExPolygons temp = intersection_ex(ExPolygons{surface_fill.surface.expolygon}, f->no_overlap_expolygons);
ExPolygons temp = f->no_overlap_expolygons.empty() ?
ExPolygons{surface_fill.surface.expolygon} :
intersection_ex(ExPolygons{surface_fill.surface.expolygon}, f->no_overlap_expolygons);
double real_surface = 0;
for(auto &t : temp) real_surface += t.area();
assert(compute_volume.volume < unscaled(unscaled(surface_fill.surface.area())) * surface_fill.params.layer_height + EPSILON);
double area = unscaled(unscaled(real_surface));
assert(compute_volume.volume < area * surface_fill.params.layer_height * 1.001);
assert(compute_volume.volume > area * surface_fill.params.layer_height * 0.999 || area < std::max(1.,surface_fill.params.config->solid_infill_below_area.value));
assert(compute_volume.volume <= area * surface_fill.params.layer_height * 1.001 || f->debug_verify_flow_mult <= 0.8);
assert(compute_volume.volume >= area * surface_fill.params.layer_height * 0.999 || f->debug_verify_flow_mult >= 1.3 || area < std::max(1.,surface_fill.params.config->solid_infill_below_area.value));
}
#endif
}
Expand Down
5 changes: 4 additions & 1 deletion src/libslic3r/Fill/FillBase.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -215,8 +215,8 @@ void Fill::fill_surface_extrusion(const Surface *surface, const FillParams &para


// ensure it doesn't over or under-extrude
double mult_flow = 1;
if (!params.dont_adjust && params.full_infill() && !params.flow.bridge() && params.fill_exactly) {
double mult_flow = 1;
// compute real volume
double polyline_volume = compute_unscaled_volume_to_fill(surface, params);
if (extruded_volume != 0 && polyline_volume != 0) mult_flow *= polyline_volume / extruded_volume;
Expand Down Expand Up @@ -282,6 +282,9 @@ void Fill::fill_surface_extrusion(const Surface *surface, const FillParams &para
if (mult_flow < 0.8) mult_flow = 0.8;
BOOST_LOG_TRIVIAL(info) << "Layer " << layer_id << ": Fill process extrude " << extruded_volume << " mm3 for a volume of " << polyline_volume << " mm3 : we mult the flow by " << mult_flow;
}
#if _DEBUG
this->debug_verify_flow_mult = mult_flow;
#endif

// Save into layer.
auto* eec = new ExtrusionEntityCollection();
Expand Down
3 changes: 3 additions & 0 deletions src/libslic3r/Fill/FillBase.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -124,6 +124,9 @@ class Fill

// Octree builds on mesh for usage in the adaptive cubic infill
FillAdaptive::Octree* adapt_fill_octree = nullptr;
#if _DEBUG
mutable double debug_verify_flow_mult = 0;
#endif
protected:
// in unscaled coordinates, please use init (after settings all others settings) as some algos want to modify the value
coordf_t spacing_priv;
Expand Down
3 changes: 3 additions & 0 deletions src/libslic3r/Fill/FillSmooth.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -114,6 +114,9 @@ namespace Slic3r {
BOOST_LOG_TRIVIAL(info) << "Layer " << layer_id << " Ironing process " << idx << " extrude " << extruded_volume << " mm3 for a volume of " << volume_to_occupy << " mm3 : we mult the flow by " << mult_flow;

}
#if _DEBUG
this->debug_verify_flow_mult = mult_flow;
#endif
extrusion_entities_append_paths(
eec, std::move(polylines_layer),
good_role,
Expand Down
Loading

0 comments on commit d24b494

Please sign in to comment.