diff --git a/FlatCAMApp.py b/FlatCAMApp.py index 36c06ba9..8fe6897a 100644 --- a/FlatCAMApp.py +++ b/FlatCAMApp.py @@ -633,6 +633,8 @@ class App(QtCore.QObject): # Excellon Options "excellon_drillz": -1.7, + "excellon_multidepth": False, + "excellon_depthperpass": 0.7, "excellon_travelz": 2, "excellon_endz": 0.5, "excellon_feedrate": 300, @@ -1289,6 +1291,8 @@ class App(QtCore.QObject): # Excellon Options "excellon_drillz": self.ui.excellon_defaults_form.excellon_opt_group.cutz_entry, + "excellon_multidepth": self.ui.excellon_defaults_form.excellon_opt_group.mpass_cb, + "excellon_depthperpass":self.ui.excellon_defaults_form.excellon_opt_group.maxdepth_entry, "excellon_travelz": self.ui.excellon_defaults_form.excellon_opt_group.travelz_entry, "excellon_endz": self.ui.excellon_defaults_form.excellon_opt_group.endz_entry, "excellon_feedrate": self.ui.excellon_defaults_form.excellon_opt_group.feedrate_z_entry, diff --git a/FlatCAMObj.py b/FlatCAMObj.py index f7faf045..6567993f 100644 --- a/FlatCAMObj.py +++ b/FlatCAMObj.py @@ -2317,6 +2317,8 @@ class FlatCAMExcellon(FlatCAMObj, Excellon): "plot": True, "solid": False, "drillz": -0.1, + "multidepth": False, + "depthperpass": 0.7, "travelz": 0.1, "feedrate": 5.0, "feedrate_rapid": 5.0, @@ -2803,6 +2805,8 @@ class FlatCAMExcellon(FlatCAMObj, Excellon): "plot": self.ui.plot_cb, "solid": self.ui.solid_cb, "drillz": self.ui.cutz_entry, + "multidepth": self.ui.mpass_cb, + "depthperpass": self.ui.maxdepth_entry, "travelz": self.ui.travelz_entry, "feedrate": self.ui.feedrate_z_entry, "feedrate_rapid": self.ui.feedrate_rapid_entry, @@ -2983,16 +2987,16 @@ class FlatCAMExcellon(FlatCAMObj, Excellon): self.ui.extracut_cb.show() self.ui.e_cut_entry.show() - if 'laser' not in self.ui.pp_excellon_name_cb.get_value().lower(): - self.ui.mpass_cb.show() - self.ui.maxdepth_entry.show() + # if 'laser' not in self.ui.pp_excellon_name_cb.get_value().lower(): + # self.ui.mpass_cb.show() + # self.ui.maxdepth_entry.show() else: self.ui.mill_type_label.hide() self.ui.mill_type_radio.hide() self.ui.mill_dia_label.hide() self.ui.mill_dia_entry.hide() - self.ui.mpass_cb.hide() - self.ui.maxdepth_entry.hide() + # self.ui.mpass_cb.hide() + # self.ui.maxdepth_entry.hide() self.ui.frxylabel.hide() self.ui.xyfeedrate_entry.hide() self.ui.extracut_cb.hide() @@ -3580,6 +3584,10 @@ class FlatCAMExcellon(FlatCAMObj, Excellon): job_obj.options['ppname_e'] = pp_excellon_name job_obj.z_cut = float(self.options["drillz"]) + + job_obj.multidepth = self.options["multidepth"] + job_obj.z_depthpercut = self.options["depthperpass"] + job_obj.tool_offset = self.tool_offset job_obj.z_move = float(self.options["travelz"]) job_obj.feedrate = float(self.options["feedrate"]) diff --git a/README.md b/README.md index f727c607..434c81bb 100644 --- a/README.md +++ b/README.md @@ -14,6 +14,7 @@ CAD program, and create G-Code for Isolation routing. - added a new preprocessor for using laser on a Marlin 3D printer named 'Marlin_laser_use_Spindle_pin' - modified the Geometry UI when using laser preprocessors - added a new preprocessor file for using laser on a Marlin motion controller but with the laser connected to one of the FAN pins, named 'Marlin_laser_use_FAN_pin' +- modified the Excellon GCode generation so now it can use multi depth drilling; modified the preprocessors to show the number of passes 5.02.2020 diff --git a/camlib.py b/camlib.py index e3002d8a..2c62d018 100644 --- a/camlib.py +++ b/camlib.py @@ -2230,7 +2230,7 @@ class CNCjob(Geometry): z_cut=-0.002, z_move=0.1, feedrate=3.0, feedrate_z=3.0, feedrate_rapid=3.0, feedrate_probe=3.0, pp_geometry_name='default', pp_excellon_name='default', - depthpercut=0.1,z_pdepth=-0.02, + depthpercut=0.1, z_pdepth=-0.02, spindlespeed=None, spindledir='CW', dwell=True, dwelltime=1000, toolchangez=0.787402, toolchange_xy=[0.0, 0.0], endz=2.0, @@ -2265,7 +2265,10 @@ class CNCjob(Geometry): self.toolC = tooldia + self.startz = None self.z_end = endz + + self.multidepth = False self.z_depthpercut = depthpercut self.unitcode = {"IN": "G20", "MM": "G21"} @@ -2566,8 +2569,6 @@ class CNCjob(Geometry): [it[0], it[1], drill_no, slot_no] ) - print(self.options['Tools_in_use']) - self.app.inform.emit(_("Creating a list of points to drill...")) # Points (Group by tool) points = dict() @@ -2777,18 +2778,43 @@ class CNCjob(Geometry): locy = locations[k][1] gcode += self.doformat(p.rapid_code, x=locx, y=locy) - gcode += self.doformat(p.down_code, x=locx, y=locy) - measured_down_distance += abs(self.z_cut) + abs(self.z_move) + if self.multidepth and abs(self.z_cut) > abs(self.z_depthpercut): + doc = deepcopy(self.z_cut) + self.z_cut = 0.0 + + while abs(self.z_cut) < abs(doc): + + self.z_cut -= self.z_depthpercut + if abs(doc) < abs(self.z_cut) < (abs(doc) + self.z_depthpercut): + self.z_cut = doc + gcode += self.doformat(p.down_code, x=locx, y=locy) + + measured_down_distance += abs(self.z_cut) + abs(self.z_move) + + if self.f_retract is False: + gcode += self.doformat(p.up_to_zero_code, x=locx, y=locy) + measured_up_to_zero_distance += abs(self.z_cut) + measured_lift_distance += abs(self.z_move) + else: + measured_lift_distance += abs(self.z_cut) + abs(self.z_move) + + gcode += self.doformat(p.lift_code, x=locx, y=locy) - if self.f_retract is False: - gcode += self.doformat(p.up_to_zero_code, x=locx, y=locy) - measured_up_to_zero_distance += abs(self.z_cut) - measured_lift_distance += abs(self.z_move) else: - measured_lift_distance += abs(self.z_cut) + abs(self.z_move) + gcode += self.doformat(p.down_code, x=locx, y=locy) + + measured_down_distance += abs(self.z_cut) + abs(self.z_move) + + if self.f_retract is False: + gcode += self.doformat(p.up_to_zero_code, x=locx, y=locy) + measured_up_to_zero_distance += abs(self.z_cut) + measured_lift_distance += abs(self.z_move) + else: + measured_lift_distance += abs(self.z_cut) + abs(self.z_move) + + gcode += self.doformat(p.lift_code, x=locx, y=locy) - gcode += self.doformat(p.lift_code, x=locx, y=locy) measured_distance += abs(distance_euclidian(locx, locy, self.oldx, self.oldy)) self.oldx = locx self.oldy = locy @@ -2920,18 +2946,43 @@ class CNCjob(Geometry): locy = locations[k][1] gcode += self.doformat(p.rapid_code, x=locx, y=locy) - gcode += self.doformat(p.down_code, x=locx, y=locy) - measured_down_distance += abs(self.z_cut) + abs(self.z_move) + if self.multidepth and abs(self.z_cut) > abs(self.z_depthpercut): + doc = deepcopy(self.z_cut) + self.z_cut = 0.0 + + while abs(self.z_cut) < abs(doc): + + self.z_cut -= self.z_depthpercut + if abs(doc) < abs(self.z_cut) < (abs(doc) + self.z_depthpercut): + self.z_cut = doc + gcode += self.doformat(p.down_code, x=locx, y=locy) + + measured_down_distance += abs(self.z_cut) + abs(self.z_move) + + if self.f_retract is False: + gcode += self.doformat(p.up_to_zero_code, x=locx, y=locy) + measured_up_to_zero_distance += abs(self.z_cut) + measured_lift_distance += abs(self.z_move) + else: + measured_lift_distance += abs(self.z_cut) + abs(self.z_move) + + gcode += self.doformat(p.lift_code, x=locx, y=locy) - if self.f_retract is False: - gcode += self.doformat(p.up_to_zero_code, x=locx, y=locy) - measured_up_to_zero_distance += abs(self.z_cut) - measured_lift_distance += abs(self.z_move) else: - measured_lift_distance += abs(self.z_cut) + abs(self.z_move) + gcode += self.doformat(p.down_code, x=locx, y=locy) + + measured_down_distance += abs(self.z_cut) + abs(self.z_move) + + if self.f_retract is False: + gcode += self.doformat(p.up_to_zero_code, x=locx, y=locy) + measured_up_to_zero_distance += abs(self.z_cut) + measured_lift_distance += abs(self.z_move) + else: + measured_lift_distance += abs(self.z_cut) + abs(self.z_move) + + gcode += self.doformat(p.lift_code, x=locx, y=locy) - gcode += self.doformat(p.lift_code, x=locx, y=locy) measured_distance += abs(distance_euclidian(locx, locy, self.oldx, self.oldy)) self.oldx = locx self.oldy = locy @@ -3023,22 +3074,50 @@ class CNCjob(Geometry): # graceful abort requested by the user raise FlatCAMApp.GracefulException - gcode += self.doformat(p.rapid_code, x=point[0], y=point[1]) - gcode += self.doformat(p.down_code, x=point[0], y=point[1]) + locx = point[0] + locy = point[1] - measured_down_distance += abs(self.z_cut) + abs(self.z_move) + gcode += self.doformat(p.rapid_code, x=locx, y=locy) + + if self.multidepth and abs(self.z_cut) > abs(self.z_depthpercut): + doc = deepcopy(self.z_cut) + self.z_cut = 0.0 + + while abs(self.z_cut) < abs(doc): + + self.z_cut -= self.z_depthpercut + if abs(doc) < abs(self.z_cut) < (abs(doc) + self.z_depthpercut): + self.z_cut = doc + gcode += self.doformat(p.down_code, x=locx, y=locy) + + measured_down_distance += abs(self.z_cut) + abs(self.z_move) + + if self.f_retract is False: + gcode += self.doformat(p.up_to_zero_code, x=locx, y=locy) + measured_up_to_zero_distance += abs(self.z_cut) + measured_lift_distance += abs(self.z_move) + else: + measured_lift_distance += abs(self.z_cut) + abs(self.z_move) + + gcode += self.doformat(p.lift_code, x=locx, y=locy) - if self.f_retract is False: - gcode += self.doformat(p.up_to_zero_code, x=point[0], y=point[1]) - measured_up_to_zero_distance += abs(self.z_cut) - measured_lift_distance += abs(self.z_move) else: - measured_lift_distance += abs(self.z_cut) + abs(self.z_move) + gcode += self.doformat(p.down_code, x=locx, y=locy) - gcode += self.doformat(p.lift_code, x=point[0], y=point[1]) - measured_distance += abs(distance_euclidian(point[0], point[1], self.oldx, self.oldy)) - self.oldx = point[0] - self.oldy = point[1] + measured_down_distance += abs(self.z_cut) + abs(self.z_move) + + if self.f_retract is False: + gcode += self.doformat(p.up_to_zero_code, x=locx, y=locy) + measured_up_to_zero_distance += abs(self.z_cut) + measured_lift_distance += abs(self.z_move) + else: + measured_lift_distance += abs(self.z_cut) + abs(self.z_move) + + gcode += self.doformat(p.lift_code, x=locx, y=locy) + + measured_distance += abs(distance_euclidian(locx, locy, self.oldx, self.oldy)) + self.oldx = locx + self.oldy = locy loc_nr += 1 disp_number = int(np.interp(loc_nr, [0, geo_len], [0, 100])) diff --git a/flatcamGUI/PreferencesUI.py b/flatcamGUI/PreferencesUI.py index 33c23ab3..b003b71c 100644 --- a/flatcamGUI/PreferencesUI.py +++ b/flatcamGUI/PreferencesUI.py @@ -3074,7 +3074,7 @@ class ExcellonOptPrefGroupUI(OptionsGroupUI): _("Drill depth (negative)\n" "below the copper surface.") ) - grid2.addWidget(cutzlabel, 0, 0) + self.cutz_entry = FCDoubleSpinner() if machinist_setting == 0: @@ -3084,15 +3084,38 @@ class ExcellonOptPrefGroupUI(OptionsGroupUI): self.cutz_entry.setSingleStep(0.1) self.cutz_entry.set_precision(self.decimals) + + grid2.addWidget(cutzlabel, 0, 0) grid2.addWidget(self.cutz_entry, 0, 1) + # Multi-Depth + self.mpass_cb = FCCheckBox('%s:' % _("Multi-Depth")) + self.mpass_cb.setToolTip( + _( + "Use multiple passes to limit\n" + "the cut depth in each pass. Will\n" + "cut multiple times until Cut Z is\n" + "reached." + ) + ) + + self.maxdepth_entry = FCDoubleSpinner() + self.maxdepth_entry.set_precision(self.decimals) + self.maxdepth_entry.set_range(0, 9999.9999) + self.maxdepth_entry.setSingleStep(0.1) + + self.maxdepth_entry.setToolTip(_("Depth of each pass (positive).")) + + grid2.addWidget(self.mpass_cb, 1, 0) + grid2.addWidget(self.maxdepth_entry, 1, 1) + # Travel Z travelzlabel = QtWidgets.QLabel('%s:' % _('Travel Z')) travelzlabel.setToolTip( _("Tool height when travelling\n" "across the XY plane.") ) - grid2.addWidget(travelzlabel, 1, 0) + self.travelz_entry = FCDoubleSpinner() self.travelz_entry.set_precision(self.decimals) @@ -3101,7 +3124,8 @@ class ExcellonOptPrefGroupUI(OptionsGroupUI): else: self.travelz_entry.set_range(-9999.9999, 9999.9999) - grid2.addWidget(self.travelz_entry, 1, 1) + grid2.addWidget(travelzlabel, 2, 0) + grid2.addWidget(self.travelz_entry, 2, 1) # Tool change: self.toolchange_cb = FCCheckBox('%s' % _("Tool change")) @@ -3109,14 +3133,15 @@ class ExcellonOptPrefGroupUI(OptionsGroupUI): _("Include tool-change sequence\n" "in G-Code (Pause for tool change).") ) - grid2.addWidget(self.toolchange_cb, 2, 0, 1, 2) + grid2.addWidget(self.toolchange_cb, 3, 0, 1, 2) + # Tool Change Z toolchangezlabel = QtWidgets.QLabel('%s:' % _('Toolchange Z')) toolchangezlabel.setToolTip( _("Z-axis position (height) for\n" "tool change.") ) - grid2.addWidget(toolchangezlabel, 3, 0) + self.toolchangez_entry = FCDoubleSpinner() self.toolchangez_entry.set_precision(self.decimals) @@ -3125,7 +3150,8 @@ class ExcellonOptPrefGroupUI(OptionsGroupUI): else: self.toolchangez_entry.set_range(-9999.9999, 9999.9999) - grid2.addWidget(self.toolchangez_entry, 3, 1) + grid2.addWidget(toolchangezlabel, 4, 0) + grid2.addWidget(self.toolchangez_entry, 4, 1) # End Move Z endz_label = QtWidgets.QLabel('%s:' % _('End move Z')) @@ -3141,8 +3167,8 @@ class ExcellonOptPrefGroupUI(OptionsGroupUI): else: self.endz_entry.set_range(-9999.9999, 9999.9999) - grid2.addWidget(endz_label, 4, 0) - grid2.addWidget(self.endz_entry, 4, 1) + grid2.addWidget(endz_label, 5, 0) + grid2.addWidget(self.endz_entry, 5, 1) # Feedrate Z frlabel = QtWidgets.QLabel('%s:' % _('Feedrate Z')) @@ -3156,8 +3182,8 @@ class ExcellonOptPrefGroupUI(OptionsGroupUI): self.feedrate_z_entry.set_precision(self.decimals) self.feedrate_z_entry.set_range(0, 99999.9999) - grid2.addWidget(frlabel, 5, 0) - grid2.addWidget(self.feedrate_z_entry, 5, 1) + grid2.addWidget(frlabel, 6, 0) + grid2.addWidget(self.feedrate_z_entry, 6, 1) # Spindle speed spdlabel = QtWidgets.QLabel('%s:' % _('Spindle Speed')) @@ -3165,11 +3191,13 @@ class ExcellonOptPrefGroupUI(OptionsGroupUI): _("Speed of the spindle\n" "in RPM (optional)") ) - grid2.addWidget(spdlabel, 6, 0) + self.spindlespeed_entry = FCSpinner() self.spindlespeed_entry.set_range(0, 1000000) self.spindlespeed_entry.setSingleStep(100) - grid2.addWidget(self.spindlespeed_entry, 6, 1) + + grid2.addWidget(spdlabel, 10, 0) + grid2.addWidget(self.spindlespeed_entry, 10, 1) # Dwell self.dwell_cb = FCCheckBox('%s' % _('Enable Dwell')) @@ -3177,16 +3205,18 @@ class ExcellonOptPrefGroupUI(OptionsGroupUI): _("Pause to allow the spindle to reach its\n" "speed before cutting.") ) - grid2.addWidget(self.dwell_cb, 7, 0, 1, 2) + grid2.addWidget(self.dwell_cb, 11, 0, 1, 2) + + # Dwell Time dwelltime = QtWidgets.QLabel('%s:' % _('Duration')) dwelltime.setToolTip(_("Number of time units for spindle to dwell.")) self.dwelltime_entry = FCDoubleSpinner() self.dwelltime_entry.set_precision(self.decimals) self.dwelltime_entry.set_range(0, 99999.9999) - grid2.addWidget(dwelltime, 8, 0) - grid2.addWidget(self.dwelltime_entry, 8, 1) + grid2.addWidget(dwelltime, 12, 0) + grid2.addWidget(self.dwelltime_entry, 12, 1) self.ois_dwell_exc = OptionalInputSection(self.dwell_cb, [self.dwelltime_entry]) @@ -3196,10 +3226,12 @@ class ExcellonOptPrefGroupUI(OptionsGroupUI): _("The preprocessor JSON file that dictates\n" "Gcode output.") ) - grid2.addWidget(pp_excellon_label, 9, 0) + self.pp_excellon_name_cb = FCComboBox() self.pp_excellon_name_cb.setFocusPolicy(Qt.StrongFocus) - grid2.addWidget(self.pp_excellon_name_cb, 9, 1) + + grid2.addWidget(pp_excellon_label, 14, 0) + grid2.addWidget(self.pp_excellon_name_cb, 14, 1) # ### Choose what to use for Gcode creation: Drills, Slots or Both excellon_gcode_type_label = QtWidgets.QLabel('%s' % _('Gcode')) @@ -3212,8 +3244,8 @@ class ExcellonOptPrefGroupUI(OptionsGroupUI): self.excellon_gcode_type_radio = RadioSet([{'label': 'Drills', 'value': 'drills'}, {'label': 'Slots', 'value': 'slots'}, {'label': 'Both', 'value': 'both'}]) - grid2.addWidget(excellon_gcode_type_label, 10, 0) - grid2.addWidget(self.excellon_gcode_type_radio, 10, 1) + grid2.addWidget(excellon_gcode_type_label, 15, 0) + grid2.addWidget(self.excellon_gcode_type_radio, 15, 1) # until I decide to implement this feature those remain disabled excellon_gcode_type_label.hide() @@ -3224,7 +3256,7 @@ class ExcellonOptPrefGroupUI(OptionsGroupUI): self.mill_hole_label.setToolTip( _("Create Geometry for milling holes.") ) - grid2.addWidget(self.mill_hole_label, 11, 0, 1, 2) + grid2.addWidget(self.mill_hole_label, 16, 0, 1, 2) tdlabel = QtWidgets.QLabel('%s:' % _('Drill Tool dia')) tdlabel.setToolTip( @@ -3234,8 +3266,8 @@ class ExcellonOptPrefGroupUI(OptionsGroupUI): self.tooldia_entry.set_precision(self.decimals) self.tooldia_entry.set_range(0, 999.9999) - grid2.addWidget(tdlabel, 12, 0) - grid2.addWidget(self.tooldia_entry, 12, 1) + grid2.addWidget(tdlabel, 18, 0) + grid2.addWidget(self.tooldia_entry, 18, 1) stdlabel = QtWidgets.QLabel('%s:' % _('Slot Tool dia')) stdlabel.setToolTip( @@ -3246,8 +3278,8 @@ class ExcellonOptPrefGroupUI(OptionsGroupUI): self.slot_tooldia_entry.set_precision(self.decimals) self.slot_tooldia_entry.set_range(0, 999.9999) - grid2.addWidget(stdlabel, 13, 0) - grid2.addWidget(self.slot_tooldia_entry, 13, 1) + grid2.addWidget(stdlabel, 21, 0) + grid2.addWidget(self.slot_tooldia_entry, 21, 1) self.layout.addStretch() diff --git a/preprocessors/ISEL_CNC.py b/preprocessors/ISEL_CNC.py index c32b4272..2e20c06e 100644 --- a/preprocessors/ISEL_CNC.py +++ b/preprocessors/ISEL_CNC.py @@ -35,10 +35,9 @@ class ISEL_CNC(FlatCAMPostProc): gcode += '(Feedrate rapids ' + str(p['feedrate_rapid']) + units + '/min' + ')\n' + '\n' gcode += '(Z_Cut: ' + str(p['z_cut']) + units + ')\n' - if str(p['options']['type']) == 'Geometry': - if p['multidepth'] is True: - gcode += '(DepthPerCut: ' + str(p['z_depthpercut']) + units + ' <=>' + \ - str(math.ceil(abs(p['z_cut']) / p['z_depthpercut'])) + ' passes' + ')\n' + if p['multidepth'] is True: + gcode += '(DepthPerCut: ' + str(p['z_depthpercut']) + units + ' <=>' + \ + str(math.ceil(abs(p['z_cut']) / p['z_depthpercut'])) + ' passes' + ')\n' gcode += '(Z_Move: ' + str(p['z_move']) + units + ')\n' gcode += '(Z Toolchange: ' + str(p['z_toolchange']) + units + ')\n' diff --git a/preprocessors/ISEL_ICP_CNC.py b/preprocessors/ISEL_ICP_CNC.py index ca820d8f..92a08691 100644 --- a/preprocessors/ISEL_ICP_CNC.py +++ b/preprocessors/ISEL_ICP_CNC.py @@ -33,10 +33,10 @@ class ISEL_ICP_CNC(FlatCAMPostProc): gcode += '\n' gcode += '; Z_Cut: ' + str(p['z_cut']) + units + '\n' - if str(p['options']['type']) == 'Geometry': - if p['multidepth'] is True: - gcode += '; DepthPerCut: ' + str(p['z_depthpercut']) + units + ' <=>' + \ - str(math.ceil(abs(p['z_cut']) / p['z_depthpercut'])) + ' passes' + '\n' + if p['multidepth'] is True: + gcode += '; DepthPerCut: ' + str(p['z_depthpercut']) + units + ' <=>' + \ + str(math.ceil(abs(p['z_cut']) / p['z_depthpercut'])) + ' passes' + '\n' + gcode += '; Z_Move: ' + str(p['z_move']) + units + '\n' gcode += '; Z Toolchange: ' + str(p['z_toolchange']) + units + '\n' if coords_xy is not None: diff --git a/preprocessors/Marlin.py b/preprocessors/Marlin.py index 128d1937..d5144d59 100644 --- a/preprocessors/Marlin.py +++ b/preprocessors/Marlin.py @@ -37,10 +37,9 @@ class Marlin(FlatCAMPostProc): gcode += ';Feedrate rapids: ' + str(p['feedrate_rapid']) + units + '/min' + '\n' + '\n' gcode += ';Z_Cut: ' + str(p['z_cut']) + units + '\n' - if str(p['options']['type']) == 'Geometry': - if p['multidepth'] is True: - gcode += ';DepthPerCut: ' + str(p['z_depthpercut']) + units + ' <=>' + \ - str(math.ceil(abs(p['z_cut']) / p['z_depthpercut'])) + ' passes' + '\n' + if p['multidepth'] is True: + gcode += ';DepthPerCut: ' + str(p['z_depthpercut']) + units + ' <=>' + \ + str(math.ceil(abs(p['z_cut']) / p['z_depthpercut'])) + ' passes' + '\n' gcode += ';Z_Move: ' + str(p['z_move']) + units + '\n' gcode += ';Z Toolchange: ' + str(p['z_toolchange']) + units + '\n' diff --git a/preprocessors/Repetier.py b/preprocessors/Repetier.py index fa760dfd..3d31a176 100644 --- a/preprocessors/Repetier.py +++ b/preprocessors/Repetier.py @@ -37,10 +37,9 @@ class Repetier(FlatCAMPostProc): gcode += ';Feedrate rapids ' + str(p['feedrate_rapid']) + units + '/min' + '\n' + '\n' gcode += ';Z_Cut: ' + str(p['z_cut']) + units + '\n' - if str(p['options']['type']) == 'Geometry': - if p['multidepth'] is True: - gcode += ';DepthPerCut: ' + str(p['z_depthpercut']) + units + ' <=>' + \ - str(math.ceil(abs(p['z_cut']) / p['z_depthpercut'])) + ' passes' + '\n' + if p['multidepth'] is True: + gcode += ';DepthPerCut: ' + str(p['z_depthpercut']) + units + ' <=>' + \ + str(math.ceil(abs(p['z_cut']) / p['z_depthpercut'])) + ' passes' + '\n' gcode += ';Z_Move: ' + str(p['z_move']) + units + '\n' gcode += ';Z Toolchange: ' + str(p['z_toolchange']) + units + '\n' diff --git a/preprocessors/Toolchange_Custom.py b/preprocessors/Toolchange_Custom.py index ce6814b9..162defbb 100644 --- a/preprocessors/Toolchange_Custom.py +++ b/preprocessors/Toolchange_Custom.py @@ -36,10 +36,9 @@ class Toolchange_Custom(FlatCAMPostProc): gcode += '(Feedrate rapids ' + str(p['feedrate_rapid']) + units + '/min' + ')\n' + '\n' gcode += '(Z_Cut: ' + str(p['z_cut']) + units + ')\n' - if str(p['options']['type']) == 'Geometry': - if p['multidepth'] is True: - gcode += '(DepthPerCut: ' + str(p['z_depthpercut']) + units + ' <=>' + \ - str(math.ceil(abs(p['z_cut']) / p['z_depthpercut'])) + ' passes' + ')\n' + if p['multidepth'] is True: + gcode += '(DepthPerCut: ' + str(p['z_depthpercut']) + units + ' <=>' + \ + str(math.ceil(abs(p['z_cut']) / p['z_depthpercut'])) + ' passes' + ')\n' gcode += '(Z_Move: ' + str(p['z_move']) + units + ')\n' gcode += '(Z Toolchange: ' + str(p['z_toolchange']) + units + ')\n' diff --git a/preprocessors/Toolchange_Probe_MACH3.py b/preprocessors/Toolchange_Probe_MACH3.py index 424848f8..3f0bb7c8 100644 --- a/preprocessors/Toolchange_Probe_MACH3.py +++ b/preprocessors/Toolchange_Probe_MACH3.py @@ -37,10 +37,9 @@ class Toolchange_Probe_MACH3(FlatCAMPostProc): gcode += '(Feedrate Probe ' + str(p['feedrate_probe']) + units + '/min' + ')\n' + '\n' gcode += '(Z_Cut: ' + str(p['z_cut']) + units + ')\n' - if str(p['options']['type']) == 'Geometry': - if p['multidepth'] is True: - gcode += '(DepthPerCut: ' + str(p['z_depthpercut']) + units + ' <=>' + \ - str(math.ceil(abs(p['z_cut']) / p['z_depthpercut'])) + ' passes' + ')\n' + if p['multidepth'] is True: + gcode += '(DepthPerCut: ' + str(p['z_depthpercut']) + units + ' <=>' + \ + str(math.ceil(abs(p['z_cut']) / p['z_depthpercut'])) + ' passes' + ')\n' gcode += '(Z_Move: ' + str(p['z_move']) + units + ')\n' gcode += '(Z Toolchange: ' + str(p['z_toolchange']) + units + ')\n' diff --git a/preprocessors/Toolchange_manual.py b/preprocessors/Toolchange_manual.py index ef583a7c..f096ab25 100644 --- a/preprocessors/Toolchange_manual.py +++ b/preprocessors/Toolchange_manual.py @@ -36,10 +36,9 @@ class Toolchange_manual(FlatCAMPostProc): gcode += '(Feedrate rapids ' + str(p['feedrate_rapid']) + units + '/min' + ')\n' + '\n' gcode += '(Z_Cut: ' + str(p['z_cut']) + units + ')\n' - if str(p['options']['type']) == 'Geometry': - if p['multidepth'] is True: - gcode += '(DepthPerCut: ' + str(p['z_depthpercut']) + units + ' <=>' + \ - str(math.ceil(abs(p['z_cut']) / p['z_depthpercut'])) + ' passes' + ')\n' + if p['multidepth'] is True: + gcode += '(DepthPerCut: ' + str(p['z_depthpercut']) + units + ' <=>' + \ + str(math.ceil(abs(p['z_cut']) / p['z_depthpercut'])) + ' passes' + ')\n' gcode += '(Z_Move: ' + str(p['z_move']) + units + ')\n' gcode += '(Z Toolchange: ' + str(p['z_toolchange']) + units + ')\n' diff --git a/preprocessors/default.py b/preprocessors/default.py index ce4bd85b..216ba98e 100644 --- a/preprocessors/default.py +++ b/preprocessors/default.py @@ -37,10 +37,9 @@ class default(FlatCAMPostProc): gcode += '(Feedrate rapids ' + str(p['feedrate_rapid']) + units + '/min' + ')\n' + '\n' gcode += '(Z_Cut: ' + str(p['z_cut']) + units + ')\n' - if str(p['options']['type']) == 'Geometry': - if p['multidepth'] is True: - gcode += '(DepthPerCut: ' + str(p['z_depthpercut']) + units + ' <=>' + \ - str(math.ceil(abs(p['z_cut']) / p['z_depthpercut'])) + ' passes' + ')\n' + if p['multidepth'] is True: + gcode += '(DepthPerCut: ' + str(p['z_depthpercut']) + units + ' <=>' + \ + str(math.ceil(abs(p['z_cut']) / p['z_depthpercut'])) + ' passes' + ')\n' gcode += '(Z_Move: ' + str(p['z_move']) + units + ')\n' gcode += '(Z Toolchange: ' + str(p['z_toolchange']) + units + ')\n' diff --git a/preprocessors/grbl_11.py b/preprocessors/grbl_11.py index a8a03b88..9fc8676b 100644 --- a/preprocessors/grbl_11.py +++ b/preprocessors/grbl_11.py @@ -37,10 +37,9 @@ class grbl_11(FlatCAMPostProc): gcode += '(Feedrate rapids ' + str(p['feedrate_rapid']) + units + '/min' + ')\n' + '\n' gcode += '(Z_Cut: ' + str(p['z_cut']) + units + ')\n' - if str(p['options']['type']) == 'Geometry': - if p['multidepth'] is True: - gcode += '(DepthPerCut: ' + str(p['z_depthpercut']) + units + ' <=>' + \ - str(math.ceil(abs(p['z_cut']) / p['z_depthpercut'])) + ' passes' + ')\n' + if p['multidepth'] is True: + gcode += '(DepthPerCut: ' + str(p['z_depthpercut']) + units + ' <=>' + \ + str(math.ceil(abs(p['z_cut']) / p['z_depthpercut'])) + ' passes' + ')\n' gcode += '(Z_Move: ' + str(p['z_move']) + units + ')\n' gcode += '(Z Toolchange: ' + str(p['z_toolchange']) + units + ')\n' diff --git a/preprocessors/line_xyz.py b/preprocessors/line_xyz.py index b3beacdd..b6130729 100644 --- a/preprocessors/line_xyz.py +++ b/preprocessors/line_xyz.py @@ -36,10 +36,9 @@ class line_xyz(FlatCAMPostProc): gcode += '(Feedrate rapids ' + str(p['feedrate_rapid']) + units + '/min' + ')\n' + '\n' gcode += '(Z_Cut: ' + str(p['z_cut']) + units + ')\n' - if str(p['options']['type']) == 'Geometry': - if p['multidepth'] is True: - gcode += '(DepthPerCut: ' + str(p['z_depthpercut']) + units + ' <=>' + \ - str(math.ceil(abs(p['z_cut']) / p['z_depthpercut'])) + ' passes' + ')\n' + if p['multidepth'] is True: + gcode += '(DepthPerCut: ' + str(p['z_depthpercut']) + units + ' <=>' + \ + str(math.ceil(abs(p['z_cut']) / p['z_depthpercut'])) + ' passes' + ')\n' gcode += '(Z_Move: ' + str(p['z_move']) + units + ')\n' gcode += '(Z Toolchange: ' + str(p['z_toolchange']) + units + ')\n'