DSF 2.1.0 and Recent versions of Prusa Slicer



  • Recent versions of Prusa Slicer (I'm using version 2.2.0) insert the estimated print time in the form of a comment that looks like this:

    ; estimated printing time (normal mode) = 38m 31s
    

    dsf 2.1.0 contains the following regular expression:

    "estimated printing time = ((?<h>(\d+))h\s*)?((?<m>(\d+))m\s*)?((?<s>(\d+))s)?"
    

    but this does not work with recent versions of PS (because of the extra "(normal mode)", not inserted in earlier versions). A modified version that does match (and that should still match older strings) is:

    "estimated printing time .*= ((?<h>(\d+))h\s*)?((?<m>(\d+))m\s*)?((?<s>(\d+))s)?"
    

    Note the additional ".*" just before "="

    In addition it is common for the start up gcode used with this version of PS to contain the following line:

    M221 S{if layer_height<0.075}100{else}95{endif}
    

    This line gets included in the gcode file (as a comment) by PS, but it causes a false match against the DSF layer height matching regular expression:

    "\slayer_height\D+(?<mm>(\d+\.?\d*))"
    

    and results in the layer height being shown as 0.07mm rather than the correct 0.20mm. The following modified version seems to avoid the false positive and returns the correct layer height:

    ";\slayer_height\D+(?<mm>(\d+\.?\d*))"
    

    Note the extra ";" at the start of the string.

    I've tested the above modified expressions with a number of versions of PS (going back a year or so) and it seems to match values correctly in generated files.


Log in to reply