Skip to content

Commit

Permalink
Feature/walls direction (#169)
Browse files Browse the repository at this point in the history
* feat: add option to choose walls direction

* fix: ruff check
  • Loading branch information
lvjonok authored Dec 22, 2024
1 parent 4b38e90 commit 22797d2
Show file tree
Hide file tree
Showing 3 changed files with 26 additions and 0 deletions.
1 change: 1 addition & 0 deletions settings.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -110,6 +110,7 @@ slicing:
overlapping_infill_percentage: 100.0
overlapping_infill_lid_percentage: 60.0
random_layer_start: false
is_wall_outside_in: true
planes_contact_with_nozzle: ""
print_speed: 50
print_speed_layer1: 50
Expand Down
2 changes: 2 additions & 0 deletions src/locales.py
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,7 @@ class Locale:
SupportsSettings = "Supports settings"
MaterialShrinkage = "Material shrinkage, %:"
RandomLayerStart = "Random layer start"
IsWallsOutsideIn = "Printing walls from outside in"
FlowRate = "Flow rate, %:"
PressureAdvance = "Pressure advance"
PressureAdvanceValue = "Pressure advance value"
Expand Down Expand Up @@ -257,6 +258,7 @@ def __init__(self, **entries):
SupportsSettings="Настройки поддержек",
MaterialShrinkage="Величина усадки материала, %:",
RandomLayerStart="Спрятать шов",
IsWallsOutsideIn="Печать стенок снаружи внутрь",
FlowRate="Коэффициент потока расплава, %:",
PressureAdvance="Управление давлением расплава",
PressureAdvanceValue="Коэффициент управления давлением",
Expand Down
23 changes: 23 additions & 0 deletions src/settings_widget.py
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,7 @@ class SettingsWidget(QWidget):
"pressure_advance_on",
"pressure_advance_rate",
"random_layer_start",
"is_wall_outside_in",
# TODO: add separate dummy setting to mark the beginning of supports settings
"supports_on",
"support_density",
Expand Down Expand Up @@ -131,6 +132,7 @@ def __init__(self, parent=None, settings_provider: callable = None):
"retraction_compensation": self.locale.RetractCompensationAmount,
"material_shrinkage": self.locale.MaterialShrinkage,
"random_layer_start": self.locale.RandomLayerStart,
"is_wall_outside_in": self.locale.IsWallsOutsideIn,
# TODO: add separate dummy setting to mark the beginning of supports settings
"supports_on": self.locale.SupportsOn,
"support_density": self.locale.SupportDensity,
Expand Down Expand Up @@ -1031,6 +1033,27 @@ def on_change():
"label": rls_on_label,
"checkbox": rls_on_box,
}
elif name == "is_wall_outside_in":
self.ensure_sett("slicing.is_wall_outside_in")

wall_outside_in_label = QLabel(self.locale.IsWallsOutsideIn)
wall_outside_in_box = QCheckBox()
if self.sett().slicing.is_wall_outside_in:
wall_outside_in_box.setCheckState(QtCore.Qt.Checked)
self.panel.addWidget(wall_outside_in_label, self.next_row, 1)
self.panel.addWidget(
wall_outside_in_box, self.cur_row, 2, 1, self.col2_cells
)

def on_change():
self.sett().slicing.is_wall_outside_in = wall_outside_in_box.isChecked()

wall_outside_in_box.stateChanged.connect(on_change)

self.__elements[name] = {
"label": wall_outside_in_label,
"checkbox": wall_outside_in_box,
}
elif name == "flow_rate":
self.ensure_sett("slicing.flow_rate")

Expand Down

0 comments on commit 22797d2

Please sign in to comment.