Commit 92bedd8d authored by sumpfralle's avatar sumpfralle

further improvements of the suport grid adjustment interface


git-svn-id: https://pycam.svn.sourceforge.net/svnroot/pycam/trunk@536 bbaffbd6-741e-11dd-a85d-61de82d9cad9
parent 59cc0712
...@@ -708,20 +708,21 @@ class ProjectGui: ...@@ -708,20 +708,21 @@ class ProjectGui:
# x axis is selected # x axis is selected
if not old_axis_was_x: if not old_axis_was_x:
self.update_support_grid_manual_model() self.update_support_grid_manual_model()
half_distance = self.settings.get("support_grid_distance_x") max_distance = self.settings.get("support_grid_distance_x")
else: else:
# y axis # y axis
if old_axis_was_x: if old_axis_was_x:
self.update_support_grid_manual_model() self.update_support_grid_manual_model()
half_distance = self.settings.get("support_grid_distance_y") max_distance = self.settings.get("support_grid_distance_y")
half_distance /= 2.0 # we allow an individual adjustment of 66% of the distance
self.grid_adjustment_value.set_lower(-half_distance) max_distance /= 1.5
self.grid_adjustment_value.set_upper(half_distance) self.grid_adjustment_value.set_lower(-max_distance)
self.grid_adjustment_value.set_upper(max_distance)
if self.grid_adjustment_value.get_value() \ if self.grid_adjustment_value.get_value() \
!= self.settings.get("support_grid_adjustment_value"): != self.settings.get("support_grid_adjustment_value"):
self.grid_adjustment_value.set_value(self.settings.get( self.grid_adjustment_value.set_value(self.settings.get(
"support_grid_adjustment_value")) "support_grid_adjustment_value"))
self.grid_adjustment_value_control.set_sensitive( self.gui.get_object("SupportGridPositionManualShiftBox").set_sensitive(
self.grid_adjustment_selector.get_active() >= 0) self.grid_adjustment_selector.get_active() >= 0)
...@@ -751,14 +752,13 @@ class ProjectGui: ...@@ -751,14 +752,13 @@ class ProjectGui:
model = self.grid_adjustment_model model = self.grid_adjustment_model
model.clear() model.clear()
s = self.settings s = self.settings
# get the toolpath without adjustments
base_x, base_y = pycam.Toolpath.SupportGrid.get_support_grid_locations( base_x, base_y = pycam.Toolpath.SupportGrid.get_support_grid_locations(
s.get("minx"), s.get("maxx"), s.get("miny"), s.get("maxy"), s.get("minx"), s.get("maxx"), s.get("miny"), s.get("maxy"),
s.get("support_grid_distance_x"), s.get("support_grid_distance_x"),
s.get("support_grid_distance_y"), s.get("support_grid_distance_y"),
offset_x=s.get("support_grid_offset_x"), offset_x=s.get("support_grid_offset_x"),
offset_y=s.get("support_grid_offset_y"), offset_y=s.get("support_grid_offset_y"))
adjustments_x=self.grid_adjustments_x,
adjustments_y=self.grid_adjustments_y)
# fill the adjustment lists # fill the adjustment lists
while len(self.grid_adjustments_x) < len(base_x): while len(self.grid_adjustments_x) < len(base_x):
self.grid_adjustments_x.append(0) self.grid_adjustments_x.append(0)
...@@ -844,6 +844,8 @@ class ProjectGui: ...@@ -844,6 +844,8 @@ class ProjectGui:
@gui_activity_guard @gui_activity_guard
def update_boundary_limits(self, widget=None): def update_boundary_limits(self, widget=None):
# update the values in the manual support grid adjustment list
self.update_support_grid_manual_model()
# the support grid depends on the boundary # the support grid depends on the boundary
self.update_support_grid_model() self.update_support_grid_model()
self.update_view() self.update_view()
......
...@@ -1315,18 +1315,40 @@ ...@@ -1315,18 +1315,40 @@
<object class="GtkVBox" id="vbox28"> <object class="GtkVBox" id="vbox28">
<property name="visible">True</property> <property name="visible">True</property>
<property name="orientation">vertical</property> <property name="orientation">vertical</property>
<child>
<object class="GtkHBox" id="SupportGridPositionManualShiftBox">
<property name="visible">True</property>
<child> <child>
<object class="GtkHScale" id="SupportGridPositionManualShiftControl"> <object class="GtkHScale" id="SupportGridPositionManualShiftControl">
<property name="visible">True</property> <property name="visible">True</property>
<property name="can_focus">True</property> <property name="can_focus">True</property>
<property name="adjustment">SupportGridPositionManualAdjustment</property> <property name="adjustment">SupportGridPositionManualAdjustment</property>
<property name="digits">2</property> <property name="digits">2</property>
<property name="draw_value">False</property>
<property name="value_pos">right</property> <property name="value_pos">right</property>
</object> </object>
<packing> <packing>
<property name="position">0</property> <property name="position">0</property>
</packing> </packing>
</child> </child>
<child>
<object class="GtkSpinButton" id="SupportGridPositionManualShiftControl2">
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="invisible_char">&#x25CF;</property>
<property name="adjustment">SupportGridPositionManualAdjustment</property>
<property name="digits">1</property>
</object>
<packing>
<property name="expand">False</property>
<property name="position">1</property>
</packing>
</child>
</object>
<packing>
<property name="position">0</property>
</packing>
</child>
<child> <child>
<object class="GtkHBox" id="hbox25"> <object class="GtkHBox" id="hbox25">
<property name="visible">True</property> <property name="visible">True</property>
...@@ -5716,10 +5738,12 @@ Any selected group of dimensions will be scaled accordingly.</property> ...@@ -5716,10 +5738,12 @@ Any selected group of dimensions will be scaled accordingly.</property>
<property name="step_increment">1</property> <property name="step_increment">1</property>
</object> </object>
<object class="GtkAdjustment" id="SupportGridOffsetX"> <object class="GtkAdjustment" id="SupportGridOffsetX">
<property name="lower">-1000</property>
<property name="upper">1000</property> <property name="upper">1000</property>
<property name="step_increment">1</property> <property name="step_increment">1</property>
</object> </object>
<object class="GtkAdjustment" id="SupportGridOffsetY"> <object class="GtkAdjustment" id="SupportGridOffsetY">
<property name="lower">-1000</property>
<property name="upper">1000</property> <property name="upper">1000</property>
<property name="step_increment">1</property> <property name="step_increment">1</property>
</object> </object>
...@@ -5843,8 +5867,6 @@ Any selected group of dimensions will be scaled accordingly.</property> ...@@ -5843,8 +5867,6 @@ Any selected group of dimensions will be scaled accordingly.</property>
</action-widgets> </action-widgets>
</object> </object>
<object class="GtkAdjustment" id="SupportGridPositionManualAdjustment"> <object class="GtkAdjustment" id="SupportGridPositionManualAdjustment">
<property name="lower">-100</property> <property name="step_increment">1</property>
<property name="upper">100</property>
<property name="step_increment">10</property>
</object> </object>
</interface> </interface>
...@@ -58,7 +58,8 @@ def generate_toolpath(model, tool_settings=None, ...@@ -58,7 +58,8 @@ def generate_toolpath(model, tool_settings=None,
engrave_offset=0.0, support_grid_distance_x=None, engrave_offset=0.0, support_grid_distance_x=None,
support_grid_distance_y=None, support_grid_thickness=None, support_grid_distance_y=None, support_grid_thickness=None,
support_grid_height=None, support_grid_offset_x=None, support_grid_height=None, support_grid_offset_x=None,
support_grid_offset_y=None, calculation_backend=None, callback=None): support_grid_offset_y=None, support_grid_adjustments_x=None,
support_grid_adjustments_y=None, calculation_backend=None, callback=None):
""" abstract interface for generating a toolpath """ abstract interface for generating a toolpath
@type model: pycam.Geometry.Model.Model @type model: pycam.Geometry.Model.Model
...@@ -156,8 +157,8 @@ def generate_toolpath(model, tool_settings=None, ...@@ -156,8 +157,8 @@ def generate_toolpath(model, tool_settings=None,
support_grid_distance_y, support_grid_thickness, support_grid_distance_y, support_grid_thickness,
support_grid_height, offset_x=support_grid_offset_x, support_grid_height, offset_x=support_grid_offset_x,
offset_y=support_grid_offset_y, offset_y=support_grid_offset_y,
support_grid_adjustments_x=support_grid_adjustments_x, adjustments_x=support_grid_adjustments_x,
support_grid_adjustments_y=support_grid_adjustments_y) adjustments_y=support_grid_adjustments_y)
trimesh_model += support_grid_model trimesh_model += support_grid_model
# Adapt the contour_model to the engraving offset. This offset is # Adapt the contour_model to the engraving offset. This offset is
# considered to be part of the material_allowance. # considered to be part of the material_allowance.
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment