Tag Archives: CuraEngine

3D Printing: Cura CLI Wrapper (cura-slicer)

Updates:

  • 2021/05/01: 0.0.7: support legacy Cura and --binary=.. to change binary name
  • 2021/03/24: 0.0.5: public release

Introduction

I’m a great admirer of the Ultimaker Cura slicer since years, yet I predominantly have been using CuraEngine on the command-line via Print3r, which hides all the tedious configuration. But it came the point (2021/03) when I needed to have a simpler interface than CuraEngine – hence I wrote Cura CLI Wrapper, the executable cura-slicer looks like prusa-slicer or slic3r and has similar usage.

Speciality is to query all the settings from cura-slicer directly:

% cura-slicer --help
acceleration_enabled = 0 (default)
acceleration_infill = 3000 [mm/s²] (default)
acceleration_ironing = 3000 [mm/s²] (default)
acceleration_layer_0 = 3000 [mm/s²] (default)
acceleration_prime_tower = 3000 [mm/s²] (default)
acceleration_print = 3000 [mm/s²] (default)
acceleration_print_layer_0 = 3000 [mm/s²] (default)
acceleration_roofing = 3000 [mm/s²] (default)
acceleration_skirt_brim = 3000 [mm/s²] (default)
acceleration_support = 3000 [mm/s²] (default)
acceleration_support_bottom = 3000 [mm/s²] (default)
acceleration_support_infill = 3000 [mm/s²] (default)
acceleration_support_interface = 3000 [mm/s²] (default)
acceleration_support_roof = 3000 [mm/s²] (default)
...

which lists ~570 settings as of CuraEngine 4.4.1 and its defaults and from where the defaults come from (definition defaults, config or cli), and you can query also a term e.g. like ‘brim’:

% cura-slicer --help brim
acceleration_skirt_brim = 3000 [mm/s²] (default)
brim_gap = 0 [mm] (default)
brim_line_count = 0 (config)
brim_outside_only = 1 (default)
brim_replaces_support = 1 (default)
brim_width = 8 [mm] (default)
jerk_skirt_brim = 20 [mm/s] (default)
prime_tower_brim_enable = 0 (default)
skirt_brim_line_width = 0.4 [mm] (default)
skirt_brim_material_flow = 100 [%] (default)
skirt_brim_minimal_length = 250 [mm] (default)
skirt_brim_speed = 30 [mm/s] (default)
support_brim_enable = 0 (default)
support_brim_line_count = 20 (default)
support_brim_width = 8 [mm] (default)

and with -v switch you even get a more descriptive output:

% cura-slicer --help brim -v
== acceleration_skirt_brim (Skirt/Brim Acceleration) ==
   The acceleration with which the skirt and brim are printed. Normally this is done with the initial layer acceleration, but sometimes you might want to print the skirt or brim at a different acceleration.
   acceleration_skirt_brim = 3000 [mm/s²] (default)

== brim_gap (Brim Distance) ==
   The horizontal distance between the first brim line and the outline of the first layer of the print. A small gap can make the brim easier to remove while still providing the thermal benefits.
   brim_gap = 0 [mm] (default)

== brim_line_count (Brim Line Count) ==
   The number of lines used for a brim. More brim lines enhance adhesion to the build plate, but also reduces the effective print area.
   brim_line_count = 0 (config)

== brim_outside_only (Brim Only on Outside) ==
   Only print the brim on the outside of the model. This reduces the amount of brim you need to remove afterwards, while it doesn't reduce the bed adhesion that much.
   brim_outside_only = 1 (default)
....

Essentially it makes Cura and CuraEngine easy to use on the command-line and provides a way to learn of the hundreds of settings available.

Usage

USAGE Cura-Slicer 0.0.7 aka Cura-CLI-Wrapper (CuraEngine 4.4.1): [<opts>] <file.stl> ...
   options:
      -v or --verbose         increase verbosity
      -vv or --verbose=2          "       "
      --version               display version of this program and exit
      --load=<config>         load config file
      --load <config>           "         "
      --output=<fn>           set output filename
      --output <fn>             "         "
      -o <fn>                   "         "
      --binary=<exe>          set executable of CuraEngine (default: CuraEngine)
      --version=<v>           set version of CuraEngine (default: 4)
      --<k>=<v>               set CuraEngine settings (keys with '-' will be converted to '_')
      -h or --help            display all settings
      -h or --help <term> ..  display settings matching term

   examples:
      cura-slicer --help
      cura-slicer --help retract
      cura-slicer -hv retract 
      cura-slicer sphere.stl
      cura-slicer overhang.stl --output=sample.gcode
      cura-slicer overhang.stl --layer-height=0.1 --support-enable=true -o sample.gcode

Settings

The user settings reside in ~/.config/cura-slicer/base.ini and will not be overwritten when upgrading Cura-CLI-Wrapper, make your changes there.

The system-wide settings reside in /usr/share/cura-slicer/base.ini and should not be be changed as it will be overwritten when upgrading Cura-CLI-Wrapper.

Download

https://github.com/Spiritdude/Cura-CLI-Wrapper

Examples

% cura-slicer cube.stl
== Cura-Slicer 0.0.3 aka Cura-CLI-Wrapper (CuraEngine 4.4.1) == 
processing cube.stl, slicing to cube.gcode
   took 0.62 secs total, done.

% cura-slicer --support-enable=true overhang-inout.stl
== Cura-Slicer 0.0.3 aka Cura-CLI-Wrapper (CuraEngine 4.4.1) == 
processing overhang-inout.stl, slicing to overhang-inout.gcode
   took 0.99 secs total, done.

References

Whereever I used CuraEngine before in my existing software packages I will switch to Cura-CLI-Wrapper with cura-slicer.

3D Printing: Print3r 0.2.x: Networked Printing

A brief post of my local network for 3d printing with several 3d printers, using print3r CLI (Command Line Interface) tool.

20190218_105541

Physical Setup

20190302_164919Orange Pi Zero (single board ARM-based computer) named printhub running Armbian (Debian-like).

  • Ethernet Port connecting to Ethernet/Wifi Hub with its own subnet (192.168.4.x)
  • External USB 4x Hub connecting 3d printers via USB:
    • Ashtar K 1 (Prusa i3-like, 400 x 300 build plate, 330mm height), 0.5mm nozzle (/dev/ttyUSB2)
    • Ashtar K 2 (300 x 300 build plate, 330mm height), 0.4mm nozzle (/dev/ttyUSB1)
    • Ashtar C 1 (CoreXY, 400 x 400 build plate, 380mm height), 0.4mm nozzle (/dev/ttyUSB0)
    • CTC DIY I3 Pro (Y3228), 0.4mm nozzle (/dev/ttyUSB3)

The workstation from which I print from (design and slice) is also connected via Ethernet. The printed violet PLA case I published a while ago on Thingiverse: Orange Pi Zero Case.

Preparation

On printhub (Orange Pi Zero) starting all the network clients processes:

% print3r /dev/ttyUSB0 client &
% print3r /dev/ttyUSB1 client &
% print3r /dev/ttyUSB2 client &
% print3r /dev/ttyUSB3 client &

Usage

On my workstation (a laptop), referencing printer profiles and devices:

% print3r --device=tcp:printhub:0 --printer=ashtar-c-1 print cube.stl
% print3r --device=tcp:printhub:1 --printer=ashtar-k-2 print cube.stl
% print3r --device=tcp:printhub:2 --printer=ashtar-k-1 print cube.stl
% print3r --device=tcp:printhub:3 --printer=y3228 print cube.stl

See Print3r Wiki: Remote Printing for more details.

The CTC I3 Pro B Y3228 low cost printer still runs Marlin 1.0 and 250,000 baudrate which won’t work with ser2net which print3r uses internally to print in network environment, so it needs to be flashed first with newer firmware, so it can be networked as well with common baudrate like 230,400. I upgraded the ~1 year old “CTC DIY I3 Pro B” 3d printer to Marlin 1.1.8 finally, first burning a bootloader with an Arduino Uno, and then properly configured Marlin, and now runs with 115,000 baudrate as well, so it can be networked as well.

Otherwise I stopped using Cura GUI or Slic3r GUI completely, and solely use print3r to first preview the Gcode, sliced with CuraEngine or Slic3r, and then print the parts, and because it runs on the command line, all the previous calls in the terminal are stored as history therefore I can scroll back (cursor-up/down) and repeat a job with slightly changed settings by editing the command line – something which GUI doesn’t offer, unless you save a printjob as .3mf and reload it and click around and change settings and save again as .3mf etc.

Command Inline OpenSCAD

Further, I often code OpenSCAD code directly with print3r for simple parts, e.g. caps for M6 threaded rods, something like:

20190225_090931

% print3r --device=tcp:printhub:0 --printer=ashtar-c-1 --random-placement --scad print 
"difference(){cylinder(d=8.4,h=10);translate([0,0,2])cylinder(d=6.4,h=10);}"

and if the print came out well, I add --multiply-part=3 or so.

Download & Install Print3r

github.com/Spiritdude/Print3r

 

That’s it for now.

 

3D Printing: Print3r 0.1.6 Release

Following major changes of 0.0.9 to 0.1.6 regarding Print3r (command line tool for 3d printing):

Multiple Slicers Support

Now print3r natively supports 4 different Open Source slicers:

  • Slic3r (slic3r)
  • Slic3r PE (Prusa Edition) (slic3r-pe)
  • CuraEngine Legacy (15.04) (cura-legacy)
  • CuraEngine (3.5.x) (cura)

which can be set with --slicer=<slicer> on the command line.

Slicer Independent Settings

Starting with 0.1.0 print3r provides a slicer-independent layer with a growing list of settings:

  • temperature
  • nozzle-diameter
  • filament-diameter
  • bed-temperature
  • etc.

Full list of settings you find at Print3r Github Wiki.

Slicer Specific Settings

Yet, if you must, you can still use slicer-specific settings to fine-tune settings according your print needs and printer capabilities.

Macros (other Profiles)

For often used settings like print quality, or filament settings, you can gather those settings and reference them in the command line like:

% print3r @filament/prusament @thin @hollow cube.scad

Quality Presets:

  • @coarse
  • @medium
  • @fine

Infill/Wall/Perimeter Presets:

  • @heavy
  • @light
  • @feather

OpenSCAD Integration

print3r already supported to print or slice .scad files,

% print3r print cube.scad

and now since 0.1.6 also following command line code integration is possible:

% print3r --scad print "cube(20)"
% print3r --scadlib=washer.scad --scad print "washer(5)"
% print3r --scadlib=parts.scad --scad "c_2020()" "edge_idler()"

Arbitrary Baudrate

Since 0.1.0 also arbitrary baudrate like 250000 (default of Marlin) is supported (Linux only, other platforms not yet), aside the common 115200.

Preview

As external Gcode viewer for preview command yagv is used, a very basic viewer – at a later time it might be replaced.

% print3r preview cube.scad

which converts, slices and preview the Gcode.

Extensive Documentation

Since the functionality of print3r is growing steadily, the requirement for proper documenation demanded its own Print3r Wiki where you find up-to-date information.

Download

https://github.com/Spiritdude/Print3r