switch res for large printer

This commit is contained in:
SoftFever
2024-05-12 23:35:41 +08:00
parent 3e9a46c5bb
commit 5daecf3583
21 changed files with 92 additions and 62 deletions

View File

@@ -84,9 +84,9 @@ wxString last_used_directory = wxEmptyString;
/// <returns>File path to svg</returns>
std::string choose_svg_file();
constexpr double get_tesselation_tolerance(double scale){
constexpr double tesselation_tolerance_in_mm = .1; //8e-2;
constexpr double tesselation_tolerance_scaled = (tesselation_tolerance_in_mm*tesselation_tolerance_in_mm) / SCALING_FACTOR / SCALING_FACTOR;
double get_tesselation_tolerance(double scale){
double tesselation_tolerance_in_mm = .1; //8e-2;
double tesselation_tolerance_scaled = (tesselation_tolerance_in_mm*tesselation_tolerance_in_mm) / SCALING_FACTOR / SCALING_FACTOR;
return tesselation_tolerance_scaled / scale / scale;
}

View File

@@ -11,8 +11,10 @@ namespace Slic3r {
namespace GUI {
constexpr double min_delta_area = scale_(scale_(25)); // equal to 25 mm2
constexpr double miscalculation = scale_(scale_(1)); // equal to 1 mm2
// equal to 25 mm2
inline double min_delta_area() { return scale_(scale_(25)); }
// equal to 1 mm2
inline double miscalculation() { return scale_(scale_(1)); }
static const float LEFT_MARGIN = 13.0f + 100.0f; // avoid thumbnail toolbar
static const float HORIZONTAL_SLIDER_WINDOW_HEIGHT = 64.0f;
@@ -33,7 +35,7 @@ static ImVec4 m_tick_rect;
bool equivalent_areas(const double& bottom_area, const double& top_area)
{
return fabs(bottom_area - top_area) <= miscalculation;
return fabs(bottom_area - top_area) <= miscalculation();
}
bool check_color_change(PrintObject *object, size_t frst_layer_id, size_t layers_cnt, bool check_overhangs, std::function<bool(Layer *)> break_condition)
@@ -50,7 +52,7 @@ bool check_color_change(PrintObject *object, size_t frst_layer_id, size_t layers
// Check percent of the area decrease.
// This value have to be more than min_delta_area and more then 10%
if ((prev_area - cur_area > min_delta_area) && (cur_area / prev_area < 0.9)) {
if ((prev_area - cur_area > min_delta_area()) && (cur_area / prev_area < 0.9)) {
detected = true;
if (break_condition(layer)) break;
}

View File

@@ -7972,6 +7972,13 @@ bool Plater::priv::show_publish_dlg(bool show)
//BBS: add bed exclude area
void Plater::priv::set_bed_shape(const Pointfs& shape, const Pointfs& exclude_areas, const double printable_height, const std::string& custom_texture, const std::string& custom_model, bool force_as_custom)
{
//Orca: reduce resolution for large bed printer
BoundingBoxf bed_size = get_extents(shape);
if (bed_size.size().maxCoeff() <= LARGE_BED_THRESHOLD)
SCALING_FACTOR = SCALING_FACTOR_INTERNAL;
else
SCALING_FACTOR = SCALING_FACTOR_INTERNAL_LARGE_PRINTER;
//BBS: add shape position
Vec2d shape_position = partplate_list.get_current_shape_position();
bool new_shape = bed.set_shape(shape, printable_height, custom_model, force_as_custom, shape_position);