Slic3r.pm 1.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061
  1. #/|/ Copyright (c) Prusa Research 2016 - 2022 Vojtěch Bubník @bubnikv, Tomáš Mészáros @tamasmeszaros, Vojtěch Král @vojtechkral, Oleksandra Iushchenko @YuSanka
  2. #/|/ Copyright (c) 2018 Martin Loidl @LoidlM
  3. #/|/ Copyright (c) Slic3r 2011 - 2016 Alessandro Ranellucci @alranel
  4. #/|/ Copyright (c) 2012 Henrik Brix Andersen @henrikbrixandersen
  5. #/|/ Copyright (c) 2012 Mark Hindess
  6. #/|/ Copyright (c) 2012 Michael Moon
  7. #/|/ Copyright (c) 2011 Clarence Risher
  8. #/|/
  9. #/|/ PrusaSlicer is released under the terms of the AGPLv3 or higher
  10. #/|/
  11. # This package loads all the non-GUI Slic3r perl packages.
  12. package Slic3r;
  13. # Copyright holder: Alessandro Ranellucci
  14. # This application is licensed under the GNU Affero General Public License, version 3
  15. use strict;
  16. use warnings;
  17. use Config;
  18. require v5.10;
  19. our $VERSION = VERSION();
  20. our $BUILD = BUILD();
  21. our $FORK_NAME = FORK_NAME();
  22. our $debug = 0;
  23. sub debugf {
  24. printf @_ if $debug;
  25. }
  26. our $loglevel = 0;
  27. BEGIN {
  28. $debug = 1 if (defined($ENV{'SLIC3R_DEBUGOUT'}) && $ENV{'SLIC3R_DEBUGOUT'} == 1);
  29. print "Debugging output enabled\n" if $debug;
  30. }
  31. use FindBin;
  32. use Moo 1.003001;
  33. use Slic3r::XS; # import all symbols (constants etc.) before they get parsed
  34. use Slic3r::Config;
  35. use Slic3r::GCode::Reader;
  36. use Slic3r::Line;
  37. use Slic3r::Model;
  38. use Slic3r::Point;
  39. use Slic3r::Polygon;
  40. use Slic3r::Polyline;
  41. our $build = eval "use Slic3r::Build; 1";
  42. # Scaling between the float and integer coordinates.
  43. # Floats are in mm.
  44. use constant SCALING_FACTOR => 0.000001;
  45. # Set the logging level at the Slic3r XS module.
  46. $Slic3r::loglevel = (defined($ENV{'SLIC3R_LOGLEVEL'}) && $ENV{'SLIC3R_LOGLEVEL'} =~ /^[1-9]/) ? $ENV{'SLIC3R_LOGLEVEL'} : 0;
  47. set_logging_level($Slic3r::loglevel);
  48. 1;