mirror of
https://github.com/SoftFever/OrcaSlicer.git
synced 2025-07-12 09:17:52 -06:00
Fix an issue that only 1 bottom/top will be generated when ensure vertical thickness is set to None (#4504)
This commit is contained in:
parent
630262689e
commit
1471ac4204
3 changed files with 18 additions and 12 deletions
|
@ -274,7 +274,7 @@ CONFIG_OPTION_ENUM_DEFINE_STATIC_MAPS(SeamScarfType)
|
||||||
|
|
||||||
// Orca
|
// Orca
|
||||||
static t_config_enum_values s_keys_map_EnsureVerticalShellThickness{
|
static t_config_enum_values s_keys_map_EnsureVerticalShellThickness{
|
||||||
{ "none", int(EnsureVerticalShellThickness::vsNone) },
|
{ "none", int(EnsureVerticalShellThickness::evstNone) },
|
||||||
{ "ensure_critical_only", int(EnsureVerticalShellThickness::evstCriticalOnly) },
|
{ "ensure_critical_only", int(EnsureVerticalShellThickness::evstCriticalOnly) },
|
||||||
{ "ensure_moderate", int(EnsureVerticalShellThickness::evstModerate) },
|
{ "ensure_moderate", int(EnsureVerticalShellThickness::evstModerate) },
|
||||||
{ "ensure_all", int(EnsureVerticalShellThickness::evstAll) },
|
{ "ensure_all", int(EnsureVerticalShellThickness::evstAll) },
|
||||||
|
|
|
@ -178,7 +178,7 @@ enum class SeamScarfType {
|
||||||
|
|
||||||
// Orca
|
// Orca
|
||||||
enum EnsureVerticalShellThickness {
|
enum EnsureVerticalShellThickness {
|
||||||
vsNone,
|
evstNone,
|
||||||
evstCriticalOnly,
|
evstCriticalOnly,
|
||||||
evstModerate,
|
evstModerate,
|
||||||
evstAll,
|
evstAll,
|
||||||
|
|
|
@ -3184,7 +3184,7 @@ void PrintObject::discover_horizontal_shells()
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
// If ensure_vertical_shell_thickness, then the rest has already been performed by discover_vertical_shells().
|
// If ensure_vertical_shell_thickness, then the rest has already been performed by discover_vertical_shells().
|
||||||
if (region_config.ensure_vertical_shell_thickness.value == evstAll || region_config.ensure_vertical_shell_thickness.value == vsNone)
|
if (region_config.ensure_vertical_shell_thickness.value == evstAll)
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
coordf_t print_z = layer->print_z;
|
coordf_t print_z = layer->print_z;
|
||||||
|
@ -3258,7 +3258,7 @@ void PrintObject::discover_horizontal_shells()
|
||||||
|
|
||||||
// Orca: Also use the same strategy if the user has selected to further reduce
|
// Orca: Also use the same strategy if the user has selected to further reduce
|
||||||
// the amount of solid infill on walls.
|
// the amount of solid infill on walls.
|
||||||
if (region_config.sparse_infill_density.value == 0 || region_config.ensure_vertical_shell_thickness.value == evstCriticalOnly) {
|
if (region_config.sparse_infill_density.value == 0 || region_config.ensure_vertical_shell_thickness.value == evstCriticalOnly || region_config.ensure_vertical_shell_thickness.value == evstNone) {
|
||||||
// If user expects the object to be void (for example a hollow sloping vase),
|
// If user expects the object to be void (for example a hollow sloping vase),
|
||||||
// don't continue the search. In this case, we only generate the external solid
|
// don't continue the search. In this case, we only generate the external solid
|
||||||
// shell if the object would otherwise show a hole (gap between perimeters of
|
// shell if the object would otherwise show a hole (gap between perimeters of
|
||||||
|
@ -3271,7 +3271,14 @@ void PrintObject::discover_horizontal_shells()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (region_config.sparse_infill_density.value == 0 || region_config.ensure_vertical_shell_thickness.value == evstCriticalOnly) {
|
float factor = 0.0f;
|
||||||
|
if (region_config.sparse_infill_density.value == 0)
|
||||||
|
factor = 1.0f;
|
||||||
|
else if (region_config.ensure_vertical_shell_thickness.value == evstNone)
|
||||||
|
factor = 0.5f;
|
||||||
|
else if (region_config.ensure_vertical_shell_thickness.value == evstCriticalOnly)
|
||||||
|
factor = 0.2f;
|
||||||
|
if (factor > 0.0f) {
|
||||||
// if we're printing a hollow object we discard any solid shell thinner
|
// if we're printing a hollow object we discard any solid shell thinner
|
||||||
// than a perimeter width, since it's probably just crossing a sloping wall
|
// than a perimeter width, since it's probably just crossing a sloping wall
|
||||||
// and it's not wanted in a hollow print even if it would make sense when
|
// and it's not wanted in a hollow print even if it would make sense when
|
||||||
|
@ -3283,12 +3290,11 @@ void PrintObject::discover_horizontal_shells()
|
||||||
// filtering. This is an arbitrary value to make this option safe
|
// filtering. This is an arbitrary value to make this option safe
|
||||||
// by ensuring that top surfaces, especially slanted ones dont go **completely** unsupported
|
// by ensuring that top surfaces, especially slanted ones dont go **completely** unsupported
|
||||||
// especially when using single perimeter top layers.
|
// especially when using single perimeter top layers.
|
||||||
float margin = region_config.ensure_vertical_shell_thickness.value == evstCriticalOnly? float(neighbor_layerm->flow(frExternalPerimeter).scaled_width()) * 0.2f : float(neighbor_layerm->flow(frExternalPerimeter).scaled_width());
|
float margin = float(neighbor_layerm->flow(frExternalPerimeter).scaled_width()) * factor;
|
||||||
Polygons too_narrow = diff(
|
Polygons too_narrow = diff(new_internal_solid,
|
||||||
new_internal_solid,
|
|
||||||
opening(new_internal_solid, margin, margin + ClipperSafetyOffset, jtMiter, 5));
|
opening(new_internal_solid, margin, margin + ClipperSafetyOffset, jtMiter, 5));
|
||||||
// Trim the regularized region by the original region.
|
// Trim the regularized region by the original region.
|
||||||
if (! too_narrow.empty())
|
if (!too_narrow.empty())
|
||||||
new_internal_solid = solid = diff(new_internal_solid, too_narrow);
|
new_internal_solid = solid = diff(new_internal_solid, too_narrow);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -3296,7 +3302,7 @@ void PrintObject::discover_horizontal_shells()
|
||||||
// when spacing is added in Fill.pm
|
// when spacing is added in Fill.pm
|
||||||
{
|
{
|
||||||
//FIXME Vojtech: Disable this and you will be sorry.
|
//FIXME Vojtech: Disable this and you will be sorry.
|
||||||
float margin = 3.f * layerm->flow(frSolidInfill).scaled_width(); // require at least this size
|
float margin = (region_config.ensure_vertical_shell_thickness.value != evstNone ? 3.f : 1.0f) * layerm->flow(frSolidInfill).scaled_width(); // require at least this size
|
||||||
// we use a higher miterLimit here to handle areas with acute angles
|
// we use a higher miterLimit here to handle areas with acute angles
|
||||||
// in those cases, the default miterLimit would cut the corner and we'd
|
// in those cases, the default miterLimit would cut the corner and we'd
|
||||||
// get a triangle in $too_narrow; if we grow it below then the shell
|
// get a triangle in $too_narrow; if we grow it below then the shell
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue