slic3r.pl 32 KB

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