Jump to content

PostProcessingPlugIn layer issue


JCD

Recommended Posts

Posted · PostProcessingPlugIn layer issue

I use Cura 3.3.1 and I try to create a plugIn by modifying the SearchAndReplace.py file

 

Everything works fine except that there is a problem in the layer "parsing" by the script

 

In the execute function I add a new line (the last line but one)

    def execute(self, data):
        search_string = self.getSettingValueByKey("search")
        if not self.getSettingValueByKey("is_regex"):
            search_string = re.escape(search_string) #Need to search for the actual string, not as a regex.
        search_regex = re.compile(search_string)

        replace_string = self.getSettingValueByKey("replace")

        for layer_number, layer in enumerate(data):
            data[layer_number] = re.sub(search_regex, replace_string, layer) #Replace all.
            data[layer_number] = ("JCD >>> %d \n" %  layer_number)  +  data[layer_number] # !!!! new line added
        return data

the result on the GCode file is not consistent

At the begining of the file there are 2 "layers"

 

beginning of the post processed GCode OK
JCD >>> 0 
;FLAVOR:Marlin
;TIME:249
;Filament used: 0.194653m
;Layer height: 0.2
;POSTPROCESSED
JCD >>> 1 
;Generated with Cura_SteamEngine 3.3.1
... 
;LAYER_COUNT:28
JCD >>> 2 
;JCDLAYER:0
...
then OK (difference of 2 between layer number-postPocess parsing- and LAYER number -slicing-up to LAYER 21

layer 21 OK
;TIME_ELAPSED:215.547436
JCD >>> 23 
;LAYER:21

layer 22 not detected ! no new line inserted before the ;LAYER:22 line
;TIME_ELAPSED:222.765224
;LAYER:22

layer 23 OK but the difference now is only one
;TIME_ELAPSED:228.186561
JCD >>> 24 
;JCDLAYER:23

 What is the problem ?

jeton27.stl

  • Link to post
    Share on other sites

    Posted · PostProcessingPlugIn layer issue

    just an information, my question is about the "skipping" of the 22nd layer, the first two are useful (introduction and start GCode)

  • Link to post
    Share on other sites

    Posted · PostProcessingPlugIn layer issue

    I've found the same problem on a simple cube

    I changed the height od the cube (hence the number of layers)

    On every try, if the total number of sliced layers is n the skipped layer is always n-4  (100 >>>96 ; 26 >>> 22 and so on)

    I tried to modify the top thickness but it doesn't change anything

     

    It seems like a bug, so beware if you're postProcessing to check for the ;LAYER:XX line if you're looking for a modification on each layer !!

  • Link to post
    Share on other sites

    Create an account or sign in to comment

    You need to be a member in order to leave a comment

    Create an account

    Sign up for a new account in our community. It's easy!

    Register a new account

    Sign in

    Already have an account? Sign in here.

    Sign In Now
    • Our picks

      • UltiMaker Cura 5.7 stable released
        Cura 5.7 is here and it brings a handy new workflow improvement when using Thingiverse and Cura together, as well as additional capabilities for Method series printers, and a powerful way of sharing print settings using new printer-agnostic project files! Read on to find out about all of these improvements and more. 
         
          • Like
        • 18 replies
      • S-Line Firmware 8.3.0 was released Nov. 20th on the "Latest" firmware branch.
        (Sorry, was out of office when this released)

        This update is for...
        All UltiMaker S series  
        New features
         
        Temperature status. During print preparation, the temperatures of the print cores and build plate will be shown on the display. This gives a better indication of the progress and remaining wait time. Save log files in paused state. It is now possible to save the printer's log files to USB if the currently active print job is paused. Previously, the Dump logs to USB option was only enabled if the printer was in idle state. Confirm print removal via Digital Factory. If the printer is connected to the Digital Factory, it is now possible to confirm the removal of a previous print job via the Digital Factory interface. This is useful in situations where the build plate is clear, but the operator forgot to select Confirm removal on the printer’s display. Visit this page for more information about this feature.
          • Like
        • 0 replies
    ×
    ×
    • Create New...