Jump to content

Visualize seam


hpek

Recommended Posts

Posted · Visualize seam

I made a perl script to visualize the seam. I am posting it here, just if someone else can find it useful. The script takes gcode as input and output new gcode. Load the new gcode in Cura - do not send this new gcode to your printer.

Old feature request:

https://github.com/Ultimaker/Cura/issues/2287

Example output:

488007942_Screenshot2020-05-03at19_49_49.thumb.png.8edd65c48d922f521d4cd59b6807b4f9.png1870688545_Screenshot2020-05-03at19_48_13.thumb.png.98d4ef63f0d89f261d93db60dbdad148.png

Terminal usage example:

cat Vise_Handle.gcode|./visualizeSeam.pl>Vise_Handle_Seam.gcode

 

Script:

 

#!/usr/bin/perl

$inOuterWall = 0;
$isTraveling = 0;
$isFirstLine = 1;
while(<STDIN>)
{

  if(/^;TYPE:WALL-OUTER/){$inOuterWall = 1; $isFirstLine = 1; $_ = scalar <STDIN>;}     #Enter outer wall
  if(/^;TYPE:/ && !/^;TYPE:WALL-OUTER/){$inOuterWall = 0;}                              #Exit outer wall
  if(/^G0/){$isTraveling = 1;}                                                          #Traveling
  if(/^G1.*X/ && $inOuterWall && $isTraveling){$isTraveling = 0; $isFirstLine = 1;}     #New part of outer wall

  if($inOuterWall && $isFirstLine){
    print ";TYPE:SKIRT\n";
    print "G91\n";
    print "G0 X0.1 Y0.1\n";
    print "G1 X-0.2 Y0.0 E1\n";
    print "G1 X0.0 Y-0.2 E1\n";
    print "G1 X0.2 Y0.0 E1\n";
    print "G1 X0.0 Y0.2 E1\n";
    print "G90\n";
    print ";TYPE:WALL-OUTER\n";
    print $prevPrevLine;
    print $prevLine;
    print;
    $isFirstLine = 0;
  }
  else{print;}

  $prevPrevLine = $prevLine;
  $prevLine = $_;
}

 

  • 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...