option for Slic3r/issues/1364 : use a lower safety offset when slicing the geometry.

This commit is contained in:
supermerill 2018-11-27 19:47:02 +01:00
parent 866bb8b811
commit f3f9b2ce67
7 changed files with 20 additions and 6 deletions

View File

@ -34,6 +34,14 @@ PrintConfigDef::PrintConfigDef()
def->cli = "avoid-crossing-perimeters!";
def->default_value = new ConfigOptionBool(false);
def = this->add("remove_small_gaps", coBool);
def->label = L("Remove small gaps");
def->tooltip = L("Remove the small gaps in the 3D model when slicing. Disable it if you "
"are very confident on your model, or you want to print an item with a geometry "
"designed for vase mode.");
def->cli = "remove-small-gaps!";
def->default_value = new ConfigOptionBool(true);
def = this->add("bed_shape", coPoints);
def->label = L("Bed shape");
def->default_value = new ConfigOptionPoints { Pointf(0,0), Pointf(200,0), Pointf(200,200), Pointf(0,200) };

View File

@ -341,6 +341,7 @@ class PrintObjectConfig : public StaticPrintConfig
STATIC_PRINT_CONFIG_CACHE(PrintObjectConfig)
public:
ConfigOptionBool clip_multipart_objects;
ConfigOptionBool remove_small_gaps;
ConfigOptionBool dont_support_bridges;
ConfigOptionFloat elefant_foot_compensation;
ConfigOptionFloatOrPercent extrusion_width;
@ -388,6 +389,7 @@ protected:
void initialize(StaticCacheBase &cache, const char *base_ptr)
{
OPT_PTR(clip_multipart_objects);
OPT_PTR(remove_small_gaps);
OPT_PTR(dont_support_bridges);
OPT_PTR(elefant_foot_compensation);
OPT_PTR(extrusion_width);

View File

@ -1856,6 +1856,7 @@ std::vector<ExPolygons> PrintObject::_slice_volumes(const std::vector<float> &z,
mesh.translate(- float(unscale(this->_copies_shift.x)), - float(unscale(this->_copies_shift.y)), -float(this->model_object()->bounding_box().min.z));
// perform actual slicing
TriangleMeshSlicer mslicer(&mesh);
mslicer.safety_offset = (this->config.remove_small_gaps ? scale_(0.0499) : SCALED_EPSILON);
mslicer.slice(z, &layers);
}
}

View File

@ -1792,7 +1792,7 @@ void TriangleMeshSlicer::make_expolygons(const Polygons &loops, ExPolygons* slic
//}
// perform a safety offset to merge very close facets (TODO: find test case for this)
double safety_offset = scale_(0.0499);
//double safety_offset = scale_(0.0499); // now a config value
//FIXME see https://github.com/prusa3d/Slic3r/issues/520
// double safety_offset = scale_(0.0001);

View File

@ -168,6 +168,7 @@ public:
const float min_z, const float max_z, IntersectionLine *line_out) const;
void cut(float z, TriangleMesh* upper, TriangleMesh* lower) const;
double safety_offset = scale_(0.0499);
private:
const TriangleMesh *mesh;
// Map from a facet to an edge index.

View File

@ -308,6 +308,7 @@ const std::vector<std::string>& Preset::print_options()
"only_one_perimeter_top", "single_extruder_multi_material_priming", "compatible_printers", "compatible_printers_condition", "inherits",
"infill_dense", "infill_dense_algo", "no_perimeter_unsupported", "min_perimeter_unsupported", "noperi_bridge_only",
"support_material_solid_first_layer", "perimeter_loop", "perimeter_loop_seam", "seam_travel"
, "remove_small_gaps"
};
return s_opts;
}

View File

@ -819,7 +819,8 @@ void TabPrint::build()
optgroup->append_line(line);
optgroup = page->new_optgroup(_(L("Advanced")));
line = { _(L("Seam options")), "" };
optgroup->append_single_option_line("remove_small_gaps");
line = { _(L("Avoid unsupported perimeters")), "" };
line.append_option(optgroup->get_option("seam_position"));
line.append_option(optgroup->get_option("seam_travel"));
optgroup->append_line(line);