adjustments in lasercheck

This commit is contained in:
Mario Voigt 2021-11-11 00:34:20 +01:00
parent 2929277f6f
commit 7c3339b111
2 changed files with 25 additions and 20 deletions

View File

@ -59,9 +59,8 @@
<option value="1016x711">1016 x 711 mm (Fusion M2 40)</option> <option value="1016x711">1016 x 711 mm (Fusion M2 40)</option>
<option value="1219x914">1219 x 914 mm (Fusion Pro 48)</option> <option value="1219x914">1219 x 914 mm (Fusion Pro 48)</option>
</param> </param>
<param name="max_cutting_speed" type="float" min="1.000" max="9999.000" precision="2" gui-text="Max. cutting speed (mm/s)">120</param> <param name="max_cutting_speed" type="float" min="1.000" max="9999.000" precision="2" gui-text="Max. cutting speed (mm/s)">120.0</param>
<param name="max_travel_speed" type="float" min="1.000" max="9999.000" precision="2" gui-text="Max. travel speed (mm/s)">500</param> <param name="max_travel_speed" type="float" min="1.000" max="9999.000" precision="2" gui-text="Max. travel speed (mm/s)">500.0</param>
<param name="cut_travel_factor" type="float" min="0.001" max="10.00" precision="3" gui-text="Factor between cutting/travel moves" gui-description="Usually ~60-80% are cutting time, rest is travel time. Set this factor to express the amount of travel time in relation to cutting time.">0.60</param>
<param name="price_per_minute_gross" type="float" min="0.0" max="9999.0" precision="2" gui-text="Price/minute € (gross)">2.0</param> <param name="price_per_minute_gross" type="float" min="0.0" max="9999.0" precision="2" gui-text="Price/minute € (gross)">2.0</param>
<param name="vector_grid_xy" type="float" min="0.0" max="9999.0" precision="2" gui-text="Vector grid (mm)">12.0</param> <param name="vector_grid_xy" type="float" min="0.0" max="9999.0" precision="2" gui-text="Vector grid (mm)">12.0</param>
</page> </page>

View File

@ -16,15 +16,13 @@ class LaserCheck(inkex.EffectExtension):
- check for elements which have the attribute "display:none" (some groups have this) - check for elements which have the attribute "display:none" (some groups have this)
- inx: - inx:
- set speed manually or pick machine (epilog) - travel and cut speed are prefilled then - 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 time estimation for specific speed percentage for for all speeds (100,90, ...)
- select material (parameters -> how to???) - select material (parameters -> how to???)
- select power of CO² source - select power of CO² source
- add fields for additional costs like configuring the machine or grabbing parts out of the machine (weeding), etc. - add fields for additional costs like configuring the machine or grabbing parts out of the machine (weeding), etc.
- add mode select: cut, engrave - 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, ... - add some extra seconds for start, stop, removing parts, attaching material, ...
- maybe remove totalTravelLength and set manually ...
- Handlungsempfehlungen einbauen - Handlungsempfehlungen einbauen
- verweisen auf diverse plugins, die man nutzen kann: - verweisen auf diverse plugins, die man nutzen kann:
- migrate ungrouper - migrate ungrouper
@ -66,9 +64,8 @@ class LaserCheck(inkex.EffectExtension):
pars.add_argument('--tab') pars.add_argument('--tab')
pars.add_argument('--machine_size', default="812x508") pars.add_argument('--machine_size', default="812x508")
pars.add_argument('--max_cutting_speed', type=float, default=500) pars.add_argument('--max_cutting_speed', type=float, default=120)
pars.add_argument('--max_travel_speed', type=float, default=150) pars.add_argument('--max_travel_speed', type=float, default=500)
pars.add_argument('--cut_travel_factor', type=float, default=0.60)
pars.add_argument('--price_per_minute_gross', type=float, default=2.0) pars.add_argument('--price_per_minute_gross', type=float, default=2.0)
pars.add_argument('--vector_grid_xy', type=float, default=12.0) #TODO 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: if so.checks == "check_all" or so.cutting_estimation is True:
inkex.utils.debug("\n---------- Cutting time estimation (Epilog Lasers)") inkex.utils.debug("\n---------- Cutting time estimation (Epilog Lasers)")
totalCuttingLength = 0 totalCuttingLength = 0
pathCount = 0 totalTravelLength = 0
cuttingPathCount = 0
travelPathCount = 0
for element in shapes: for element in shapes:
if isinstance(element, inkex.PathElement): if isinstance(element, inkex.PathElement):
slengths, stotal = csplength(element.path.transform(element.composed_transform()).to_superpath()) slengths, stotal = csplength(element.path.transform(element.composed_transform()).to_superpath())
totalCuttingLength += stotal if "-travelLine" in element.get('id'): #we use that id scheme together with the extension "Draw Directions / Travel Moves"
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 += stotal
totalTravelLength = totalCuttingLength * so.cut_travel_factor travelPathCount += 1
elif "markerId-" in element.get('id'):
pass #we skip the path "markerId-<nr>", possibly generated by the extension "Draw Directions / Travel Moves
else:
totalCuttingLength += stotal
cuttingPathCount += 1
totalLength = totalCuttingLength + totalTravelLength 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("(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("(measured) 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) 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 ''' 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 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]: 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 speedFactorR = speedFactor / 100.0
adjusted_speed = 482.4000 / so.max_cutting_speed #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) / 19.0 #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_cut = so.max_cutting_speed * speedFactorR
v_travel = so.max_travel_speed #this is always at maximum 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 tsec_cut = (self.svg.uutounit(str(totalCuttingLength)) / (adjusted_speed * so.max_cutting_speed * speedFactorR)) * empiric_scale