slic3r.pl 32 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627
  1. #!/usr/bin/env perl
  2. use strict;
  3. use warnings;
  4. BEGIN {
  5. use FindBin;
  6. use lib "$FindBin::Bin/lib";
  7. use local::lib '--no-create', "$FindBin::Bin/local-lib";
  8. }
  9. use File::Basename qw(basename);
  10. use Getopt::Long qw(:config no_auto_abbrev);
  11. use List::Util qw(first);
  12. use POSIX qw(setlocale LC_NUMERIC ceil);
  13. use Slic3r;
  14. use Slic3r::Geometry qw(epsilon X Y Z deg2rad);
  15. use Time::HiRes qw(gettimeofday tv_interval);
  16. $|++;
  17. binmode STDOUT, ':utf8';
  18. binmode STDERR, ':utf8';
  19. $ENV{GDK_BACKEND} = 'x11';
  20. our %opt = ();
  21. my %cli_options = ();
  22. {
  23. my %options = (
  24. 'help' => sub { usage() },
  25. 'version' => sub { print "$Slic3r::VERSION\n"; exit 0 },
  26. 'debug' => \$Slic3r::debug,
  27. 'gui' => \$opt{gui},
  28. 'no-gui' => \$opt{no_gui},
  29. 'o|output=s' => \$opt{output},
  30. 'j|threads=i' => \$opt{threads},
  31. 'save=s' => \$opt{save},
  32. 'load=s@' => \$opt{load},
  33. 'autosave=s' => \$opt{autosave},
  34. 'ignore-nonexistent-config' => \$opt{ignore_nonexistent_config},
  35. 'datadir=s' => \$opt{datadir},
  36. 'export-svg' => \$opt{export_svg},
  37. 'merge|m' => \$opt{merge},
  38. 'repair' => \$opt{repair},
  39. 'cut=f' => \$opt{cut},
  40. 'cut-grid=s' => \$opt{cut_grid},
  41. 'split' => \$opt{split},
  42. 'info' => \$opt{info},
  43. 'scale=f' => \$opt{scale},
  44. 'rotate=f' => \$opt{rotate},
  45. 'duplicate=i' => \$opt{duplicate},
  46. 'duplicate-grid=s' => \$opt{duplicate_grid},
  47. 'print-center=s' => \$opt{print_center},
  48. 'dont-arrange' => \$opt{dont_arrange},
  49. # legacy options, ignored
  50. 'no-plater' => \$opt{no_plater},
  51. 'gui-mode=s' => \$opt{gui_mode},
  52. );
  53. foreach my $opt_key (keys %{$Slic3r::Config::Options}) {
  54. my $cli = $Slic3r::Config::Options->{$opt_key}->{cli} or next;
  55. # allow both the dash-separated option name and the full opt_key
  56. $options{ "$opt_key|$cli" } = \$cli_options{$opt_key};
  57. }
  58. @ARGV = grep !/^-psn_\d/, @ARGV if $^O eq 'darwin';
  59. GetOptions(%options) or usage(1);
  60. warn "--no-plater option is deprecated; ignoring\n" if $opt{no_plater};
  61. warn "--gui-mode option is deprecated (Slic3r now has only Expert Mode); ignoring\n" if $opt{gui_mode};
  62. }
  63. # load configuration files
  64. my @external_configs = ();
  65. if ($opt{load}) {
  66. foreach my $configfile (@{$opt{load}}) {
  67. $configfile = Slic3r::decode_path($configfile);
  68. if (-e Slic3r::encode_path($configfile)) {
  69. push @external_configs, Slic3r::Config->load($configfile);
  70. } elsif (-e Slic3r::encode_path("$FindBin::Bin/$configfile")) {
  71. printf STDERR "Loading $FindBin::Bin/$configfile\n";
  72. push @external_configs, Slic3r::Config->load("$FindBin::Bin/$configfile");
  73. } else {
  74. $opt{ignore_nonexistent_config} or die "Cannot find specified configuration file ($configfile).\n";
  75. }
  76. }
  77. # expand shortcuts before applying, otherwise destination values would be already filled with defaults
  78. $_->normalize for @external_configs;
  79. }
  80. # process command line options
  81. my $cli_config = Slic3r::Config->new_from_cli(%cli_options);
  82. $cli_config->normalize; # expand shortcuts
  83. # save configuration
  84. if ($opt{save}) {
  85. my $config = $cli_config->clone;
  86. $config->apply($_) for @external_configs;
  87. if (@{$config->get_keys} > 0) {
  88. $config->save($opt{save});
  89. } else {
  90. Slic3r::Config->new_from_defaults->save(Slic3r::decode_path($opt{save}));
  91. }
  92. }
  93. # launch GUI
  94. my $gui;
  95. if ((!@ARGV || $opt{gui}) && !$opt{no_gui} && !$opt{save} && eval "require Slic3r::GUI; 1") {
  96. {
  97. no warnings 'once';
  98. $Slic3r::GUI::datadir = Slic3r::decode_path($opt{datadir} // '');
  99. $Slic3r::GUI::autosave = Slic3r::decode_path($opt{autosave} // '');
  100. $Slic3r::GUI::threads = $opt{threads};
  101. }
  102. $gui = Slic3r::GUI->new;
  103. setlocale(LC_NUMERIC, 'C');
  104. $gui->CallAfter(sub {
  105. $gui->{mainframe}->load_config_file($_) for @{$opt{load}};
  106. $gui->{mainframe}->load_config($cli_config);
  107. foreach my $input_file (@ARGV) {
  108. $input_file = Slic3r::decode_path($input_file);
  109. $gui->{mainframe}{plater}->load_file($input_file);
  110. }
  111. });
  112. $gui->MainLoop;
  113. exit;
  114. }
  115. die $@ if $@ && $opt{gui} && !$opt{no_gui};
  116. if (@ARGV) { # slicing from command line
  117. # apply command line config on top of default config
  118. my $config = Slic3r::Config->new_from_defaults;
  119. $config->apply($_) for @external_configs;
  120. $config->apply($cli_config);
  121. $config->validate;
  122. if ($opt{repair}) {
  123. foreach my $file (@ARGV) {
  124. $file = Slic3r::decode_path($file);
  125. die "Repair is currently supported only on STL files\n"
  126. if $file !~ /\.stl$/i;
  127. my $output_file = $file;
  128. $output_file =~ s/\.(stl)$/_fixed.obj/i;
  129. my $tmesh = Slic3r::TriangleMesh->new;
  130. $tmesh->ReadSTLFile($file);
  131. $tmesh->repair;
  132. $tmesh->WriteOBJFile($output_file);
  133. }
  134. exit;
  135. }
  136. if ($opt{cut}) {
  137. foreach my $file (@ARGV) {
  138. $file = Slic3r::decode_path($file);
  139. my $model = Slic3r::Model->read_from_file($file);
  140. $model->add_default_instances;
  141. my $mesh = $model->mesh;
  142. $mesh->translate(0, 0, -$mesh->bounding_box->z_min);
  143. my $upper = Slic3r::TriangleMesh->new;
  144. my $lower = Slic3r::TriangleMesh->new;
  145. $mesh->cut(Z, $opt{cut}, $upper, $lower);
  146. $upper->repair;
  147. $lower->repair;
  148. $upper->write_ascii("${file}_upper.stl")
  149. if $upper->facets_count > 0;
  150. $lower->write_ascii("${file}_lower.stl")
  151. if $lower->facets_count > 0;
  152. }
  153. exit;
  154. }
  155. if ($opt{cut_grid}) {
  156. my ($grid_x, $grid_y) = split /[,x]/, $opt{cut_grid}, 2;
  157. foreach my $file (@ARGV) {
  158. $file = Slic3r::decode_path($file);
  159. my $model = Slic3r::Model->read_from_file($file);
  160. $model->add_default_instances;
  161. my $mesh = $model->mesh;
  162. my $bb = $mesh->bounding_box;
  163. $mesh->translate(0, 0, -$bb->z_min);
  164. my $x_parts = ceil(($bb->size->x - epsilon)/$grid_x);
  165. my $y_parts = ceil(($bb->size->y - epsilon)/$grid_y); #--
  166. for my $i (1..$x_parts) {
  167. my $this = Slic3r::TriangleMesh->new;
  168. if ($i == $x_parts) {
  169. $this = $mesh;
  170. } else {
  171. my $next = Slic3r::TriangleMesh->new;
  172. $mesh->cut(X, $bb->x_min + ($grid_x * $i), $next, $this);
  173. $this->repair;
  174. $next->repair;
  175. $mesh = $next;
  176. }
  177. for my $j (1..$y_parts) {
  178. my $tile = Slic3r::TriangleMesh->new;
  179. if ($j == $y_parts) {
  180. $tile = $this;
  181. } else {
  182. my $next = Slic3r::TriangleMesh->new;
  183. $this->cut(Y, $bb->y_min + ($grid_y * $j), $next, $tile);
  184. $tile->repair;
  185. $next->repair;
  186. $this = $next;
  187. }
  188. $tile->write_ascii("${file}_${i}_${j}.stl");
  189. }
  190. }
  191. }
  192. exit;
  193. }
  194. if ($opt{split}) {
  195. foreach my $file (@ARGV) {
  196. $file = Slic3r::decode_path($file);
  197. my $model = Slic3r::Model->read_from_file($file);
  198. $model->add_default_instances;
  199. my $mesh = $model->mesh;
  200. $mesh->repair;
  201. my $part_count = 0;
  202. foreach my $new_mesh (@{$mesh->split}) {
  203. my $output_file = sprintf '%s_%02d.stl', $file, ++$part_count;
  204. printf "Writing to %s\n", basename($output_file);
  205. $new_mesh->write_binary($output_file);
  206. }
  207. }
  208. exit;
  209. }
  210. while (my $input_file = shift @ARGV) {
  211. $input_file = Slic3r::decode_path($input_file);
  212. my $model;
  213. if ($opt{merge}) {
  214. my @models = map Slic3r::Model->read_from_file($_), $input_file, (splice @ARGV, 0);
  215. $model = Slic3r::Model->merge(@models);
  216. } else {
  217. $model = Slic3r::Model->read_from_file($input_file);
  218. }
  219. $model->repair;
  220. if ($opt{info}) {
  221. $model->print_info;
  222. next;
  223. }
  224. if (defined $opt{duplicate_grid}) {
  225. $opt{duplicate_grid} = [ split /[,x]/, $opt{duplicate_grid}, 2 ];
  226. }
  227. if (defined $opt{print_center}) {
  228. $opt{print_center} = Slic3r::Pointf->new(split /[,x]/, $opt{print_center}, 2);
  229. }
  230. my $sprint = Slic3r::Print::Simple->new(
  231. scale => $opt{scale} // 1,
  232. rotate => deg2rad($opt{rotate} // 0),
  233. duplicate => $opt{duplicate} // 1,
  234. duplicate_grid => $opt{duplicate_grid} // [1,1],
  235. print_center => $opt{print_center},
  236. dont_arrange => $opt{dont_arrange} // 0,
  237. status_cb => sub {
  238. my ($percent, $message) = @_;
  239. printf "=> %s\n", $message;
  240. },
  241. output_file => Slic3r::decode_path($opt{output}),
  242. );
  243. $sprint->apply_config($config);
  244. $sprint->config->set('threads', $opt{threads}) if $opt{threads};
  245. $sprint->set_model($model);
  246. if ($opt{export_svg}) {
  247. $sprint->export_svg;
  248. } else {
  249. my $t0 = [gettimeofday];
  250. $sprint->export_gcode;
  251. # output some statistics
  252. {
  253. my $duration = tv_interval($t0);
  254. printf "Done. Process took %d minutes and %.3f seconds\n",
  255. int($duration/60), ($duration - int($duration/60)*60); # % truncates to integer
  256. }
  257. printf "Filament required: %.1fmm (%.1fcm3)\n",
  258. $sprint->total_used_filament, $sprint->total_extruded_volume/1000;
  259. }
  260. }
  261. } else {
  262. usage(1) unless $opt{save};
  263. }
  264. sub usage {
  265. my ($exit_code) = @_;
  266. my $config = Slic3r::Config->new_from_defaults->as_hash;
  267. my $j = '';
  268. if ($Slic3r::have_threads) {
  269. $j = <<"EOF";
  270. -j, --threads <num> Number of threads to use
  271. EOF
  272. }
  273. print <<"EOF";
  274. Slic3r $Slic3r::VERSION is a STL-to-GCODE translator for RepRap 3D printers
  275. written by Alessandro Ranellucci <aar\@cpan.org> - http://slic3r.org/
  276. Usage: slic3r.pl [ OPTIONS ] [ file.stl ] [ file2.stl ] ...
  277. --help Output this usage screen and exit
  278. --version Output the version of Slic3r and exit
  279. --save <file> Save configuration to the specified file
  280. --load <file> Load configuration from the specified file. It can be used
  281. more than once to load options from multiple files.
  282. --datadir <path> Load and store settings at the given directory.
  283. This is useful for maintaining different profiles or including
  284. configurations from a network storage.
  285. -o, --output <file> File to output gcode to (by default, the file will be saved
  286. into the same directory as the input file using the
  287. --output-filename-format to generate the filename.) If a
  288. directory is specified for this option, the output will
  289. be saved under that directory, and the filename will be
  290. generated by --output-filename-format.
  291. Non-slicing actions (no G-code will be generated):
  292. --repair Repair given STL files and save them as <name>_fixed.obj
  293. --cut <z> Cut given input files at given Z (relative) and export
  294. them as <name>_upper.stl and <name>_lower.stl
  295. --split Split the shells contained in given STL file into several STL files
  296. --info Output information about the supplied file(s) and exit
  297. $j
  298. GUI options:
  299. --gui Forces the GUI launch instead of command line slicing (if you
  300. supply a model file, it will be loaded into the plater)
  301. --no-gui Forces the command line slicing instead of gui.
  302. This takes precedence over --gui if both are present.
  303. --autosave <file> Automatically export current configuration to the specified file
  304. Output options:
  305. --output-filename-format
  306. Output file name format; all config options enclosed in brackets
  307. will be replaced by their values, as well as [input_filename_base]
  308. and [input_filename] (default: $config->{output_filename_format})
  309. --post-process Generated G-code will be processed with the supplied script;
  310. call this more than once to process through multiple scripts.
  311. --export-svg Export a SVG file containing slices instead of G-code.
  312. -m, --merge If multiple files are supplied, they will be composed into a single
  313. print rather than processed individually.
  314. Printer options:
  315. --nozzle-diameter Diameter of nozzle in mm (default: $config->{nozzle_diameter}->[0])
  316. --print-center Coordinates in mm of the point to center the print around
  317. (default: 100,100)
  318. --z-offset Additional height in mm to add to vertical coordinates
  319. (+/-, default: $config->{z_offset})
  320. --z-steps-per-mm Number of full steps per mm of the Z axis. Experimental feature for
  321. preventing rounding issues.
  322. --gcode-flavor The type of G-code to generate (reprap/teacup/repetier/makerware/sailfish/mach3/machinekit/smoothie/no-extrusion,
  323. default: $config->{gcode_flavor})
  324. --use-relative-e-distances Enable this to get relative E values (default: no)
  325. --use-firmware-retraction Enable firmware-controlled retraction using G10/G11 (default: no)
  326. --use-volumetric-e Express E in cubic millimeters and prepend M200 (default: no)
  327. --gcode-arcs Use G2/G3 commands for native arcs (experimental, not supported
  328. by all firmwares)
  329. --gcode-comments Make G-code verbose by adding comments (default: no)
  330. --vibration-limit Limit the frequency of moves on X and Y axes (Hz, set zero to disable;
  331. default: $config->{vibration_limit})
  332. --pressure-advance Adjust pressure using the experimental advance algorithm (K constant,
  333. set zero to disable; default: $config->{pressure_advance})
  334. Filament options:
  335. --filament-diameter Diameter in mm of your raw filament (default: $config->{filament_diameter}->[0])
  336. --extrusion-multiplier
  337. Change this to alter the amount of plastic extruded. There should be
  338. very little need to change this value, which is only useful to
  339. compensate for filament packing (default: $config->{extrusion_multiplier}->[0])
  340. --temperature Extrusion temperature in degree Celsius, set 0 to disable (default: $config->{temperature}->[0])
  341. --first-layer-temperature Extrusion temperature for the first layer, in degree Celsius,
  342. set 0 to disable (default: same as --temperature)
  343. --bed-temperature Heated bed temperature in degree Celsius, set 0 to disable (default: $config->{bed_temperature})
  344. --first-layer-bed-temperature Heated bed temperature for the first layer, in degree Celsius,
  345. set 0 to disable (default: same as --bed-temperature)
  346. Speed options:
  347. --travel-speed Speed of non-print moves in mm/s (default: $config->{travel_speed})
  348. --perimeter-speed Speed of print moves for perimeters in mm/s (default: $config->{perimeter_speed})
  349. --small-perimeter-speed
  350. Speed of print moves for small perimeters in mm/s or % over perimeter speed
  351. (default: $config->{small_perimeter_speed})
  352. --external-perimeter-speed
  353. Speed of print moves for the external perimeter in mm/s or % over perimeter speed
  354. (default: $config->{external_perimeter_speed})
  355. --infill-speed Speed of print moves in mm/s (default: $config->{infill_speed})
  356. --solid-infill-speed Speed of print moves for solid surfaces in mm/s or % over infill speed
  357. (default: $config->{solid_infill_speed})
  358. --top-solid-infill-speed Speed of print moves for top surfaces in mm/s or % over solid infill speed
  359. (default: $config->{top_solid_infill_speed})
  360. --support-material-speed
  361. Speed of support material print moves in mm/s (default: $config->{support_material_speed})
  362. --support-material-interface-speed
  363. Speed of support material interface print moves in mm/s or % over support material
  364. speed (default: $config->{support_material_interface_speed})
  365. --bridge-speed Speed of bridge print moves in mm/s (default: $config->{bridge_speed})
  366. --gap-fill-speed Speed of gap fill print moves in mm/s (default: $config->{gap_fill_speed})
  367. --first-layer-speed Speed of print moves for bottom layer, expressed either as an absolute
  368. value or as a percentage over normal speeds (default: $config->{first_layer_speed})
  369. Acceleration options:
  370. --perimeter-acceleration
  371. Overrides firmware's default acceleration for perimeters. (mm/s^2, set zero
  372. to disable; default: $config->{perimeter_acceleration})
  373. --infill-acceleration
  374. Overrides firmware's default acceleration for infill. (mm/s^2, set zero
  375. to disable; default: $config->{infill_acceleration})
  376. --bridge-acceleration
  377. Overrides firmware's default acceleration for bridges. (mm/s^2, set zero
  378. to disable; default: $config->{bridge_acceleration})
  379. --first-layer-acceleration
  380. Overrides firmware's default acceleration for first layer. (mm/s^2, set zero
  381. to disable; default: $config->{first_layer_acceleration})
  382. --default-acceleration
  383. Acceleration will be reset to this value after the specific settings above
  384. have been applied. (mm/s^2, set zero to disable; default: $config->{default_acceleration})
  385. Accuracy options:
  386. --layer-height Layer height in mm (default: $config->{layer_height})
  387. --first-layer-height Layer height for first layer (mm or %, default: $config->{first_layer_height})
  388. --infill-every-layers
  389. Infill every N layers (default: $config->{infill_every_layers})
  390. --solid-infill-every-layers
  391. Force a solid layer every N layers (default: $config->{solid_infill_every_layers})
  392. Print options:
  393. --perimeters Number of perimeters/horizontal skins (range: 0+, default: $config->{perimeters})
  394. --top-solid-layers Number of solid layers to do for top surfaces (range: 0+, default: $config->{top_solid_layers})
  395. --bottom-solid-layers Number of solid layers to do for bottom surfaces (range: 0+, default: $config->{bottom_solid_layers})
  396. --min-shell-thickness Minimum thickness of all solid shells (range: 0+, default: 0)
  397. --solid-layers Shortcut for setting the two options above at once
  398. --fill-density Infill density (range: 0%-100%, default: $config->{fill_density}%)
  399. --fill-angle Infill angle in degrees (range: 0-90, default: $config->{fill_angle})
  400. --fill-pattern Pattern to use to fill non-solid layers (default: $config->{fill_pattern})
  401. --fill-gaps Fill gaps with single passes (default: yes)
  402. --external-infill-pattern Pattern to use to fill solid layers.
  403. (Shortcut for --top-infill-pattern and --bottom-infill-pattern)
  404. --top-infill-pattern Pattern to use to fill top solid layers (default: $config->{top_infill_pattern})
  405. --bottom-infill-pattern Pattern to use to fill bottom solid layers (default: $config->{bottom_infill_pattern})
  406. --start-gcode Load initial G-code from the supplied file. This will overwrite
  407. the default command (home all axes [G28]).
  408. --end-gcode Load final G-code from the supplied file. This will overwrite
  409. the default commands (turn off temperature [M104 S0],
  410. home X axis [G28 X], disable motors [M84]).
  411. --before-layer-gcode Load before-layer-change G-code from the supplied file (default: nothing).
  412. --layer-gcode Load layer-change G-code from the supplied file (default: nothing).
  413. --toolchange-gcode Load tool-change G-code from the supplied file (default: nothing).
  414. --seam-position Position of loop starting points (random/nearest/aligned, default: $config->{seam_position}).
  415. --external-perimeters-first Reverse perimeter order. (default: no)
  416. --perimeter-loop Join the perimeters in a unique loop (default: no)
  417. --perimeter-loop-seam Position of the perimeter loop switching points (nearest/rear), default: $config->{perimeter_loop_seam}).
  418. --spiral-vase Experimental option to raise Z gradually when printing single-walled vases
  419. (default: no)
  420. --only-retract-when-crossing-perimeters
  421. Disable retraction when travelling between infill paths inside the same island.
  422. (default: no)
  423. --solid-infill-below-area
  424. Force solid infill when a region has a smaller area than this threshold
  425. (mm^2, default: $config->{solid_infill_below_area})
  426. --infill-only-where-needed
  427. Only infill under ceilings (default: no)
  428. --infill-first Make infill before perimeters (default: no)
  429. Quality options (slower slicing):
  430. --extra-perimeters Add more perimeters when needed (default: yes)
  431. --avoid-crossing-perimeters Optimize travel moves so that no perimeters are crossed (default: no)
  432. --thin-walls Detect single-width walls (default: yes)
  433. --detect-bridging-perimeters Detect bridging perimeters and apply bridge flow, speed and fan
  434. (default: yes)
  435. Support material options:
  436. --support-material Generate support material for overhangs
  437. --support-material-threshold
  438. Overhang threshold angle (range: 0-90, set 0 for automatic detection,
  439. default: $config->{support_material_threshold})
  440. --support-material-pattern
  441. Pattern to use for support material (default: $config->{support_material_pattern})
  442. --support-material-spacing
  443. Spacing between pattern lines (mm, default: $config->{support_material_spacing})
  444. --support-material-pillar-size
  445. Size of the pillars in the pillar support pattern (default: $config->{support_material_pillar_size})
  446. --support-material-pillar-spacing
  447. Spacing between the pillars in the pillar support pattern (default: $config->{support_material_pillar_spacing})
  448. --support-material-angle
  449. Support material angle in degrees (range: 0-90, default: $config->{support_material_angle})
  450. --support-material-contact-distance
  451. Vertical distance between object and support material (0+, default: $config->{support_material_contact_distance})
  452. --support-material-interface-layers
  453. Number of perpendicular layers between support material and object (0+, default: $config->{support_material_interface_layers})
  454. --support-material-interface-spacing
  455. Spacing between interface pattern lines (mm, set 0 to get a solid layer, default: $config->{support_material_interface_spacing})
  456. --raft-layers Number of layers to raise the printed objects by (range: 0+, default: $config->{raft_layers})
  457. --support-material-enforce-layers
  458. Enforce support material on the specified number of layers from bottom,
  459. regardless of --support-material and threshold (0+, default: $config->{support_material_enforce_layers})
  460. --support-material-buildplate-only
  461. Only create support if it lies on a build plate. Don't create support on a print. (default: no)
  462. --dont-support-bridges
  463. Experimental option for preventing support material from being generated under bridged areas (default: yes)
  464. Retraction options:
  465. --retract-length Length of retraction in mm when pausing extrusion (default: $config->{retract_length}[0])
  466. --retract-speed Speed for retraction in mm/s (default: $config->{retract_speed}[0])
  467. --retract-restart-extra
  468. Additional amount of filament in mm to push after
  469. compensating retraction (default: $config->{retract_restart_extra}[0])
  470. --retract-before-travel
  471. Only retract before travel moves of this length in mm (default: $config->{retract_before_travel}[0])
  472. --retract-lift Lift Z by the given distance in mm when retracting (default: $config->{retract_lift}[0])
  473. --retract-lift-above Only lift Z when above the specified height (default: $config->{retract_lift_above}[0])
  474. --retract-lift-below Only lift Z when below the specified height (default: $config->{retract_lift_below}[0])
  475. --retract-layer-change
  476. Enforce a retraction before each Z move (default: no)
  477. --wipe Wipe the nozzle while doing a retraction (default: no)
  478. Retraction options for multi-extruder setups:
  479. --retract-length-toolchange
  480. Length of retraction in mm when disabling tool (default: $config->{retract_length_toolchange}[0])
  481. --retract-restart-extra-toolchange
  482. Additional amount of filament in mm to push after
  483. switching tool (default: $config->{retract_restart_extra_toolchange}[0])
  484. Cooling options:
  485. --cooling Enable fan and cooling control
  486. --min-fan-speed Minimum fan speed (default: $config->{min_fan_speed}%)
  487. --max-fan-speed Maximum fan speed (default: $config->{max_fan_speed}%)
  488. --bridge-fan-speed Fan speed to use when bridging (default: $config->{bridge_fan_speed}%)
  489. --fan-below-layer-time Enable fan if layer print time is below this approximate number
  490. of seconds (default: $config->{fan_below_layer_time})
  491. --slowdown-below-layer-time Slow down if layer print time is below this approximate number
  492. of seconds (default: $config->{slowdown_below_layer_time})
  493. --min-print-speed Minimum print speed (mm/s, default: $config->{min_print_speed})
  494. --disable-fan-first-layers Disable fan for the first N layers (default: $config->{disable_fan_first_layers})
  495. --fan-always-on Keep fan always on at min fan speed, even for layers that don't need
  496. cooling
  497. Skirt options:
  498. --skirts Number of skirts to draw (0+, default: $config->{skirts})
  499. --skirt-distance Distance in mm between innermost skirt and object
  500. (default: $config->{skirt_distance})
  501. --skirt-height Height of skirts to draw (expressed in layers, 0+, default: $config->{skirt_height})
  502. --min-skirt-length Generate no less than the number of loops required to consume this length
  503. of filament on the first layer, for each extruder (mm, 0+, default: $config->{min_skirt_length})
  504. --brim-width Width of the brim that will get added to each object to help adhesion
  505. (mm, default: $config->{brim_width})
  506. --interior-brim-width Width of the brim that will get printed inside object holes to help adhesion
  507. (mm, default: $config->{interior_brim_width})
  508. Transform options:
  509. --scale Factor for scaling input object (default: 1)
  510. --rotate Rotation angle in degrees (0-360, default: 0)
  511. --duplicate Number of items with auto-arrange (1+, default: 1)
  512. --duplicate-grid Number of items with grid arrangement (default: 1,1)
  513. --duplicate-distance Distance in mm between copies (default: $config->{duplicate_distance})
  514. --dont-arrange Don't arrange the objects on the build plate. The model coordinates
  515. define the absolute positions on the build plate.
  516. The option --print-center will be ignored.
  517. --xy-size-compensation
  518. Grow/shrink objects by the configured absolute distance (mm, default: $config->{xy_size_compensation})
  519. Sequential printing options:
  520. --complete-objects When printing multiple objects and/or copies, complete each one before
  521. starting the next one; watch out for extruder collisions (default: no)
  522. --extruder-clearance-radius Radius in mm above which extruder won't collide with anything
  523. (default: $config->{extruder_clearance_radius})
  524. --extruder-clearance-height Maximum vertical extruder depth; i.e. vertical distance from
  525. extruder tip and carriage bottom (default: $config->{extruder_clearance_height})
  526. Miscellaneous options:
  527. --notes Notes to be added as comments to the output file
  528. --resolution Minimum detail resolution (mm, set zero for full resolution, default: $config->{resolution})
  529. Flow options (advanced):
  530. --extrusion-width Set extrusion width manually; it accepts either an absolute value in mm
  531. (like 0.65) or a percentage over layer height (like 200%)
  532. --first-layer-extrusion-width
  533. Set a different extrusion width for first layer
  534. --perimeter-extrusion-width
  535. Set a different extrusion width for perimeters
  536. --external-perimeter-extrusion-width
  537. Set a different extrusion width for external perimeters
  538. --infill-extrusion-width
  539. Set a different extrusion width for infill
  540. --solid-infill-extrusion-width
  541. Set a different extrusion width for solid infill
  542. --top-infill-extrusion-width
  543. Set a different extrusion width for top infill
  544. --support-material-extrusion-width
  545. Set a different extrusion width for support material
  546. --infill-overlap Overlap between infill and perimeters (default: $config->{infill_overlap})
  547. --bridge-flow-ratio Multiplier for extrusion when bridging (> 0, default: $config->{bridge_flow_ratio})
  548. Multiple extruder options:
  549. --extruder-offset Offset of each extruder, if firmware doesn't handle the displacement
  550. (can be specified multiple times, default: 0x0)
  551. --perimeter-extruder
  552. Extruder to use for perimeters and brim (1+, default: $config->{perimeter_extruder})
  553. --infill-extruder Extruder to use for infill (1+, default: $config->{infill_extruder})
  554. --solid-infill-extruder Extruder to use for solid infill (1+, default: $config->{solid_infill_extruder})
  555. --support-material-extruder
  556. Extruder to use for support material, raft and skirt (1+, default: $config->{support_material_extruder})
  557. --support-material-interface-extruder
  558. Extruder to use for support material interface (1+, default: $config->{support_material_interface_extruder})
  559. --ooze-prevention Drop temperature and park extruders outside a full skirt for automatic wiping
  560. (default: no)
  561. --standby-temperature-delta
  562. Temperature difference to be applied when an extruder is not active and
  563. --ooze-prevention is enabled (default: $config->{standby_temperature_delta})
  564. EOF
  565. exit ($exit_code || 0);
  566. }
  567. __END__