From 7c3339b1111d07cb4ce675fd06378443b5014cf7 Mon Sep 17 00:00:00 2001 From: Mario Voigt Date: Thu, 11 Nov 2021 00:34:20 +0100 Subject: [PATCH] adjustments in lasercheck --- .../laser_check/laser_check.inx | 5 +-- .../fablabchemnitz/laser_check/laser_check.py | 40 +++++++++++-------- 2 files changed, 25 insertions(+), 20 deletions(-) diff --git a/extensions/fablabchemnitz/laser_check/laser_check.inx b/extensions/fablabchemnitz/laser_check/laser_check.inx index 79e4277a..3fa8db53 100644 --- a/extensions/fablabchemnitz/laser_check/laser_check.inx +++ b/extensions/fablabchemnitz/laser_check/laser_check.inx @@ -59,9 +59,8 @@ - 120 - 500 - 0.60 + 120.0 + 500.0 2.0 12.0 diff --git a/extensions/fablabchemnitz/laser_check/laser_check.py b/extensions/fablabchemnitz/laser_check/laser_check.py index dd343959..4b08c852 100644 --- a/extensions/fablabchemnitz/laser_check/laser_check.py +++ b/extensions/fablabchemnitz/laser_check/laser_check.py @@ -16,15 +16,13 @@ class LaserCheck(inkex.EffectExtension): - check for elements which have the attribute "display:none" (some groups have this) - inx: - set speed manually or pick machine (epilog) - travel and cut speed are prefilled then - - calculate cut estimation with linear or non-linear (epiloog) speeds > select formula or like this + - calculate cut estimation with linear or non-linear (epilog) speeds > select formula or like this - select time estimation for specific speed percentage for for all speeds (100,90, ...) - select material (parameters -> how to???) - select power of CO² source - add fields for additional costs like configuring the machine or grabbing parts out of the machine (weeding), etc. - add mode select: cut, engrave - - look for lines especially containing id "travelLines-" and sum up travel lines - add some extra seconds for start, stop, removing parts, attaching material, ... - - maybe remove totalTravelLength and set manually ... - Handlungsempfehlungen einbauen - verweisen auf diverse plugins, die man nutzen kann: - migrate ungrouper @@ -66,9 +64,8 @@ class LaserCheck(inkex.EffectExtension): pars.add_argument('--tab') pars.add_argument('--machine_size', default="812x508") - pars.add_argument('--max_cutting_speed', type=float, default=500) - pars.add_argument('--max_travel_speed', type=float, default=150) - pars.add_argument('--cut_travel_factor', type=float, default=0.60) + pars.add_argument('--max_cutting_speed', type=float, default=120) + pars.add_argument('--max_travel_speed', type=float, default=500) pars.add_argument('--price_per_minute_gross', type=float, default=2.0) pars.add_argument('--vector_grid_xy', type=float, default=12.0) #TODO @@ -573,27 +570,36 @@ class LaserCheck(inkex.EffectExtension): if so.checks == "check_all" or so.cutting_estimation is True: inkex.utils.debug("\n---------- Cutting time estimation (Epilog Lasers)") totalCuttingLength = 0 - pathCount = 0 + totalTravelLength = 0 + cuttingPathCount = 0 + travelPathCount = 0 + for element in shapes: if isinstance(element, inkex.PathElement): slengths, stotal = csplength(element.path.transform(element.composed_transform()).to_superpath()) - totalCuttingLength += stotal - pathCount += 1 #each path has one start and one end (if open path) or start=end on closed path. For cutting the we calculate with 2 points because we enter and leave each path ALWAYS - totalTravelLength = totalCuttingLength * so.cut_travel_factor + if "-travelLine" in element.get('id'): #we use that id scheme together with the extension "Draw Directions / Travel Moves" + totalTravelLength += stotal + travelPathCount += 1 + elif "markerId-" in element.get('id'): + pass #we skip the path "markerId-", possibly generated by the extension "Draw Directions / Travel Moves + else: + totalCuttingLength += stotal + cuttingPathCount += 1 totalLength = totalCuttingLength + totalTravelLength - inkex.utils.debug("total paths={}".format(pathCount)) + inkex.utils.debug("total cutting paths={}".format(cuttingPathCount)) + inkex.utils.debug("total travel paths={}".format(travelPathCount)) inkex.utils.debug("(measured) cutting length (mm) = {:0.2f} mm".format(self.svg.uutounit(str(totalCuttingLength), "mm"), self.svg.uutounit(str(totalCuttingLength), "mm"))) - inkex.utils.debug("(estimated) travel length (mm) = {:0.2f} mm".format(self.svg.uutounit(str(totalTravelLength), "mm"), self.svg.uutounit(str(totalTravelLength), "mm"))) - inkex.utils.debug("(estimated) total length (mm) = {:0.2f} mm".format(self.svg.uutounit(str(totalLength), "mm"), self.svg.uutounit(str(totalLength), "mm"))) + inkex.utils.debug("(measured) travel length (mm) = {:0.2f} mm".format(self.svg.uutounit(str(totalTravelLength), "mm"), self.svg.uutounit(str(totalTravelLength), "mm"))) + inkex.utils.debug("(measured) total length (mm) = {:0.2f} mm".format(self.svg.uutounit(str(totalLength), "mm"), self.svg.uutounit(str(totalLength), "mm"))) ''' from https://www.epiloglaser.com/assets/downloads/fusion-material-settings.pdf - Speed Settings: The speed setting scale of 1% to 100% is not linear – + "Speed Settings: The speed setting scale of 1% to 100% is not linear – i.e. 100% speed will not be twice as fast as 50% speed. This non-linear - scale is very useful in compensating for the different factors that affect engraving time. + scale is very useful in compensating for the different factors that affect engraving time." ''' for speedFactor in [100,90,80,70,60,50,40,30,20,10,9,8,7,6,5,4,3,2,1]: speedFactorR = speedFactor / 100.0 - adjusted_speed = 482.4000 / so.max_cutting_speed #empiric - found out by trying for hours ... - empiric_scale = 1 + (speedFactorR**2) / 19.0 #empiric - found out by trying for hours ... + adjusted_speed = 480.0 / so.max_cutting_speed #empiric - found out by trying for hours ... + empiric_scale = 1 + (speedFactorR**2) / 15.25 #empiric - found out by trying for hours ... v_cut = so.max_cutting_speed * speedFactorR v_travel = so.max_travel_speed #this is always at maximum tsec_cut = (self.svg.uutounit(str(totalCuttingLength)) / (adjusted_speed * so.max_cutting_speed * speedFactorR)) * empiric_scale