├── .github ├── CODEOWNERS ├── CONTRIBUTING.md ├── ISSUE_TEMPLATE.md └── ISSUE_TEMPLATE │ ├── bug_report.md │ ├── feature_request.md │ └── old-slic3r-issue-template.md ├── .gitignore ├── .travis.yml ├── Build.PL ├── LICENSE ├── README.md ├── appveyor.yml ├── lib ├── Slic3r.pm └── Slic3r │ ├── Config.pm │ ├── ExPolygon.pm │ ├── ExtrusionLoop.pm │ ├── ExtrusionPath.pm │ ├── Flow.pm │ ├── GCode │ ├── ArcFitting.pm │ ├── MotionPlanner.pm │ ├── PressureRegulator.pm │ ├── Reader.pm │ └── VibrationLimit.pm │ ├── GUI.pm │ ├── GUI │ ├── 2DBed.pm │ ├── 3DScene.pm │ ├── AboutDialog.pm │ ├── BedShapeDialog.pm │ ├── BonjourBrowser.pm │ ├── ColorScheme.pm │ ├── ConfigWizard.pm │ ├── Controller.pm │ ├── Controller │ │ ├── ManualControlDialog.pm │ │ └── PrinterPanel.pm │ ├── MainFrame.pm │ ├── Notifier.pm │ ├── OptionsGroup.pm │ ├── OptionsGroup │ │ └── Field.pm │ ├── Plater.pm │ ├── Plater │ │ ├── 2D.pm │ │ ├── 2DToolpaths.pm │ │ ├── 3D.pm │ │ ├── 3DPreview.pm │ │ ├── LambdaObjectDialog.pm │ │ ├── ObjectCutDialog.pm │ │ ├── ObjectPartsPanel.pm │ │ ├── ObjectRotateFaceDialog.pm │ │ ├── ObjectSettingsDialog.pm │ │ ├── OverrideSettingsPanel.pm │ │ └── SplineControl.pm │ ├── Preferences.pm │ ├── Preset.pm │ ├── PresetEditor.pm │ ├── PresetEditorDialog.pm │ ├── ProgressStatusBar.pm │ ├── Projector.pm │ ├── ReloadDialog.pm │ └── SLAPrintOptions.pm │ ├── Geometry.pm │ ├── Geometry │ └── Clipper.pm │ ├── Layer.pm │ ├── Line.pm │ ├── Model.pm │ ├── Point.pm │ ├── Polygon.pm │ ├── Polyline.pm │ ├── Print.pm │ ├── Print │ ├── GCode.pm │ ├── Object.pm │ ├── Simple.pm │ ├── State.pm │ └── SupportMaterial.pm │ ├── SVG.pm │ ├── Surface.pm │ ├── Test.pm │ └── Test │ └── SectionCut.pm ├── package ├── common │ ├── coreperl │ ├── shell.cpp │ ├── travis-decrypt-key │ └── util.sh ├── deploy │ ├── bintray.sh │ ├── sftp-symlink.sh │ ├── sftp.sh │ ├── slic3r-upload.ppk.enc │ ├── slic3r-upload.rsa.enc │ └── winscp.ps1 ├── linux │ ├── appimage-apprun.sh │ ├── appimage.sh │ ├── build_shell.mk │ ├── libpaths.appimage.txt │ ├── libpaths.txt │ ├── make_archive.sh │ ├── slic3r.desktop.in │ ├── startup_script.sh │ ├── travis-build-cpp.sh │ ├── travis-build-main.sh │ ├── travis-deploy-cpp.sh │ └── travis-deploy-main.sh ├── osx │ ├── make_dmg.sh │ ├── patch-wxwidgets.diff │ ├── plist.sh │ ├── startup_script.sh │ ├── travis-build-cpp.sh │ ├── travis-build-main.sh │ └── travis-deploy-main.sh └── win │ ├── appveyor_buildscript.ps1 │ ├── appveyor_deploy.ps1 │ ├── appveyor_preinstall.ps1 │ ├── compile_wrapper.ps1 │ ├── package_win32.ps1 │ ├── slic3r.exe.manifest │ └── slic3r.rc ├── share └── locale │ └── ja │ └── slic3r.mo ├── slic3r.pl ├── src ├── CMakeLists.txt ├── GUI │ ├── ColorScheme.hpp │ ├── ColorScheme │ │ ├── ColorSchemeBase.hpp │ │ ├── Default.hpp │ │ └── Solarized.hpp │ ├── Controller.hpp │ ├── Dialogs │ │ ├── AboutDialog.cpp │ │ ├── AboutDialog.hpp │ │ ├── AnglePicker.hpp │ │ ├── MaterialEditor.cpp │ │ ├── ObjectCutDialog.cpp │ │ ├── ObjectCutDialog.hpp │ │ ├── PresetEditor.cpp │ │ ├── PresetEditor.hpp │ │ ├── PrintEditor.cpp │ │ └── PrinterEditor.cpp │ ├── GUI.cpp │ ├── GUI.hpp │ ├── MainFrame.cpp │ ├── MainFrame.hpp │ ├── Notifier.hpp │ ├── OptionsGroup.hpp │ ├── OptionsGroup │ │ ├── Field.hpp │ │ ├── UI_Choice.cpp │ │ ├── UI_Color.cpp │ │ ├── UI_NumChoice.cpp │ │ ├── UI_Point.cpp │ │ ├── UI_Point3.cpp │ │ └── UI_Slider.cpp │ ├── Plater.cpp │ ├── Plater.hpp │ ├── Plater │ │ ├── 3DPreview.pm │ │ ├── Plate2D.cpp │ │ ├── Plate2D.hpp │ │ ├── Plate3D.cpp │ │ ├── Plate3D.hpp │ │ ├── PlaterObject.cpp │ │ ├── PlaterObject.hpp │ │ ├── PresetChooser.cpp │ │ ├── PresetChooser.hpp │ │ ├── Preview2D.hpp │ │ ├── Preview3D.cpp │ │ ├── Preview3D.hpp │ │ └── PreviewDLP.hpp │ ├── Preset.cpp │ ├── Preset.hpp │ ├── ProgressStatusBar.cpp │ ├── ProgressStatusBar.hpp │ ├── Scene3D.cpp │ ├── Scene3D.hpp │ ├── Settings.cpp │ ├── Settings.hpp │ ├── misc_ui.cpp │ └── misc_ui.hpp ├── slic3r.cpp ├── slic3r.hpp ├── standalone │ └── config.h ├── test │ ├── GUI │ │ ├── test_cli.cpp │ │ ├── test_field_checkbox.cpp │ │ ├── test_field_choice.cpp │ │ ├── test_field_colorpicker.cpp │ │ ├── test_field_numchoice.cpp │ │ ├── test_field_point.cpp │ │ ├── test_field_point3.cpp │ │ ├── test_field_slider.cpp │ │ ├── test_field_spinctrl.cpp │ │ ├── test_field_textbox.cpp │ │ ├── test_harness_gui.cpp │ │ ├── test_misc_ui.cpp │ │ ├── test_optionsgroup.cpp │ │ ├── test_preset.cpp │ │ ├── test_preset_chooser.cpp │ │ ├── testableframe.cpp │ │ └── testableframe.h │ ├── inputs │ │ ├── 20mmbox.stl │ │ ├── README.md │ │ ├── test_3mf │ │ │ └── Geräte │ │ │ │ └── box.3mf │ │ ├── test_amf │ │ │ ├── 20mmbox.amf │ │ │ ├── 20mmbox_deflated-in_directories.amf │ │ │ ├── 20mmbox_deflated-mult_files.amf │ │ │ ├── 20mmbox_deflated.amf │ │ │ ├── 5061-malicious.amf │ │ │ └── read-amf.amf │ │ ├── test_cli │ │ │ ├── 20mmbox.stl │ │ │ └── 20mmbox_config.ini │ │ ├── test_config │ │ │ ├── config_bundle_test.ini │ │ │ └── new_from_ini.ini │ │ ├── test_gcodewriter │ │ │ └── config_lift_unlift.ini │ │ ├── test_preset │ │ │ └── preset_load_numeric.ini │ │ ├── test_preset_chooser │ │ │ ├── incompat-material-profile.ini │ │ │ ├── material-profile.ini │ │ │ ├── print-profile.ini │ │ │ ├── printer-profile-2.ini │ │ │ └── printer-profile.ini │ │ └── test_trianglemesh │ │ │ └── 4486 │ │ │ ├── 100_000.stl │ │ │ ├── 10_000.stl │ │ │ └── config_4486.ini │ ├── libslic3r │ │ ├── test_3mf.cpp │ │ ├── test_amf.cpp │ │ ├── test_config.cpp │ │ ├── test_extrusion_entity.cpp │ │ ├── test_fill.cpp │ │ ├── test_flow.cpp │ │ ├── test_gcode.cpp │ │ ├── test_gcodewriter.cpp │ │ ├── test_geometry.cpp │ │ ├── test_log.cpp │ │ ├── test_model.cpp │ │ ├── test_polygon.cpp │ │ ├── test_print.cpp │ │ ├── test_printgcode.cpp │ │ ├── test_printobject.cpp │ │ ├── test_skirt_brim.cpp │ │ ├── test_support_material.cpp │ │ ├── test_test_data.cpp │ │ ├── test_transformationmatrix.cpp │ │ └── test_trianglemesh.cpp │ ├── test_data.cpp │ ├── test_data.hpp │ ├── test_harness.cpp │ └── test_options.hpp.in ├── utils │ └── extrude-tin.cpp └── windows-build.txt ├── t ├── adaptive_slicing.t ├── adaptive_width.t ├── angles.t ├── arcs.t ├── avoid_crossing_perimeters.t ├── bridges.t ├── clean_polylines.t ├── clipper.t ├── collinear.t ├── combineinfill.t ├── config.t ├── cooling.t ├── custom_gcode.t ├── fill.t ├── flow.t ├── gaps.t ├── gcode.t ├── geometry.t ├── layers.t ├── loops.t ├── multi.t ├── perimeters.t ├── polyclip.t ├── pressure.t ├── print.t ├── retraction.t ├── shells.t ├── skirt_brim.t ├── slice.t ├── speed.t ├── support.t ├── svg.t ├── thin.t ├── threads.t └── vibrationlimit.t ├── translation ├── de_DE.po ├── en_US.po ├── fr_FR.po ├── nl_NL.po └── zh_CN.po ├── utils ├── amf-to-stl.pl ├── clang_format ├── config-bundle-to-config.pl ├── dump-stl.pl ├── estimate-gcode-time.pl ├── gcode_sectioncut.pl ├── modifier_helpers │ ├── layer_generator.jscad │ └── solid_layers.scad ├── pdf-slices.pl ├── post-processing │ ├── decimate.pl │ ├── fan_kickstart.py │ ├── filament-weight.pl │ ├── flowrate.pl │ ├── prowl-notification.pl │ ├── strip-toolchange.pl │ └── z-every-line.pl ├── send-gcode.pl ├── split_stl.pl ├── stl-to-amf.pl ├── view-mesh.pl ├── view-toolpaths.pl ├── wireframe.pl └── zsh │ ├── README.markdown │ └── functions │ └── _slic3r ├── var ├── Slic3r.icns ├── Slic3r.ico ├── Slic3r.png ├── Slic3r_128px.png ├── Slic3r_192px.png ├── Slic3r_192px_transparent.png ├── add.png ├── application_view_tile.png ├── arrow_down.png ├── arrow_in.png ├── arrow_left.png ├── arrow_out.png ├── arrow_redo.png ├── arrow_refresh.png ├── arrow_right.png ├── arrow_rotate_anticlockwise.png ├── arrow_rotate_clockwise.png ├── arrow_rotate_x_anticlockwise.png ├── arrow_rotate_x_clockwise.png ├── arrow_rotate_y_anticlockwise.png ├── arrow_rotate_y_clockwise.png ├── arrow_rotate_z_anticlockwise.png ├── arrow_rotate_z_clockwise.png ├── arrow_undo.png ├── arrow_up.png ├── box.png ├── brick.png ├── brick_add.png ├── brick_delete.png ├── brick_go.png ├── bricks.png ├── building.png ├── bullet_black.png ├── bullet_blue.png ├── bullet_green.png ├── bullet_red.png ├── bullet_white.png ├── cog.png ├── cog_go.png ├── control_pause.png ├── control_pause_blue.png ├── control_play.png ├── control_play_blue.png ├── control_stop.png ├── control_stop_blue.png ├── cross.png ├── delete.png ├── disk.png ├── error.png ├── film.png ├── funnel.png ├── gcode.icns ├── gcode.ico ├── hourglass.png ├── house.png ├── infill.png ├── joystick.png ├── layers.png ├── lorry_add.png ├── lorry_go.png ├── lorry_import.png ├── map_add.png ├── note.png ├── package.png ├── package_green.png ├── page_white_go.png ├── plugin.png ├── plugin_add.png ├── plugin_go.png ├── printer_empty.png ├── rotate_face.png ├── script.png ├── shape_flip_horizontal.png ├── shape_flip_horizontal_x.png ├── shape_flip_horizontal_y.png ├── shape_flip_horizontal_z.png ├── shape_handles.png ├── shape_ungroup.png ├── slt.ico ├── solarized │ ├── arrow_rotate_x_180.png │ ├── arrow_rotate_x_180_16.png │ ├── arrow_rotate_x_anticlockwise90.png │ ├── arrow_rotate_x_anticlockwise90_16.png │ ├── arrow_rotate_x_clockwise90.png │ ├── arrow_rotate_x_clockwise90_16.png │ ├── arrow_rotate_y_180.png │ ├── arrow_rotate_y_180_16.png │ ├── arrow_rotate_y_anticlockwise90.png │ ├── arrow_rotate_y_anticlockwise90_16.png │ ├── arrow_rotate_y_clockwise90.png │ ├── arrow_rotate_y_clockwise90_16.png │ ├── arrow_rotate_z_180.png │ ├── arrow_rotate_z_180_16.png │ ├── arrow_rotate_z_anticlockwise45.png │ ├── arrow_rotate_z_anticlockwise45_16.png │ ├── arrow_rotate_z_anticlockwise90.png │ ├── arrow_rotate_z_anticlockwise90_16.png │ ├── arrow_rotate_z_clockwise45.png │ ├── arrow_rotate_z_clockwise45_16.png │ ├── arrow_rotate_z_clockwise90.png │ └── arrow_rotate_z_clockwise90_16.png ├── spool.png ├── stl.icns ├── tag_blue.png ├── textfield.png ├── tick.png ├── time.png ├── variable_layer_height.png ├── wand.png ├── wrench.png ├── zoom.png ├── zoom_in.png └── zoom_out.png └── xs ├── Build.PL ├── MANIFEST ├── MANIFEST.SKIP ├── lib └── Slic3r │ └── XS.pm ├── libslic3r.doxygen ├── src ├── BSpline │ ├── BSpline.cpp │ ├── BSpline.h │ ├── BandedMatrix.h │ └── COPYRIGHT ├── Zip │ ├── ZipArchive.cpp │ └── ZipArchive.hpp ├── admesh │ ├── connect.c │ ├── normals.c │ ├── portable_endian.h │ ├── shared.c │ ├── stl.h │ ├── stl_io.c │ ├── stlinit.c │ └── util.c ├── boost │ └── nowide │ │ ├── args.hpp │ │ ├── cenv.hpp │ │ ├── config.hpp │ │ ├── convert.hpp │ │ ├── cstdio.hpp │ │ ├── cstdlib.hpp │ │ ├── filebuf.hpp │ │ ├── fstream.hpp │ │ ├── integration │ │ └── filesystem.hpp │ │ ├── iostream.cpp │ │ ├── iostream.hpp │ │ ├── stackstring.hpp │ │ ├── system.hpp │ │ ├── utf8_codecvt.hpp │ │ └── windows.hpp ├── clipper.cpp ├── clipper.hpp ├── expat │ ├── COPYING │ ├── README │ ├── ascii.h │ ├── asciitab.h │ ├── expat.h │ ├── expat_config.h │ ├── expat_external.h │ ├── iasciitab.h │ ├── internal.h │ ├── latin1tab.h │ ├── nametab.h │ ├── utf8tab.h │ ├── xmlparse.c │ ├── xmlrole.c │ ├── xmlrole.h │ ├── xmltok.c │ ├── xmltok.h │ ├── xmltok_impl.h │ ├── xmltok_impl.inc │ └── xmltok_ns.inc ├── exprtk │ └── exprtk.hpp ├── libslic3r │ ├── BoundingBox.cpp │ ├── BoundingBox.hpp │ ├── BridgeDetector.cpp │ ├── BridgeDetector.hpp │ ├── ClipperUtils.cpp │ ├── ClipperUtils.hpp │ ├── ConditionalGCode.cpp │ ├── ConditionalGCode.hpp │ ├── Config.cpp │ ├── Config.hpp │ ├── ConfigBase.cpp │ ├── ConfigBase.hpp │ ├── ExPolygon.cpp │ ├── ExPolygon.hpp │ ├── ExPolygonCollection.cpp │ ├── ExPolygonCollection.hpp │ ├── Exception.hpp │ ├── Extruder.cpp │ ├── Extruder.hpp │ ├── ExtrusionEntity.cpp │ ├── ExtrusionEntity.hpp │ ├── ExtrusionEntityCollection.cpp │ ├── ExtrusionEntityCollection.hpp │ ├── Fill │ │ ├── Fill.cpp │ │ ├── Fill.hpp │ │ ├── Fill3DHoneycomb.cpp │ │ ├── Fill3DHoneycomb.hpp │ │ ├── FillConcentric.cpp │ │ ├── FillConcentric.hpp │ │ ├── FillGyroid.cpp │ │ ├── FillGyroid.hpp │ │ ├── FillHoneycomb.cpp │ │ ├── FillHoneycomb.hpp │ │ ├── FillPlanePath.cpp │ │ ├── FillPlanePath.hpp │ │ ├── FillRectilinear.cpp │ │ └── FillRectilinear.hpp │ ├── Flow.cpp │ ├── Flow.hpp │ ├── GCode.cpp │ ├── GCode.hpp │ ├── GCode │ │ ├── CoolingBuffer.cpp │ │ ├── CoolingBuffer.hpp │ │ ├── SpiralVase.cpp │ │ └── SpiralVase.hpp │ ├── GCodeReader.cpp │ ├── GCodeReader.hpp │ ├── GCodeSender.cpp │ ├── GCodeSender.hpp │ ├── GCodeTimeEstimator.cpp │ ├── GCodeTimeEstimator.hpp │ ├── GCodeWriter.cpp │ ├── GCodeWriter.hpp │ ├── Geometry.cpp │ ├── Geometry.hpp │ ├── IO.cpp │ ├── IO.hpp │ ├── IO │ │ ├── AMF.cpp │ │ ├── TMF.cpp │ │ └── TMF.hpp │ ├── Layer.cpp │ ├── Layer.hpp │ ├── LayerHeightSpline.cpp │ ├── LayerHeightSpline.hpp │ ├── LayerRegion.cpp │ ├── LayerRegionFill.cpp │ ├── Line.cpp │ ├── Line.hpp │ ├── Log.cpp │ ├── Log.hpp │ ├── Model.cpp │ ├── Model.hpp │ ├── MotionPlanner.cpp │ ├── MotionPlanner.hpp │ ├── MultiPoint.cpp │ ├── MultiPoint.hpp │ ├── PerimeterGenerator.cpp │ ├── PerimeterGenerator.hpp │ ├── PlaceholderParser.cpp │ ├── PlaceholderParser.hpp │ ├── Point.cpp │ ├── Point.hpp │ ├── Polygon.cpp │ ├── Polygon.hpp │ ├── Polyline.cpp │ ├── Polyline.hpp │ ├── PolylineCollection.cpp │ ├── PolylineCollection.hpp │ ├── Print.cpp │ ├── Print.hpp │ ├── PrintConfig.cpp │ ├── PrintConfig.hpp │ ├── PrintGCode.cpp │ ├── PrintGCode.hpp │ ├── PrintObject.cpp │ ├── PrintRegion.cpp │ ├── SLAPrint.cpp │ ├── SLAPrint.hpp │ ├── SVG.cpp │ ├── SVG.hpp │ ├── SimplePrint.cpp │ ├── SimplePrint.hpp │ ├── SlicingAdaptive.cpp │ ├── SlicingAdaptive.hpp │ ├── SupportMaterial.cpp │ ├── SupportMaterial.hpp │ ├── Surface.cpp │ ├── Surface.hpp │ ├── SurfaceCollection.cpp │ ├── SurfaceCollection.hpp │ ├── TransformationMatrix.cpp │ ├── TransformationMatrix.hpp │ ├── TriangleMesh.cpp │ ├── TriangleMesh.hpp │ ├── libslic3r.h │ ├── miniz_extension.cpp │ ├── miniz_extension.hpp │ ├── utils.cpp │ └── utils.hpp ├── miniz │ ├── CMakeLists.txt │ ├── ChangeLog.md │ ├── LICENSE │ ├── miniz.c │ ├── miniz.h │ └── readme.md ├── perlglue.cpp ├── poly2tri │ ├── common │ │ ├── shapes.cc │ │ ├── shapes.h │ │ └── utils.h │ ├── poly2tri.h │ └── sweep │ │ ├── advancing_front.cc │ │ ├── advancing_front.h │ │ ├── cdt.cc │ │ ├── cdt.h │ │ ├── sweep.cc │ │ ├── sweep.h │ │ ├── sweep_context.cc │ │ └── sweep_context.h ├── polypartition.cpp ├── polypartition.h ├── ppport.h ├── slic3r │ └── GUI │ │ ├── 3DScene.cpp │ │ ├── 3DScene.hpp │ │ ├── GUI.cpp │ │ └── xsGUI.hpp ├── tiny_obj_loader.h └── xsinit.h ├── t ├── 01_trianglemesh.t ├── 03_point.t ├── 04_expolygon.t ├── 05_surface.t ├── 06_polygon.t ├── 07_extrusionpath.t ├── 08_extrusionloop.t ├── 09_polyline.t ├── 10_line.t ├── 11_clipper.t ├── 12_extrusionpathcollection.t ├── 13_polylinecollection.t ├── 14_geometry.t ├── 15_config.t ├── 16_flow.t ├── 17_boundingbox.t ├── 18_motionplanner.t ├── 19_model.t ├── 20_print.t ├── 21_gcode.t ├── 22_exception.t ├── 23_3mf.t ├── 24_gcodemath.t ├── 25_transformationmatrix.t ├── inc │ └── 22_config_bad_config_options.ini └── models │ ├── 3mf │ ├── box.3mf │ ├── chess.3mf │ └── gimblekeychain.3mf │ ├── Geräte │ └── box.3mf │ ├── amf │ └── FaceColors.amf.xml │ └── stl │ └── spikey_top.stl └── xsp ├── BoundingBox.xsp ├── BridgeDetector.xsp ├── Clipper.xsp ├── ConditionalGcode.xsp ├── Config.xsp ├── ExPolygon.xsp ├── ExPolygonCollection.xsp ├── Extruder.xsp ├── ExtrusionEntityCollection.xsp ├── ExtrusionLoop.xsp ├── ExtrusionPath.xsp ├── Filler.xsp ├── Flow.xsp ├── GCode.xsp ├── GCodeSender.xsp ├── GCodeTimeEstimator.xsp ├── GCodeWriter.xsp ├── GUI.xsp ├── GUI_3DScene.xsp ├── Geometry.xsp ├── Layer.xsp ├── LayerHeightSpline.xsp ├── Line.xsp ├── Model.xsp ├── MotionPlanner.xsp ├── PerimeterGenerator.xsp ├── PlaceholderParser.xsp ├── Point.xsp ├── Polygon.xsp ├── Polyline.xsp ├── PolylineCollection.xsp ├── Print.xsp ├── SLAPrint.xsp ├── SlicingAdaptive.xsp ├── SupportMaterial.xsp ├── Surface.xsp ├── SurfaceCollection.xsp ├── TransformationMatrix.xsp ├── TriangleMesh.xsp ├── XS.xsp ├── my.map ├── mytype.map └── typemap.xspt /.github/CODEOWNERS: -------------------------------------------------------------------------------- 1 | * @alranel @lordofhyphens 2 | 3 | src/gui/* @lordofhyphens 4 | .github/CODEOWNERS @alranel @lordofhyphens 5 | -------------------------------------------------------------------------------- /.github/ISSUE_TEMPLATE.md: -------------------------------------------------------------------------------- 1 | ### Version 2 | _Version of Slic3r used goes here_ 3 | 4 | _Use `About->About Slic3r` for release versions._ 5 | 6 | _Do not report Prusa3D Slic3r bugs here without confirming it is a problem on a development release of Slic3r, or your issue will be closed. *Only* use normal Slic3r version IDs._ 7 | 8 | _For -dev versions, use `git describe --tag` or get the hash value for the version you downloaded or `git rev-parse HEAD`_ 9 | 10 | ### Operating system type + version 11 | _What OS are you using, and state any version #s_ 12 | 13 | ### Behavior 14 | * _Describe the problem_ 15 | * _Steps needed to reproduce the problem_ 16 | * _If this is a command-line slicing issue, include the options used_ 17 | * _Expected Results_ 18 | * _Actual Results_ 19 | * _Screenshots from __*Slic3r*__ preview are preferred_ 20 | 21 | _Is this a new feature request?_ 22 | Related guides for writing feature requests: http://meta.stackexchange.com/a/259196 http://nickohrn.com/2013/09/write-great-feature-request-bug-report/ 23 | 24 | 25 | #### STL/Config (.ZIP) where problem occurs 26 | _Upload a zipped copy of an STL and your config (`File -> Export Config`)_ 27 | -------------------------------------------------------------------------------- /.github/ISSUE_TEMPLATE/bug_report.md: -------------------------------------------------------------------------------- 1 | --- 2 | name: Bug report 3 | about: Create a report to help us improve 4 | 5 | --- 6 | 7 | ### Do not report Prusa3D Slic3r bugs here without confirming it is a problem on a development release of Slic3r, or your issue will be closed. [Development builds of Slic3r](https://dl.slic3r.org/dev). [Prusa3D Issue Tracker](https://github.com/Prusa3D/Slic3r/issues) 8 | 9 | **Describe the bug** 10 | A clear and concise description of what the bug is. 11 | 12 | **To Reproduce** 13 | Steps to reproduce the behavior: 14 | 1. Go to '...' 15 | 2. Click on '....' 16 | 3. Scroll down to '....' 17 | 4. See error 18 | 19 | **3D Model and Slic3r Configuration Export** 20 | Please upload a ZIP archive containing a copy of the 3D model you are seeing this bug with and a CTRL-E export of the configuration used. 21 | 22 | **Expected behavior** 23 | A clear and concise description of what you expected to happen. 24 | 25 | **Screenshots** 26 | If applicable, add screenshots to help explain your problem. 27 | 28 | **Desktop (please complete the following information):** 29 | - OS: [e.g. MacOS, Linux, Windows] 30 | - Version [e.g. 1.3.0] 31 | - _Do not report Prusa3D Slic3r bugs here without confirming it is a problem on a development release of Slic3r, or your issue will be closed. *Only* use normal Slic3r version IDs._ 32 | - _For -dev versions, use `git describe --tag` or get the hash value for the version you downloaded or `git rev-parse HEAD`_ 33 | - _Use `About->About Slic3r` for release versions._ 34 | 35 | **Additional context** 36 | Add any other context about the problem here. 37 | -------------------------------------------------------------------------------- /.github/ISSUE_TEMPLATE/feature_request.md: -------------------------------------------------------------------------------- 1 | --- 2 | name: Feature request 3 | about: Suggest an idea for this project 4 | 5 | --- 6 | 7 | ### Do not request features for the Prusa3D fork of Slic3r here without confirming it is applicable to the mainline Slic3r, or your issue will be closed. [Development builds of Slic3r](https://dl.slic3r.org/dev). [Prusa3D Issue Tracker](https://github.com/Prusa3D/Slic3r/issues) 8 | 9 | **Is your feature request related to a problem? Please describe.** 10 | A clear and concise description of what the problem is. Ex. I'm always frustrated when [...] 11 | 12 | **Describe the solution you'd like** 13 | A clear and concise description of what you want to happen. 14 | 15 | **Describe alternatives you've considered** 16 | A clear and concise description of any alternative solutions or features you've considered. 17 | 18 | **Additional context** 19 | Add any other context or screenshots about the feature request here. 20 | -------------------------------------------------------------------------------- /.github/ISSUE_TEMPLATE/old-slic3r-issue-template.md: -------------------------------------------------------------------------------- 1 | --- 2 | name: Old Slic3r Issue Template 3 | about: Use the other ones if possible. 4 | 5 | --- 6 | 7 | ### Version 8 | _Version of Slic3r used goes here_ 9 | 10 | _Use `About->About Slic3r` for release versions._ 11 | 12 | _Do not report Prusa3D Slic3r bugs here without confirming it is a problem on a development release of Slic3r, or your issue will be closed. *Only* use normal Slic3r version IDs._ 13 | 14 | _For -dev versions, use `git describe --tag` or get the hash value for the version you downloaded or `git rev-parse HEAD`_ 15 | 16 | ### Operating system type + version 17 | _What OS are you using, and state any version #s_ 18 | 19 | ### Behavior 20 | * _Describe the problem_ 21 | * _Steps needed to reproduce the problem_ 22 | * _If this is a command-line slicing issue, include the options used_ 23 | * _Expected Results_ 24 | * _Actual Results_ 25 | * _Screenshots from __*Slic3r*__ preview are preferred_ 26 | 27 | _Is this a new feature request?_ 28 | Related guides for writing feature requests: http://meta.stackexchange.com/a/259196 http://nickohrn.com/2013/09/write-great-feature-request-bug-report/ 29 | 30 | 31 | #### STL/Config (.ZIP) where problem occurs 32 | _Upload a zipped copy of an STL and your config (`File -> Export Config`)_ 33 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | build 2 | Build 3 | Build.bat 4 | */external/Catch 5 | Makefile 6 | MYMETA.json 7 | MYMETA.yml 8 | _build 9 | blib 10 | xs/buildtmp 11 | *.o 12 | MANIFEST.bak 13 | xs/MANIFEST.bak 14 | xs/assertlib* 15 | .init_bundle.ini 16 | local-lib 17 | package/osx/Slic3r*.app 18 | package/osx/_tmp 19 | *.dmg 20 | *.swp 21 | *.swo 22 | CMakeFiles 23 | *.orig 24 | *.a 25 | core 26 | CMakeCache.txt 27 | *.cmake 28 | *.exe 29 | src/test/test_options.hpp 30 | src/slic3r 31 | build/* 32 | serial.txt 33 | .vscode 34 | 35 | slic3r 36 | gui_test 37 | slic3r_test 38 | compile_commands.json 39 | tags 40 | -------------------------------------------------------------------------------- /appveyor.yml: -------------------------------------------------------------------------------- 1 | version: 1.3.0-{branch}-{build} 2 | branches: 3 | only: 4 | - master 5 | - cppgui 6 | image: WMF 5 7 | init: 8 | - ps: 9 | environment: 10 | LDLOADLIBS: -lstdc++ 11 | SLIC3R_STATIC: 1 12 | SLIC3R_VERSION: 1.3.0 13 | BOOST_DIR: C:\dev\boost_1_63_0 14 | WXDIR: C:\dev\wxwidgets 15 | WXSHARED: SHARED=0 16 | FORCE_WX_BUILD: 0 17 | FORCE_BOOST_REINSTALL: 0 18 | ENC_SECRET: 19 | secure: QfeTOSKXz1uFCEACqFKLNw== 20 | UPLOAD_USER: 21 | secure: fYPwnI3p6HNR+eMRJR3JfmyNolFn+Uc0MUn2bBXp9uU= 22 | matrix: 23 | - ARCH: 64bit 24 | - ARCH: 32bit 25 | 26 | install: 27 | - IF DEFINED ENC_SECRET nuget install secure-file -ExcludeVersion 28 | - IF DEFINED ENC_SECRET secure-file\tools\secure-file -decrypt package/deploy/slic3r-upload.ppk.enc -secret %ENC_SECRET% 29 | - ps: "& package/win/appveyor_preinstall.ps1" 30 | cache: 31 | - C:\Users\appveyor\local-lib-64bit.7z 32 | - C:\Users\appveyor\local-lib-32bit.7z 33 | - C:\Users\appveyor\freeglut.64bit.7z 34 | - C:\Users\appveyor\freeglut.32bit.7z 35 | - C:\users\appveyor\strawberry.64bit.msi 36 | - C:\users\appveyor\strawberry.32bit.msi 37 | - C:\Users\appveyor\winscp.zip 38 | - C:\Users\appveyor\extra_perl.7z 39 | - C:\Users\appveyor\wxwidgets-64bit.7z 40 | - C:\Users\appveyor\wxwidgets-32bit.7z 41 | - C:\Users\appveyor\boost.1.63.0.32bit.7z 42 | - C:\Users\appveyor\boost.1.63.0.64bit.7z 43 | build_script: 44 | - ps: "& package/win/appveyor_buildscript.ps1" 45 | artifacts: 46 | - path: .\slic3r*zip 47 | name: slic3r-dev 48 | deploy_script: 49 | - ps: "if ($env:APPVEYOR_REPO_BRANCH -eq 'master') { cd C:/projects/slic3r; & package/win/appveyor_deploy.ps1 }" 50 | on_success: 51 | - ps: 52 | on_failure: 53 | - ps: 54 | # - ps: $blockRdp = $true; iex ((new-object net.webclient).DownloadString('https://raw.githubusercontent.com/appveyor/ci/master/scripts/enable-rdp.ps1')) 55 | on_finish: 56 | - ps: 57 | -------------------------------------------------------------------------------- /lib/Slic3r/ExPolygon.pm: -------------------------------------------------------------------------------- 1 | package Slic3r::ExPolygon; 2 | use strict; 3 | use warnings; 4 | 5 | # an ExPolygon is a polygon with holes 6 | 7 | use List::Util qw(first); 8 | use Slic3r::Geometry qw(X Y A B point_in_polygon epsilon scaled_epsilon); 9 | use Slic3r::Geometry::Clipper qw(union_ex diff_pl); 10 | 11 | sub wkt { 12 | my $self = shift; 13 | return sprintf "POLYGON(%s)", 14 | join ',', map "($_)", map { join ',', map "$_->[0] $_->[1]", @$_ } @$self; 15 | } 16 | 17 | sub dump_perl { 18 | my $self = shift; 19 | return sprintf "[%s]", 20 | join ',', map "[$_]", map { join ',', map "[$_->[0],$_->[1]]", @$_ } @$self; 21 | } 22 | 23 | sub offset { 24 | my $self = shift; 25 | return Slic3r::Geometry::Clipper::offset(\@$self, @_); 26 | } 27 | 28 | sub offset_ex { 29 | my $self = shift; 30 | return Slic3r::Geometry::Clipper::offset_ex(\@$self, @_); 31 | } 32 | 33 | sub bounding_box { 34 | my $self = shift; 35 | return $self->contour->bounding_box; 36 | } 37 | 38 | package Slic3r::ExPolygon::Collection; 39 | use Slic3r::Geometry qw(X1 Y1); 40 | 41 | sub size { 42 | my $self = shift; 43 | return [ Slic3r::Geometry::size_2D([ map @$_, map @$_, @$self ]) ]; 44 | } 45 | 46 | 1; 47 | -------------------------------------------------------------------------------- /lib/Slic3r/ExtrusionLoop.pm: -------------------------------------------------------------------------------- 1 | package Slic3r::ExtrusionLoop; 2 | use strict; 3 | use warnings; 4 | 5 | use parent qw(Exporter); 6 | 7 | our @EXPORT_OK = qw(EXTRL_ROLE_DEFAULT 8 | EXTRL_ROLE_CONTOUR_INTERNAL_PERIMETER EXTRL_ROLE_SKIRT); 9 | our %EXPORT_TAGS = (roles => \@EXPORT_OK); 10 | 11 | 12 | 1; 13 | -------------------------------------------------------------------------------- /lib/Slic3r/ExtrusionPath.pm: -------------------------------------------------------------------------------- 1 | package Slic3r::ExtrusionPath; 2 | use strict; 3 | use warnings; 4 | 5 | use parent qw(Exporter); 6 | 7 | our @EXPORT_OK = qw(EXTR_ROLE_PERIMETER EXTR_ROLE_EXTERNAL_PERIMETER EXTR_ROLE_OVERHANG_PERIMETER 8 | EXTR_ROLE_FILL EXTR_ROLE_SOLIDFILL EXTR_ROLE_TOPSOLIDFILL EXTR_ROLE_GAPFILL EXTR_ROLE_BRIDGE 9 | EXTR_ROLE_SKIRT EXTR_ROLE_SUPPORTMATERIAL EXTR_ROLE_SUPPORTMATERIAL_INTERFACE 10 | EXTR_ROLE_NONE); 11 | our %EXPORT_TAGS = (roles => \@EXPORT_OK); 12 | 13 | 1; 14 | -------------------------------------------------------------------------------- /lib/Slic3r/Flow.pm: -------------------------------------------------------------------------------- 1 | package Slic3r::Flow; 2 | use strict; 3 | use warnings; 4 | 5 | use parent qw(Exporter); 6 | 7 | our @EXPORT_OK = qw(FLOW_ROLE_EXTERNAL_PERIMETER FLOW_ROLE_PERIMETER FLOW_ROLE_INFILL 8 | FLOW_ROLE_SOLID_INFILL 9 | FLOW_ROLE_TOP_SOLID_INFILL FLOW_ROLE_SUPPORT_MATERIAL 10 | FLOW_ROLE_SUPPORT_MATERIAL_INTERFACE); 11 | our %EXPORT_TAGS = (roles => \@EXPORT_OK); 12 | 13 | 1; 14 | -------------------------------------------------------------------------------- /lib/Slic3r/GUI/BonjourBrowser.pm: -------------------------------------------------------------------------------- 1 | # A tiny dialog to select an OctoPrint device to print to. 2 | 3 | package Slic3r::GUI::BonjourBrowser; 4 | use strict; 5 | use warnings; 6 | use utf8; 7 | 8 | use Wx qw(:dialog :id :misc :sizer :choicebook wxTAB_TRAVERSAL); 9 | use Wx::Event qw(EVT_CLOSE); 10 | use base 'Wx::Dialog'; 11 | 12 | sub new { 13 | my $class = shift; 14 | my ($parent, $devices) = @_; 15 | my $self = $class->SUPER::new($parent, -1, "Device Browser", wxDefaultPosition, [350,700], wxDEFAULT_DIALOG_STYLE | wxRESIZE_BORDER); 16 | 17 | $self->{devices} = $devices; 18 | 19 | # label 20 | my $text = Wx::StaticText->new($self, -1, "Choose an OctoPrint device in your network:", wxDefaultPosition, wxDefaultSize); 21 | 22 | # selector 23 | $self->{choice} = my $choice = Wx::Choice->new($self, -1, wxDefaultPosition, wxDefaultSize, 24 | [ map $_->name, @{$self->{devices}} ]); 25 | 26 | my $main_sizer = Wx::BoxSizer->new(wxVERTICAL); 27 | $main_sizer->Add($text, 1, wxEXPAND | wxALL, 10); 28 | $main_sizer->Add($choice, 1, wxEXPAND | wxALL, 10); 29 | $main_sizer->Add($self->CreateButtonSizer(wxOK | wxCANCEL), 0, wxEXPAND); 30 | 31 | $self->SetSizer($main_sizer); 32 | $self->SetMinSize($self->GetSize); 33 | $main_sizer->SetSizeHints($self); 34 | 35 | # needed to actually free memory 36 | EVT_CLOSE($self, sub { 37 | $self->EndModal(wxID_OK); 38 | $self->Destroy; 39 | }); 40 | 41 | return $self; 42 | } 43 | 44 | sub GetValue { 45 | my ($self) = @_; 46 | return $self->{devices}[ $self->{choice}->GetSelection ]->address; 47 | } 48 | sub GetPort { 49 | my ($self) = @_; 50 | return $self->{devices}[ $self->{choice}->GetSelection ]->port; 51 | } 52 | 53 | 1; 54 | -------------------------------------------------------------------------------- /lib/Slic3r/GUI/Notifier.pm: -------------------------------------------------------------------------------- 1 | # Notify about the end of slicing. 2 | # The notifications are sent out using the Growl protocol if installed, and using DBus XWindow protocol. 3 | 4 | package Slic3r::GUI::Notifier; 5 | use Moo; 6 | 7 | has 'growler' => (is => 'rw'); 8 | 9 | my $icon = $Slic3r::var->("Slic3r.png"); 10 | 11 | sub BUILD { 12 | my ($self) = @_; 13 | 14 | if (eval 'use Growl::GNTP; 1') { 15 | # register with growl 16 | eval { 17 | $self->growler(Growl::GNTP->new(AppName => 'Slic3r', AppIcon => $icon)); 18 | $self->growler->register([{Name => 'SKEIN_DONE', DisplayName => 'Slicing Done'}]); 19 | }; 20 | # if register() fails (for example because of a timeout), disable growler at all 21 | $self->growler(undef) if $@; 22 | } 23 | } 24 | 25 | sub notify { 26 | my ($self, $message) = @_; 27 | my $title = 'Slicing Done!'; 28 | 29 | eval { 30 | $self->growler->notify(Event => 'SKEIN_DONE', Title => $title, Message => $message) 31 | if $self->growler; 32 | }; 33 | # Net::DBus is broken in multithreaded environment 34 | if (0 && eval 'use Net::DBus; 1') { 35 | eval { 36 | my $session = Net::DBus->session; 37 | my $serv = $session->get_service('org.freedesktop.Notifications'); 38 | my $notifier = $serv->get_object('/org/freedesktop/Notifications', 39 | 'org.freedesktop.Notifications'); 40 | $notifier->Notify('Slic3r', 0, $icon, $title, $message, [], {}, -1); 41 | undef $Net::DBus::bus_session; 42 | }; 43 | } 44 | } 45 | 46 | 1; 47 | -------------------------------------------------------------------------------- /lib/Slic3r/Geometry/Clipper.pm: -------------------------------------------------------------------------------- 1 | package Slic3r::Geometry::Clipper; 2 | use strict; 3 | use warnings; 4 | 5 | require Exporter; 6 | our @ISA = qw(Exporter); 7 | our @EXPORT_OK = qw(offset offset_ex 8 | diff_ex diff union_ex intersection_ex JT_ROUND JT_MITER 9 | JT_SQUARE is_counter_clockwise union_pt offset2 offset2_ex 10 | intersection intersection_pl diff_pl union CLIPPER_OFFSET_SCALE 11 | union_pt_chained intersection_ppl); 12 | 13 | 1; 14 | -------------------------------------------------------------------------------- /lib/Slic3r/Layer.pm: -------------------------------------------------------------------------------- 1 | # Extends the C++ class Slic3r::Layer. 2 | 3 | package Slic3r::Layer; 4 | use strict; 5 | use warnings; 6 | 7 | # the following two were previously generated by Moo 8 | sub print { 9 | my $self = shift; 10 | return $self->object->print; 11 | } 12 | 13 | sub config { 14 | my $self = shift; 15 | return $self->object->config; 16 | } 17 | 18 | sub region { 19 | my $self = shift; 20 | my ($region_id) = @_; 21 | 22 | while ($self->region_count <= $region_id) { 23 | $self->add_region($self->object->print->get_region($self->region_count)); 24 | } 25 | 26 | return $self->get_region($region_id); 27 | } 28 | 29 | sub regions { 30 | my ($self) = @_; 31 | return [ map $self->get_region($_), 0..($self->region_count-1) ]; 32 | } 33 | 34 | package Slic3r::Layer::Support; 35 | our @ISA = qw(Slic3r::Layer); 36 | 37 | 1; 38 | -------------------------------------------------------------------------------- /lib/Slic3r/Line.pm: -------------------------------------------------------------------------------- 1 | package Slic3r::Line; 2 | use strict; 3 | use warnings; 4 | 5 | # a line is a two-points line 6 | use parent 'Slic3r::Polyline'; 7 | 8 | sub intersection { 9 | my $self = shift; 10 | my ($line, $require_crossing) = @_; 11 | return Slic3r::Geometry::line_intersection($self, $line, $require_crossing); 12 | } 13 | 14 | sub grow { 15 | my $self = shift; 16 | return Slic3r::Polyline->new(@$self)->grow(@_); 17 | } 18 | 19 | 1; 20 | -------------------------------------------------------------------------------- /lib/Slic3r/Point.pm: -------------------------------------------------------------------------------- 1 | package Slic3r::Point; 2 | use strict; 3 | use warnings; 4 | 5 | sub new_scale { 6 | my $class = shift; 7 | return $class->new(map Slic3r::Geometry::scale($_), @_); 8 | } 9 | 10 | sub dump_perl { 11 | my $self = shift; 12 | return sprintf "[%s,%s]", @$self; 13 | } 14 | 15 | package Slic3r::Pointf; 16 | use strict; 17 | use warnings; 18 | 19 | sub new_unscale { 20 | my $class = shift; 21 | return $class->new(map Slic3r::Geometry::unscale($_), @_); 22 | } 23 | 24 | package Slic3r::Pointf3; 25 | use strict; 26 | use warnings; 27 | 28 | sub new_unscale { 29 | my $class = shift; 30 | return $class->new(map Slic3r::Geometry::unscale($_), @_); 31 | } 32 | 33 | 1; 34 | -------------------------------------------------------------------------------- /lib/Slic3r/Polygon.pm: -------------------------------------------------------------------------------- 1 | package Slic3r::Polygon; 2 | use strict; 3 | use warnings; 4 | 5 | # a polygon is a closed polyline. 6 | use parent 'Slic3r::Polyline'; 7 | 8 | use Slic3r::Geometry qw(PI); 9 | 10 | sub grow { 11 | my $self = shift; 12 | return $self->split_at_first_point->grow(@_); 13 | } 14 | 15 | # this method subdivides the polygon segments to that no one of them 16 | # is longer than the length provided 17 | sub subdivide { 18 | my $self = shift; 19 | my ($max_length) = @_; 20 | 21 | my @points = @$self; 22 | push @points, $points[0]; # append first point as this is a polygon 23 | my @new_points = shift @points; 24 | while (@points) { 25 | while ($new_points[-1]->distance_to($points[0]) > $max_length) { 26 | push @new_points, map Slic3r::Point->new(@$_), 27 | Slic3r::Geometry::point_along_segment($new_points[-1], $points[0], $max_length); 28 | } 29 | push @new_points, shift @points; 30 | } 31 | pop @new_points; # remove last point as it coincides with first one 32 | return Slic3r::Polygon->new(@new_points); 33 | } 34 | 35 | 1; -------------------------------------------------------------------------------- /lib/Slic3r/Polyline.pm: -------------------------------------------------------------------------------- 1 | package Slic3r::Polyline; 2 | use strict; 3 | use warnings; 4 | 5 | use Slic3r::Geometry qw(X Y); 6 | 7 | sub new_scale { 8 | my $class = shift; 9 | my @points = map { ref($_) eq 'Slic3r::Point' ? $_->pp : $_ } @_; 10 | return $class->new(map [ Slic3r::Geometry::scale($_->[X]), Slic3r::Geometry::scale($_->[Y]) ], @points); 11 | } 12 | 13 | sub dump_perl { 14 | my $self = shift; 15 | return sprintf "[%s]", join ',', map "[$_->[0],$_->[1]]", @$self; 16 | } 17 | 18 | 1; 19 | -------------------------------------------------------------------------------- /lib/Slic3r/Print/State.pm: -------------------------------------------------------------------------------- 1 | # Wraps C++ enums Slic3r::PrintStep and Slic3r::PrintObjectStep 2 | package Slic3r::Print::State; 3 | use strict; 4 | use warnings; 5 | 6 | require Exporter; 7 | our @ISA = qw(Exporter); 8 | our @EXPORT_OK = qw(STEP_LAYERS STEP_SLICE STEP_PERIMETERS STEP_PREPARE_INFILL 9 | STEP_INFILL STEP_SUPPORTMATERIAL STEP_SKIRT STEP_BRIM); 10 | our %EXPORT_TAGS = (steps => \@EXPORT_OK); 11 | 12 | 1; 13 | -------------------------------------------------------------------------------- /lib/Slic3r/Surface.pm: -------------------------------------------------------------------------------- 1 | package Slic3r::Surface; 2 | use strict; 3 | use warnings; 4 | 5 | require Exporter; 6 | our @ISA = qw(Exporter); 7 | our @EXPORT_OK = qw(S_TYPE_TOP S_TYPE_BOTTOM S_TYPE_INTERNAL S_TYPE_SOLID S_TYPE_BRIDGE S_TYPE_VOID); 8 | our %EXPORT_TAGS = (types => \@EXPORT_OK); 9 | 10 | sub p { 11 | my $self = shift; 12 | return @{$self->polygons}; 13 | } 14 | 15 | 1; 16 | -------------------------------------------------------------------------------- /package/common/coreperl: -------------------------------------------------------------------------------- 1 | # Core perl modules used in Slic3r 2 | attributes 3 | base 4 | bytes 5 | B 6 | POSIX 7 | FindBin 8 | Getopt::Long 9 | Unicode::Normalize 10 | Tie::Handle 11 | Time::HiRes 12 | Time::Local 13 | Thread::Semaphore 14 | Math::Trig 15 | IO::Socket 16 | Errno 17 | Storable 18 | lib 19 | overload 20 | warnings 21 | local::lib 22 | strict 23 | utf8 24 | parent 25 | -------------------------------------------------------------------------------- /package/common/travis-decrypt-key: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # Script to only decrypt if it is available 3 | 4 | if [ ! -z ${encrypted_daaf322d08bf_key+x} ]; then 5 | openssl aes-256-cbc -K $encrypted_daaf322d08bf_key -iv $encrypted_daaf322d08bf_iv -in $TRAVIS_BUILD_DIR/package/deploy/slic3r-upload.rsa.enc -out ~/slic3r-upload.rsa -d 6 | chmod 600 ~/slic3r-upload.rsa 7 | fi 8 | -------------------------------------------------------------------------------- /package/deploy/sftp-symlink.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # Prerequisites 3 | # Environment Variables: 4 | # UPLOAD_USER - user to upload to sftp server 5 | # KEY is assumed to be path to a ssh key for UPLOAD_USER 6 | 7 | DIR=$1 8 | shift 9 | KEY=$1 10 | shift 11 | EXT=$1 12 | shift 13 | FILES=$* 14 | 15 | if [ -z ${READLINK+x} ]; then 16 | READLINK_BIN=readlink 17 | else 18 | READLINK_BIN=$READLINK 19 | fi 20 | 21 | source $(dirname $0)/../common/util.sh 22 | set_pr_id 23 | set_branch 24 | if [ ! -z ${PR_ID+x} ]; then 25 | exit 0 26 | fi 27 | if [ ! -z ${PR_ID+x} ] || [ $current_branch != "master" ]; then 28 | DIR=${DIR}/branches 29 | fi 30 | 31 | if [ -s $KEY ]; then 32 | for i in $FILES; do 33 | filepath=$(${READLINK_BIN} -f "$i") 34 | filepath=$(basename $filepath) 35 | tmpfile=$(mktemp) 36 | 37 | echo "rm Slic3r-${current_branch}-latest.${EXT}" | sftp -i$KEY "${UPLOAD_USER}@dl.slic3r.org:$DIR/" 38 | echo "symlink $filepath Slic3r-${current_branch}-latest.${EXT} " > $tmpfile 39 | sftp -b $tmpfile -i$KEY "${UPLOAD_USER}@dl.slic3r.org:$DIR/" 40 | result=$? 41 | if [ $? -eq 1 ]; then 42 | echo "Error with SFTP symlink" 43 | exit $result; 44 | fi 45 | done 46 | else 47 | echo "$KEY is not available, not symlinking." 48 | fi 49 | exit $result 50 | -------------------------------------------------------------------------------- /package/deploy/sftp.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # Prerequisites 3 | # Environment Variables: 4 | # UPLOAD_USER - user to upload to sftp server 5 | # KEY is assumed to be path to a ssh key for UPLOAD_USER 6 | 7 | DIR=$1 8 | shift 9 | KEY=$1 10 | shift 11 | FILES=$* 12 | source $(dirname $0)/../common/util.sh 13 | set_pr_id 14 | set_branch 15 | if [ ! -z ${PR_ID+x} ] || [ $current_branch != "master" ]; then 16 | DIR=${DIR}/branches 17 | fi 18 | 19 | if [ -s $KEY ]; then 20 | if [ ! -z ${PR_ID+x} ] || [ $current_branch != "master" ]; then 21 | # clean up old copies of the same branch/PR 22 | if [ ! -z ${PR_ID+x} ]; then 23 | echo "rm *PR${PR_ID}*" | sftp -i$KEY "${UPLOAD_USER}@dl.slic3r.org:$DIR/" 24 | fi 25 | if [ $current_branch != "master" ]; then 26 | echo "rm *${current_branch}*" | sftp -i$KEY "${UPLOAD_USER}@dl.slic3r.org:$DIR/" 27 | fi 28 | fi 29 | for i in $FILES; do 30 | filepath=$i # this is expected to be an absolute path 31 | tmpfile=$(mktemp) 32 | echo progress > $tmpfile 33 | echo put $filepath >> $tmpfile 34 | 35 | sftp -b $tmpfile -i$KEY "${UPLOAD_USER}@dl.slic3r.org:$DIR/" 36 | result=$? 37 | if [ $? -eq 1 ]; then 38 | echo "Error with SFTP" 39 | exit $result; 40 | fi 41 | rm $tmpfile 42 | done 43 | else 44 | echo "$KEY is not available, not deploying." 45 | fi 46 | exit $result 47 | -------------------------------------------------------------------------------- /package/deploy/slic3r-upload.ppk.enc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/slic3r/Slic3r/026c1380e0ad12176dd2fc8cdf8f6f181deeb071/package/deploy/slic3r-upload.ppk.enc -------------------------------------------------------------------------------- /package/deploy/slic3r-upload.rsa.enc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/slic3r/Slic3r/026c1380e0ad12176dd2fc8cdf8f6f181deeb071/package/deploy/slic3r-upload.rsa.enc -------------------------------------------------------------------------------- /package/deploy/winscp.ps1: -------------------------------------------------------------------------------- 1 | # Prerequisites 2 | # Environment Variables: 3 | # UPLOAD_USER - user to upload to sftp server 4 | # KEY is assumed to be path to a ssh key for UPLOAD_USER 5 | 6 | Param( 7 | [string]$DIR, 8 | [string]$KEY, 9 | [string]$FILE 10 | ) 11 | Set-Variable -Name "UUSER" -Value "$env:UPLOAD_USER" 12 | Set-Variable -Name "UPLOAD" -Value "$($FILE | Resolve-Path)" 13 | if (Test-Path $KEY) { 14 | if ($env:APPVEYOR_PULL_REQUEST_NUMBER -Or $env:APPVEYOR_REPO_BRANCH -ne "master" ) { 15 | if ($env:APPVEYOR_PULL_REQUEST_NUMBER) { 16 | winscp.com /privatekey=$KEY /command "open sftp://$UUSER@dl.slic3r.org/$DIR/branches -hostkey=*" "rm *PR${env:APPVEYOR_PULL_REQUEST_NUMBER}*" "exit" 17 | } 18 | if ($env:APPVEYOR_REPO_BRANCH -ne "master" ) { 19 | winscp.com /privatekey=$KEY /command "open sftp://$UUSER@dl.slic3r.org/$DIR/branches -hostkey=*" "rm *${env:APPVEYOR_REPO_BRANCH}*" "exit" 20 | } 21 | winscp.com /privatekey=$KEY /command "open sftp://$UUSER@dl.slic3r.org/$DIR/branches -hostkey=*" "put $UPLOAD ./$FILE" "exit" 22 | } else { 23 | winscp.com /privatekey=$KEY /command "open sftp://$UUSER@dl.slic3r.org/$DIR -hostkey=*" "put $UPLOAD ./$FILE" "exit" 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /package/linux/build_shell.mk: -------------------------------------------------------------------------------- 1 | src=../common/shell.cpp 2 | 3 | # override with environment variable 4 | CXX ?= g++ 5 | 6 | # Path to perl header files 7 | INCLUDEDIR ?= ${HOME}/perl5/perlbrew/perls/slic3r-perl/lib/5.28.1/x86_64-linux-thread-multi/CORE 8 | 9 | # path to library files for perl 10 | LIBDIR ?= ${HOME}/perl5/perlbrew/perls/slic3r-perl/lib/5.28.1/x86_64-linux-thread-multi/CORE 11 | 12 | LIBS += -lperl -lpthread -lcrypt 13 | 14 | CXXFLAGS += -std=c++11 -static-libgcc -static-libstdc++ -I${INCLUDEDIR} 15 | LDFLAGS += -L${LIBDIR} 16 | 17 | .PHONY: all clean 18 | all: Slic3r Slic3r-console 19 | 20 | Slic3r: slic3r.o 21 | ${CXX} ${LDFLAGS} -o $@ $< ${LIBS} 22 | 23 | Slic3r-console: slic3r-console.o 24 | ${CXX} ${LDFLAGS} -o $@ $< ${LIBS} 25 | slic3r-console.o: ${src} 26 | ${CXX} -c ${CXXFLAGS} -o $@ $< 27 | slic3r.o: ${src} 28 | ${CXX} -c -DFORCE_GUI ${CXXFLAGS} -o $@ $< 29 | 30 | clean: 31 | rm *.o Slic3r* 32 | -------------------------------------------------------------------------------- /package/linux/libpaths.appimage.txt: -------------------------------------------------------------------------------- 1 | #/usr/lib/x86_64-linux-gnu/libstdc++.so.6 # needed because of ancient distros and slic3r (and perl for perl reasons) needs modern c++. 2 | #/usr/lib/x86_64-linux-gnu/dri/swrast_dri.so # Missing? 3 | /lib/x86_64-linux-gnu/libcrypt.so.1 # Add because FEDORA. 4 | -------------------------------------------------------------------------------- /package/linux/libpaths.txt: -------------------------------------------------------------------------------- 1 | /home/travis/builds/alexrj/Slic3r/local-lib/lib/perl5/x86_64-linux-thread-multi/Alien/wxWidgets/gtk_3_0_2_uni/lib/libwx_baseu-3.0.so.0 2 | /home/travis/builds/alexrj/Slic3r/local-lib/lib/perl5/x86_64-linux-thread-multi/Alien/wxWidgets/gtk_3_0_2_uni/lib/libwx_gtk2u_adv-3.0.so.0 3 | /home/travis/builds/alexrj/Slic3r/local-lib/lib/perl5/x86_64-linux-thread-multi/Alien/wxWidgets/gtk_3_0_2_uni/lib/libwx_gtk2u_core-3.0.so.0 4 | /home/travis/builds/alexrj/Slic3r/local-lib/lib/perl5/x86_64-linux-thread-multi/Alien/wxWidgets/gtk_3_0_2_uni/lib/libwx_gtk2u_gl-3.0.so.0 5 | /home/travis/builds/alexrj/Slic3r/local-lib/lib/perl5/x86_64-linux-thread-multi/Alien/wxWidgets/gtk_3_0_2_uni/lib/libwx_gtk2u_html-3.0.so.0 6 | /lib/x86_64-linux-gnu/liblzma.so.5 7 | /lib/x86_64-linux-gnu/libpng12.so.0 8 | /usr/lib/x86_64-linux-gnu/libjpeg.so.8 9 | /usr/lib/x86_64-linux-gnu/libjbig.so.0 10 | /usr/lib/x86_64-linux-gnu/libtiff.so.5 11 | /usr/lib/x86_64-linux-gnu/libglut.so.3 # needed for appimage on some systems that don't have glut installed. 12 | -------------------------------------------------------------------------------- /package/linux/slic3r.desktop.in: -------------------------------------------------------------------------------- 1 | [Desktop Entry] 2 | 3 | Type=Application 4 | 5 | Name=APPLICATION_NAME 6 | 7 | Comment=Prepare 3D Models for printing 8 | 9 | Icon=slic3r 10 | 11 | Exec=Slic3r 12 | -------------------------------------------------------------------------------- /package/linux/startup_script.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | BIN=$(readlink -f "$0") 4 | DIR=$(dirname "$BIN") 5 | export LD_LIBRARY_PATH="$DIR/bin" 6 | exec "$DIR/perl-local" -I"$DIR/local-lib/lib/perl5" "$DIR/slic3r.pl" "$@" 7 | -------------------------------------------------------------------------------- /package/linux/travis-build-cpp.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | set -euo pipefail 3 | 4 | export WXVERSION=pkg 5 | export CC=gcc-7 6 | export CXX=g++-7 7 | export DISPLAY=:99.0 8 | 9 | if [ -f "$(which cmake3)" ]; then 10 | export CMAKE=$(which cmake3) 11 | else 12 | export CMAKE=$(which cmake) 13 | fi 14 | 15 | mkdir -p $CACHE 16 | 17 | if [[ "$WXVERSION" != "pkg" ]]; then 18 | export WXDIR=$HOME/wx${WXVERSION} 19 | if [ ! -e $CACHE/wx${WXVERSION}.tar.bz2 ]; then 20 | echo "Downloading http://www.siusgs.com/slic3r/buildserver/wx${WXVERSION}-libs.tar.bz2 => $CACHE/wx${WXVERSION}.tar.bz2" 21 | curl -L "http://www.siusgs.com/slic3r/buildserver/wx${WXVERSION}-libs.tar.bz2" -o $CACHE/wx${WXVERSION}.tar.bz2 22 | fi 23 | tar -C$HOME -xjf $CACHE/wx${WXVERSION}.tar.bz2 24 | fi 25 | 26 | if [ ! -e $CACHE/boost-compiled.tar.bz2 ]; then 27 | echo "Downloading http://www.siusgs.com/slic3r/buildserver/boost_1_63_0.built.gcc-4.9.4-buildserver.tar.bz2 => $CACHE/boost-compiled.tar.bz2" 28 | curl -L "http://www.siusgs.com/slic3r/buildserver/boost_1_63_0.built.gcc-4.9.4-buildserver.tar.bz2" -o $CACHE/boost-compiled.tar.bz2 29 | fi 30 | 31 | tar -C$HOME -xjf $CACHE/boost-compiled.tar.bz2 32 | 33 | mkdir build && cd build 34 | ${CMAKE} -DBOOST_ROOT=$HOME/boost_1_63_0 -DSLIC3R_STATIC=ON -DCMAKE_BUILD_TYPE=Release ../src 35 | ${CMAKE} --build . 36 | ./slic3r_test -s 37 | -------------------------------------------------------------------------------- /package/linux/travis-build-main.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | # -u is too strict for source $HOME/perl5/perlbrew/etc/bashrc: 4 | ### set -euo pipefail 5 | set -eo pipefail 6 | 7 | if [ ! -d $HOME/perl5/perlbrew/perls/slic3r-perl ]; then 8 | echo "Downloading slic3r-perlbrew-5.28.tar.bz2" 9 | curl -L "http://www.siusgs.com/slic3r/buildserver/slic3r-perl.528.gcc81.travis.tar.bz2" -o /tmp/slic3r-perlbrew-5.28.tar.bz2; 10 | tar -C$HOME/perl5/perlbrew/perls -xjf /tmp/slic3r-perlbrew-5.28.tar.bz2 11 | fi 12 | 13 | source $HOME/perl5/perlbrew/etc/bashrc 14 | perlbrew switch slic3r-perl 15 | 16 | if [ ! -e $HOME/boost_1_63_0/boost/version.hpp ]; then 17 | echo "Downloading boost_1_69_0.built.gcc-8.1.0-buildserver.tar.bz2" 18 | curl -L "http://www.siusgs.com/slic3r/buildserver/boost_1_69_0.built.gcc-8.1.0-buildserver.tar.bz2" -o /tmp/boost-compiled.tar.bz2 19 | tar -C$HOME -xjf /tmp/boost-compiled.tar.bz2 20 | fi 21 | 22 | if [ ! -e ./local-lib/lib/perl5/x86_64-linux-thread-multi/Wx.pm ]; then 23 | echo "Downloading slic3r-dependencies.gcc81.travis-wx302.tar.bz2" 24 | curl -L "http://www.siusgs.com/slic3r/buildserver/slic3r-dependencies.gcc81.travis-wx302.tar.bz2" -o /tmp/local-lib-wx302.tar.bz2 25 | tar -C$TRAVIS_BUILD_DIR -xjf /tmp/local-lib-wx302.tar.bz2 26 | fi 27 | 28 | cpanm local::lib 29 | eval $(perl -Mlocal::lib=${TRAVIS_BUILD_DIR}/local-lib) 30 | CC=g++-8 CXX=g++-8 cpanm ExtUtils::CppGuess --force 31 | CC=g++-8 CXX=g++-8 BOOST_DIR=$HOME/boost_1_69_0 perl ./Build.PL 32 | excode=$? 33 | if [ $excode -ne 0 ]; then exit $excode; fi 34 | perl ./Build.PL --gui 35 | exit $? 36 | -------------------------------------------------------------------------------- /package/linux/travis-deploy-cpp.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | set -euo pipefail 3 | 4 | # Not sure this is the correct deployment: 5 | # cp slic3r ../ 6 | # LD_LIBRARY_PATH=$WXDIR/lib package/linux/make_archive.sh linux-x64 7 | # package/linux/appimage.sh x86_64 8 | # package/deploy/sftp.sh linux ~/slic3r-upload.rsa *.bz2 Slic3r*.AppImage 9 | # package/deploy/sftp-symlink.sh linux ~/slic3r-upload.rsa AppImage Slic3r*.AppImage 10 | # package/deploy/sftp-symlink.sh linux ~/slic3r-upload.rsa tar.bz2 *.bz2 11 | -------------------------------------------------------------------------------- /package/linux/travis-deploy-main.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | set -euo pipefail 3 | 4 | perlbrew switch slic3r-perl 5 | cpanm local::lib 6 | eval $(perl -Mlocal::lib=$TRAVIS_BUILD_DIR/local-lib) 7 | cd package/linux && make -f build_shell.mk && mv Slic3r* $TRAVIS_BUILD_DIR && cd $TRAVIS_BUILD_DIR 8 | 9 | if [ -z ${WXDIR+x} ]; then 10 | package/linux/make_archive.sh linux-x64 11 | else 12 | LD_LIBRARY_PATH=$WXDIR/lib package/linux/make_archive.sh linux-x64 13 | fi 14 | 15 | package/linux/appimage.sh x86_64 16 | 17 | package/deploy/sftp.sh linux ~/slic3r-upload.rsa `pwd`/*.bz2 `pwd`/Slic3r*.AppImage 18 | package/deploy/sftp-symlink.sh linux ~/slic3r-upload.rsa AppImage Slic3r*.AppImage 19 | package/deploy/sftp-symlink.sh linux ~/slic3r-upload.rsa tar.bz2 *.bz2 20 | -------------------------------------------------------------------------------- /package/osx/patch-wxwidgets.diff: -------------------------------------------------------------------------------- 1 | diff --git src/osx/carbon/dataobj.cpp src/osx/carbon/dataobj.cpp 2 | index 758e3a7928..5445aa6b14 100644 3 | --- src/osx/carbon/dataobj.cpp 4 | +++ src/osx/carbon/dataobj.cpp 5 | @@ -29,10 +29,6 @@ 6 | 7 | #include "wx/osx/private.h" 8 | 9 | -#if wxOSX_USE_COCOA_OR_CARBON 10 | - #include 11 | -#endif 12 | - 13 | // ---------------------------------------------------------------------------- 14 | // wxDataFormat 15 | // ---------------------------------------------------------------------------- 16 | diff --git src/osx/core/bitmap.cpp src/osx/core/bitmap.cpp 17 | index 3c61c173e7..3322b605fc 100644 18 | --- src/osx/core/bitmap.cpp 19 | +++ src/osx/core/bitmap.cpp 20 | @@ -35,10 +35,6 @@ 21 | #include "wx/osx/private.h" 22 | #endif 23 | 24 | -#ifndef __WXOSX_IPHONE__ 25 | -#include 26 | -#endif 27 | - 28 | CGColorSpaceRef wxMacGetGenericRGBColorSpace(); 29 | CGDataProviderRef wxMacCGDataProviderCreateWithMemoryBuffer( const wxMemoryBuffer& buf ); 30 | 31 | diff --git src/stc/scintilla/src/Editor.cxx src/stc/scintilla/src/Editor.cxx 32 | index cd72953ae7..a3ee41c49b 100644 33 | --- src/stc/scintilla/src/Editor.cxx 34 | +++ src/stc/scintilla/src/Editor.cxx 35 | @@ -5841,9 +5841,9 @@ 36 | } 37 | 38 | static bool Close(Point pt1, Point pt2) { 39 | - if (abs(pt1.x - pt2.x) > 3) 40 | + if (labs(pt1.x - pt2.x) > 3) 41 | return false; 42 | - if (abs(pt1.y - pt2.y) > 3) 43 | + if (labs(pt1.y - pt2.y) > 3) 44 | return false; 45 | return true; 46 | } 47 | -------------------------------------------------------------------------------- /package/osx/startup_script.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | DIR=$(dirname "$0") 4 | exec "$DIR/perl-local" -I"$DIR/local-lib/lib/perl5" "$DIR/slic3r.pl" "$@" 5 | -------------------------------------------------------------------------------- /package/osx/travis-build-cpp.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | set -euo pipefail 3 | 4 | export WXVERSION=pkg 5 | export DISPLAY=:99.0 6 | 7 | mkdir -p $CACHE 8 | 9 | ( sudo Xvfb :99 -ac -screen 0 1024x768x8; echo ok )& 10 | brew update -v 11 | brew install ccache || brew upgrade ccache 12 | brew install coreutils || brew upgrade coreutils 13 | 14 | if [[ "$WXVERSION" != "pkg" ]]; then 15 | WXVER_EXPANDED=${WXVERSION:0:1}.${WXVERSION:1:1}.${WXVERSION:2:1} 16 | export WXDIR=$HOME/wx${WXVERSION} 17 | if [ ! -e $CACHE/wx${WXVERSION}-${TRAVIS_OS_NAME}.tar.bz2 ]; then 18 | curl -L "https://github.com/wxWidgets/wxWidgets/releases/download/v${WXVER_EXPANDED}/wxWidgets-${WXVER_EXPANDED}.tar.bz2" -o $HOME/wx${WXVERSION}-src.tar.bz2 19 | tar -C$HOME -xjf $HOME/wx${WXVERSION}-src.tar.bz2 20 | mkdir $WXDIR 21 | cd $HOME/$WXDIR && cmake $HOME/wxWidgets-${WXVER_EXPANDED} -DwxBUILD_SHARED=OFF 22 | cmake --build . --target -- -j4 23 | tar -C$HOME -cjf $CACHE/wx${WXVERSION}-${TRAVIS_OS_NAME}.tar.bz2 $(basename ${WXDIR}) 24 | else 25 | tar -C$HOME -xjf $CACHE/wx${WXVERSION}-${TRAVIS_OS_NAME}.tar.bz2 26 | fi 27 | export PATH=${PATH}:${WXDIR} 28 | cd $TRAVIS_BUILD_DIR # go back to the build dir 29 | else 30 | brew install wxmac || brew upgrade wxmac # install via homebrew 31 | fi 32 | 33 | mkdir build && cd build 34 | cmake -DBOOST_ROOT=$HOME/boost_1_63_0 -DSLIC3R_STATIC=ON -DCMAKE_BUILD_TYPE=Release ../src 35 | cmake --build . 36 | ./slic3r_test -s 37 | #./gui_test -s 38 | -------------------------------------------------------------------------------- /package/osx/travis-build-main.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | set -euo pipefail 3 | 4 | # These two commands are only needed on 10.12: 5 | rm -rf /usr/local/Homebrew/Library/Taps/homebrew/homebrew-cask 6 | brew uninstall --force postgis cgal sfcgal 7 | 8 | brew update -v 9 | 10 | brew install boost || brew upgrade boost 11 | brew install perl || brew upgrade perl 12 | brew install cpanminus || brew upgrade cpanminus 13 | brew install wxwidgets || brew upgrade wxwidgets 14 | brew install coreutils || brew upgrade coreutils 15 | brew link --overwrite perl cpanminus 16 | 17 | export SLIC3R_STATIC=1 18 | export BOOST_DIR=/usr/local 19 | perl ./Build.PL 20 | 21 | # remove X11 because otherwise OpenGL.pm will link libglut.3.dylib instead of GLUT.framework 22 | sudo rm -rf /opt/X11* 23 | 24 | export LIBRARY_PATH=/usr/local/lib 25 | 26 | # One Wx test fails on 10.12; seems harmless 27 | if [ $TRAVIS_OSX_IMAGE == 'xcode9.2' ]; then 28 | cpanm --local-lib local-lib -f Wx 29 | fi 30 | 31 | perl ./Build.PL --gui 32 | 33 | # Install PAR::Packer now so that it gets cached by Travis 34 | cpanm --local-lib local-lib PAR::Packer 35 | -------------------------------------------------------------------------------- /package/osx/travis-deploy-main.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | set -euo pipefail 3 | 4 | package/osx/make_dmg.sh 5 | package/deploy/sftp.sh mac ~/slic3r-upload.rsa `pwd`/slic3r*.dmg 6 | READLINK=greadlink package/deploy/sftp-symlink.sh mac ~/slic3r-upload.rsa dmg *.dmg 7 | -------------------------------------------------------------------------------- /package/win/appveyor_buildscript.ps1: -------------------------------------------------------------------------------- 1 | if (!(Test-Path "C:\users\appveyor\local-lib-$env:ARCH.7z")) { 2 | wget "https://bintray.com/lordofhyphens/Slic3r/download_file?file_path=local-lib-$env:ARCH.7z" -o "C:\users\appveyor\local-lib-$env:ARCH.7z" | Write-Output 3 | } 4 | 5 | if (Test-Path "C:\users\appveyor\local-lib-$env:ARCH.7z") { 6 | cmd /c "7z x C:\Users\appveyor\local-lib-$env:ARCH.7z -oC:\projects\slic3r" -y | Write-Output 7 | rm -r 'C:\projects\slic3r\local-lib\Slic3r*' 8 | } 9 | 10 | $env:Path = "C:\Strawberry\c\bin;C:\Strawberry\perl\bin;" + $env:Path 11 | cd C:\projects\slic3r 12 | 13 | rm -r 'C:\Program Files (x86)\Microsoft Vis*\bin' -Force 14 | 15 | Add-AppveyorCompilationMessage -Message "Building Slic3r XS" 16 | $env:SLIC3R_GIT_VERSION = $(git rev-parse HEAD) 17 | wget "http://www.siusgs.com/slic3r/buildserver/win/Build_PL" -O "Build.PL" 18 | perl ./Build.pl 19 | 20 | if ($LastExitCode -ne 0) { 21 | Add-AppveyorCompilationMessage -Message "XS Failed to Build" -Category Error 22 | $host.SetShouldExit($LastExitCode) 23 | exit 24 | } 25 | Add-AppveyorCompilationMessage -Message "Making ZIP package" 26 | cd package/win 27 | ./compile_wrapper.ps1 524 | Write-Output 28 | ./package_win32.ps1 524| Write-Output 29 | -------------------------------------------------------------------------------- /package/win/appveyor_deploy.ps1: -------------------------------------------------------------------------------- 1 | 2 | Add-AppveyorCompilationMessage -Message "Uploading to server." 3 | & ./package/deploy/winscp.ps1 -DIR win -KEY $env:APPVEYOR_BUILD_FOLDER/package/deploy/slic3r-upload.ppk -FILE *.zip *>> ./sftplog.txt 4 | -------------------------------------------------------------------------------- /package/win/slic3r.exe.manifest: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Slic3r 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | -------------------------------------------------------------------------------- /package/win/slic3r.rc: -------------------------------------------------------------------------------- 1 | id ICON "../../var/Slic3r.ico" 2 | 1 VERSIONINFO 3 | FILEVERSION 1,3,0,0 4 | PRODUCTVERSION 1,3,0,0 5 | FILEOS 0x4 6 | FILETYPE 0x1 7 | BEGIN 8 | BLOCK "StringFileInfo" 9 | BEGIN 10 | BLOCK "040904E4" 11 | BEGIN 12 | VALUE "CompanyName", "Slic3r.org" 13 | VALUE "FileDescription", "3D Printer Slicer application" 14 | VALUE "FileVersion", "1.3.0" 15 | VALUE "InternalName", "slic3r.exe" 16 | VALUE "LegalCopyright", "Alessandro Ranellucci" 17 | VALUE "OriginalFilename", "slic3r.exe" 18 | VALUE "ProductName", "Slic3r" 19 | VALUE "ProductVersion", "1.3.0" 20 | END 21 | END 22 | BLOCK "VarFileInfo" 23 | BEGIN 24 | VALUE "Translation", 0x409, 1252 25 | END 26 | END 27 | 1 24 "slic3r.exe.manifest" 28 | -------------------------------------------------------------------------------- /share/locale/ja/slic3r.mo: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/slic3r/Slic3r/026c1380e0ad12176dd2fc8cdf8f6f181deeb071/share/locale/ja/slic3r.mo -------------------------------------------------------------------------------- /src/GUI/ColorScheme.hpp: -------------------------------------------------------------------------------- 1 | #ifndef COLORSCHEME_HPP 2 | #define COLORSCHEME_HPP 3 | 4 | /// Wrapper file to make the color schemes available to using applications 5 | /// without the circular include headaches. 6 | 7 | #include "ColorScheme/ColorSchemeBase.hpp" 8 | #include "ColorScheme/Default.hpp" 9 | #include "ColorScheme/Solarized.hpp" 10 | 11 | #endif 12 | -------------------------------------------------------------------------------- /src/GUI/Controller.hpp: -------------------------------------------------------------------------------- 1 | #ifndef CONTROLLER_UI_HPP 2 | #define CONTROLLER_UI_HPP 3 | 4 | namespace Slic3r { namespace GUI { 5 | 6 | class Controller : public wxPanel { 7 | public: 8 | Controller(wxWindow* parent, const wxString& title) : 9 | wxPanel(parent, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxTAB_TRAVERSAL, title) 10 | { } 11 | }; 12 | 13 | }} // Namespace Slic3r::GUI 14 | 15 | #endif // CONTROLLER_UI_HPP 16 | -------------------------------------------------------------------------------- /src/GUI/Dialogs/AboutDialog.hpp: -------------------------------------------------------------------------------- 1 | #ifndef ABOUTDIALOG_HPP 2 | #define ABOUTDIALOG_HPP 3 | #include 4 | #include 5 | #include 6 | #include 7 | #include 8 | #include 9 | #include 10 | 11 | #include "libslic3r.h" 12 | #include "misc_ui.hpp" 13 | 14 | 15 | #ifndef SLIC3R_BUILD_COMMIT 16 | #define SLIC3R_BUILD_COMMIT (Unknown revision) 17 | #endif 18 | 19 | #define VER1_(x) #x 20 | #define VER_(x) VER1_(x) 21 | #define BUILD_COMMIT VER_(SLIC3R_BUILD_COMMIT) 22 | 23 | namespace Slic3r { namespace GUI { 24 | 25 | const wxString build_date {__DATE__}; 26 | const wxString git_version {BUILD_COMMIT}; 27 | 28 | class AboutDialogLogo : public wxPanel { 29 | private: 30 | wxBitmap logo; 31 | public: 32 | AboutDialogLogo(wxWindow* parent); 33 | void repaint(wxPaintEvent& event); 34 | }; 35 | 36 | class AboutDialog : public wxDialog { 37 | public: 38 | /// Build and show the About popup. 39 | AboutDialog(wxWindow* parent); 40 | }; 41 | 42 | 43 | 44 | }} // namespace Slic3r::GUI 45 | 46 | #endif // ABOUTDIALOG_HPP 47 | -------------------------------------------------------------------------------- /src/GUI/Dialogs/MaterialEditor.cpp: -------------------------------------------------------------------------------- 1 | #include "Dialogs/PresetEditor.hpp" 2 | namespace Slic3r { namespace GUI { 3 | 4 | MaterialEditor::MaterialEditor(wxWindow* parent, t_config_option_keys options) : 5 | PresetEditor(parent, options) { 6 | 7 | this->config = Slic3r::Config::new_from_defaults(this->my_options()); 8 | this->_update_tree(); 9 | this->load_presets(); 10 | this->_update(); 11 | this->_build(); 12 | } 13 | 14 | void MaterialEditor::_update(const std::string& opt_key) { 15 | } 16 | 17 | void MaterialEditor::_build() { 18 | } 19 | }} // namespace Slic3r::GUI 20 | -------------------------------------------------------------------------------- /src/GUI/Dialogs/ObjectCutDialog.hpp: -------------------------------------------------------------------------------- 1 | #ifndef OBJECTCUTDIALOG_HPP 2 | #define OBJECTCUTDIALOG_HPP 3 | 4 | 5 | #include 6 | 7 | #include "Scene3D.hpp" 8 | #include "Model.hpp" 9 | 10 | namespace Slic3r { namespace GUI { 11 | 12 | class ObjectCutCanvas : public Scene3D { 13 | // Not sure yet 14 | 15 | protected: 16 | // Draws the cutting plane 17 | void after_render(); 18 | }; 19 | 20 | struct CutOptions { 21 | float z; 22 | enum {X,Y,Z} axis; 23 | bool keep_upper, keep_lower, rotate_lower; 24 | bool preview; 25 | }; 26 | 27 | class ObjectCutDialog : public wxDialog { 28 | public: 29 | ObjectCutDialog(wxWindow* parent, ModelObject* _model); 30 | private: 31 | // Mark whether the mesh cut is valid. 32 | // If not, it needs to be recalculated by _update() on wxTheApp->CallAfter() or on exit of the dialog. 33 | bool mesh_cut_valid = false; 34 | // Note whether the window was already closed, so a pending update is not executed. 35 | bool already_closed = false; 36 | 37 | // ObjectCutCanvas canvas; 38 | ModelObject* model_object; 39 | 40 | //std::shared_ptr model; 41 | 42 | void _mesh_slice_z_pos(); 43 | void _life_preview_active(); 44 | void _perform_cut(); 45 | void _update(); 46 | void NewModelObjects(); 47 | 48 | }; 49 | 50 | }} // namespace Slic3r::GUI 51 | #endif // OBJECTCUTDIALOG_HPP 52 | -------------------------------------------------------------------------------- /src/GUI/Dialogs/PrintEditor.cpp: -------------------------------------------------------------------------------- 1 | #include "Dialogs/PresetEditor.hpp" 2 | namespace Slic3r { namespace GUI { 3 | 4 | PrintEditor::PrintEditor(wxWindow* parent, t_config_option_keys options) : 5 | PresetEditor(parent, options) { 6 | 7 | this->config = Slic3r::Config::new_from_defaults(this->my_options()); 8 | this->_update_tree(); 9 | this->load_presets(); 10 | this->_update(); 11 | this->_build(); 12 | } 13 | 14 | void PrintEditor::_update(const std::string& opt_key) { 15 | } 16 | 17 | 18 | // TODO 19 | void PrintEditor::_on_preset_loaded() { 20 | } 21 | 22 | void PrintEditor::_build() { 23 | } 24 | }} // namespace Slic3r::GUI 25 | -------------------------------------------------------------------------------- /src/GUI/Dialogs/PrinterEditor.cpp: -------------------------------------------------------------------------------- 1 | #include "Dialogs/PresetEditor.hpp" 2 | namespace Slic3r { namespace GUI { 3 | 4 | PrinterEditor::PrinterEditor(wxWindow* parent, t_config_option_keys options) : 5 | PresetEditor(parent, options) { 6 | 7 | this->config = Slic3r::Config::new_from_defaults(this->my_options()); 8 | this->_update_tree(); 9 | this->load_presets(); 10 | this->_update(); 11 | this->_build(); 12 | } 13 | 14 | void PrinterEditor::_update(const std::string& opt_key) { 15 | } 16 | 17 | void PrinterEditor::_build() { 18 | } 19 | }} // namespace Slic3r::GUI 20 | -------------------------------------------------------------------------------- /src/GUI/MainFrame.hpp: -------------------------------------------------------------------------------- 1 | 2 | #ifndef MAINFRAME_HPP 3 | #define MAINFRAME_HPP 4 | #include 5 | #ifndef WX_PRECOMP 6 | #include 7 | #endif 8 | #include 9 | #include 10 | 11 | #include 12 | #include 13 | 14 | 15 | #include "Controller.hpp" 16 | #include "Plater.hpp" 17 | #include "Dialogs/PresetEditor.hpp" 18 | #include "Settings.hpp" 19 | #include "GUI.hpp" 20 | #include "ProgressStatusBar.hpp" 21 | 22 | namespace Slic3r { namespace GUI { 23 | 24 | class Plater; 25 | 26 | constexpr unsigned int TOOLTIP_TIMER = 32767; 27 | 28 | class MainFrame: public wxFrame 29 | { 30 | public: 31 | MainFrame(const wxString& title, const wxPoint& pos, const wxSize& size); 32 | ProgressStatusBar* statusbar {new ProgressStatusBar(this, -1)}; 33 | 34 | bool has_plater_menu() { return this->plater_menu != nullptr; } 35 | wxMenu* plater_select_menu {nullptr}; 36 | wxNotebook* tabs() { return tabpanel; } 37 | 38 | std::map preset_editor_tabs; 39 | private: 40 | wxDECLARE_EVENT_TABLE(); 41 | 42 | void init_menubar(); //< Routine to initialize all top-level menu items. 43 | void init_tabpanel(); //< Routine to initialize all of the tabs. 44 | 45 | bool loaded; //< Main frame itself has finished loading. 46 | // STUB: preset editor tabs storage 47 | // STUB: Statusbar reference 48 | 49 | wxNotebook* tabpanel; 50 | Controller* controller; 51 | Plater* plater; 52 | 53 | wxMenu* plater_menu {nullptr}; 54 | 55 | 56 | void on_plater_object_list_changed(bool force) {}; 57 | void on_plater_selection_changed(bool force) {}; 58 | 59 | 60 | }; 61 | 62 | }} // Namespace Slic3r::GUI 63 | #endif // MAINFRAME_HPP 64 | -------------------------------------------------------------------------------- /src/GUI/Notifier.hpp: -------------------------------------------------------------------------------- 1 | #ifndef NOTIFIER_HPP 2 | #define NOTIFIER_HPP 3 | 4 | namespace Slic3r { namespace GUI { 5 | 6 | /// Class to perform window manager notifications using Growl and/or DBus XWindow 7 | 8 | class Notifier { 9 | public: 10 | Notifier() { } 11 | }; 12 | 13 | }} // Namespace Slic3r::GUI 14 | 15 | #endif // NOTIFIER_HPP 16 | -------------------------------------------------------------------------------- /src/GUI/OptionsGroup/UI_Color.cpp: -------------------------------------------------------------------------------- 1 | #include "OptionsGroup/Field.hpp" 2 | #include "misc_ui.hpp" 3 | 4 | namespace Slic3r { namespace GUI { 5 | 6 | UI_Color::UI_Color(wxWindow* parent, Slic3r::ConfigOptionDef _opt ) : UI_Window(parent, _opt) { 7 | wxColour default_color(255,255,255,255); 8 | if (_opt.default_value != nullptr) { 9 | default_color = _string_to_color(_opt.default_value->getString()); 10 | } 11 | this->_picker = new wxColourPickerCtrl(parent, wxID_ANY, default_color, wxDefaultPosition, this->_default_size()); 12 | this->window = dynamic_cast(this->_picker); 13 | 14 | this->_picker->Bind(wxEVT_COLOURPICKER_CHANGED, [this](wxColourPickerEvent& e) { this->_on_change(""); e.Skip(); }); 15 | 16 | } 17 | 18 | void UI_Color::set_value(boost::any value) { 19 | if (value.type() == typeid(wxColour)) { 20 | _picker->SetColour(boost::any_cast(value)); 21 | } else if (value.type() == typeid(std::string)) { 22 | _picker->SetColour(wxString(boost::any_cast(value))); 23 | } else if (value.type() == typeid(const char*)) { 24 | _picker->SetColour(wxString(boost::any_cast(value))); 25 | } else if (value.type() == typeid(wxString)) { 26 | _picker->SetColour(boost::any_cast(value)); 27 | } else { 28 | Slic3r::Log::warn(this->LogChannel(), LOG_WSTRING("Type " << value.type().name() << " is not handled in set_value.")); 29 | } 30 | } 31 | 32 | std::string UI_Color::get_string() { 33 | return _picker->GetColour().GetAsString(wxC2S_HTML_SYNTAX).ToStdString(); 34 | } 35 | 36 | wxColour UI_Color::_string_to_color(const std::string& color) { 37 | // if invalid color string sent, use the default 38 | wxColour col(255,255,255,255); 39 | if (col.Set(wxString(color))) 40 | return col; 41 | return wxColor(); 42 | } 43 | 44 | } } // Namespace Slic3r::GUI 45 | -------------------------------------------------------------------------------- /src/GUI/Plater/Plate3D.hpp: -------------------------------------------------------------------------------- 1 | #ifndef PLATE3D_HPP 2 | #define PLATE3D_HPP 3 | #include 4 | #ifndef WX_PRECOMP 5 | #include 6 | #endif 7 | #include "Plater/PlaterObject.hpp" 8 | #include "Scene3D.hpp" 9 | #include "Settings.hpp" 10 | #include "Model.hpp" 11 | #include "Config.hpp" 12 | 13 | namespace Slic3r { namespace GUI { 14 | 15 | class Plate3D : public Scene3D { 16 | public: 17 | Plate3D(wxWindow* parent, const wxSize& size, std::vector& _objects, std::shared_ptr _model, std::shared_ptr _config); 18 | 19 | /// Called to regenerate rendered volumes from the model 20 | void update(); 21 | 22 | /// Registered function to fire when objects are selected. 23 | std::function on_select_object {}; 24 | 25 | /// Registered function to fire when an instance is moved. 26 | std::function on_instances_moved {}; 27 | 28 | void selection_changed(){Refresh();} 29 | protected: 30 | // Render each volume as a different color and check what color is beneath 31 | // the mouse to determine the hovered volume 32 | void before_render(); 33 | 34 | // Mouse events are needed to handle selecting and moving objects 35 | void mouse_up(wxMouseEvent &e); 36 | void mouse_move(wxMouseEvent &e); 37 | void mouse_down(wxMouseEvent &e); 38 | 39 | private: 40 | void color_volumes(); 41 | Point pos, move_start; 42 | bool hover = false, mouse = false, moving = false; 43 | uint hover_volume, hover_object, moving_volume; 44 | 45 | std::vector& objects; //< reference to parent vector 46 | std::shared_ptr model; 47 | std::shared_ptr config; 48 | }; 49 | 50 | } } // Namespace Slic3r::GUI 51 | #endif 52 | -------------------------------------------------------------------------------- /src/GUI/Plater/PlaterObject.hpp: -------------------------------------------------------------------------------- 1 | #ifndef PLATEROBJECT_HPP 2 | #define PLATEROBJECT_HPP 3 | #include 4 | #ifndef WX_PRECOMP 5 | #include 6 | #endif 7 | 8 | #include "ExPolygonCollection.hpp" 9 | #include "Model.hpp" 10 | 11 | namespace Slic3r { namespace GUI { 12 | 13 | class PlaterObject { 14 | public: 15 | std::string name {""}; 16 | int identifier {0}; 17 | std::string input_file {""}; 18 | int input_file_obj_idx {-1}; 19 | 20 | bool selected {false}; 21 | int selected_instance {-1}; 22 | 23 | Slic3r::ExPolygonCollection thumbnail; 24 | Slic3r::ExPolygonCollection transformed_thumbnail; 25 | 26 | // read only 27 | std::vector instance_thumbnails; 28 | 29 | Slic3r::ExPolygonCollection& make_thumbnail(const Slic3r::Model model, int obj_idx); 30 | Slic3r::ExPolygonCollection& make_thumbnail(const std::shared_ptr model, int obj_idx); 31 | 32 | Slic3r::ExPolygonCollection& transform_thumbnail(const Slic3r::Model model, int obj_idx); 33 | Slic3r::ExPolygonCollection& transform_thumbnail(const std::shared_ptr model, int obj_idx); 34 | 35 | bool instance_contains(Slic3r::Point point) const; 36 | 37 | PlaterObject& operator=(const PlaterObject& other); 38 | PlaterObject& operator=(PlaterObject&& other); 39 | 40 | PlaterObject(const PlaterObject& other) = default; 41 | PlaterObject() = default; 42 | 43 | protected: 44 | const std::string LogChannel {"PlaterObject"}; 45 | 46 | }; 47 | 48 | }} // Namespace Slic3r::GUI 49 | #endif 50 | -------------------------------------------------------------------------------- /src/GUI/Plater/Preview2D.hpp: -------------------------------------------------------------------------------- 1 | #ifndef PREVIEW2D_HPP 2 | #define PREVIEW2D_HPP 3 | #include 4 | #ifndef WX_PRECOMP 5 | #include 6 | #endif 7 | 8 | #include "Model.hpp" 9 | #include "Config.hpp" 10 | 11 | namespace Slic3r { namespace GUI { 12 | 13 | class Preview2D : public wxPanel { 14 | public: 15 | void reload_print() {}; 16 | Preview2D(wxWindow* parent, const wxSize& size, std::vector& _objects, std::shared_ptr _model, std::shared_ptr _config) : 17 | wxPanel(parent, wxID_ANY, wxDefaultPosition, size, wxTAB_TRAVERSAL), objects(_objects), model(_model), config(_config) 18 | {} 19 | 20 | void enabled(bool enable = true) {} 21 | private: 22 | std::vector& objects; //< reference to parent vector 23 | std::shared_ptr model; 24 | std::shared_ptr config; 25 | }; 26 | 27 | } } // Namespace Slic3r::GUI 28 | #endif 29 | -------------------------------------------------------------------------------- /src/GUI/Plater/Preview3D.hpp: -------------------------------------------------------------------------------- 1 | #ifndef PREVIEW3D_HPP 2 | #define PREVIEW3D_HPP 3 | #include 4 | #ifndef WX_PRECOMP 5 | #include 6 | #endif 7 | 8 | #include "PlaterObject.hpp" 9 | #include "Scene3D.hpp" 10 | #include "Model.hpp" 11 | #include "Config.hpp" 12 | #include "Print.hpp" 13 | 14 | namespace Slic3r { namespace GUI { 15 | 16 | class PreviewScene3D : public Scene3D { 17 | public: 18 | PreviewScene3D(wxWindow* parent, const wxSize& size) : Scene3D(parent,size){} 19 | // TODO: load_print_toolpaths(Print); 20 | // TODO: load_print_object_toolpaths(PrintObject); 21 | void resetObjects(){volumes.clear();} 22 | }; 23 | 24 | class Preview3D : public wxPanel { 25 | public: 26 | void reload_print(); 27 | Preview3D(wxWindow* parent, const wxSize& size, std::shared_ptr _print, std::vector& _objects, std::shared_ptr _model, std::shared_ptr _config); 28 | void enabled(bool enable = true) {} 29 | private: 30 | void load_print(); 31 | void set_z(float z); 32 | bool loaded = false, _enabled = false; 33 | std::vector layers_z; 34 | std::shared_ptr print; 35 | PreviewScene3D canvas; 36 | wxSlider* slider; 37 | wxStaticText* z_label; 38 | std::vector& objects; //< reference to parent vector 39 | std::shared_ptr model; 40 | std::shared_ptr config; 41 | }; 42 | 43 | } } // Namespace Slic3r::GUI 44 | #endif 45 | -------------------------------------------------------------------------------- /src/GUI/Plater/PreviewDLP.hpp: -------------------------------------------------------------------------------- 1 | #ifndef PREVIEWDLP_HPP 2 | #define PREVIEWDLP_HPP 3 | #include 4 | #ifndef WX_PRECOMP 5 | #include 6 | #endif 7 | 8 | #include "Model.hpp" 9 | #include "Config.hpp" 10 | 11 | namespace Slic3r { namespace GUI { 12 | 13 | class PreviewDLP : public wxPanel { 14 | public: 15 | void reload_print() {}; 16 | PreviewDLP(wxWindow* parent, const wxSize& size, std::vector& _objects, std::shared_ptr _model, std::shared_ptr _config) : 17 | wxPanel(parent, wxID_ANY, wxDefaultPosition, size, wxTAB_TRAVERSAL), objects(_objects), model(_model), config(_config) 18 | {} 19 | 20 | void enabled(bool enable = true) {} 21 | private: 22 | std::vector& objects; //< reference to parent vector 23 | std::shared_ptr model; 24 | std::shared_ptr config; 25 | }; 26 | 27 | } } // Namespace Slic3r::GUI 28 | #endif 29 | -------------------------------------------------------------------------------- /src/GUI/Settings.cpp: -------------------------------------------------------------------------------- 1 | #include "Settings.hpp" 2 | #include "misc_ui.hpp" 3 | 4 | namespace Slic3r { namespace GUI { 5 | 6 | std::unique_ptr ui_settings {nullptr}; 7 | 8 | Settings::Settings() { 9 | // Initialize fonts 10 | this->_small_font = wxSystemSettings::GetFont(wxSYS_DEFAULT_GUI_FONT); 11 | if (the_os == OS::Mac) _small_font.SetPointSize(11); 12 | this->_small_bold_font = wxSystemSettings::GetFont(wxSYS_DEFAULT_GUI_FONT); 13 | if (the_os == OS::Mac) _small_bold_font.SetPointSize(11); 14 | this->_small_bold_font.MakeBold(); 15 | this->_medium_font = wxSystemSettings::GetFont(wxSYS_DEFAULT_GUI_FONT); 16 | this->_medium_font.SetPointSize(12); 17 | 18 | this->_scroll_step = wxSystemSettings::GetFont(wxSYS_DEFAULT_GUI_FONT).GetPointSize(); 19 | } 20 | void Settings::save_settings() { 21 | /* 22 | sub save_settings { 23 | my ($self) = @_; 24 | Slic3r::Config->write_ini("$datadir/slic3r.ini", $Settings); 25 | } 26 | 27 | */ 28 | 29 | } 30 | 31 | void Settings::save_window_pos(wxWindow* ref, wxString name) { 32 | } 33 | 34 | void Settings::restore_window_pos(wxWindow* ref, wxString name) { 35 | } 36 | }} // namespace Slic3r::GUI 37 | -------------------------------------------------------------------------------- /src/slic3r.hpp: -------------------------------------------------------------------------------- 1 | #ifndef SLIC3R_HPP 2 | #define SLIC3R_HPP 3 | 4 | #include "ConfigBase.hpp" 5 | #include "IO.hpp" 6 | #include "Model.hpp" 7 | 8 | namespace Slic3r { 9 | 10 | class CLI { 11 | public: 12 | int run(int argc, char **argv); 13 | 14 | const FullPrintConfig& full_print_config_ref() { return this->full_print_config; } 15 | 16 | private: 17 | ConfigDef config_def; 18 | DynamicConfig config; 19 | DynamicPrintConfig print_config; 20 | FullPrintConfig full_print_config; 21 | t_config_option_keys input_files, actions, transforms; 22 | std::vector models; 23 | std::string last_outfile; 24 | 25 | /// Prints usage of the CLI. 26 | void print_help(bool include_print_options = false) const; 27 | 28 | /// Exports loaded models to a file of the specified format, according to the options affecting output filename. 29 | void export_models(IO::ExportFormat format); 30 | 31 | bool has_print_action() const { 32 | return this->config.has("export_gcode") || this->config.has("export_sla_svg"); 33 | }; 34 | 35 | std::string output_filepath(const Model &model, IO::ExportFormat format) const; 36 | }; 37 | 38 | } 39 | 40 | #endif 41 | -------------------------------------------------------------------------------- /src/standalone/config.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/slic3r/Slic3r/026c1380e0ad12176dd2fc8cdf8f6f181deeb071/src/standalone/config.h -------------------------------------------------------------------------------- /src/test/GUI/test_misc_ui.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include "misc_ui.hpp" 3 | #include 4 | 5 | using namespace std::string_literals; 6 | using namespace Slic3r::GUI; 7 | 8 | SCENARIO( "trim_zeroes leaves parsable numbers.") { 9 | auto n192 {"19.200000000"s}; 10 | auto n00 {"0.0"s}; 11 | auto n0 {"0."s}; 12 | REQUIRE(trim_zeroes(n00) == "0.0"s); 13 | REQUIRE(trim_zeroes(n0) == "0.0"s); 14 | REQUIRE(trim_zeroes(n192) == "19.2"s); 15 | } 16 | 17 | SCENARIO ( "trim_zeroes doesn't reduce precision.") { 18 | GIVEN( "A number with a long string of zeroes and a 0") { 19 | auto n12 {"19.200000002"s}; 20 | auto n120 {"19.2000000020"s}; 21 | auto n1200 {"19.20000000200"s}; 22 | 23 | REQUIRE(trim_zeroes(n12) == "19.200000002"s); 24 | REQUIRE(trim_zeroes(n120) == "19.200000002"s); 25 | REQUIRE(trim_zeroes(n1200) == "19.200000002"s); 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /src/test/GUI/test_optionsgroup.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #ifndef WX_PRECOMP 3 | #include "wx/app.h" 4 | #include "wx/sizer.h" 5 | #include "wx/uiaction.h" 6 | #endif // WX_PRECOMP 7 | #include 8 | 9 | #include "OptionsGroup.hpp" 10 | #include "ConfigBase.hpp" 11 | #include "Config.hpp" 12 | 13 | using namespace Slic3r::GUI; 14 | 15 | SCENARIO("OptionsGroup: Construction.") { 16 | } 17 | SCENARIO("ConfigOptionsGroup: Factory methods") { 18 | GIVEN("A default Slic3r config") { 19 | OptionsGroup optgroup; 20 | WHEN("add_single_option is called for avoid_crossing_perimeters") { 21 | THEN("a UI_Checkbox is added to the field map") { 22 | REQUIRE(optgroup.get_field("avoid_crossing_perimeters") != nullptr); 23 | } 24 | THEN("a ConfigOptionBool is added to the option map") { 25 | REQUIRE(optgroup.get_field("avoid_crossing_perimeters") != nullptr); 26 | } 27 | } 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /src/test/GUI/testableframe.cpp: -------------------------------------------------------------------------------- 1 | /////////////////////////////////////////////////////////////////////////////// 2 | // Name: testableframe.cpp 3 | // Purpose: An improved wxFrame for unit-testing 4 | // Author: Steven Lamerton 5 | // Copyright: (c) 2010 Steven Lamerton 6 | // Licence: wxWindows licence 7 | /////////////////////////////////////////////////////////////////////////////// 8 | #ifdef __BORLANDC__ 9 | #pragma hdrstop 10 | #endif 11 | 12 | #include "wx/app.h" 13 | #include "testableframe.h" 14 | 15 | wxTestableFrame::wxTestableFrame() : wxFrame(NULL, wxID_ANY, "Test Frame") 16 | { 17 | // Use fixed position to facilitate debugging. 18 | Move(200, 200); 19 | 20 | Show(); 21 | } 22 | 23 | void wxTestableFrame::OnEvent(wxEvent& evt) 24 | { 25 | m_count[evt.GetEventType()]++; 26 | 27 | if(! evt.IsCommandEvent() ) 28 | evt.Skip(); 29 | } 30 | 31 | int wxTestableFrame::GetEventCount(wxEventType type) 32 | { 33 | return m_count[type]; 34 | } 35 | 36 | void wxTestableFrame::ClearEventCount(wxEventType type) 37 | { 38 | m_count[type] = 0; 39 | } 40 | 41 | EventCounter::EventCounter(wxWindow* win, wxEventType type) : m_type(type), 42 | m_win(win) 43 | 44 | { 45 | m_frame = wxStaticCast(wxTheApp->GetTopWindow(), wxTestableFrame); 46 | 47 | m_win->Connect(m_type, wxEventHandler(wxTestableFrame::OnEvent), 48 | NULL, m_frame); 49 | } 50 | 51 | EventCounter::~EventCounter() 52 | { 53 | m_win->Disconnect(m_type, wxEventHandler(wxTestableFrame::OnEvent), 54 | NULL, m_frame); 55 | 56 | //This stops spurious counts from previous tests 57 | Clear(); 58 | 59 | m_frame = NULL; 60 | m_win = NULL; 61 | } 62 | -------------------------------------------------------------------------------- /src/test/GUI/testableframe.h: -------------------------------------------------------------------------------- 1 | /////////////////////////////////////////////////////////////////////////////// 2 | // Name: testableframe.h 3 | // Purpose: An improved wxFrame for unit-testing 4 | // Author: Steven Lamerton 5 | // Copyright: (c) 2010 Steven Lamerton 6 | // Licence: wxWindows licence 7 | /////////////////////////////////////////////////////////////////////////////// 8 | 9 | #include "wx/frame.h" 10 | #include "wx/hashmap.h" 11 | #include "wx/event.h" 12 | 13 | class wxTestableFrame : public wxFrame 14 | { 15 | public: 16 | wxTestableFrame(); 17 | 18 | void OnEvent(wxEvent& evt); 19 | 20 | private: 21 | friend class EventCounter; 22 | 23 | int GetEventCount(wxEventType type); 24 | void ClearEventCount(wxEventType type); 25 | 26 | wxLongToLongHashMap m_count; 27 | }; 28 | 29 | class EventCounter 30 | { 31 | public: 32 | EventCounter(wxWindow* win, wxEventType type); 33 | ~EventCounter(); 34 | 35 | int GetCount() { return m_frame->GetEventCount(m_type); } 36 | void Clear() { m_frame->ClearEventCount(m_type); } 37 | 38 | private: 39 | wxEventType m_type; 40 | wxTestableFrame* m_frame; 41 | wxWindow* m_win; 42 | }; 43 | -------------------------------------------------------------------------------- /src/test/inputs/20mmbox.stl: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /src/test/inputs/README.md: -------------------------------------------------------------------------------- 1 | Directory containing test-specific input files that are not source code. 2 | 3 | --- 4 | 5 | Rules 6 | === 7 | * Each folder shall be named for the test that it supports. 8 | * `test_config` directory supports `test_config.cpp`, etc. 9 | * If a specific test file is reused across multiple tests, it should go in the `common` directory. 10 | * Each extra input file should be named in such a way that it is relevant to the specific feature of it. 11 | * No files should have special characters in the name (unless those special characters are part of the test). 12 | * No spaces should be in the file paths (again, unless testing the presence of spaces is part of the test). 13 | * Input files that are 3D models should be as small/specific as possible. 14 | * Do not add copyrighted models without permission from the copyright holder. 15 | * Do not add NonCommercial models, these would need to be relicensed from the original holder. 16 | * Add any necessary licensing or attributation information as `.license` 17 | * Example: A CC-By-SA 3D model called `cool_statue_bro.stl` should have its attributation/license information included in a file called `cool_statue_bro.license` 18 | * Any submitted files without an accompanying `.license` file are assumed to be licensed under [CC-By-SA 3.0](https://creativecommons.org/licenses/by-sa/3.0/us/). 19 | * The author of a commit adding any extra input files asserts that, via the process of committing those files, that they 20 | * have abided by the terms of all licensing agreements involved with the files added or 21 | * are the author of the files in question and submit them to the Slic3r project under the terms of [CC-By-SA 3.0](https://creativecommons.org/licenses/by-sa/3.0/us/). 22 | -------------------------------------------------------------------------------- /src/test/inputs/test_3mf/Geräte/box.3mf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/slic3r/Slic3r/026c1380e0ad12176dd2fc8cdf8f6f181deeb071/src/test/inputs/test_3mf/Geräte/box.3mf -------------------------------------------------------------------------------- /src/test/inputs/test_amf/20mmbox_deflated-in_directories.amf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/slic3r/Slic3r/026c1380e0ad12176dd2fc8cdf8f6f181deeb071/src/test/inputs/test_amf/20mmbox_deflated-in_directories.amf -------------------------------------------------------------------------------- /src/test/inputs/test_amf/20mmbox_deflated-mult_files.amf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/slic3r/Slic3r/026c1380e0ad12176dd2fc8cdf8f6f181deeb071/src/test/inputs/test_amf/20mmbox_deflated-mult_files.amf -------------------------------------------------------------------------------- /src/test/inputs/test_amf/20mmbox_deflated.amf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/slic3r/Slic3r/026c1380e0ad12176dd2fc8cdf8f6f181deeb071/src/test/inputs/test_amf/20mmbox_deflated.amf -------------------------------------------------------------------------------- /src/test/inputs/test_amf/5061-malicious.amf: -------------------------------------------------------------------------------- 1 | 2 | 3 | Split Pyramid 4 | John Smith 5 | 6 | 7 | 8 | 200 9 | 2.50.50 10 | 11 | 12 | Hard side 13 | 999999212 14 | 002 15 | 16 | 17 | 18 | 19 | 20 | 21 | -------------------------------------------------------------------------------- /src/test/inputs/test_amf/read-amf.amf: -------------------------------------------------------------------------------- 1 | 2 | 3 | Split Pyramid 4 | John Smith 5 | 6 | 7 | 8 | 200 9 | 2.50.50 10 | 3.52.50 11 | 12 | 13 | Hard side 14 | 212 15 | 002 16 | 17 | 18 | 19 | 20 | -------------------------------------------------------------------------------- /src/test/inputs/test_cli/20mmbox_config.ini: -------------------------------------------------------------------------------- 1 | # generated by Slic3r 1.3.1-dev on 2018-11-24 17:57:55 2 | bottom_solid_layers = 0 3 | brim_width = 0 4 | complete_objects = 0 5 | external_perimeter_extrusion_width = 0.2 6 | external_perimeters_first = 0 7 | extra_perimeters = 1 8 | extruder_offset = 0x0 9 | extrusion_axis = E 10 | extrusion_width = 0 11 | fill_density = 0% 12 | fill_gaps = 1 13 | first_layer_extrusion_width = 0.2 14 | first_layer_height = 0.3 15 | infill_extrusion_width = 0 16 | interface_shells = 0 17 | interior_brim_width = 0 18 | layer_height = 0.3 19 | min_shell_thickness = 0 20 | only_retract_when_crossing_perimeters = 1 21 | ooze_prevention = 0 22 | perimeter_extrusion_width = 0.2 23 | perimeters = 1 24 | skirts = 0 25 | support_material = 0 26 | support_material_extrusion_width = 0 27 | temperature = 206 28 | thin_walls = 1 29 | threads = 16 30 | top_infill_extrusion_width = 0 31 | top_infill_pattern = rectilinear 32 | top_solid_infill_speed = 15 33 | top_solid_layers = 0 34 | use_firmware_retraction = 1 35 | use_volumetric_e = 1 36 | wipe = 0 37 | xy_size_compensation = 0 38 | z_offset = 0 39 | -------------------------------------------------------------------------------- /src/test/inputs/test_gcodewriter/config_lift_unlift.ini: -------------------------------------------------------------------------------- 1 | # generated by Slic3r 1.3.1-dev on 2018-07-27 01:40:55 2 | before_layer_gcode = 3 | between_objects_gcode = 4 | end_filament_gcode = "; Filament-specific end gcode \n;END gcode for filament\n" 5 | end_gcode = M104 S0 ; turn off temperature\nG28 X0 ; home X axis\nM84 ; disable motors\n 6 | extrusion_axis = E 7 | extrusion_multiplier = 1 8 | filament_cost = 0 9 | filament_density = 0 10 | filament_diameter = 3 11 | filament_max_volumetric_speed = 0 12 | filament_notes = "" 13 | gcode_comments = 0 14 | gcode_flavor = reprap 15 | label_printed_objects = 0 16 | layer_gcode = 17 | max_print_speed = 80 18 | max_volumetric_speed = 0 19 | notes = 20 | pressure_advance = 0 21 | printer_notes = 22 | retract_length = 2 23 | retract_length_toolchange = 10 24 | retract_lift = 1.5 25 | retract_lift_above = 0 26 | retract_lift_below = 0 27 | retract_restart_extra = 0 28 | retract_restart_extra_toolchange = 0 29 | retract_speed = 40 30 | start_filament_gcode = "; Filament gcode\n" 31 | start_gcode = G28 ; home all axes\nG1 Z5 F5000 ; lift nozzle\n 32 | toolchange_gcode = 33 | travel_speed = 130 34 | use_firmware_retraction = 0 35 | use_relative_e_distances = 0 36 | use_set_and_wait_bed = 0 37 | use_set_and_wait_extruder = 0 38 | use_volumetric_e = 0 39 | -------------------------------------------------------------------------------- /src/test/inputs/test_preset/preset_load_numeric.ini: -------------------------------------------------------------------------------- 1 | # generated by joseph lenox 2 | adaptive_slicing = 1 3 | -------------------------------------------------------------------------------- /src/test/inputs/test_preset_chooser/incompat-material-profile.ini: -------------------------------------------------------------------------------- 1 | # generated by Slic3r 1.3.0-dev on 2018-03-23 03:49:17 2 | bed_temperature = 70 3 | bridge_fan_speed = 100 4 | compatible_printers = printer-profile-2;nothing 5 | cooling = 1 6 | disable_fan_first_layers = 4 7 | end_filament_gcode = "; Filament-specific end gcode \n;END gcode for filament\n" 8 | extrusion_multiplier = 1 9 | fan_always_on = 1 10 | fan_below_layer_time = 10 11 | filament_colour = #4EFF00 12 | filament_cost = 30 13 | filament_density = 1.25 14 | filament_diameter = 1.73 15 | filament_max_volumetric_speed = 0 16 | filament_notes = "" 17 | filament_settings_id = 18 | first_layer_bed_temperature = 70 19 | first_layer_temperature = 220 20 | max_fan_speed = 100 21 | min_fan_speed = 100 22 | min_print_speed = 10 23 | slowdown_below_layer_time = 60 24 | start_filament_gcode = "; Filament gcode\n; ATOMIC PLA" 25 | temperature = 218 26 | -------------------------------------------------------------------------------- /src/test/inputs/test_preset_chooser/material-profile.ini: -------------------------------------------------------------------------------- 1 | # generated by Slic3r 1.3.0-dev on 2018-03-23 03:49:17 2 | bed_temperature = 70 3 | bridge_fan_speed = 100 4 | compatible_printers = 5 | cooling = 1 6 | disable_fan_first_layers = 4 7 | end_filament_gcode = "; Filament-specific end gcode \n;END gcode for filament\n" 8 | extrusion_multiplier = 1 9 | fan_always_on = 1 10 | fan_below_layer_time = 10 11 | filament_colour = #4EFF00 12 | filament_cost = 30 13 | filament_density = 1.25 14 | filament_diameter = 1.73 15 | filament_max_volumetric_speed = 0 16 | filament_notes = "" 17 | filament_settings_id = 18 | first_layer_bed_temperature = 70 19 | first_layer_temperature = 220 20 | max_fan_speed = 100 21 | min_fan_speed = 100 22 | min_print_speed = 10 23 | slowdown_below_layer_time = 60 24 | start_filament_gcode = "; Filament gcode\n; ATOMIC PLA" 25 | temperature = 218 26 | -------------------------------------------------------------------------------- /src/test/libslic3r/test_3mf.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include "Model.hpp" 4 | #include "TMF.hpp" 5 | 6 | 7 | using namespace Slic3r; 8 | 9 | SCENARIO("Reading 3mf file") { 10 | GIVEN("umlauts in the path of the file") { 11 | auto model {new Slic3r::Model()}; 12 | WHEN("3mf model is read") { 13 | auto ret = Slic3r::IO::TMF::read(testfile("test_3mf/Geräte/box.3mf"),model); 14 | THEN("read should not return 0") { 15 | REQUIRE(ret == 1); 16 | } 17 | } 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /src/test/libslic3r/test_polygon.cpp: -------------------------------------------------------------------------------- 1 | 2 | #include 3 | 4 | #include "Point.hpp" 5 | #include "Polygon.hpp" 6 | 7 | 8 | using namespace Slic3r; 9 | 10 | 11 | // This test currently only covers remove_collinear_points. 12 | // All remaining tests are to be ported from xs/t/06_polygon.t 13 | 14 | Points collinear_circle({ 15 | Point::new_scale(0, 0), // 3 collinear points at beginning 16 | Point::new_scale(10, 0), 17 | Point::new_scale(20, 0), 18 | Point::new_scale(30, 10), 19 | Point::new_scale(40, 20), // 2 collinear points 20 | Point::new_scale(40, 30), 21 | Point::new_scale(30, 40), // 3 collinear points 22 | Point::new_scale(20, 40), 23 | Point::new_scale(10, 40), 24 | Point::new_scale(-10, 20), 25 | Point::new_scale(-20, 10), 26 | Point::new_scale(-20, 0), // 3 collinear points at end 27 | Point::new_scale(-10, 0), 28 | Point::new_scale(-5, 0) 29 | }); 30 | 31 | 32 | SCENARIO("Remove collinear points from Polygon") { 33 | GIVEN("Polygon with collinear points"){ 34 | Polygon p(collinear_circle); 35 | WHEN("collinear points are removed") { 36 | p.remove_collinear_points(); 37 | THEN("Leading collinear points are removed") { 38 | REQUIRE(p.points.front() == Point::new_scale(20, 0)); 39 | } 40 | THEN("Trailing collinear points are removed") { 41 | REQUIRE(p.points.back() == Point::new_scale(-20, 0)); 42 | } 43 | THEN("Number of remaining points is correct") { 44 | REQUIRE(p.points.size() == 7); 45 | } 46 | } 47 | } 48 | } -------------------------------------------------------------------------------- /src/test/libslic3r/test_test_data.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | 4 | #include "test_data.hpp" 5 | 6 | using namespace Slic3r::Test; 7 | 8 | SCENARIO("init_print functionality") { 9 | GIVEN("A default config") { 10 | config_ptr config {Slic3r::Config::new_from_defaults()}; 11 | std::stringstream gcode; 12 | WHEN("init_print is called with a single mesh.") { 13 | Slic3r::Model model; 14 | auto print = init_print({TestMesh::cube_20x20x20}, model, config, true); 15 | gcode.clear(); 16 | THEN("One mesh/printobject is in the resulting Print object.") { 17 | REQUIRE(print->objects.size() == 1); 18 | } 19 | THEN("print->process() doesn't crash.") { 20 | REQUIRE_NOTHROW(print->process()); 21 | } 22 | THEN("Export gcode functions outputs text.") { 23 | print->process(); 24 | print->export_gcode(gcode, true); 25 | REQUIRE(gcode.str().size() > 0); 26 | } 27 | } 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /src/test/test_harness.cpp: -------------------------------------------------------------------------------- 1 | #define CATCH_CONFIG_MAIN // This tells Catch to provide a main() - only do this in one cpp file 2 | #include 3 | -------------------------------------------------------------------------------- /src/test/test_options.hpp.in: -------------------------------------------------------------------------------- 1 | #ifndef TEST_OPTIONS_HPP 2 | #include 3 | 4 | /// Directory path, passed in from the outside, for the path to the test inputs dir. 5 | constexpr auto* testfile_dir {"@TESTFILE_DIR@"}; 6 | 7 | inline std::string testfile(std::string filename) { 8 | std::string result; 9 | result.append(testfile_dir); 10 | result.append(filename); 11 | return result; 12 | } 13 | 14 | #endif // TEST_OPTIONS_HPP 15 | -------------------------------------------------------------------------------- /src/windows-build.txt: -------------------------------------------------------------------------------- 1 | Install: 2 | mingw 3 | boost 4 | cmake 5 | git 6 | 7 | Assuming boost is in c:\program files\boost\boost_1_61_0 and mingw is in c:\mingw 8 | 9 | start cmd.exe 10 | > cd c:\program files\boost\boost_1_61_0 11 | > set PATH=c:\mingw\bin 12 | > bootstrap gcc 13 | > .\b2 --build-dir=c:\boost-mingw toolset=gcc link=static runtime-link=static variant=release --with-system --with-thread 14 | leave cmd window open 15 | 16 | start git bash 17 | > cd /c 18 | > git clone http://github.com/slic3r/slic3r 19 | > cd slic3r 20 | > git checkout cppsvg 21 | close git bash when done 22 | 23 | make sure c:\mingw\bin is part of the Path system variable, add it otherwise 24 | 25 | start cmake gui 26 | source code: c:\slic3r\src 27 | build directory: c:\slic3r\build 28 | click configure, select "mingw makefiles" from list, select "default native compilers", click finish 29 | click generate 30 | close cmake gui 31 | 32 | alternatively, do it from command line: 33 | cmake ..\src -G "MinGW Makefiles" -DBOOST_ROOT="c:\program files\boost\boost_1_61_0" 34 | (in case cmake can't find the libs, -DBoost_DEBUG=1 and -DBoost_COMPILER=-mgw46 are useful) 35 | 36 | go back to cmd window 37 | > cd c:\slic3r\build 38 | > mingw32-make.exe 39 | might be mingw64 on 64-bit setup, I'm not sure 40 | The resulting slic3r.exe is the target executable, it has no dependencies except windows system libraries (kernel32 and msvcrt) 41 | -------------------------------------------------------------------------------- /t/avoid_crossing_perimeters.t: -------------------------------------------------------------------------------- 1 | use Test::More tests => 1; 2 | use strict; 3 | use warnings; 4 | 5 | BEGIN { 6 | use FindBin; 7 | use lib "$FindBin::Bin/../lib"; 8 | use local::lib "$FindBin::Bin/../local-lib"; 9 | } 10 | 11 | use List::Util qw(first sum); 12 | use Slic3r; 13 | use Slic3r::Test; 14 | 15 | { 16 | my $config = Slic3r::Config->new_from_defaults; 17 | $config->set('avoid_crossing_perimeters', 2); 18 | my $print = Slic3r::Test::init_print('20mm_cube', config => $config, duplicate => 2); 19 | ok my $gcode = Slic3r::Test::gcode($print), "no crash with avoid_crossing_perimeters and multiple objects"; 20 | } 21 | 22 | __END__ 23 | -------------------------------------------------------------------------------- /t/config.t: -------------------------------------------------------------------------------- 1 | use Test::More tests => 1; 2 | use strict; 3 | use warnings; 4 | 5 | BEGIN { 6 | use FindBin; 7 | use lib "$FindBin::Bin/../lib"; 8 | use local::lib "$FindBin::Bin/../local-lib"; 9 | } 10 | 11 | use Slic3r; 12 | use Slic3r::Test; 13 | 14 | { 15 | my $config = Slic3r::Config->new_from_defaults; 16 | $config->set('perimeter_extrusion_width', '250%'); 17 | ok $config->validate, 'percent extrusion width is validated'; 18 | 19 | my $print = Slic3r::Test::init_print('20mm_cube', config => $config, scale => 2); 20 | } 21 | 22 | __END__ 23 | -------------------------------------------------------------------------------- /t/loops.t: -------------------------------------------------------------------------------- 1 | use Test::More; 2 | use strict; 3 | use warnings; 4 | 5 | plan tests => 4; 6 | 7 | BEGIN { 8 | use FindBin; 9 | use lib "$FindBin::Bin/../lib"; 10 | use local::lib "$FindBin::Bin/../local-lib"; 11 | } 12 | 13 | use Slic3r; 14 | use Slic3r::Geometry qw(Z epsilon scale); 15 | use Slic3r::Test; 16 | 17 | { 18 | # We want to check what happens when three concentric loops happen 19 | # to be at the same height, the two external ones being ccw and the other being 20 | # a hole, thus cw. So we create three cubes, centered around origin, the internal 21 | # one having reversed normals. 22 | my $mesh1 = Slic3r::Test::mesh('20mm_cube'); 23 | 24 | # center around origin 25 | my $bb = $mesh1->bounding_box; 26 | $mesh1->translate( 27 | -($bb->x_min + $bb->size->x/2), 28 | -($bb->y_min + $bb->size->y/2), #// 29 | -($bb->z_min + $bb->size->z/2), 30 | ); 31 | 32 | my $mesh2 = $mesh1->clone; 33 | $mesh2->scale(1.2); 34 | 35 | my $mesh3 = $mesh2->clone; 36 | $mesh3->scale(1.2); 37 | 38 | $mesh1->reverse_normals; 39 | ok $mesh1->volume < 0, 'reverse_normals'; 40 | 41 | my $all_meshes = Slic3r::TriangleMesh->new; 42 | $all_meshes->merge($_) for $mesh1, $mesh2, $mesh3; 43 | 44 | my $loops = $all_meshes->slice_at(Z, 0); 45 | is scalar(@$loops), 1, 'one expolygon returned'; 46 | is scalar(@{$loops->[0]->holes}), 1, 'expolygon has one hole'; 47 | ok abs(-$loops->[0]->holes->[0]->area - scale($bb->size->x)*scale($bb->size->y)) < epsilon, #)) 48 | 'hole has expected size'; 49 | } 50 | 51 | __END__ 52 | -------------------------------------------------------------------------------- /t/pressure.t: -------------------------------------------------------------------------------- 1 | use Test::More tests => 1; 2 | use strict; 3 | use warnings; 4 | 5 | BEGIN { 6 | use FindBin; 7 | use lib "$FindBin::Bin/../lib"; 8 | use local::lib "$FindBin::Bin/../local-lib"; 9 | } 10 | 11 | use List::Util qw(); 12 | use Slic3r; 13 | use Slic3r::Geometry qw(epsilon); 14 | use Slic3r::Test; 15 | 16 | { 17 | my $config = Slic3r::Config->new_from_defaults; 18 | $config->set('pressure_advance', 10); 19 | $config->set('retract_length', [1]); 20 | 21 | my $print = Slic3r::Test::init_print('20mm_cube', config => $config, duplicate => 2); 22 | my $retracted = $config->retract_length->[0]; 23 | Slic3r::GCode::Reader->new->parse(Slic3r::Test::gcode($print), sub { 24 | my ($self, $cmd, $args, $info) = @_; 25 | 26 | if ($info->{extruding} && !$info->{dist_XY}) { 27 | $retracted += $info->{dist_E}; 28 | } elsif ($info->{retracting}) { 29 | $retracted += $info->{dist_E}; 30 | } 31 | }); 32 | 33 | ok abs($retracted) < 0.01, 'all retractions are compensated'; 34 | } 35 | 36 | 37 | __END__ 38 | -------------------------------------------------------------------------------- /t/speed.t: -------------------------------------------------------------------------------- 1 | use Test::More tests => 2; 2 | use strict; 3 | use warnings; 4 | 5 | BEGIN { 6 | use FindBin; 7 | use lib "$FindBin::Bin/../lib"; 8 | use local::lib "$FindBin::Bin/../local-lib"; 9 | } 10 | 11 | use List::Util qw(none); 12 | use Slic3r; 13 | use Slic3r::Geometry qw(epsilon); 14 | use Slic3r::Test; 15 | 16 | { 17 | my $config = Slic3r::Config->new_from_defaults; 18 | my $test = sub { 19 | my $print = Slic3r::Test::init_print('20mm_cube', config => $config); 20 | my %speeds_by_z = (); # z => [] 21 | Slic3r::GCode::Reader->new->parse(my $gcode = Slic3r::Test::gcode($print), sub { 22 | my ($self, $cmd, $args, $info) = @_; 23 | 24 | if ($cmd eq 'G1' && $info->{dist_E} > 0 && $info->{dist_XY} > 0) { 25 | $speeds_by_z{$self->Z} //= []; 26 | push @{ $speeds_by_z{$self->Z} }, $self->F/60; 27 | } 28 | }); 29 | return %speeds_by_z; 30 | }; 31 | 32 | { 33 | $config->set('perimeter_speed', 0); 34 | $config->set('external_perimeter_speed', 0); 35 | $config->set('infill_speed', 0); 36 | $config->set('support_material_speed', 0); 37 | $config->set('solid_infill_speed', 0); 38 | $config->set('first_layer_speed', '50%'); 39 | $config->set('first_layer_height', 0.25); 40 | my %speeds_by_z = $test->(); 41 | ok !!(none { $_ > $config->max_print_speed/2+&epsilon } @{ $speeds_by_z{$config->first_layer_height} }), 42 | 'percent first_layer_speed is applied over autospeed'; 43 | } 44 | 45 | { 46 | $config->set('first_layer_speed', 33); 47 | my %speeds_by_z = $test->(); 48 | ok !!(none { $_ > $config->first_layer_speed } @{ $speeds_by_z{$config->first_layer_height} }), 49 | 'absolute first_layer_speed overrides autospeed'; 50 | } 51 | } 52 | 53 | __END__ 54 | -------------------------------------------------------------------------------- /t/svg.t: -------------------------------------------------------------------------------- 1 | use Test::More tests => 2; 2 | use strict; 3 | use warnings; 4 | 5 | BEGIN { 6 | use FindBin; 7 | use lib "$FindBin::Bin/../lib"; 8 | use local::lib "$FindBin::Bin/../local-lib"; 9 | } 10 | 11 | use Slic3r; 12 | use Slic3r::Test; 13 | 14 | { 15 | my $print = Slic3r::Test::init_print('20mm_cube'); 16 | eval { 17 | my $fh = IO::Scalar->new(\my $gcode); 18 | $print->print->export_svg(output_fh => $fh, quiet => 1); 19 | $fh->close; 20 | }; 21 | die $@ if $@; 22 | ok !$@, 'successful SVG export'; 23 | } 24 | 25 | { 26 | my $print = Slic3r::Test::init_print('two_hollow_squares'); 27 | eval { 28 | my $fh = IO::Scalar->new(\my $gcode); 29 | $print->print->export_svg(output_fh => $fh, quiet => 1); 30 | $fh->close; 31 | }; 32 | die $@ if $@; 33 | ok !$@, 'successful SVG export of object with two islands'; 34 | } 35 | 36 | __END__ 37 | -------------------------------------------------------------------------------- /t/threads.t: -------------------------------------------------------------------------------- 1 | use Test::More; 2 | use strict; 3 | use warnings; 4 | 5 | BEGIN { 6 | use FindBin; 7 | use lib "$FindBin::Bin/../lib"; 8 | use local::lib "$FindBin::Bin/../local-lib"; 9 | } 10 | 11 | use List::Util qw(first); 12 | use Slic3r; 13 | use Slic3r::Test; 14 | 15 | if (!$Slic3r::have_threads) { 16 | plan skip_all => "this perl is not compiled with threads"; 17 | } 18 | plan tests => 2; 19 | 20 | { 21 | my $print = Slic3r::Test::init_print('20mm_cube'); 22 | { 23 | my $thread = threads->create(sub { Slic3r::thread_cleanup(); return 1; }); 24 | ok $thread->join, "print survives thread spawning"; 25 | } 26 | } 27 | 28 | { 29 | my $thread = threads->create(sub { 30 | { 31 | my $print = Slic3r::Test::init_print('20mm_cube'); 32 | Slic3r::Test::gcode($print); 33 | } 34 | Slic3r::thread_cleanup(); 35 | return 1; 36 | }); 37 | ok $thread->join, "process print in a separate thread"; 38 | } 39 | 40 | __END__ 41 | -------------------------------------------------------------------------------- /utils/amf-to-stl.pl: -------------------------------------------------------------------------------- 1 | #!/usr/bin/perl 2 | # This script converts an AMF file to STL 3 | 4 | use strict; 5 | use warnings; 6 | 7 | BEGIN { 8 | use FindBin; 9 | use lib "$FindBin::Bin/../lib"; 10 | use local::lib "$FindBin::Bin/../local-lib"; 11 | } 12 | 13 | use File::Basename qw(basename); 14 | use Getopt::Long qw(:config no_auto_abbrev); 15 | use Slic3r; 16 | $|++; 17 | 18 | my %opt = (); 19 | { 20 | my %options = ( 21 | 'help' => sub { usage() }, 22 | 'ascii' => \$opt{ascii}, 23 | ); 24 | GetOptions(%options) or usage(1); 25 | $ARGV[0] or usage(1); 26 | } 27 | 28 | { 29 | my $model = Slic3r::Model->read_from_file($ARGV[0]); 30 | my $output_file = $ARGV[0]; 31 | $output_file =~ s/\.amf(?:\.xml)?$/\.stl/i; 32 | 33 | printf "Writing to %s\n", basename($output_file); 34 | $model->write_stl($output_file, !$opt{ascii}); 35 | } 36 | 37 | 38 | sub usage { 39 | my ($exit_code) = @_; 40 | 41 | print <<"EOF"; 42 | Usage: amf-to-stl.pl [ OPTIONS ] file.amf 43 | 44 | --help Output this usage screen and exit 45 | --ascii Generate ASCII STL files (default: binary) 46 | 47 | EOF 48 | exit ($exit_code || 0); 49 | } 50 | 51 | __END__ 52 | -------------------------------------------------------------------------------- /utils/clang_format: -------------------------------------------------------------------------------- 1 | --- 2 | IndentWidth: '4' 3 | BreakBeforeBraces: 'Linux' 4 | ColumnLimit: '100' 5 | AllowAllParametersOfDeclarationOnNextLine: 'true' 6 | AccessModifierOffset: '-4' 7 | FixNamespaceComments: 'true' 8 | ... 9 | -------------------------------------------------------------------------------- /utils/config-bundle-to-config.pl: -------------------------------------------------------------------------------- 1 | #!/usr/bin/perl 2 | # This script extracts a full active config from a config bundle. 3 | # (Often users reporting issues don't attach plain configs, but 4 | # bundles...) 5 | 6 | use strict; 7 | use warnings; 8 | 9 | BEGIN { 10 | use FindBin; 11 | use lib "$FindBin::Bin/../lib"; 12 | use local::lib "$FindBin::Bin/../local-lib"; 13 | } 14 | 15 | use Getopt::Long qw(:config no_auto_abbrev); 16 | use Slic3r; 17 | use Slic3r::Test; 18 | $|++; 19 | 20 | my %opt = (); 21 | { 22 | my %options = ( 23 | 'help' => sub { usage() }, 24 | 'output=s' => \$opt{output}, 25 | ); 26 | GetOptions(%options) or usage(1); 27 | $ARGV[0] or usage(1); 28 | } 29 | 30 | ($ARGV[0] && $opt{output}) or usage(1); 31 | 32 | { 33 | my $bundle_ini = Slic3r::Config->read_ini($ARGV[0]) 34 | or die "Failed to read $ARGV[0]\n"; 35 | 36 | my $config_ini = { _ => {} }; 37 | foreach my $section (qw(print filament printer)) { 38 | my $preset_name = $bundle_ini->{presets}{$section}; 39 | $preset_name =~ s/\.ini$//; 40 | my $preset = $bundle_ini->{"$section:$preset_name"} 41 | or die "Failed to find preset $preset_name in bundle\n"; 42 | $config_ini->{_}{$_} = $preset->{$_} for keys %$preset; 43 | } 44 | 45 | Slic3r::Config->write_ini($opt{output}, $config_ini); 46 | } 47 | 48 | 49 | sub usage { 50 | my ($exit_code) = @_; 51 | 52 | print <<"EOF"; 53 | Usage: config-bundle-to-config.pl --output config.ini bundle.ini 54 | EOF 55 | exit ($exit_code || 0); 56 | } 57 | 58 | __END__ 59 | -------------------------------------------------------------------------------- /utils/dump-stl.pl: -------------------------------------------------------------------------------- 1 | #!/usr/bin/perl 2 | # This script dumps a STL file into Perl syntax for writing tests 3 | # or dumps a test model into a STL file 4 | 5 | use strict; 6 | use warnings; 7 | 8 | BEGIN { 9 | use FindBin; 10 | use lib "$FindBin::Bin/../lib"; 11 | use local::lib "$FindBin::Bin/../local-lib"; 12 | } 13 | 14 | use Slic3r; 15 | use Slic3r::Test; 16 | $|++; 17 | 18 | $ARGV[0] or usage(1); 19 | 20 | if (-e $ARGV[0]) { 21 | my $model = Slic3r::Model->read_from_file($ARGV[0]); 22 | $model->objects->[0]->add_instance(offset => Slic3r::Pointf->new(0,0)); 23 | my $mesh = $model->mesh; 24 | $mesh->repair; 25 | printf "VERTICES = %s\n", join ',', map "[$_->[0],$_->[1],$_->[2]]", @{$mesh->vertices}; 26 | printf "FACETS = %s\n", join ',', map "[$_->[0],$_->[1],$_->[2]]", @{$mesh->facets}; 27 | exit 0; 28 | } elsif ((my $model = Slic3r::Test::model($ARGV[0]))) { 29 | $ARGV[1] or die "Missing writeable destination as second argument\n"; 30 | $model->write_stl($ARGV[1]); 31 | printf "Model $ARGV[0] written to $ARGV[1]\n"; 32 | exit 0; 33 | } else { 34 | die "No such model exists\n"; 35 | } 36 | 37 | 38 | sub usage { 39 | my ($exit_code) = @_; 40 | 41 | print <<"EOF"; 42 | Usage: dump-stl.pl file.stl 43 | dump-stl.pl modelname file.stl 44 | EOF 45 | exit ($exit_code || 0); 46 | } 47 | 48 | __END__ 49 | -------------------------------------------------------------------------------- /utils/estimate-gcode-time.pl: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env perl 2 | 3 | use strict; 4 | use warnings; 5 | 6 | BEGIN { 7 | use FindBin; 8 | use lib "$FindBin::Bin/../lib"; 9 | use local::lib "$FindBin::Bin/../local-lib"; 10 | } 11 | 12 | use Slic3r; 13 | 14 | die "Usage: estimate-gcode-time.pl FILE\n" 15 | if @ARGV != 1; 16 | 17 | my $estimator = Slic3r::GCode::TimeEstimator->new; 18 | $estimator->parse_file($ARGV[0]); 19 | printf "Time: %d minutes and %d seconds\n", int($estimator->time / 60), $estimator->time % 60; 20 | 21 | __END__ 22 | -------------------------------------------------------------------------------- /utils/modifier_helpers/layer_generator.jscad: -------------------------------------------------------------------------------- 1 | // title: Layer_generator 2 | // written by: Joseph Lenox 3 | // Used for generating cubes oriented about the center 4 | // for making simple modifier meshes. 5 | 6 | var width = 100; 7 | var layer_height = 0.3; 8 | var z = 30; 9 | function main() { 10 | 11 | return cube(size=[width,width,layer_height], center=true).translate([0,0,z]); 12 | } 13 | function getParameterDefinitions() { 14 | return [ 15 | { name: 'width', type: 'float', initial: 100, caption: "Width of the cube:" }, 16 | { name: 'layer_height', type: 'float', initial: 0.3, caption: "Layer height used:" }, 17 | { name: 'z', type: 'float', initial: 0, caption: "Z:" } 18 | ]; 19 | } 20 | -------------------------------------------------------------------------------- /utils/modifier_helpers/solid_layers.scad: -------------------------------------------------------------------------------- 1 | // Used to generate a modifier mesh to do something every few layers. 2 | // Load into OpenSCAD, tweak the variables below, export as STL and load as 3 | // a modifier mesh. Then change settings for the modifier mesh. 4 | 5 | // Written by Joseph Lenox; in public domain. 6 | 7 | layer_height = 0.3; // set to layer height in slic3r for "best" results. 8 | number_of_solid_layers = 2; 9 | N = 4; // N > number_of_solid_layers or else the whole thing will be solid 10 | model_height = 300.0; 11 | model_width = 300.0; // these two should be at least as big as the model 12 | model_depth = 300.0; // but bigger isn't a problem 13 | initial_offset=0; // don't generate below this 14 | 15 | position_on_bed=[0,0,0]; // in case you need to move it around 16 | 17 | // don't touch below unless you know what you are doing. 18 | simple_layers = round(model_height/layer_height); 19 | translate(position_on_bed) 20 | for (i = [initial_offset:N:simple_layers]) { 21 | translate([0,0,i*layer_height]) 22 | translate([0,0,(layer_height*number_of_solid_layers)/2]) 23 | cube([model_width,model_depth,layer_height*number_of_solid_layers], center=true); 24 | } 25 | -------------------------------------------------------------------------------- /utils/post-processing/decimate.pl: -------------------------------------------------------------------------------- 1 | #!/usr/bin/perl -i~ 2 | 3 | use strict; 4 | use warnings; 5 | 6 | my %lastpos = (X => 10000, Y => 10000, Z => 10000, E => 10000, F => 10000); 7 | my %pos = (X => 0, Y => 0, Z => 0, E => 0, F => 0); 8 | 9 | my $mindist = 0.33; 10 | 11 | my $mindistz = 0.005; 12 | 13 | my $mindistsq = $mindist * $mindist; 14 | 15 | sub dist { 16 | my $sq = 0; 17 | for (qw/X Y Z E/) { 18 | $sq += ($pos{$_} - $lastpos{$_}) ** 2; 19 | } 20 | return $sq; 21 | } 22 | 23 | while (<>) { 24 | if (m#\bG[01]\b#) { 25 | while (m#([XYZEF])(\d+(\.\d+)?)#gi) { 26 | $pos{uc $1} = $2; 27 | } 28 | if ( 29 | ( 30 | /X/ && 31 | /Y/ && 32 | (dist() >= $mindistsq) 33 | ) || 34 | (abs($pos{Z} - $lastpos{Z}) > $mindistz) || 35 | (!/X/ || !/Y/) 36 | ) { 37 | print; 38 | %lastpos = %pos; 39 | } 40 | elsif (($pos{F} - $lastpos{F}) != 0) { 41 | printf "G1 F%s\n", $pos{F}; 42 | $lastpos{F} = $pos{F}; 43 | } 44 | } 45 | else { 46 | if (m#\bG92\b#) { 47 | while (m#([XYZEF])(\d+(\.\d+)?)#gi) { 48 | $lastpos{uc $1} = $2; 49 | } 50 | } 51 | print; 52 | } 53 | } 54 | -------------------------------------------------------------------------------- /utils/post-processing/fan_kickstart.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/python 2 | import sys 3 | import re 4 | 5 | sea = re.compile("M106 S[1-9]+[0-9]*") 6 | rep = re.compile("M106 S255\n\g<0>") 7 | out = open(sys.argv[1]+"_fixed", 'w') 8 | with open(sys.argv[1]) as f: 9 | for r in f: 10 | if re.search(sea, r) is not None: 11 | out.write(re.sub(sea,"M106 S255\n\g<0>",r)) 12 | else: 13 | out.write(r) 14 | -------------------------------------------------------------------------------- /utils/post-processing/filament-weight.pl: -------------------------------------------------------------------------------- 1 | #!/usr/bin/perl -i 2 | # 3 | # Post-processing script for adding weight and cost of required 4 | # filament to G-code output. 5 | 6 | use strict; 7 | use warnings; 8 | 9 | # example densities, adjust according to filament specifications 10 | use constant PLA_P => 1.25; # g/cm3 11 | use constant ABS_P => 1.05; # g/cm3 12 | 13 | # example costs, adjust according to filament prices 14 | use constant PLA_PRICE => 0.05; # EUR/g 15 | use constant ABS_PRICE => 0.02; # EUR/g 16 | use constant CURRENCY => "EUR"; 17 | 18 | while (<>) { 19 | if (/^(;\s+filament\s+used\s+=\s.*\((\d+(?:\.\d+)?)cm3)\)/) { 20 | my $pla_weight = $2 * PLA_P; 21 | my $abs_weight = $2 * ABS_P; 22 | 23 | my $pla_costs = $pla_weight * PLA_PRICE; 24 | my $abs_costs = $abs_weight * ABS_PRICE; 25 | 26 | printf "%s or %.2fg PLA/%.2fg ABS)\n", $1, $pla_weight, $abs_weight; 27 | printf "; costs = %s %.2f (PLA), %s %.2f (ABS)\n", CURRENCY, $pla_costs, CURRENCY, $abs_costs; 28 | } else { 29 | print; 30 | } 31 | } 32 | -------------------------------------------------------------------------------- /utils/post-processing/flowrate.pl: -------------------------------------------------------------------------------- 1 | #!/usr/bin/perl -i 2 | 3 | # 4 | # Post-processing script for calculating flow rate for each move 5 | 6 | use strict; 7 | use warnings; 8 | 9 | use constant PI => 3.141592653589793238; 10 | my @filament_diameter = split /,/, $ENV{SLIC3R_FILAMENT_DIAMETER}; 11 | 12 | my $E = 0; 13 | my $T = 0; 14 | my ($X, $Y, $F); 15 | while (<>) { 16 | if (/^G1.*? F([0-9.]+)/) { 17 | $F = $1; 18 | } 19 | if (/^G1 X([0-9.-]+) Y([0-9.-]+).*? E([0-9.-]+)/) { 20 | my ($x, $y, $e) = ($1, $2, $3); 21 | my $e_length = $e - $E; 22 | if ($e_length > 0 && defined $X && defined $Y) { 23 | my $dist = sqrt( (($x-$X)**2) + (($y-$Y)**2) ); 24 | if ($dist > 0) { 25 | my $mm_per_mm = $e_length / $dist; # dE/dXY 26 | my $mm3_per_mm = (($filament_diameter[$T] // 0) ** 2) * PI/4 * $mm_per_mm; 27 | my $vol_speed = $F/60 * $mm3_per_mm; 28 | my $comment = sprintf ' ; dXY = %.3fmm ; dE = %.5fmm ; dE/XY = %.5fmm/mm; volspeed = %.5fmm^3/sec', 29 | $dist, $e_length, $mm_per_mm, $vol_speed; 30 | s/(\R+)/$comment$1/; 31 | } 32 | } 33 | $E = $e; 34 | $X = $x; 35 | $Y = $y; 36 | } 37 | if (/^G1 X([0-9.]+) Y([0-9.]+)/) { 38 | $X = $1; 39 | $Y = $2; 40 | } 41 | if (/^G1.*? E([0-9.]+)/) { 42 | $E = $1; 43 | } 44 | if (/^G92 E0/) { 45 | $E = 0; 46 | } 47 | if (/^T(\d+)/) { 48 | $T = $1; 49 | } 50 | print; 51 | } 52 | 53 | __END__ 54 | -------------------------------------------------------------------------------- /utils/post-processing/prowl-notification.pl: -------------------------------------------------------------------------------- 1 | #!/usr/bin/perl 2 | # 3 | # Example post-processing script for sending a Prowl notification upon 4 | # completion. See http://www.prowlapp.com/ for more info. 5 | 6 | use strict; 7 | use warnings; 8 | 9 | use File::Basename qw(basename); 10 | use WebService::Prowl; 11 | 12 | # set your Prowl API key here 13 | my $apikey = ''; 14 | 15 | my $file = basename $ARGV[0]; 16 | my $prowl = WebService::Prowl->new(apikey => $apikey); 17 | my %options = (application => 'Slic3r', 18 | event =>'Slicing Done!', 19 | description => "$file was successfully generated"); 20 | printf STDERR "Error sending Prowl notification: %s\n", $prowl->error 21 | unless $prowl->add(%options); 22 | -------------------------------------------------------------------------------- /utils/post-processing/strip-toolchange.pl: -------------------------------------------------------------------------------- 1 | #!/usr/bin/perl -i 2 | # 3 | # Remove all toolchange commands (and T# arguments) from gcode. 4 | 5 | use strict; 6 | use warnings; 7 | 8 | # read stdin and any/all files passed as parameters one line at a time 9 | while (<>) { 10 | if (not /^T[0-9]/) { 11 | s/\s*(T[0-9])//; 12 | print; 13 | } else { 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /utils/post-processing/z-every-line.pl: -------------------------------------------------------------------------------- 1 | #!/usr/bin/perl -i 2 | 3 | use strict; 4 | use warnings; 5 | 6 | my $z = 0; 7 | 8 | # read stdin and any/all files passed as parameters one line at a time 9 | while (<>) { 10 | # if we find a Z word, save it 11 | $z = $1 if /Z\s*(\d+(\.\d+)?)/; 12 | 13 | # if we don't have Z, but we do have X and Y 14 | if (!/Z/ && /X/ && /Y/ && $z > 0) { 15 | # chop off the end of the line (incl. comments), saving chopped section in $1 16 | s/\s*([\r\n\;\(].*)/" Z$z $1"/es; 17 | # print start of line, insert our Z value then re-add the chopped end of line 18 | # print "$_ Z$z $1"; 19 | } 20 | #else { 21 | # nothing interesting, print line as-is 22 | print or die $!; 23 | #} 24 | } 25 | -------------------------------------------------------------------------------- /utils/send-gcode.pl: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env perl 2 | 3 | use strict; 4 | use warnings; 5 | 6 | BEGIN { 7 | use FindBin; 8 | use lib "$FindBin::Bin/../lib"; 9 | use local::lib "$FindBin::Bin/../local-lib"; 10 | } 11 | 12 | use Slic3r; 13 | 14 | die "Usage: send-gcode.pl SERIALPORT BAUDRATE GCODE_FILE\n" 15 | if @ARGV != 3; 16 | 17 | my $serial = Slic3r::GCode::Sender->new; 18 | $serial->connect($ARGV[0], $ARGV[1]); 19 | 1 until $serial->is_connected; 20 | print "Connected to printer\n"; 21 | 22 | { 23 | local $/ = "\n"; 24 | Slic3r::open(\my $fh, '<', $ARGV[2]) 25 | or die "Unable to open $ARGV[2]: $!\n"; 26 | binmode $fh, ':utf8'; 27 | while (<$fh>) { 28 | $serial->send($_); 29 | } 30 | close $fh; 31 | } 32 | 33 | while ((my $queue_size = $serial->queue_size) > 0) { 34 | printf "Queue size: %d\n", $queue_size; 35 | } 36 | $serial->disconnect; 37 | 38 | __END__ 39 | -------------------------------------------------------------------------------- /utils/split_stl.pl: -------------------------------------------------------------------------------- 1 | #!/usr/bin/perl 2 | # This script splits a STL plate into individual files 3 | 4 | use strict; 5 | use warnings; 6 | 7 | BEGIN { 8 | use FindBin; 9 | use lib "$FindBin::Bin/../lib"; 10 | use local::lib "$FindBin::Bin/../local-lib"; 11 | } 12 | 13 | use File::Basename qw(basename); 14 | use Getopt::Long qw(:config no_auto_abbrev); 15 | use Slic3r; 16 | $|++; 17 | 18 | my %opt = (); 19 | { 20 | my %options = ( 21 | 'help' => sub { usage() }, 22 | 'ascii' => \$opt{ascii}, 23 | ); 24 | GetOptions(%options) or usage(1); 25 | $ARGV[0] or usage(1); 26 | } 27 | 28 | { 29 | my $model = Slic3r::Model->read_from_file($ARGV[0]); 30 | my $basename = $ARGV[0]; 31 | $basename =~ s/\.stl$//i; 32 | 33 | my $part_count = 0; 34 | my $mesh = $model->objects->[0]->volumes->[0]->mesh; 35 | foreach my $new_mesh (@{$mesh->split}) { 36 | $new_mesh->repair; 37 | 38 | my $new_model = Slic3r::Model->new; 39 | $new_model 40 | ->add_object() 41 | ->add_volume(mesh => $new_mesh); 42 | 43 | $new_model->add_default_instances; 44 | 45 | my $output_file = sprintf '%s_%02d.stl', $basename, ++$part_count; 46 | printf "Writing to %s\n", basename($output_file); 47 | $new_model->write_stl($output_file, !$opt{ascii}); 48 | } 49 | } 50 | 51 | 52 | sub usage { 53 | my ($exit_code) = @_; 54 | 55 | print <<"EOF"; 56 | Usage: split_stl.pl [ OPTIONS ] file.stl 57 | 58 | --help Output this usage screen and exit 59 | --ascii Generate ASCII STL files (default: binary) 60 | 61 | EOF 62 | exit ($exit_code || 0); 63 | } 64 | 65 | __END__ 66 | -------------------------------------------------------------------------------- /utils/zsh/README.markdown: -------------------------------------------------------------------------------- 1 | # ZSH Completions for Slic3r 2 | 3 | To enable zsh(1) completions for Slic3r, add the following to your 4 | ``~/.zshrc`` file, replacing ``/path/to/Slic3r/`` with the actual path 5 | to your Slic3r directory: 6 | 7 | typeset -U fpath 8 | 9 | if [[ -d /path/to/Slic3r/utils/zsh/functions ]]; then 10 | fpath=(/path/to/Slic3r/utils/zsh/functions $fpath) 11 | fi 12 | 13 | autoload -Uz compinit 14 | compinit 15 | zstyle ':completion:*' verbose true 16 | zstyle ':completion:*:descriptions' format '%B%d%b' 17 | zstyle ':completion:*:messages' format '%d' 18 | zstyle ':completion:*:warnings' format 'No matches for %d' 19 | zstyle ':completion:*' group-name '%d' 20 | 21 | See the zshcompsys(1) man page for further details. 22 | -------------------------------------------------------------------------------- /var/Slic3r.icns: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/slic3r/Slic3r/026c1380e0ad12176dd2fc8cdf8f6f181deeb071/var/Slic3r.icns -------------------------------------------------------------------------------- /var/Slic3r.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/slic3r/Slic3r/026c1380e0ad12176dd2fc8cdf8f6f181deeb071/var/Slic3r.ico -------------------------------------------------------------------------------- /var/Slic3r.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/slic3r/Slic3r/026c1380e0ad12176dd2fc8cdf8f6f181deeb071/var/Slic3r.png -------------------------------------------------------------------------------- /var/Slic3r_128px.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/slic3r/Slic3r/026c1380e0ad12176dd2fc8cdf8f6f181deeb071/var/Slic3r_128px.png -------------------------------------------------------------------------------- /var/Slic3r_192px.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/slic3r/Slic3r/026c1380e0ad12176dd2fc8cdf8f6f181deeb071/var/Slic3r_192px.png -------------------------------------------------------------------------------- /var/Slic3r_192px_transparent.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/slic3r/Slic3r/026c1380e0ad12176dd2fc8cdf8f6f181deeb071/var/Slic3r_192px_transparent.png -------------------------------------------------------------------------------- /var/add.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/slic3r/Slic3r/026c1380e0ad12176dd2fc8cdf8f6f181deeb071/var/add.png -------------------------------------------------------------------------------- /var/application_view_tile.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/slic3r/Slic3r/026c1380e0ad12176dd2fc8cdf8f6f181deeb071/var/application_view_tile.png -------------------------------------------------------------------------------- /var/arrow_down.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/slic3r/Slic3r/026c1380e0ad12176dd2fc8cdf8f6f181deeb071/var/arrow_down.png -------------------------------------------------------------------------------- /var/arrow_in.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/slic3r/Slic3r/026c1380e0ad12176dd2fc8cdf8f6f181deeb071/var/arrow_in.png -------------------------------------------------------------------------------- /var/arrow_left.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/slic3r/Slic3r/026c1380e0ad12176dd2fc8cdf8f6f181deeb071/var/arrow_left.png -------------------------------------------------------------------------------- /var/arrow_out.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/slic3r/Slic3r/026c1380e0ad12176dd2fc8cdf8f6f181deeb071/var/arrow_out.png -------------------------------------------------------------------------------- /var/arrow_redo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/slic3r/Slic3r/026c1380e0ad12176dd2fc8cdf8f6f181deeb071/var/arrow_redo.png -------------------------------------------------------------------------------- /var/arrow_refresh.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/slic3r/Slic3r/026c1380e0ad12176dd2fc8cdf8f6f181deeb071/var/arrow_refresh.png -------------------------------------------------------------------------------- /var/arrow_right.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/slic3r/Slic3r/026c1380e0ad12176dd2fc8cdf8f6f181deeb071/var/arrow_right.png -------------------------------------------------------------------------------- /var/arrow_rotate_anticlockwise.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/slic3r/Slic3r/026c1380e0ad12176dd2fc8cdf8f6f181deeb071/var/arrow_rotate_anticlockwise.png -------------------------------------------------------------------------------- /var/arrow_rotate_clockwise.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/slic3r/Slic3r/026c1380e0ad12176dd2fc8cdf8f6f181deeb071/var/arrow_rotate_clockwise.png -------------------------------------------------------------------------------- /var/arrow_rotate_x_anticlockwise.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/slic3r/Slic3r/026c1380e0ad12176dd2fc8cdf8f6f181deeb071/var/arrow_rotate_x_anticlockwise.png -------------------------------------------------------------------------------- /var/arrow_rotate_x_clockwise.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/slic3r/Slic3r/026c1380e0ad12176dd2fc8cdf8f6f181deeb071/var/arrow_rotate_x_clockwise.png -------------------------------------------------------------------------------- /var/arrow_rotate_y_anticlockwise.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/slic3r/Slic3r/026c1380e0ad12176dd2fc8cdf8f6f181deeb071/var/arrow_rotate_y_anticlockwise.png -------------------------------------------------------------------------------- /var/arrow_rotate_y_clockwise.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/slic3r/Slic3r/026c1380e0ad12176dd2fc8cdf8f6f181deeb071/var/arrow_rotate_y_clockwise.png -------------------------------------------------------------------------------- /var/arrow_rotate_z_anticlockwise.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/slic3r/Slic3r/026c1380e0ad12176dd2fc8cdf8f6f181deeb071/var/arrow_rotate_z_anticlockwise.png -------------------------------------------------------------------------------- /var/arrow_rotate_z_clockwise.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/slic3r/Slic3r/026c1380e0ad12176dd2fc8cdf8f6f181deeb071/var/arrow_rotate_z_clockwise.png -------------------------------------------------------------------------------- /var/arrow_undo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/slic3r/Slic3r/026c1380e0ad12176dd2fc8cdf8f6f181deeb071/var/arrow_undo.png -------------------------------------------------------------------------------- /var/arrow_up.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/slic3r/Slic3r/026c1380e0ad12176dd2fc8cdf8f6f181deeb071/var/arrow_up.png -------------------------------------------------------------------------------- /var/box.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/slic3r/Slic3r/026c1380e0ad12176dd2fc8cdf8f6f181deeb071/var/box.png -------------------------------------------------------------------------------- /var/brick.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/slic3r/Slic3r/026c1380e0ad12176dd2fc8cdf8f6f181deeb071/var/brick.png -------------------------------------------------------------------------------- /var/brick_add.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/slic3r/Slic3r/026c1380e0ad12176dd2fc8cdf8f6f181deeb071/var/brick_add.png -------------------------------------------------------------------------------- /var/brick_delete.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/slic3r/Slic3r/026c1380e0ad12176dd2fc8cdf8f6f181deeb071/var/brick_delete.png -------------------------------------------------------------------------------- /var/brick_go.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/slic3r/Slic3r/026c1380e0ad12176dd2fc8cdf8f6f181deeb071/var/brick_go.png -------------------------------------------------------------------------------- /var/bricks.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/slic3r/Slic3r/026c1380e0ad12176dd2fc8cdf8f6f181deeb071/var/bricks.png -------------------------------------------------------------------------------- /var/building.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/slic3r/Slic3r/026c1380e0ad12176dd2fc8cdf8f6f181deeb071/var/building.png -------------------------------------------------------------------------------- /var/bullet_black.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/slic3r/Slic3r/026c1380e0ad12176dd2fc8cdf8f6f181deeb071/var/bullet_black.png -------------------------------------------------------------------------------- /var/bullet_blue.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/slic3r/Slic3r/026c1380e0ad12176dd2fc8cdf8f6f181deeb071/var/bullet_blue.png -------------------------------------------------------------------------------- /var/bullet_green.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/slic3r/Slic3r/026c1380e0ad12176dd2fc8cdf8f6f181deeb071/var/bullet_green.png -------------------------------------------------------------------------------- /var/bullet_red.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/slic3r/Slic3r/026c1380e0ad12176dd2fc8cdf8f6f181deeb071/var/bullet_red.png -------------------------------------------------------------------------------- /var/bullet_white.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/slic3r/Slic3r/026c1380e0ad12176dd2fc8cdf8f6f181deeb071/var/bullet_white.png -------------------------------------------------------------------------------- /var/cog.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/slic3r/Slic3r/026c1380e0ad12176dd2fc8cdf8f6f181deeb071/var/cog.png -------------------------------------------------------------------------------- /var/cog_go.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/slic3r/Slic3r/026c1380e0ad12176dd2fc8cdf8f6f181deeb071/var/cog_go.png -------------------------------------------------------------------------------- /var/control_pause.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/slic3r/Slic3r/026c1380e0ad12176dd2fc8cdf8f6f181deeb071/var/control_pause.png -------------------------------------------------------------------------------- /var/control_pause_blue.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/slic3r/Slic3r/026c1380e0ad12176dd2fc8cdf8f6f181deeb071/var/control_pause_blue.png -------------------------------------------------------------------------------- /var/control_play.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/slic3r/Slic3r/026c1380e0ad12176dd2fc8cdf8f6f181deeb071/var/control_play.png -------------------------------------------------------------------------------- /var/control_play_blue.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/slic3r/Slic3r/026c1380e0ad12176dd2fc8cdf8f6f181deeb071/var/control_play_blue.png -------------------------------------------------------------------------------- /var/control_stop.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/slic3r/Slic3r/026c1380e0ad12176dd2fc8cdf8f6f181deeb071/var/control_stop.png -------------------------------------------------------------------------------- /var/control_stop_blue.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/slic3r/Slic3r/026c1380e0ad12176dd2fc8cdf8f6f181deeb071/var/control_stop_blue.png -------------------------------------------------------------------------------- /var/cross.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/slic3r/Slic3r/026c1380e0ad12176dd2fc8cdf8f6f181deeb071/var/cross.png -------------------------------------------------------------------------------- /var/delete.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/slic3r/Slic3r/026c1380e0ad12176dd2fc8cdf8f6f181deeb071/var/delete.png -------------------------------------------------------------------------------- /var/disk.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/slic3r/Slic3r/026c1380e0ad12176dd2fc8cdf8f6f181deeb071/var/disk.png -------------------------------------------------------------------------------- /var/error.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/slic3r/Slic3r/026c1380e0ad12176dd2fc8cdf8f6f181deeb071/var/error.png -------------------------------------------------------------------------------- /var/film.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/slic3r/Slic3r/026c1380e0ad12176dd2fc8cdf8f6f181deeb071/var/film.png -------------------------------------------------------------------------------- /var/funnel.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/slic3r/Slic3r/026c1380e0ad12176dd2fc8cdf8f6f181deeb071/var/funnel.png -------------------------------------------------------------------------------- /var/gcode.icns: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/slic3r/Slic3r/026c1380e0ad12176dd2fc8cdf8f6f181deeb071/var/gcode.icns -------------------------------------------------------------------------------- /var/gcode.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/slic3r/Slic3r/026c1380e0ad12176dd2fc8cdf8f6f181deeb071/var/gcode.ico -------------------------------------------------------------------------------- /var/hourglass.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/slic3r/Slic3r/026c1380e0ad12176dd2fc8cdf8f6f181deeb071/var/hourglass.png -------------------------------------------------------------------------------- /var/house.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/slic3r/Slic3r/026c1380e0ad12176dd2fc8cdf8f6f181deeb071/var/house.png -------------------------------------------------------------------------------- /var/infill.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/slic3r/Slic3r/026c1380e0ad12176dd2fc8cdf8f6f181deeb071/var/infill.png -------------------------------------------------------------------------------- /var/joystick.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/slic3r/Slic3r/026c1380e0ad12176dd2fc8cdf8f6f181deeb071/var/joystick.png -------------------------------------------------------------------------------- /var/layers.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/slic3r/Slic3r/026c1380e0ad12176dd2fc8cdf8f6f181deeb071/var/layers.png -------------------------------------------------------------------------------- /var/lorry_add.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/slic3r/Slic3r/026c1380e0ad12176dd2fc8cdf8f6f181deeb071/var/lorry_add.png -------------------------------------------------------------------------------- /var/lorry_go.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/slic3r/Slic3r/026c1380e0ad12176dd2fc8cdf8f6f181deeb071/var/lorry_go.png -------------------------------------------------------------------------------- /var/lorry_import.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/slic3r/Slic3r/026c1380e0ad12176dd2fc8cdf8f6f181deeb071/var/lorry_import.png -------------------------------------------------------------------------------- /var/map_add.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/slic3r/Slic3r/026c1380e0ad12176dd2fc8cdf8f6f181deeb071/var/map_add.png -------------------------------------------------------------------------------- /var/note.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/slic3r/Slic3r/026c1380e0ad12176dd2fc8cdf8f6f181deeb071/var/note.png -------------------------------------------------------------------------------- /var/package.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/slic3r/Slic3r/026c1380e0ad12176dd2fc8cdf8f6f181deeb071/var/package.png -------------------------------------------------------------------------------- /var/package_green.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/slic3r/Slic3r/026c1380e0ad12176dd2fc8cdf8f6f181deeb071/var/package_green.png -------------------------------------------------------------------------------- /var/page_white_go.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/slic3r/Slic3r/026c1380e0ad12176dd2fc8cdf8f6f181deeb071/var/page_white_go.png -------------------------------------------------------------------------------- /var/plugin.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/slic3r/Slic3r/026c1380e0ad12176dd2fc8cdf8f6f181deeb071/var/plugin.png -------------------------------------------------------------------------------- /var/plugin_add.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/slic3r/Slic3r/026c1380e0ad12176dd2fc8cdf8f6f181deeb071/var/plugin_add.png -------------------------------------------------------------------------------- /var/plugin_go.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/slic3r/Slic3r/026c1380e0ad12176dd2fc8cdf8f6f181deeb071/var/plugin_go.png -------------------------------------------------------------------------------- /var/printer_empty.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/slic3r/Slic3r/026c1380e0ad12176dd2fc8cdf8f6f181deeb071/var/printer_empty.png -------------------------------------------------------------------------------- /var/rotate_face.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/slic3r/Slic3r/026c1380e0ad12176dd2fc8cdf8f6f181deeb071/var/rotate_face.png -------------------------------------------------------------------------------- /var/script.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/slic3r/Slic3r/026c1380e0ad12176dd2fc8cdf8f6f181deeb071/var/script.png -------------------------------------------------------------------------------- /var/shape_flip_horizontal.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/slic3r/Slic3r/026c1380e0ad12176dd2fc8cdf8f6f181deeb071/var/shape_flip_horizontal.png -------------------------------------------------------------------------------- /var/shape_flip_horizontal_x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/slic3r/Slic3r/026c1380e0ad12176dd2fc8cdf8f6f181deeb071/var/shape_flip_horizontal_x.png -------------------------------------------------------------------------------- /var/shape_flip_horizontal_y.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/slic3r/Slic3r/026c1380e0ad12176dd2fc8cdf8f6f181deeb071/var/shape_flip_horizontal_y.png -------------------------------------------------------------------------------- /var/shape_flip_horizontal_z.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/slic3r/Slic3r/026c1380e0ad12176dd2fc8cdf8f6f181deeb071/var/shape_flip_horizontal_z.png -------------------------------------------------------------------------------- /var/shape_handles.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/slic3r/Slic3r/026c1380e0ad12176dd2fc8cdf8f6f181deeb071/var/shape_handles.png -------------------------------------------------------------------------------- /var/shape_ungroup.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/slic3r/Slic3r/026c1380e0ad12176dd2fc8cdf8f6f181deeb071/var/shape_ungroup.png -------------------------------------------------------------------------------- /var/slt.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/slic3r/Slic3r/026c1380e0ad12176dd2fc8cdf8f6f181deeb071/var/slt.ico -------------------------------------------------------------------------------- /var/solarized/arrow_rotate_x_180.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/slic3r/Slic3r/026c1380e0ad12176dd2fc8cdf8f6f181deeb071/var/solarized/arrow_rotate_x_180.png -------------------------------------------------------------------------------- /var/solarized/arrow_rotate_x_180_16.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/slic3r/Slic3r/026c1380e0ad12176dd2fc8cdf8f6f181deeb071/var/solarized/arrow_rotate_x_180_16.png -------------------------------------------------------------------------------- /var/solarized/arrow_rotate_x_anticlockwise90.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/slic3r/Slic3r/026c1380e0ad12176dd2fc8cdf8f6f181deeb071/var/solarized/arrow_rotate_x_anticlockwise90.png -------------------------------------------------------------------------------- /var/solarized/arrow_rotate_x_anticlockwise90_16.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/slic3r/Slic3r/026c1380e0ad12176dd2fc8cdf8f6f181deeb071/var/solarized/arrow_rotate_x_anticlockwise90_16.png -------------------------------------------------------------------------------- /var/solarized/arrow_rotate_x_clockwise90.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/slic3r/Slic3r/026c1380e0ad12176dd2fc8cdf8f6f181deeb071/var/solarized/arrow_rotate_x_clockwise90.png -------------------------------------------------------------------------------- /var/solarized/arrow_rotate_x_clockwise90_16.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/slic3r/Slic3r/026c1380e0ad12176dd2fc8cdf8f6f181deeb071/var/solarized/arrow_rotate_x_clockwise90_16.png -------------------------------------------------------------------------------- /var/solarized/arrow_rotate_y_180.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/slic3r/Slic3r/026c1380e0ad12176dd2fc8cdf8f6f181deeb071/var/solarized/arrow_rotate_y_180.png -------------------------------------------------------------------------------- /var/solarized/arrow_rotate_y_180_16.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/slic3r/Slic3r/026c1380e0ad12176dd2fc8cdf8f6f181deeb071/var/solarized/arrow_rotate_y_180_16.png -------------------------------------------------------------------------------- /var/solarized/arrow_rotate_y_anticlockwise90.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/slic3r/Slic3r/026c1380e0ad12176dd2fc8cdf8f6f181deeb071/var/solarized/arrow_rotate_y_anticlockwise90.png -------------------------------------------------------------------------------- /var/solarized/arrow_rotate_y_anticlockwise90_16.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/slic3r/Slic3r/026c1380e0ad12176dd2fc8cdf8f6f181deeb071/var/solarized/arrow_rotate_y_anticlockwise90_16.png -------------------------------------------------------------------------------- /var/solarized/arrow_rotate_y_clockwise90.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/slic3r/Slic3r/026c1380e0ad12176dd2fc8cdf8f6f181deeb071/var/solarized/arrow_rotate_y_clockwise90.png -------------------------------------------------------------------------------- /var/solarized/arrow_rotate_y_clockwise90_16.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/slic3r/Slic3r/026c1380e0ad12176dd2fc8cdf8f6f181deeb071/var/solarized/arrow_rotate_y_clockwise90_16.png -------------------------------------------------------------------------------- /var/solarized/arrow_rotate_z_180.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/slic3r/Slic3r/026c1380e0ad12176dd2fc8cdf8f6f181deeb071/var/solarized/arrow_rotate_z_180.png -------------------------------------------------------------------------------- /var/solarized/arrow_rotate_z_180_16.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/slic3r/Slic3r/026c1380e0ad12176dd2fc8cdf8f6f181deeb071/var/solarized/arrow_rotate_z_180_16.png -------------------------------------------------------------------------------- /var/solarized/arrow_rotate_z_anticlockwise45.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/slic3r/Slic3r/026c1380e0ad12176dd2fc8cdf8f6f181deeb071/var/solarized/arrow_rotate_z_anticlockwise45.png -------------------------------------------------------------------------------- /var/solarized/arrow_rotate_z_anticlockwise45_16.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/slic3r/Slic3r/026c1380e0ad12176dd2fc8cdf8f6f181deeb071/var/solarized/arrow_rotate_z_anticlockwise45_16.png -------------------------------------------------------------------------------- /var/solarized/arrow_rotate_z_anticlockwise90.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/slic3r/Slic3r/026c1380e0ad12176dd2fc8cdf8f6f181deeb071/var/solarized/arrow_rotate_z_anticlockwise90.png -------------------------------------------------------------------------------- /var/solarized/arrow_rotate_z_anticlockwise90_16.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/slic3r/Slic3r/026c1380e0ad12176dd2fc8cdf8f6f181deeb071/var/solarized/arrow_rotate_z_anticlockwise90_16.png -------------------------------------------------------------------------------- /var/solarized/arrow_rotate_z_clockwise45.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/slic3r/Slic3r/026c1380e0ad12176dd2fc8cdf8f6f181deeb071/var/solarized/arrow_rotate_z_clockwise45.png -------------------------------------------------------------------------------- /var/solarized/arrow_rotate_z_clockwise45_16.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/slic3r/Slic3r/026c1380e0ad12176dd2fc8cdf8f6f181deeb071/var/solarized/arrow_rotate_z_clockwise45_16.png -------------------------------------------------------------------------------- /var/solarized/arrow_rotate_z_clockwise90.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/slic3r/Slic3r/026c1380e0ad12176dd2fc8cdf8f6f181deeb071/var/solarized/arrow_rotate_z_clockwise90.png -------------------------------------------------------------------------------- /var/solarized/arrow_rotate_z_clockwise90_16.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/slic3r/Slic3r/026c1380e0ad12176dd2fc8cdf8f6f181deeb071/var/solarized/arrow_rotate_z_clockwise90_16.png -------------------------------------------------------------------------------- /var/spool.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/slic3r/Slic3r/026c1380e0ad12176dd2fc8cdf8f6f181deeb071/var/spool.png -------------------------------------------------------------------------------- /var/stl.icns: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/slic3r/Slic3r/026c1380e0ad12176dd2fc8cdf8f6f181deeb071/var/stl.icns -------------------------------------------------------------------------------- /var/tag_blue.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/slic3r/Slic3r/026c1380e0ad12176dd2fc8cdf8f6f181deeb071/var/tag_blue.png -------------------------------------------------------------------------------- /var/textfield.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/slic3r/Slic3r/026c1380e0ad12176dd2fc8cdf8f6f181deeb071/var/textfield.png -------------------------------------------------------------------------------- /var/tick.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/slic3r/Slic3r/026c1380e0ad12176dd2fc8cdf8f6f181deeb071/var/tick.png -------------------------------------------------------------------------------- /var/time.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/slic3r/Slic3r/026c1380e0ad12176dd2fc8cdf8f6f181deeb071/var/time.png -------------------------------------------------------------------------------- /var/variable_layer_height.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/slic3r/Slic3r/026c1380e0ad12176dd2fc8cdf8f6f181deeb071/var/variable_layer_height.png -------------------------------------------------------------------------------- /var/wand.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/slic3r/Slic3r/026c1380e0ad12176dd2fc8cdf8f6f181deeb071/var/wand.png -------------------------------------------------------------------------------- /var/wrench.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/slic3r/Slic3r/026c1380e0ad12176dd2fc8cdf8f6f181deeb071/var/wrench.png -------------------------------------------------------------------------------- /var/zoom.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/slic3r/Slic3r/026c1380e0ad12176dd2fc8cdf8f6f181deeb071/var/zoom.png -------------------------------------------------------------------------------- /var/zoom_in.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/slic3r/Slic3r/026c1380e0ad12176dd2fc8cdf8f6f181deeb071/var/zoom_in.png -------------------------------------------------------------------------------- /var/zoom_out.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/slic3r/Slic3r/026c1380e0ad12176dd2fc8cdf8f6f181deeb071/var/zoom_out.png -------------------------------------------------------------------------------- /xs/MANIFEST.SKIP: -------------------------------------------------------------------------------- 1 | 2 | #!start included /Library/Perl/Updates/5.12.4/ExtUtils/MANIFEST.SKIP 3 | # Avoid version control files. 4 | \bRCS\b 5 | \bCVS\b 6 | \bSCCS\b 7 | ,v$ 8 | \B\.svn\b 9 | \B\.git\b 10 | \B\.gitignore\b 11 | \b_darcs\b 12 | \B\.cvsignore$ 13 | 14 | # Avoid VMS specific MakeMaker generated files 15 | \bDescrip.MMS$ 16 | \bDESCRIP.MMS$ 17 | \bdescrip.mms$ 18 | 19 | # Avoid Makemaker generated and utility files. 20 | \bMANIFEST\.bak 21 | \bMakefile$ 22 | \bblib/ 23 | \bMakeMaker-\d 24 | \bpm_to_blib\.ts$ 25 | \bpm_to_blib$ 26 | \bblibdirs\.ts$ # 6.18 through 6.25 generated this 27 | 28 | # Avoid Module::Build generated and utility files. 29 | \bBuild$ 30 | \b_build/ 31 | \bBuild.bat$ 32 | \bBuild.COM$ 33 | \bBUILD.COM$ 34 | \bbuild.com$ 35 | 36 | # Avoid temp and backup files. 37 | ~$ 38 | \.old$ 39 | \#$ 40 | \b\.# 41 | \.bak$ 42 | \.tmp$ 43 | \.# 44 | \.rej$ 45 | 46 | # Avoid OS-specific files/dirs 47 | # Mac OSX metadata 48 | \B\.DS_Store 49 | # Mac OSX SMB mount metadata files 50 | \B\._ 51 | 52 | # Avoid Devel::Cover and Devel::CoverX::Covered files. 53 | \bcover_db\b 54 | \bcovered\b 55 | 56 | # Avoid MYMETA files 57 | ^MYMETA\. 58 | #!end included /Library/Perl/Updates/5.12.4/ExtUtils/MANIFEST.SKIP 59 | 60 | # Avoid configuration metadata file 61 | ^MYMETA\. 62 | 63 | # Avoid Module::Build generated and utility files. 64 | \bBuild$ 65 | \bBuild.bat$ 66 | \b_build 67 | \bBuild.COM$ 68 | \bBUILD.COM$ 69 | \bbuild.com$ 70 | ^MANIFEST\.SKIP 71 | 72 | # Avoid archives of this distribution 73 | \bSlic3r-XS-[\d\.\_]+ 74 | 75 | ^assertlib 76 | -------------------------------------------------------------------------------- /xs/src/boost/nowide/config.hpp: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright (c) 2012 Artyom Beilis (Tonkikh) 3 | // 4 | // Distributed under the Boost Software License, Version 1.0. (See 5 | // accompanying file LICENSE_1_0.txt or copy at 6 | // http://www.boost.org/LICENSE_1_0.txt) 7 | // 8 | #ifndef BOOST_NOWIDE_CONFIG_HPP_INCLUDED 9 | #define BOOST_NOWIDE_CONFIG_HPP_INCLUDED 10 | 11 | #include 12 | 13 | #ifndef BOOST_SYMBOL_VISIBLE 14 | # define BOOST_SYMBOL_VISIBLE 15 | #endif 16 | 17 | #ifdef BOOST_HAS_DECLSPEC 18 | # if defined(BOOST_ALL_DYN_LINK) || defined(BOOST_NOWIDE_DYN_LINK) 19 | # ifdef BOOST_NOWIDE_SOURCE 20 | # define BOOST_NOWIDE_DECL BOOST_SYMBOL_EXPORT 21 | # else 22 | # define BOOST_NOWIDE_DECL BOOST_SYMBOL_IMPORT 23 | # endif // BOOST_NOWIDE_SOURCE 24 | # endif // DYN_LINK 25 | #endif // BOOST_HAS_DECLSPEC 26 | 27 | #ifndef BOOST_NOWIDE_DECL 28 | # define BOOST_NOWIDE_DECL 29 | #endif 30 | 31 | // 32 | // Automatically link to the correct build variant where possible. 33 | // 34 | #if !defined(BOOST_ALL_NO_LIB) && !defined(BOOST_NOWIDE_NO_LIB) && !defined(BOOST_NOWIDE_SOURCE) 35 | // 36 | // Set the name of our library, this will get undef'ed by auto_link.hpp 37 | // once it's done with it: 38 | // 39 | #define BOOST_LIB_NAME boost_nowide 40 | // 41 | // If we're importing code from a dll, then tell auto_link.hpp about it: 42 | // 43 | #if defined(BOOST_ALL_DYN_LINK) || defined(BOOST_NOWIDE_DYN_LINK) 44 | # define BOOST_DYN_LINK 45 | #endif 46 | // 47 | // And include the header that does the work: 48 | // 49 | #include 50 | #endif // auto-linking disabled 51 | 52 | 53 | #endif // boost/nowide/config.hpp 54 | // vim: tabstop=4 expandtab shiftwidth=4 softtabstop=4 -------------------------------------------------------------------------------- /xs/src/boost/nowide/cstdlib.hpp: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright (c) 2012 Artyom Beilis (Tonkikh) 3 | // 4 | // Distributed under the Boost Software License, Version 1.0. (See 5 | // accompanying file LICENSE_1_0.txt or copy at 6 | // http://www.boost.org/LICENSE_1_0.txt) 7 | // 8 | #ifndef BOOST_NOWIDE_CSTDLIB_HPP_INCLUDED 9 | #define BOOST_NOWIDE_CSTDLIB_HPP_INCLUDED 10 | 11 | #include 12 | #include 13 | 14 | #endif 15 | /// 16 | // vim: tabstop=4 expandtab shiftwidth=4 softtabstop=4 17 | -------------------------------------------------------------------------------- /xs/src/boost/nowide/integration/filesystem.hpp: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright (c) 2012 Artyom Beilis (Tonkikh) 3 | // 4 | // Distributed under the Boost Software License, Version 1.0. (See 5 | // accompanying file LICENSE_1_0.txt or copy at 6 | // http://www.boost.org/LICENSE_1_0.txt) 7 | // 8 | #ifndef BOOST_NOWIDE_INTEGRATION_FILESYSTEM_HPP_INCLUDED 9 | #define BOOST_NOWIDE_INTEGRATION_FILESYSTEM_HPP_INCLUDED 10 | 11 | #include 12 | #include 13 | namespace boost { 14 | namespace nowide { 15 | /// 16 | /// Install utf8_codecvt facet into boost::filesystem::path such all char strings are interpreted as utf-8 strings 17 | /// 18 | inline void nowide_filesystem() 19 | { 20 | std::locale tmp = std::locale(std::locale(),new boost::nowide::utf8_codecvt()); 21 | boost::filesystem::path::imbue(tmp); 22 | } 23 | } // nowide 24 | } // boost 25 | 26 | #endif 27 | /// 28 | // vim: tabstop=4 expandtab shiftwidth=4 softtabstop=4 29 | -------------------------------------------------------------------------------- /xs/src/boost/nowide/system.hpp: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright (c) 2012 Artyom Beilis (Tonkikh) 3 | // 4 | // Distributed under the Boost Software License, Version 1.0. (See 5 | // accompanying file LICENSE_1_0.txt or copy at 6 | // http://www.boost.org/LICENSE_1_0.txt) 7 | // 8 | #ifndef BOOST_NOWIDE_CSTDLIB_HPP 9 | #define BOOST_NOWIDE_CSTDLIB_HPP 10 | 11 | #include 12 | #include 13 | #include 14 | namespace boost { 15 | namespace nowide { 16 | 17 | #if !defined(BOOST_WINDOWS) && !defined(BOOST_NOWIDE_DOXYGEN) 18 | 19 | using ::system; 20 | 21 | #else // Windows 22 | 23 | /// 24 | /// Same as std::system but cmd is UTF-8. 25 | /// 26 | /// If the input is not valid UTF-8, -1 returned and errno set to EINVAL 27 | /// 28 | inline int system(char const *cmd) 29 | { 30 | if(!cmd) 31 | return _wsystem(0); 32 | wstackstring wcmd; 33 | if(!wcmd.convert(cmd)) { 34 | errno = EINVAL; 35 | return -1; 36 | } 37 | return _wsystem(wcmd.c_str()); 38 | } 39 | 40 | #endif 41 | } // nowide 42 | } // namespace boost 43 | 44 | #endif 45 | /// 46 | // vim: tabstop=4 expandtab shiftwidth=4 softtabstop=4 47 | -------------------------------------------------------------------------------- /xs/src/boost/nowide/windows.hpp: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright (c) 2012 Artyom Beilis (Tonkikh) 3 | // 4 | // Distributed under the Boost Software License, Version 1.0. (See 5 | // accompanying file LICENSE_1_0.txt or copy at 6 | // http://www.boost.org/LICENSE_1_0.txt) 7 | // 8 | #ifndef BOOST_NOWIDE_WINDOWS_HPP_INCLUDED 9 | #define BOOST_NOWIDE_WINDOWS_HPP_INCLUDED 10 | 11 | #include 12 | 13 | #ifdef BOOST_NOWIDE_USE_WINDOWS_H 14 | #include 15 | #else 16 | 17 | // 18 | // These are function prototypes... Allow to to include windows.h 19 | // 20 | extern "C" { 21 | 22 | __declspec(dllimport) wchar_t* __stdcall GetEnvironmentStringsW(void); 23 | __declspec(dllimport) int __stdcall FreeEnvironmentStringsW(wchar_t *); 24 | __declspec(dllimport) wchar_t* __stdcall GetCommandLineW(void); 25 | __declspec(dllimport) wchar_t** __stdcall CommandLineToArgvW(wchar_t const *,int *); 26 | __declspec(dllimport) unsigned long __stdcall GetLastError(); 27 | __declspec(dllimport) void* __stdcall LocalFree(void *); 28 | __declspec(dllimport) int __stdcall SetEnvironmentVariableW(wchar_t const *,wchar_t const *); 29 | __declspec(dllimport) unsigned long __stdcall GetEnvironmentVariableW(wchar_t const *,wchar_t *,unsigned long); 30 | 31 | } 32 | 33 | #endif 34 | 35 | 36 | 37 | #endif 38 | /// 39 | // vim: tabstop=4 expandtab shiftwidth=4 softtabstop=4 40 | -------------------------------------------------------------------------------- /xs/src/clipper.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/slic3r/Slic3r/026c1380e0ad12176dd2fc8cdf8f6f181deeb071/xs/src/clipper.cpp -------------------------------------------------------------------------------- /xs/src/expat/COPYING: -------------------------------------------------------------------------------- 1 | Copyright (c) 1998-2000 Thai Open Source Software Center Ltd and Clark Cooper 2 | Copyright (c) 2001-2016 Expat maintainers 3 | 4 | Permission is hereby granted, free of charge, to any person obtaining 5 | a copy of this software and associated documentation files (the 6 | "Software"), to deal in the Software without restriction, including 7 | without limitation the rights to use, copy, modify, merge, publish, 8 | distribute, sublicense, and/or sell copies of the Software, and to 9 | permit persons to whom the Software is furnished to do so, subject to 10 | the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included 13 | in all copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 16 | EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 17 | MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. 18 | IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY 19 | CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, 20 | TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE 21 | SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 22 | -------------------------------------------------------------------------------- /xs/src/expat/asciitab.h: -------------------------------------------------------------------------------- 1 | /* Copyright (c) 1998, 1999 Thai Open Source Software Center Ltd 2 | See the file COPYING for copying permission. 3 | */ 4 | 5 | /* 0x00 */ BT_NONXML, BT_NONXML, BT_NONXML, BT_NONXML, 6 | /* 0x04 */ BT_NONXML, BT_NONXML, BT_NONXML, BT_NONXML, 7 | /* 0x08 */ BT_NONXML, BT_S, BT_LF, BT_NONXML, 8 | /* 0x0C */ BT_NONXML, BT_CR, BT_NONXML, BT_NONXML, 9 | /* 0x10 */ BT_NONXML, BT_NONXML, BT_NONXML, BT_NONXML, 10 | /* 0x14 */ BT_NONXML, BT_NONXML, BT_NONXML, BT_NONXML, 11 | /* 0x18 */ BT_NONXML, BT_NONXML, BT_NONXML, BT_NONXML, 12 | /* 0x1C */ BT_NONXML, BT_NONXML, BT_NONXML, BT_NONXML, 13 | /* 0x20 */ BT_S, BT_EXCL, BT_QUOT, BT_NUM, 14 | /* 0x24 */ BT_OTHER, BT_PERCNT, BT_AMP, BT_APOS, 15 | /* 0x28 */ BT_LPAR, BT_RPAR, BT_AST, BT_PLUS, 16 | /* 0x2C */ BT_COMMA, BT_MINUS, BT_NAME, BT_SOL, 17 | /* 0x30 */ BT_DIGIT, BT_DIGIT, BT_DIGIT, BT_DIGIT, 18 | /* 0x34 */ BT_DIGIT, BT_DIGIT, BT_DIGIT, BT_DIGIT, 19 | /* 0x38 */ BT_DIGIT, BT_DIGIT, BT_COLON, BT_SEMI, 20 | /* 0x3C */ BT_LT, BT_EQUALS, BT_GT, BT_QUEST, 21 | /* 0x40 */ BT_OTHER, BT_HEX, BT_HEX, BT_HEX, 22 | /* 0x44 */ BT_HEX, BT_HEX, BT_HEX, BT_NMSTRT, 23 | /* 0x48 */ BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, 24 | /* 0x4C */ BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, 25 | /* 0x50 */ BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, 26 | /* 0x54 */ BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, 27 | /* 0x58 */ BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, BT_LSQB, 28 | /* 0x5C */ BT_OTHER, BT_RSQB, BT_OTHER, BT_NMSTRT, 29 | /* 0x60 */ BT_OTHER, BT_HEX, BT_HEX, BT_HEX, 30 | /* 0x64 */ BT_HEX, BT_HEX, BT_HEX, BT_NMSTRT, 31 | /* 0x68 */ BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, 32 | /* 0x6C */ BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, 33 | /* 0x70 */ BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, 34 | /* 0x74 */ BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, 35 | /* 0x78 */ BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, BT_OTHER, 36 | /* 0x7C */ BT_VERBAR, BT_OTHER, BT_OTHER, BT_OTHER, 37 | -------------------------------------------------------------------------------- /xs/src/expat/expat_config.h: -------------------------------------------------------------------------------- 1 | /*================================================================ 2 | ** Copyright 2000, Clark Cooper 3 | ** All rights reserved. 4 | ** 5 | ** This is free software. You are permitted to copy, distribute, or modify 6 | ** it under the terms of the MIT/X license (contained in the COPYING file 7 | ** with this distribution.) 8 | */ 9 | 10 | #ifndef EXPATCONFIG_H 11 | #define EXPATCONFIG_H 12 | 13 | #include 14 | #include 15 | 16 | #define XML_NS 1 17 | #define XML_DTD 1 18 | #define XML_CONTEXT_BYTES 1024 19 | 20 | /* we will assume all Windows platforms are little endian */ 21 | #define BYTEORDER 1234 22 | 23 | /* Windows has memmove() available. */ 24 | #define HAVE_MEMMOVE 25 | 26 | #ifdef WIN32 27 | #define WIN32_LEAN_AND_MEAN 28 | #include 29 | #undef WIN32_LEAN_AND_MEAN 30 | #else 31 | #endif 32 | 33 | #endif /* ifndef EXPATCONFIG_H */ 34 | -------------------------------------------------------------------------------- /xs/src/expat/iasciitab.h: -------------------------------------------------------------------------------- 1 | /* Copyright (c) 1998, 1999 Thai Open Source Software Center Ltd 2 | See the file COPYING for copying permission. 3 | */ 4 | 5 | /* Like asciitab.h, except that 0xD has code BT_S rather than BT_CR */ 6 | /* 0x00 */ BT_NONXML, BT_NONXML, BT_NONXML, BT_NONXML, 7 | /* 0x04 */ BT_NONXML, BT_NONXML, BT_NONXML, BT_NONXML, 8 | /* 0x08 */ BT_NONXML, BT_S, BT_LF, BT_NONXML, 9 | /* 0x0C */ BT_NONXML, BT_S, BT_NONXML, BT_NONXML, 10 | /* 0x10 */ BT_NONXML, BT_NONXML, BT_NONXML, BT_NONXML, 11 | /* 0x14 */ BT_NONXML, BT_NONXML, BT_NONXML, BT_NONXML, 12 | /* 0x18 */ BT_NONXML, BT_NONXML, BT_NONXML, BT_NONXML, 13 | /* 0x1C */ BT_NONXML, BT_NONXML, BT_NONXML, BT_NONXML, 14 | /* 0x20 */ BT_S, BT_EXCL, BT_QUOT, BT_NUM, 15 | /* 0x24 */ BT_OTHER, BT_PERCNT, BT_AMP, BT_APOS, 16 | /* 0x28 */ BT_LPAR, BT_RPAR, BT_AST, BT_PLUS, 17 | /* 0x2C */ BT_COMMA, BT_MINUS, BT_NAME, BT_SOL, 18 | /* 0x30 */ BT_DIGIT, BT_DIGIT, BT_DIGIT, BT_DIGIT, 19 | /* 0x34 */ BT_DIGIT, BT_DIGIT, BT_DIGIT, BT_DIGIT, 20 | /* 0x38 */ BT_DIGIT, BT_DIGIT, BT_COLON, BT_SEMI, 21 | /* 0x3C */ BT_LT, BT_EQUALS, BT_GT, BT_QUEST, 22 | /* 0x40 */ BT_OTHER, BT_HEX, BT_HEX, BT_HEX, 23 | /* 0x44 */ BT_HEX, BT_HEX, BT_HEX, BT_NMSTRT, 24 | /* 0x48 */ BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, 25 | /* 0x4C */ BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, 26 | /* 0x50 */ BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, 27 | /* 0x54 */ BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, 28 | /* 0x58 */ BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, BT_LSQB, 29 | /* 0x5C */ BT_OTHER, BT_RSQB, BT_OTHER, BT_NMSTRT, 30 | /* 0x60 */ BT_OTHER, BT_HEX, BT_HEX, BT_HEX, 31 | /* 0x64 */ BT_HEX, BT_HEX, BT_HEX, BT_NMSTRT, 32 | /* 0x68 */ BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, 33 | /* 0x6C */ BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, 34 | /* 0x70 */ BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, 35 | /* 0x74 */ BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, 36 | /* 0x78 */ BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, BT_OTHER, 37 | /* 0x7C */ BT_VERBAR, BT_OTHER, BT_OTHER, BT_OTHER, 38 | -------------------------------------------------------------------------------- /xs/src/expat/latin1tab.h: -------------------------------------------------------------------------------- 1 | /* Copyright (c) 1998, 1999 Thai Open Source Software Center Ltd 2 | See the file COPYING for copying permission. 3 | */ 4 | 5 | /* 0x80 */ BT_OTHER, BT_OTHER, BT_OTHER, BT_OTHER, 6 | /* 0x84 */ BT_OTHER, BT_OTHER, BT_OTHER, BT_OTHER, 7 | /* 0x88 */ BT_OTHER, BT_OTHER, BT_OTHER, BT_OTHER, 8 | /* 0x8C */ BT_OTHER, BT_OTHER, BT_OTHER, BT_OTHER, 9 | /* 0x90 */ BT_OTHER, BT_OTHER, BT_OTHER, BT_OTHER, 10 | /* 0x94 */ BT_OTHER, BT_OTHER, BT_OTHER, BT_OTHER, 11 | /* 0x98 */ BT_OTHER, BT_OTHER, BT_OTHER, BT_OTHER, 12 | /* 0x9C */ BT_OTHER, BT_OTHER, BT_OTHER, BT_OTHER, 13 | /* 0xA0 */ BT_OTHER, BT_OTHER, BT_OTHER, BT_OTHER, 14 | /* 0xA4 */ BT_OTHER, BT_OTHER, BT_OTHER, BT_OTHER, 15 | /* 0xA8 */ BT_OTHER, BT_OTHER, BT_NMSTRT, BT_OTHER, 16 | /* 0xAC */ BT_OTHER, BT_OTHER, BT_OTHER, BT_OTHER, 17 | /* 0xB0 */ BT_OTHER, BT_OTHER, BT_OTHER, BT_OTHER, 18 | /* 0xB4 */ BT_OTHER, BT_NMSTRT, BT_OTHER, BT_NAME, 19 | /* 0xB8 */ BT_OTHER, BT_OTHER, BT_NMSTRT, BT_OTHER, 20 | /* 0xBC */ BT_OTHER, BT_OTHER, BT_OTHER, BT_OTHER, 21 | /* 0xC0 */ BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, 22 | /* 0xC4 */ BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, 23 | /* 0xC8 */ BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, 24 | /* 0xCC */ BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, 25 | /* 0xD0 */ BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, 26 | /* 0xD4 */ BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, BT_OTHER, 27 | /* 0xD8 */ BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, 28 | /* 0xDC */ BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, 29 | /* 0xE0 */ BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, 30 | /* 0xE4 */ BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, 31 | /* 0xE8 */ BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, 32 | /* 0xEC */ BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, 33 | /* 0xF0 */ BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, 34 | /* 0xF4 */ BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, BT_OTHER, 35 | /* 0xF8 */ BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, 36 | /* 0xFC */ BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, 37 | -------------------------------------------------------------------------------- /xs/src/expat/utf8tab.h: -------------------------------------------------------------------------------- 1 | /* Copyright (c) 1998, 1999 Thai Open Source Software Center Ltd 2 | See the file COPYING for copying permission. 3 | */ 4 | 5 | 6 | /* 0x80 */ BT_TRAIL, BT_TRAIL, BT_TRAIL, BT_TRAIL, 7 | /* 0x84 */ BT_TRAIL, BT_TRAIL, BT_TRAIL, BT_TRAIL, 8 | /* 0x88 */ BT_TRAIL, BT_TRAIL, BT_TRAIL, BT_TRAIL, 9 | /* 0x8C */ BT_TRAIL, BT_TRAIL, BT_TRAIL, BT_TRAIL, 10 | /* 0x90 */ BT_TRAIL, BT_TRAIL, BT_TRAIL, BT_TRAIL, 11 | /* 0x94 */ BT_TRAIL, BT_TRAIL, BT_TRAIL, BT_TRAIL, 12 | /* 0x98 */ BT_TRAIL, BT_TRAIL, BT_TRAIL, BT_TRAIL, 13 | /* 0x9C */ BT_TRAIL, BT_TRAIL, BT_TRAIL, BT_TRAIL, 14 | /* 0xA0 */ BT_TRAIL, BT_TRAIL, BT_TRAIL, BT_TRAIL, 15 | /* 0xA4 */ BT_TRAIL, BT_TRAIL, BT_TRAIL, BT_TRAIL, 16 | /* 0xA8 */ BT_TRAIL, BT_TRAIL, BT_TRAIL, BT_TRAIL, 17 | /* 0xAC */ BT_TRAIL, BT_TRAIL, BT_TRAIL, BT_TRAIL, 18 | /* 0xB0 */ BT_TRAIL, BT_TRAIL, BT_TRAIL, BT_TRAIL, 19 | /* 0xB4 */ BT_TRAIL, BT_TRAIL, BT_TRAIL, BT_TRAIL, 20 | /* 0xB8 */ BT_TRAIL, BT_TRAIL, BT_TRAIL, BT_TRAIL, 21 | /* 0xBC */ BT_TRAIL, BT_TRAIL, BT_TRAIL, BT_TRAIL, 22 | /* 0xC0 */ BT_LEAD2, BT_LEAD2, BT_LEAD2, BT_LEAD2, 23 | /* 0xC4 */ BT_LEAD2, BT_LEAD2, BT_LEAD2, BT_LEAD2, 24 | /* 0xC8 */ BT_LEAD2, BT_LEAD2, BT_LEAD2, BT_LEAD2, 25 | /* 0xCC */ BT_LEAD2, BT_LEAD2, BT_LEAD2, BT_LEAD2, 26 | /* 0xD0 */ BT_LEAD2, BT_LEAD2, BT_LEAD2, BT_LEAD2, 27 | /* 0xD4 */ BT_LEAD2, BT_LEAD2, BT_LEAD2, BT_LEAD2, 28 | /* 0xD8 */ BT_LEAD2, BT_LEAD2, BT_LEAD2, BT_LEAD2, 29 | /* 0xDC */ BT_LEAD2, BT_LEAD2, BT_LEAD2, BT_LEAD2, 30 | /* 0xE0 */ BT_LEAD3, BT_LEAD3, BT_LEAD3, BT_LEAD3, 31 | /* 0xE4 */ BT_LEAD3, BT_LEAD3, BT_LEAD3, BT_LEAD3, 32 | /* 0xE8 */ BT_LEAD3, BT_LEAD3, BT_LEAD3, BT_LEAD3, 33 | /* 0xEC */ BT_LEAD3, BT_LEAD3, BT_LEAD3, BT_LEAD3, 34 | /* 0xF0 */ BT_LEAD4, BT_LEAD4, BT_LEAD4, BT_LEAD4, 35 | /* 0xF4 */ BT_LEAD4, BT_NONXML, BT_NONXML, BT_NONXML, 36 | /* 0xF8 */ BT_NONXML, BT_NONXML, BT_NONXML, BT_NONXML, 37 | /* 0xFC */ BT_NONXML, BT_NONXML, BT_MALFORM, BT_MALFORM, 38 | -------------------------------------------------------------------------------- /xs/src/expat/xmltok_impl.h: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (c) 1998, 1999 Thai Open Source Software Center Ltd 3 | See the file COPYING for copying permission. 4 | */ 5 | 6 | enum { 7 | BT_NONXML, 8 | BT_MALFORM, 9 | BT_LT, 10 | BT_AMP, 11 | BT_RSQB, 12 | BT_LEAD2, 13 | BT_LEAD3, 14 | BT_LEAD4, 15 | BT_TRAIL, 16 | BT_CR, 17 | BT_LF, 18 | BT_GT, 19 | BT_QUOT, 20 | BT_APOS, 21 | BT_EQUALS, 22 | BT_QUEST, 23 | BT_EXCL, 24 | BT_SOL, 25 | BT_SEMI, 26 | BT_NUM, 27 | BT_LSQB, 28 | BT_S, 29 | BT_NMSTRT, 30 | BT_COLON, 31 | BT_HEX, 32 | BT_DIGIT, 33 | BT_NAME, 34 | BT_MINUS, 35 | BT_OTHER, /* known not to be a name or name start character */ 36 | BT_NONASCII, /* might be a name or name start character */ 37 | BT_PERCNT, 38 | BT_LPAR, 39 | BT_RPAR, 40 | BT_AST, 41 | BT_PLUS, 42 | BT_COMMA, 43 | BT_VERBAR 44 | }; 45 | 46 | #include 47 | -------------------------------------------------------------------------------- /xs/src/libslic3r/BridgeDetector.hpp: -------------------------------------------------------------------------------- 1 | #ifndef slic3r_BridgeDetector_hpp_ 2 | #define slic3r_BridgeDetector_hpp_ 3 | 4 | #include "libslic3r.h" 5 | #include "ExPolygon.hpp" 6 | #include "ExPolygonCollection.hpp" 7 | #include 8 | 9 | namespace Slic3r { 10 | 11 | class BridgeDetector { 12 | public: 13 | /// The non-grown hole. 14 | ExPolygon expolygon; 15 | /// Lower slices, all regions. 16 | ExPolygonCollection lower_slices; 17 | /// Scaled extrusion width of the infill. 18 | coord_t extrusion_width; 19 | /// Angle resolution for the brute force search of the best bridging angle. 20 | double resolution; 21 | /// The final optimal angle. 22 | double angle; 23 | 24 | BridgeDetector(const ExPolygon &_expolygon, const ExPolygonCollection &_lower_slices, coord_t _extrusion_width); 25 | bool detect_angle(); 26 | Polygons coverage() const; 27 | Polygons coverage(double angle) const; 28 | 29 | /// Return the bridge edges that are not currently supported but would permit use of the supplied 30 | /// bridge angle if it was supported. 31 | Polylines unsupported_edges(double angle = -1) const; 32 | 33 | private: 34 | /// Open lines representing the supporting edges. 35 | Polylines _edges; 36 | /// Closed polygons representing the supporting areas. 37 | ExPolygons _anchors; 38 | 39 | class BridgeDirection { 40 | public: 41 | BridgeDirection(double a = -1.) : angle(a), coverage(0.), max_length(0.) {} 42 | /// the best direction is the one causing most lines to be bridged (thus most coverage) 43 | bool operator<(const BridgeDirection &other) const { 44 | // Initial sort by coverage only - comparator must obey strict weak ordering 45 | return this->coverage > other.coverage; 46 | }; 47 | double angle; 48 | double coverage; 49 | double max_length; 50 | }; 51 | }; 52 | 53 | } 54 | 55 | #endif 56 | -------------------------------------------------------------------------------- /xs/src/libslic3r/ConditionalGCode.hpp: -------------------------------------------------------------------------------- 1 | /** 2 | * https://github.com/slic3r/Slic3r/wiki/Conditional-Gcode-Syntax-Spec 3 | * 4 | */ 5 | 6 | #ifndef slic3r_ConditionalGcode_hpp_ 7 | #define slic3r_ConditionalGcode_hpp_ 8 | 9 | #include 10 | #include 11 | #include 12 | 13 | 14 | // Valid start tokens 15 | // {, {if 16 | // 17 | // Valid end tokens 18 | // } 19 | // 20 | // Special case: 21 | // 22 | // {if is special, it indicates that the rest of the line is dropped (ignored) if 23 | // it evaluates to False/0. 24 | 25 | namespace Slic3r { 26 | 27 | /// Recursive expression parser. Offloads mathematics to exprtk. 28 | /// Precondition: All strings inside {} are able to be understood by exprtk (and thus parsed to a number). 29 | /// Starts from the end of the string and works from the inside out. 30 | /// Any statements that resolve to {if0} will remove everything on the same line. 31 | std::string expression(const std::string& input, const int depth = 0); 32 | 33 | /// External access function to begin replac 34 | std::string apply_math(const std::string& input); 35 | 36 | } 37 | 38 | #endif 39 | -------------------------------------------------------------------------------- /xs/src/libslic3r/Config.cpp: -------------------------------------------------------------------------------- 1 | #include "Config.hpp" 2 | 3 | namespace Slic3r { 4 | 5 | std::shared_ptr 6 | Config::new_from_defaults() 7 | { 8 | std::shared_ptr my_config(std::make_shared()); 9 | my_config->_config.apply(FullPrintConfig()); 10 | return my_config; 11 | } 12 | std::shared_ptr 13 | Config::new_from_defaults(std::initializer_list init) 14 | { 15 | return Config::new_from_defaults(t_config_option_keys(init)); 16 | } 17 | 18 | std::shared_ptr 19 | Config::new_from_defaults(t_config_option_keys init) 20 | { 21 | std::shared_ptr my_config(std::make_shared()); 22 | my_config->_config.set_defaults(init); 23 | return my_config; 24 | } 25 | 26 | std::shared_ptr 27 | Config::new_from_ini(const std::string& inifile) 28 | { 29 | std::shared_ptr my_config(std::make_shared()); 30 | my_config->_config.load(inifile); 31 | return my_config; 32 | } 33 | 34 | } // namespace Slic3r 35 | -------------------------------------------------------------------------------- /xs/src/libslic3r/Exception.hpp: -------------------------------------------------------------------------------- 1 | #ifndef _libslic3r_Exception_h_ 2 | #define _libslic3r_Exception_h_ 3 | 4 | #include 5 | 6 | namespace Slic3r { 7 | 8 | // PrusaSlicer's own exception hierarchy is derived from std::runtime_error. 9 | // Base for Slicer's own exceptions. 10 | class Exception : public std::runtime_error { using std::runtime_error::runtime_error; }; 11 | #define SLIC3R_DERIVE_EXCEPTION(DERIVED_EXCEPTION, PARENT_EXCEPTION) \ 12 | class DERIVED_EXCEPTION : public PARENT_EXCEPTION { using PARENT_EXCEPTION::PARENT_EXCEPTION; } 13 | // Critical exception produced by Slicer, such exception shall never propagate up to the UI thread. 14 | // If that happens, an ugly fat message box with an ugly fat exclamation mark is displayed. 15 | SLIC3R_DERIVE_EXCEPTION(CriticalException, Exception); 16 | SLIC3R_DERIVE_EXCEPTION(RuntimeError, CriticalException); 17 | SLIC3R_DERIVE_EXCEPTION(LogicError, CriticalException); 18 | SLIC3R_DERIVE_EXCEPTION(InvalidArgument, LogicError); 19 | SLIC3R_DERIVE_EXCEPTION(OutOfRange, LogicError); 20 | SLIC3R_DERIVE_EXCEPTION(IOError, CriticalException); 21 | SLIC3R_DERIVE_EXCEPTION(FileIOError, IOError); 22 | SLIC3R_DERIVE_EXCEPTION(HostNetworkError, IOError); 23 | SLIC3R_DERIVE_EXCEPTION(ExportError, CriticalException); 24 | SLIC3R_DERIVE_EXCEPTION(PlaceholderParserError, RuntimeError); 25 | // Runtime exception produced by Slicer. Such exception cancels the slicing process and it shall be shown in notifications. 26 | SLIC3R_DERIVE_EXCEPTION(SlicingError, Exception); 27 | #undef SLIC3R_DERIVE_EXCEPTION 28 | 29 | } // namespace Slic3r 30 | 31 | #endif // _libslic3r_Exception_h_ 32 | -------------------------------------------------------------------------------- /xs/src/libslic3r/Extruder.hpp: -------------------------------------------------------------------------------- 1 | #ifndef slic3r_Extruder_hpp_ 2 | #define slic3r_Extruder_hpp_ 3 | 4 | #include "libslic3r.h" 5 | #include "Point.hpp" 6 | #include "PrintConfig.hpp" 7 | 8 | namespace Slic3r { 9 | 10 | class Extruder 11 | { 12 | public: 13 | /// ID of current object. 14 | unsigned int id; 15 | double E; 16 | double absolute_E; 17 | double retracted; 18 | double restart_extra; 19 | double e_per_mm3; 20 | double retract_speed_mm_min; 21 | 22 | Extruder(unsigned int id, GCodeConfig *config); 23 | virtual ~Extruder() {} 24 | void reset(); 25 | /// Calculate the amount extruded for relative or absolute moves. 26 | double extrude(double dE); 27 | double retract(double length, double restart_extra); 28 | double unretract(); 29 | double e_per_mm(double mm3_per_mm) const; 30 | double extruded_volume() const; 31 | 32 | /// Calculate amount of filament used for current Extruder object. 33 | double used_filament() const; 34 | 35 | /// Retrieve the filament diameter for this Extruder from config. 36 | double filament_diameter() const; 37 | /// Retrieve the filament density for this Extruder from config. 38 | double filament_density() const; 39 | /// Retrieve the filament cost for this Extruder from config. 40 | double filament_cost() const; 41 | /// Retrieve the extrustion multiplier for this Extruder from config. 42 | double extrusion_multiplier() const; 43 | double retract_length() const; 44 | double retract_lift() const; 45 | int retract_speed() const; 46 | double retract_restart_extra() const; 47 | double retract_length_toolchange() const; 48 | double retract_restart_extra_toolchange() const; 49 | 50 | private: 51 | GCodeConfig *config; 52 | }; 53 | 54 | } 55 | 56 | #endif 57 | -------------------------------------------------------------------------------- /xs/src/libslic3r/Fill/Fill3DHoneycomb.hpp: -------------------------------------------------------------------------------- 1 | #ifndef slic3r_Fill3DHoneycomb_hpp_ 2 | #define slic3r_Fill3DHoneycomb_hpp_ 3 | 4 | #include 5 | 6 | #include "../libslic3r.h" 7 | 8 | #include "Fill.hpp" 9 | 10 | namespace Slic3r { 11 | 12 | class Fill3DHoneycomb : public Fill 13 | { 14 | public: 15 | virtual Fill* clone() const { return new Fill3DHoneycomb(*this); }; 16 | virtual ~Fill3DHoneycomb() {} 17 | 18 | // require bridge flow since most of this pattern hangs in air 19 | virtual bool use_bridge_flow() const { return true; } 20 | 21 | protected: 22 | virtual void _fill_surface_single( 23 | unsigned int thickness_layers, 24 | const direction_t &direction, 25 | ExPolygon &expolygon, 26 | Polylines* polylines_out); 27 | }; 28 | 29 | } // namespace Slic3r 30 | 31 | #endif // slic3r_Fill3DHoneycomb_hpp_ 32 | -------------------------------------------------------------------------------- /xs/src/libslic3r/Fill/FillConcentric.hpp: -------------------------------------------------------------------------------- 1 | #ifndef slic3r_FillConcentric_hpp_ 2 | #define slic3r_FillConcentric_hpp_ 3 | 4 | #include "Fill.hpp" 5 | 6 | namespace Slic3r { 7 | 8 | class FillConcentric : public Fill 9 | { 10 | public: 11 | virtual ~FillConcentric() {} 12 | 13 | protected: 14 | virtual Fill* clone() const { return new FillConcentric(*this); }; 15 | virtual void _fill_surface_single( 16 | unsigned int thickness_layers, 17 | const direction_t &direction, 18 | ExPolygon &expolygon, 19 | Polylines* polylines_out); 20 | 21 | virtual bool no_sort() const { return true; } 22 | virtual bool can_solid() const { return true; }; 23 | }; 24 | 25 | } // namespace Slic3r 26 | 27 | #endif // slic3r_FillConcentric_hpp_ 28 | -------------------------------------------------------------------------------- /xs/src/libslic3r/Fill/FillGyroid.hpp: -------------------------------------------------------------------------------- 1 | #ifndef slic3r_FillGyroid_hpp_ 2 | #define slic3r_FillGyroid_hpp_ 3 | 4 | #include "../libslic3r.h" 5 | 6 | #include "Fill.hpp" 7 | 8 | namespace Slic3r { 9 | 10 | class FillGyroid : public Fill 11 | { 12 | public: 13 | 14 | FillGyroid(){} 15 | virtual Fill* clone() const { return new FillGyroid(*this); }; 16 | virtual ~FillGyroid() {} 17 | 18 | /// require bridge flow since most of this pattern hangs in air 19 | // but it's not useful as most of it is on the previous layer. 20 | // it's just slowing it down => set it to false! 21 | virtual bool use_bridge_flow() const { return false; } 22 | 23 | protected: 24 | 25 | virtual void _fill_surface_single( 26 | unsigned int thickness_layers, 27 | const std::pair &direction, 28 | ExPolygon &expolygon, 29 | Polylines *polylines_out); 30 | }; 31 | 32 | } // namespace Slic3r 33 | 34 | #endif // slic3r_FillGyroid_hpp_ 35 | -------------------------------------------------------------------------------- /xs/src/libslic3r/Fill/FillHoneycomb.hpp: -------------------------------------------------------------------------------- 1 | #ifndef slic3r_FillHoneycomb_hpp_ 2 | #define slic3r_FillHoneycomb_hpp_ 3 | 4 | #include 5 | 6 | #include "../libslic3r.h" 7 | 8 | #include "Fill.hpp" 9 | 10 | namespace Slic3r { 11 | 12 | class FillHoneycomb : public Fill 13 | { 14 | public: 15 | virtual ~FillHoneycomb() {} 16 | 17 | protected: 18 | virtual Fill* clone() const { return new FillHoneycomb(*this); }; 19 | virtual void _fill_surface_single( 20 | unsigned int thickness_layers, 21 | const direction_t &direction, 22 | ExPolygon &expolygon, 23 | Polylines* polylines_out 24 | ); 25 | 26 | // Cache the hexagon math. 27 | struct CacheData 28 | { 29 | coord_t distance; 30 | coord_t hex_side; 31 | coord_t hex_width; 32 | coord_t pattern_height; 33 | coord_t y_short; 34 | coord_t x_offset; 35 | coord_t y_offset; 36 | Point hex_center; 37 | }; 38 | typedef std::pair CacheID; // density, spacing 39 | typedef std::map Cache; 40 | Cache cache; 41 | 42 | virtual float _layer_angle(size_t idx) const { return float(M_PI/3.) * (idx % 3); } 43 | }; 44 | 45 | } // namespace Slic3r 46 | 47 | #endif // slic3r_FillHoneycomb_hpp_ 48 | -------------------------------------------------------------------------------- /xs/src/libslic3r/GCode/CoolingBuffer.hpp: -------------------------------------------------------------------------------- 1 | #ifndef slic3r_CoolingBuffer_hpp_ 2 | #define slic3r_CoolingBuffer_hpp_ 3 | 4 | #include "libslic3r.h" 5 | #include "GCode.hpp" 6 | #include 7 | #include 8 | 9 | namespace Slic3r { 10 | 11 | /* 12 | A standalone G-code filter, to control cooling of the print. 13 | The G-code is processed per layer. Once a layer is collected, fan start / stop commands are edited 14 | and the print is modified to stretch over a minimum layer time. 15 | */ 16 | 17 | class CoolingBuffer { 18 | public: 19 | CoolingBuffer(GCode &gcodegen) 20 | : _gcodegen(&gcodegen), _elapsed_time(0.), _elapsed_time_bridges(0.), 21 | _elapsed_time_external(0.), _layer_id(0) 22 | { 23 | this->_min_print_speed = this->_gcodegen->config.min_print_speed * 60; 24 | }; 25 | std::string append(const std::string &gcode, std::string obj_id, size_t layer_id, float print_z); 26 | std::string flush(); 27 | GCode* gcodegen() { return this->_gcodegen; }; 28 | 29 | private: 30 | GCode* _gcodegen; 31 | std::string _gcode; 32 | float _elapsed_time; 33 | float _elapsed_time_bridges; 34 | float _elapsed_time_external; 35 | size_t _layer_id; 36 | std::map _last_z; 37 | float _min_print_speed; 38 | }; 39 | 40 | #ifdef SLIC3R_TEST 41 | void apply_speed_factor(std::string &line, float speed_factor, float min_print_speed); 42 | #endif 43 | 44 | } 45 | 46 | #endif 47 | -------------------------------------------------------------------------------- /xs/src/libslic3r/GCode/SpiralVase.hpp: -------------------------------------------------------------------------------- 1 | #ifndef slic3r_SpiralVase_hpp_ 2 | #define slic3r_SpiralVase_hpp_ 3 | 4 | #include "libslic3r.h" 5 | #include "GCode.hpp" 6 | #include "GCodeReader.hpp" 7 | 8 | namespace Slic3r { 9 | 10 | class SpiralVase { 11 | public: 12 | bool enable; 13 | 14 | SpiralVase(const PrintConfig &config) 15 | : enable(false), _config(&config) 16 | { 17 | this->_reader.Z = this->_config->z_offset; 18 | this->_reader.apply_config(*this->_config); 19 | }; 20 | std::string process_layer(const std::string &gcode); 21 | 22 | private: 23 | const PrintConfig* _config; 24 | GCodeReader _reader; 25 | }; 26 | 27 | } 28 | 29 | #endif 30 | -------------------------------------------------------------------------------- /xs/src/libslic3r/GCodeTimeEstimator.hpp: -------------------------------------------------------------------------------- 1 | #ifndef slic3r_GCodeTimeEstimator_hpp_ 2 | #define slic3r_GCodeTimeEstimator_hpp_ 3 | 4 | #include "libslic3r.h" 5 | #include "GCodeReader.hpp" 6 | 7 | namespace Slic3r { 8 | 9 | class GCodeTimeEstimator : public GCodeReader { 10 | public: 11 | float time = 0; // in seconds 12 | 13 | void parse(const std::string &gcode); 14 | void parse_file(const std::string &file); 15 | 16 | protected: 17 | float acceleration = 9000; 18 | void _parser(GCodeReader&, const GCodeReader::GCodeLine &line); 19 | static float _accelerated_move(double length, double v, double acceleration); 20 | }; 21 | 22 | } /* namespace Slic3r */ 23 | 24 | #endif /* slic3r_GCodeTimeEstimator_hpp_ */ 25 | -------------------------------------------------------------------------------- /xs/src/libslic3r/IO.hpp: -------------------------------------------------------------------------------- 1 | #ifndef slic3r_IO_hpp_ 2 | #define slic3r_IO_hpp_ 3 | 4 | #include "libslic3r.h" 5 | #include "Model.hpp" 6 | #include "TriangleMesh.hpp" 7 | #include 8 | #include 9 | 10 | namespace Slic3r { namespace IO { 11 | 12 | enum ExportFormat { AMF, OBJ, POV, STL, SVG, TMF, Gcode }; 13 | 14 | extern const std::map extensions; 15 | extern const std::map write_model; 16 | 17 | class STL 18 | { 19 | public: 20 | static bool read(std::string input_file, TriangleMesh* mesh); 21 | static bool read(std::string input_file, Model* model); 22 | static bool write(const Model &model, std::string output_file) { 23 | return STL::write(model, output_file, true); 24 | }; 25 | static bool write(const Model &model, std::string output_file, bool binary); 26 | static bool write(const TriangleMesh &mesh, std::string output_file, bool binary = true); 27 | }; 28 | 29 | class OBJ 30 | { 31 | public: 32 | static bool read(std::string input_file, TriangleMesh* mesh); 33 | static bool read(std::string input_file, Model* model); 34 | static bool write(const Model& model, std::string output_file); 35 | static bool write(const TriangleMesh& mesh, std::string output_file); 36 | }; 37 | 38 | class AMF 39 | { 40 | public: 41 | static bool read(std::string input_file, Model* model); 42 | static bool write(const Model& model, std::string output_file); 43 | }; 44 | 45 | class POV 46 | { 47 | public: 48 | static bool write(const Model& model, std::string output_file); 49 | static bool write(const TriangleMesh& mesh, std::string output_file); 50 | }; 51 | 52 | class TMF 53 | { 54 | public: 55 | static bool read(std::string input_file, Model* model); 56 | static bool write(const Model& model, std::string output_file); 57 | }; 58 | 59 | } } 60 | 61 | #endif 62 | -------------------------------------------------------------------------------- /xs/src/libslic3r/LayerHeightSpline.hpp: -------------------------------------------------------------------------------- 1 | #ifndef slic3r_LayerHeightSpline_hpp_ 2 | #define slic3r_LayerHeightSpline_hpp_ 3 | 4 | #include "libslic3r.h" 5 | #include "BSpline/BSpline.h" // Warning: original BSplineBase.h/cpp merged into BSpline.h/cpp to avoid dependency issues caused by Build::WithXSpp which tries to compile all .cpp files in /src 6 | 7 | namespace Slic3r { 8 | 9 | 10 | class LayerHeightSpline 11 | { 12 | public: 13 | LayerHeightSpline(); 14 | LayerHeightSpline(const LayerHeightSpline &other); 15 | LayerHeightSpline& operator=(const LayerHeightSpline &other); 16 | void setObjectHeight(coordf_t object_height) { this->_object_height = object_height; }; 17 | bool hasData(); // indicate that we have valid data; 18 | bool setLayers(std::vector layers); 19 | bool updateLayerHeights(std::vector heights); 20 | bool layersUpdated() const { return this->_layers_updated; }; // true if the basis set of layers was updated (by the slicing algorithm) 21 | bool layerHeightsUpdated() const { return this->_layer_heights_updated; }; // true if the heights where updated (by the spline control user interface) 22 | void clear(); 23 | std::vector getOriginalLayers() const { return this->_layers; }; 24 | std::vector getInterpolatedLayers() const; 25 | const coordf_t getLayerHeightAt(coordf_t height); 26 | 27 | private: 28 | bool _updateBSpline(); 29 | 30 | coordf_t _object_height; 31 | bool _is_valid; 32 | bool _layers_updated; 33 | bool _layer_heights_updated; 34 | std::vector _layers; 35 | std::vector _layer_heights; 36 | std::vector _spline_layers; 37 | std::vector _spline_layer_heights; 38 | std::unique_ptr> _layer_height_spline; 39 | }; 40 | 41 | } 42 | 43 | #endif 44 | -------------------------------------------------------------------------------- /xs/src/libslic3r/MultiPoint.hpp: -------------------------------------------------------------------------------- 1 | #ifndef slic3r_MultiPoint_hpp_ 2 | #define slic3r_MultiPoint_hpp_ 3 | 4 | #include "libslic3r.h" 5 | #include 6 | #include 7 | #include "Line.hpp" 8 | #include "Point.hpp" 9 | 10 | namespace Slic3r { 11 | 12 | class BoundingBox; 13 | 14 | class MultiPoint 15 | { 16 | public: 17 | Points points; 18 | 19 | operator Points() const; 20 | void scale(double factor); 21 | void translate(double x, double y); 22 | void translate(const Point &vector); 23 | void rotate(double angle); 24 | void rotate(double angle, const Point ¢er); 25 | void reverse(); 26 | Point first_point() const; 27 | virtual Point last_point() const = 0; 28 | virtual Lines lines() const = 0; 29 | double length() const; 30 | bool is_valid() const { return this->points.size() >= 2; } 31 | 32 | int find_point(const Point &point) const; 33 | bool has_boundary_point(const Point &point) const; 34 | BoundingBox bounding_box() const; 35 | 36 | // Return true if there are exact duplicates. 37 | bool has_duplicate_points() const; 38 | 39 | // Remove exact duplicates, return true if any duplicate has been removed. 40 | bool remove_duplicate_points(); 41 | 42 | void append(const Point &point); 43 | void append(const Points &points); 44 | void append(const Points::const_iterator &begin, const Points::const_iterator &end); 45 | bool intersection(const Line& line, Point* intersection) const; 46 | std::string dump_perl() const; 47 | 48 | static Points _douglas_peucker(const Points &points, const double tolerance); 49 | 50 | protected: 51 | MultiPoint() {}; 52 | explicit MultiPoint(const Points &_points): points(_points) {}; 53 | ~MultiPoint() = default; 54 | }; 55 | 56 | } // namespace Slic3r 57 | 58 | #endif 59 | -------------------------------------------------------------------------------- /xs/src/libslic3r/PlaceholderParser.hpp: -------------------------------------------------------------------------------- 1 | #ifndef slic3r_PlaceholderParser_hpp_ 2 | #define slic3r_PlaceholderParser_hpp_ 3 | 4 | #include "libslic3r.h" 5 | #include 6 | #include 7 | #include 8 | #include "PrintConfig.hpp" 9 | 10 | 11 | namespace Slic3r { 12 | 13 | typedef std::map t_strstr_map; 14 | typedef std::map > t_strstrs_map; 15 | 16 | class PlaceholderParser 17 | { 18 | public: 19 | t_strstr_map _single; 20 | t_strstrs_map _multiple; 21 | 22 | PlaceholderParser(); 23 | void update_timestamp(); 24 | void apply_config(const DynamicConfig &config); 25 | void apply_env_variables(); 26 | void set(const std::string &key, const std::string &value); 27 | void set(const std::string &key, int value); 28 | void set(const std::string &key, std::vector values); 29 | std::string process(std::string str) const; 30 | 31 | private: 32 | bool find_and_replace(std::string &source, std::string const &find, std::string const &replace) const; 33 | }; 34 | 35 | } 36 | 37 | #endif 38 | -------------------------------------------------------------------------------- /xs/src/libslic3r/PolylineCollection.hpp: -------------------------------------------------------------------------------- 1 | #ifndef slic3r_PolylineCollection_hpp_ 2 | #define slic3r_PolylineCollection_hpp_ 3 | 4 | #include "libslic3r.h" 5 | #include "Polyline.hpp" 6 | 7 | namespace Slic3r { 8 | 9 | class PolylineCollection 10 | { 11 | static Polylines _chained_path_from( 12 | const Polylines &src, 13 | Point start_near, 14 | bool no_reverse 15 | #if SLIC3R_CPPVER >= 11 16 | , bool move_from_src 17 | #endif 18 | ); 19 | 20 | public: 21 | Polylines polylines; 22 | void chained_path(PolylineCollection* retval, bool no_reverse = false) const 23 | { retval->polylines = chained_path(this->polylines, no_reverse); } 24 | void chained_path_from(Point start_near, PolylineCollection* retval, bool no_reverse = false) const 25 | { retval->polylines = chained_path_from(this->polylines, start_near, no_reverse); } 26 | Point leftmost_point() const 27 | { return leftmost_point(polylines); } 28 | void append(const Polylines &polylines); 29 | 30 | static Point leftmost_point(const Polylines &polylines); 31 | #if SLIC3R_CPPVER >= 11 32 | static Polylines chained_path(Polylines &&src, bool no_reverse = false); 33 | static Polylines chained_path_from(Polylines &&src, Point start_near, bool no_reverse = false); 34 | #endif 35 | static Polylines chained_path(const Polylines &src, bool no_reverse = false); 36 | static Polylines chained_path_from(const Polylines &src, Point start_near, bool no_reverse = false); 37 | }; 38 | 39 | } 40 | 41 | #endif 42 | -------------------------------------------------------------------------------- /xs/src/libslic3r/SLAPrint.hpp: -------------------------------------------------------------------------------- 1 | #ifndef slic3r_SLAPrint_hpp_ 2 | #define slic3r_SLAPrint_hpp_ 3 | 4 | #include "libslic3r.h" 5 | #include "ExPolygon.hpp" 6 | #include "ExPolygonCollection.hpp" 7 | #include "Fill/Fill.hpp" 8 | #include "Model.hpp" 9 | #include "Point.hpp" 10 | #include "PrintConfig.hpp" 11 | #include "SVG.hpp" 12 | 13 | namespace Slic3r { 14 | 15 | class SLAPrint 16 | { 17 | public: 18 | SLAPrintConfig config; 19 | 20 | class Layer { 21 | public: 22 | ExPolygonCollection slices; 23 | ExPolygonCollection perimeters; 24 | ExtrusionEntityCollection infill; 25 | ExPolygonCollection solid_infill; 26 | float slice_z, print_z; 27 | bool solid; 28 | 29 | Layer(float _slice_z, float _print_z) 30 | : slice_z(_slice_z), print_z(_print_z), solid(true) {}; 31 | }; 32 | std::vector layers; 33 | 34 | class SupportPillar : public Point { 35 | public: 36 | size_t top_layer, bottom_layer; 37 | SupportPillar(const Point &p) : Point(p), top_layer(0), bottom_layer(0) {}; 38 | }; 39 | std::vector sm_pillars; 40 | 41 | SLAPrint(const Model* _model) : model(_model) {}; 42 | void slice(); 43 | void write_svg(const std::string &outputfile) const; 44 | 45 | private: 46 | const Model* model; 47 | BoundingBoxf3 bb; 48 | 49 | void _infill_layer(size_t i, const Fill* fill); 50 | coordf_t sm_pillars_radius() const; 51 | std::string _SVG_path_d(const Polygon &polygon) const; 52 | std::string _SVG_path_d(const ExPolygon &expolygon) const; 53 | }; 54 | 55 | } 56 | 57 | #endif 58 | -------------------------------------------------------------------------------- /xs/src/libslic3r/SimplePrint.hpp: -------------------------------------------------------------------------------- 1 | #ifndef slic3r_SimplePrint_hpp_ 2 | #define slic3r_SimplePrint_hpp_ 3 | 4 | #include "libslic3r.h" 5 | #include "Point.hpp" 6 | #include "Print.hpp" 7 | 8 | namespace Slic3r { 9 | 10 | class SimplePrint { 11 | public: 12 | bool arrange{true}; 13 | bool center{true}; 14 | std::function status_cb {nullptr}; 15 | 16 | bool apply_config(DynamicPrintConfig config) { return this->_print.apply_config(config); } 17 | double total_used_filament() const { return this->_print.total_used_filament; } 18 | double total_extruded_volume() const { return this->_print.total_extruded_volume; } 19 | void set_model(const Model &model); 20 | void export_gcode(std::string outfile); 21 | const Model& model() const { return this->_model; }; 22 | const Print& print() const { return this->_print; }; 23 | 24 | private: 25 | Model _model; 26 | Print _print; 27 | }; 28 | 29 | } 30 | 31 | #endif 32 | -------------------------------------------------------------------------------- /xs/src/libslic3r/SlicingAdaptive.hpp: -------------------------------------------------------------------------------- 1 | #ifndef slic3r_SlicingAdaptive_hpp_ 2 | #define slic3r_SlicingAdaptive_hpp_ 3 | 4 | #include "admesh/stl.h" 5 | 6 | namespace Slic3r 7 | { 8 | 9 | class TriangleMesh; 10 | 11 | class SlicingAdaptive 12 | { 13 | public: 14 | SlicingAdaptive() {}; 15 | ~SlicingAdaptive() {}; 16 | void clear(); 17 | void add_mesh(const TriangleMesh *mesh) { m_meshes.push_back(mesh); } 18 | void prepare(coordf_t object_size); 19 | float next_layer_height(coordf_t z, coordf_t quality_factor, coordf_t min_layer_height, coordf_t max_layer_height); 20 | float horizontal_facet_distance(coordf_t z, coordf_t max_layer_height); 21 | 22 | private: 23 | float _layer_height_from_facet(int ordered_id, float scaled_quality_factor); 24 | 25 | protected: 26 | // id of the current facet from last iteration 27 | coordf_t object_size; 28 | int current_facet; 29 | std::vector m_meshes; 30 | // Collected faces of all meshes, sorted by raising Z of the bottom most face. 31 | std::vector m_faces; 32 | // Z component of face normals, normalized. 33 | std::vector m_face_normal_z; 34 | }; 35 | 36 | }; // namespace Slic3r 37 | 38 | #endif /* slic3r_SlicingAdaptive_hpp_ */ 39 | -------------------------------------------------------------------------------- /xs/src/libslic3r/Surface.cpp: -------------------------------------------------------------------------------- 1 | #include "Surface.hpp" 2 | 3 | namespace Slic3r { 4 | 5 | Surface::operator Polygons() const 6 | { 7 | return this->expolygon; 8 | } 9 | 10 | double 11 | Surface::area() const 12 | { 13 | return this->expolygon.area(); 14 | } 15 | 16 | bool 17 | Surface::is_solid() const 18 | { 19 | return (this->surface_type & (stTop | stBottom | stSolid | stBridge)) != 0; 20 | } 21 | 22 | bool 23 | Surface::is_external() const 24 | { 25 | return is_top() || is_bottom(); 26 | } 27 | 28 | bool 29 | Surface::is_internal() const 30 | { 31 | return (this->surface_type & stInternal) != 0; 32 | } 33 | 34 | bool 35 | Surface::is_bottom() const 36 | { 37 | return (this->surface_type & stBottom) != 0; 38 | } 39 | 40 | bool 41 | Surface::is_top() const 42 | { 43 | return (this->surface_type & stTop) != 0; 44 | } 45 | 46 | bool 47 | Surface::is_bridge() const 48 | { 49 | return (this->surface_type & stBridge) != 0; 50 | } 51 | 52 | } 53 | -------------------------------------------------------------------------------- /xs/src/libslic3r/miniz_extension.hpp: -------------------------------------------------------------------------------- 1 | #ifndef MINIZ_EXTENSION_HPP 2 | #define MINIZ_EXTENSION_HPP 3 | 4 | #include 5 | #include 6 | 7 | namespace Slic3r { 8 | 9 | bool open_zip_reader(mz_zip_archive *zip, const std::string &fname_utf8); 10 | bool open_zip_writer(mz_zip_archive *zip, const std::string &fname_utf8); 11 | bool close_zip_reader(mz_zip_archive *zip); 12 | bool close_zip_writer(mz_zip_archive *zip); 13 | 14 | class MZ_Archive { 15 | public: 16 | mz_zip_archive arch; 17 | 18 | MZ_Archive(); 19 | 20 | static std::string get_errorstr(mz_zip_error mz_err); 21 | 22 | std::string get_errorstr() const 23 | { 24 | return get_errorstr(arch.m_last_error) + "!"; 25 | } 26 | 27 | bool is_alive() const 28 | { 29 | return arch.m_zip_mode != MZ_ZIP_MODE_WRITING_HAS_BEEN_FINALIZED; 30 | } 31 | }; 32 | 33 | } // namespace Slic3r 34 | 35 | #endif // MINIZ_EXTENSION_HPP 36 | -------------------------------------------------------------------------------- /xs/src/libslic3r/utils.cpp: -------------------------------------------------------------------------------- 1 | #include "utils.hpp" 2 | #include 3 | #ifndef NO_PERL 4 | #include 5 | #else 6 | #include "Log.hpp" 7 | #endif 8 | 9 | #include 10 | 11 | void 12 | confess_at(const char *file, int line, const char *func, 13 | const char *pat, ...) 14 | { 15 | #ifdef SLIC3RXS 16 | va_list args; 17 | SV *error_sv = newSVpvf("Error in function %s at %s:%d: ", func, 18 | file, line); 19 | 20 | va_start(args, pat); 21 | sv_vcatpvf(error_sv, pat, &args); 22 | va_end(args); 23 | 24 | sv_catpvn(error_sv, "\n\t", 2); 25 | 26 | dSP; 27 | ENTER; 28 | SAVETMPS; 29 | PUSHMARK(SP); 30 | XPUSHs( sv_2mortal(error_sv) ); 31 | PUTBACK; 32 | call_pv("Carp::confess", G_DISCARD); 33 | FREETMPS; 34 | LEAVE; 35 | #else 36 | std::stringstream ss; 37 | ss << "Error in function " << func << " at " << file << ":" << line << ": "; 38 | ss << pat << "\n"; 39 | 40 | Slic3r::Log::error(std::string("Libslic3r"), ss.str() ); 41 | #endif 42 | } 43 | 44 | std::vector 45 | split_at_regex(const std::string& input, const std::string& regex) { 46 | // passing -1 as the submatch index parameter performs splitting 47 | std::regex re(regex); 48 | std::sregex_token_iterator 49 | first{input.begin(), input.end(), re, -1}, 50 | last; 51 | return {first, last}; 52 | } 53 | 54 | std::string _trim_zeroes(std::string in) { return trim_zeroes(in); } 55 | /// Remove extra zeroes generated from std::to_string on doubles 56 | std::string trim_zeroes(std::string in) { 57 | std::string result {""}; 58 | std::regex strip_zeroes("(0*)$"); 59 | std::regex_replace (std::back_inserter(result), in.begin(), in.end(), strip_zeroes, ""); 60 | if (result.back() == '.') result.append("0"); 61 | return result; 62 | } 63 | -------------------------------------------------------------------------------- /xs/src/miniz/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | project(miniz) 2 | cmake_minimum_required(VERSION 2.6) 3 | 4 | add_library(miniz INTERFACE) 5 | 6 | if(NOT SLIC3R_STATIC OR CMAKE_SYSTEM_NAME STREQUAL "Linux") 7 | find_package(miniz 2.1 QUIET) 8 | endif() 9 | 10 | if(miniz_FOUND) 11 | 12 | message(STATUS "Using system miniz...") 13 | target_link_libraries(miniz INTERFACE miniz::miniz) 14 | 15 | else() 16 | 17 | add_library(miniz_static STATIC 18 | miniz.c 19 | miniz.h 20 | ) 21 | 22 | if(${CMAKE_C_COMPILER_ID} STREQUAL "GNU") 23 | target_compile_definitions(miniz_static PRIVATE _GNU_SOURCE) 24 | endif() 25 | 26 | target_link_libraries(miniz INTERFACE miniz_static) 27 | target_include_directories(miniz INTERFACE ${CMAKE_CURRENT_SOURCE_DIR}) 28 | 29 | message(STATUS "Miniz NOT found in system, using bundled version...") 30 | 31 | endif() 32 | 33 | -------------------------------------------------------------------------------- /xs/src/miniz/LICENSE: -------------------------------------------------------------------------------- 1 | Copyright 2013-2014 RAD Game Tools and Valve Software 2 | Copyright 2010-2014 Rich Geldreich and Tenacious Software LLC 3 | 4 | All Rights Reserved. 5 | 6 | Permission is hereby granted, free of charge, to any person obtaining a copy 7 | of this software and associated documentation files (the "Software"), to deal 8 | in the Software without restriction, including without limitation the rights 9 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 10 | copies of the Software, and to permit persons to whom the Software is 11 | furnished to do so, subject to the following conditions: 12 | 13 | The above copyright notice and this permission notice shall be included in 14 | all copies or substantial portions of the Software. 15 | 16 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 18 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 19 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 20 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 21 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 22 | THE SOFTWARE. 23 | -------------------------------------------------------------------------------- /xs/src/poly2tri/poly2tri.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Poly2Tri Copyright (c) 2009-2010, Poly2Tri Contributors 3 | * http://code.google.com/p/poly2tri/ 4 | * 5 | * All rights reserved. 6 | * 7 | * Redistribution and use in source and binary forms, with or without modification, 8 | * are permitted provided that the following conditions are met: 9 | * 10 | * * Redistributions of source code must retain the above copyright notice, 11 | * this list of conditions and the following disclaimer. 12 | * * Redistributions in binary form must reproduce the above copyright notice, 13 | * this list of conditions and the following disclaimer in the documentation 14 | * and/or other materials provided with the distribution. 15 | * * Neither the name of Poly2Tri nor the names of its contributors may be 16 | * used to endorse or promote products derived from this software without specific 17 | * prior written permission. 18 | * 19 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 20 | * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 21 | * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 22 | * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR 23 | * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, 24 | * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, 25 | * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR 26 | * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF 27 | * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING 28 | * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 29 | * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 30 | */ 31 | 32 | #ifndef POLY2TRI_H 33 | #define POLY2TRI_H 34 | 35 | #include "common/shapes.h" 36 | #include "sweep/cdt.h" 37 | 38 | #endif -------------------------------------------------------------------------------- /xs/src/slic3r/GUI/3DScene.hpp: -------------------------------------------------------------------------------- 1 | #ifndef slic3r_3DScene_hpp_ 2 | #define slic3r_3DScene_hpp_ 3 | 4 | #include "../../libslic3r/libslic3r.h" 5 | #include "../../libslic3r/Point.hpp" 6 | #include "../../libslic3r/Line.hpp" 7 | #include "../../libslic3r/TriangleMesh.hpp" 8 | 9 | namespace Slic3r { 10 | 11 | class GLVertexArray { 12 | public: 13 | std::vector verts, norms; 14 | 15 | void reserve(size_t len) { 16 | this->verts.reserve(len); 17 | this->norms.reserve(len); 18 | }; 19 | void reserve_more(size_t len) { 20 | len += this->verts.size(); 21 | this->reserve(len); 22 | }; 23 | void push_vert(const Pointf3 &point) { 24 | this->verts.push_back(point.x); 25 | this->verts.push_back(point.y); 26 | this->verts.push_back(point.z); 27 | }; 28 | void push_vert(float x, float y, float z) { 29 | this->verts.push_back(x); 30 | this->verts.push_back(y); 31 | this->verts.push_back(z); 32 | }; 33 | void push_norm(const Pointf3 &point) { 34 | this->norms.push_back(point.x); 35 | this->norms.push_back(point.y); 36 | this->norms.push_back(point.z); 37 | }; 38 | void push_norm(float x, float y, float z) { 39 | this->norms.push_back(x); 40 | this->norms.push_back(y); 41 | this->norms.push_back(z); 42 | }; 43 | void load_mesh(const TriangleMesh &mesh); 44 | Pointf3 get_point(int i){ 45 | return Pointf3(this->verts.at(i*3),this->verts.at(i*3+1),this->verts.at(i*3+2)); 46 | } 47 | }; 48 | 49 | class _3DScene 50 | { 51 | public: 52 | static void _extrusionentity_to_verts_do(const Lines &lines, const std::vector &widths, 53 | const std::vector &heights, bool closed, double top_z, const Point ©, 54 | GLVertexArray* qverts, GLVertexArray* tverts); 55 | }; 56 | 57 | } 58 | 59 | #endif 60 | -------------------------------------------------------------------------------- /xs/src/slic3r/GUI/GUI.cpp: -------------------------------------------------------------------------------- 1 | #include "xsGUI.hpp" 2 | 3 | #if __APPLE__ 4 | #import 5 | #elif _WIN32 6 | #include 7 | #pragma comment(lib, "user32.lib") 8 | #endif 9 | 10 | namespace Slic3r { namespace GUI { 11 | 12 | #if __APPLE__ 13 | IOPMAssertionID assertionID; 14 | #endif 15 | 16 | void 17 | disable_screensaver() 18 | { 19 | #if __APPLE__ 20 | CFStringRef reasonForActivity = CFSTR("Slic3r"); 21 | IOReturn success = IOPMAssertionCreateWithName(kIOPMAssertionTypeNoDisplaySleep, 22 | kIOPMAssertionLevelOn, reasonForActivity, &assertionID); 23 | // ignore result: success == kIOReturnSuccess 24 | #elif _WIN32 25 | SetThreadExecutionState(ES_DISPLAY_REQUIRED | ES_CONTINUOUS); 26 | #endif 27 | } 28 | 29 | void 30 | enable_screensaver() 31 | { 32 | #if __APPLE__ 33 | IOReturn success = IOPMAssertionRelease(assertionID); 34 | #elif _WIN32 35 | SetThreadExecutionState(ES_CONTINUOUS); 36 | #endif 37 | } 38 | 39 | } } 40 | -------------------------------------------------------------------------------- /xs/src/slic3r/GUI/xsGUI.hpp: -------------------------------------------------------------------------------- 1 | #ifndef slic3r_GUI_hpp_ 2 | #define slic3r_GUI_hpp_ 3 | 4 | namespace Slic3r { namespace GUI { 5 | 6 | void disable_screensaver(); 7 | void enable_screensaver(); 8 | 9 | } } 10 | 11 | #endif 12 | -------------------------------------------------------------------------------- /xs/t/07_extrusionpath.t: -------------------------------------------------------------------------------- 1 | #!/usr/bin/perl 2 | 3 | use strict; 4 | use warnings; 5 | 6 | use Slic3r::XS; 7 | use Test::More tests => 8; 8 | 9 | my $points = [ 10 | [100, 100], 11 | [200, 100], 12 | [200, 200], 13 | ]; 14 | 15 | my $path = Slic3r::ExtrusionPath->new( 16 | polyline => Slic3r::Polyline->new(@$points), 17 | role => Slic3r::ExtrusionPath::EXTR_ROLE_EXTERNAL_PERIMETER, 18 | mm3_per_mm => 1, 19 | ); 20 | isa_ok $path->polyline, 'Slic3r::Polyline::Ref', 'path polyline'; 21 | is_deeply $path->polyline->pp, $points, 'path points roundtrip'; 22 | 23 | $path->reverse; 24 | is_deeply $path->polyline->pp, [ reverse @$points ], 'reverse path'; 25 | 26 | $path->append([ 150, 150 ]); 27 | is scalar(@$path), 4, 'append to path'; 28 | 29 | $path->pop_back; 30 | is scalar(@$path), 3, 'pop_back from path'; 31 | 32 | ok $path->first_point->coincides_with($path->polyline->[0]), 'first_point'; 33 | 34 | $path = $path->clone; 35 | 36 | is $path->role, Slic3r::ExtrusionPath::EXTR_ROLE_EXTERNAL_PERIMETER, 'role'; 37 | $path->role(Slic3r::ExtrusionPath::EXTR_ROLE_FILL); 38 | is $path->role, Slic3r::ExtrusionPath::EXTR_ROLE_FILL, 'modify role'; 39 | 40 | __END__ 41 | -------------------------------------------------------------------------------- /xs/t/13_polylinecollection.t: -------------------------------------------------------------------------------- 1 | #!/usr/bin/perl 2 | 3 | use strict; 4 | use warnings; 5 | 6 | use Slic3r::XS; 7 | use Test::More tests => 3; 8 | 9 | { 10 | my $collection = Slic3r::Polyline::Collection->new( 11 | Slic3r::Polyline->new([0,15], [0,18], [0,20]), 12 | Slic3r::Polyline->new([0,10], [0,8], [0,5]), 13 | ); 14 | is_deeply 15 | [ map $_->y, map @$_, @{$collection->chained_path_from(Slic3r::Point->new(0,30), 0)} ], 16 | [20, 18, 15, 10, 8, 5], 17 | 'chained_path_from'; 18 | is_deeply 19 | [ map $_->y, map @$_, @{$collection->chained_path(0)} ], 20 | [15, 18, 20, 10, 8, 5], 21 | 'chained_path'; 22 | } 23 | 24 | { 25 | my $collection = Slic3r::Polyline::Collection->new( 26 | Slic3r::Polyline->new([15,0], [10,0], [4,0]), 27 | Slic3r::Polyline->new([10,5], [15,5], [20,5]), 28 | ); 29 | is_deeply 30 | [ map $_->x, map @$_, @{$collection->chained_path_from(Slic3r::Point->new(30,0), 0)} ], 31 | [reverse 4, 10, 15, 10, 15, 20], 32 | 'chained_path_from'; 33 | } 34 | 35 | __END__ 36 | -------------------------------------------------------------------------------- /xs/t/14_geometry.t: -------------------------------------------------------------------------------- 1 | #!/usr/bin/perl 2 | 3 | use strict; 4 | use warnings; 5 | 6 | use Slic3r::XS; 7 | use Test::More tests => 9; 8 | 9 | use constant PI => 4 * atan2(1, 1); 10 | 11 | { 12 | my @points = ( 13 | Slic3r::Point->new(100,100), 14 | Slic3r::Point->new(100,200), 15 | Slic3r::Point->new(200,200), 16 | Slic3r::Point->new(200,100), 17 | Slic3r::Point->new(150,150), 18 | ); 19 | my $hull = Slic3r::Geometry::convex_hull(\@points); 20 | isa_ok $hull, 'Slic3r::Polygon', 'convex_hull returns a Polygon'; 21 | is scalar(@$hull), 4, 'convex_hull returns the correct number of points'; 22 | } 23 | 24 | # directions_parallel() and directions_parallel_within() are tested 25 | # also with Slic3r::Line::parallel_to() tests in 10_line.t 26 | { 27 | ok Slic3r::Geometry::directions_parallel_within(0, 0, 0), 'directions_parallel_within'; 28 | ok Slic3r::Geometry::directions_parallel_within(0, PI, 0), 'directions_parallel_within'; 29 | ok Slic3r::Geometry::directions_parallel_within(0, 0, PI/180), 'directions_parallel_within'; 30 | ok Slic3r::Geometry::directions_parallel_within(0, PI, PI/180), 'directions_parallel_within'; 31 | ok !Slic3r::Geometry::directions_parallel_within(PI/2, PI, 0), 'directions_parallel_within'; 32 | ok !Slic3r::Geometry::directions_parallel_within(PI/2, PI, PI/180), 'directions_parallel_within'; 33 | } 34 | 35 | { 36 | my $positions = Slic3r::Geometry::arrange(4, Slic3r::Pointf->new(20, 20), 5); 37 | is scalar(@$positions), 4, 'arrange() returns expected number of positions'; 38 | } 39 | 40 | __END__ 41 | -------------------------------------------------------------------------------- /xs/t/16_flow.t: -------------------------------------------------------------------------------- 1 | #!/usr/bin/perl 2 | 3 | use strict; 4 | use warnings; 5 | 6 | use Slic3r::XS; 7 | use Test::More tests => 2; 8 | 9 | { 10 | my $flow = Slic3r::Flow->new_from_width( 11 | role => Slic3r::Flow::FLOW_ROLE_PERIMETER, 12 | width => '1', 13 | nozzle_diameter => 0.5, 14 | layer_height => 0.3, 15 | bridge_flow_ratio => 1, 16 | ); 17 | isa_ok $flow, 'Slic3r::Flow', 'new_from_width'; 18 | } 19 | 20 | { 21 | my $flow = Slic3r::Flow->new( 22 | width => 1, 23 | height => 0.4, 24 | nozzle_diameter => 0.5, 25 | ); 26 | isa_ok $flow, 'Slic3r::Flow', 'new'; 27 | } 28 | 29 | __END__ 30 | -------------------------------------------------------------------------------- /xs/t/17_boundingbox.t: -------------------------------------------------------------------------------- 1 | #!/usr/bin/perl 2 | 3 | use strict; 4 | use warnings; 5 | 6 | use Slic3r::XS; 7 | use Test::More tests => 5; 8 | 9 | { 10 | my @points = ( 11 | Slic3r::Point->new(100, 200), 12 | Slic3r::Point->new(500, -600), 13 | ); 14 | my $bb = Slic3r::Geometry::BoundingBox->new_from_points(\@points); 15 | isa_ok $bb, 'Slic3r::Geometry::BoundingBox', 'new_from_points'; 16 | is_deeply $bb->min_point->pp, [100,-600], 'min_point'; 17 | is_deeply $bb->max_point->pp, [500,200], 'max_point'; 18 | } 19 | 20 | { 21 | my $bb = Slic3r::Geometry::BoundingBox->new; 22 | $bb->merge_point(Slic3r::Point->new(10, 10)); 23 | is_deeply $bb->min_point->pp, [10,10], 'min_point equals to the only defined point'; 24 | is_deeply $bb->max_point->pp, [10,10], 'max_point equals to the only defined point'; 25 | } 26 | 27 | __END__ 28 | -------------------------------------------------------------------------------- /xs/t/19_model.t: -------------------------------------------------------------------------------- 1 | #!/usr/bin/perl 2 | 3 | use strict; 4 | use warnings; 5 | 6 | use Slic3r::XS; 7 | use Test::More tests => 2; 8 | 9 | { 10 | my $model = Slic3r::Model->new; 11 | my $object = $model->_add_object; 12 | isa_ok $object, 'Slic3r::Model::Object::Ref'; 13 | 14 | my $lhr = [ [ 5, 10, 0.1 ] ]; 15 | $object->set_layer_height_ranges($lhr); 16 | is_deeply $object->layer_height_ranges, $lhr, 'layer_height_ranges roundtrip'; 17 | } 18 | 19 | __END__ 20 | -------------------------------------------------------------------------------- /xs/t/20_print.t: -------------------------------------------------------------------------------- 1 | #!/usr/bin/perl 2 | 3 | use strict; 4 | use warnings; 5 | 6 | use Slic3r::XS; 7 | use Test::More tests => 6; 8 | 9 | { 10 | { 11 | my $print = Slic3r::Print->new; 12 | isa_ok $print, 'Slic3r::Print'; 13 | isa_ok $print->config, 'Slic3r::Config::Static::Ref'; 14 | isa_ok $print->default_object_config, 'Slic3r::Config::Static::Ref'; 15 | isa_ok $print->default_region_config, 'Slic3r::Config::Static::Ref'; 16 | isa_ok $print->placeholder_parser, 'Slic3r::GCode::PlaceholderParser::Ref'; 17 | } 18 | 19 | { 20 | my $print = Slic3r::Print->new; 21 | my $config = Slic3r::Config->new; 22 | $config->set('skirts', 0); 23 | $print->apply_config($config); 24 | $config->set('skirts', 1); 25 | $print->set_step_started(Slic3r::Print::State::STEP_SKIRT); 26 | $print->set_step_done(Slic3r::Print::State::STEP_SKIRT); 27 | my $invalid = $print->apply_config($config); 28 | ok $invalid, 'applying skirt config invalidates skirt step'; 29 | } 30 | 31 | } 32 | 33 | __END__ 34 | -------------------------------------------------------------------------------- /xs/t/22_exception.t: -------------------------------------------------------------------------------- 1 | #!/usr/bin/perl 2 | 3 | use strict; 4 | use warnings; 5 | 6 | use Slic3r::XS; 7 | use Test::More tests => 1; 8 | 9 | { 10 | eval { 11 | Slic3r::xspp_test_croak_hangs_on_strawberry(); 12 | }; 13 | is $@, "xspp_test_croak_hangs_on_strawberry: exception catched\n", 'croak from inside a C++ exception delivered'; 14 | } 15 | 16 | __END__ 17 | -------------------------------------------------------------------------------- /xs/t/inc/22_config_bad_config_options.ini: -------------------------------------------------------------------------------- 1 | # generated by Slic3r 1.1.7 on Tue Aug 19 21:49:50 2014 2 | avoid_crossing_perimeters = 1 3 | bed_size = 200,180 4 | g0 = 0 5 | perimeter_acceleration = 0 6 | support_material_extruder = 1 7 | support_material_extrusion_width = 0 8 | -------------------------------------------------------------------------------- /xs/t/models/3mf/box.3mf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/slic3r/Slic3r/026c1380e0ad12176dd2fc8cdf8f6f181deeb071/xs/t/models/3mf/box.3mf -------------------------------------------------------------------------------- /xs/t/models/3mf/chess.3mf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/slic3r/Slic3r/026c1380e0ad12176dd2fc8cdf8f6f181deeb071/xs/t/models/3mf/chess.3mf -------------------------------------------------------------------------------- /xs/t/models/3mf/gimblekeychain.3mf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/slic3r/Slic3r/026c1380e0ad12176dd2fc8cdf8f6f181deeb071/xs/t/models/3mf/gimblekeychain.3mf -------------------------------------------------------------------------------- /xs/t/models/Geräte/box.3mf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/slic3r/Slic3r/026c1380e0ad12176dd2fc8cdf8f6f181deeb071/xs/t/models/Geräte/box.3mf -------------------------------------------------------------------------------- /xs/t/models/stl/spikey_top.stl: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/slic3r/Slic3r/026c1380e0ad12176dd2fc8cdf8f6f181deeb071/xs/t/models/stl/spikey_top.stl -------------------------------------------------------------------------------- /xs/xsp/BridgeDetector.xsp: -------------------------------------------------------------------------------- 1 | %module{Slic3r::XS}; 2 | 3 | %{ 4 | #include 5 | #include "libslic3r/BridgeDetector.hpp" 6 | %} 7 | 8 | %name{Slic3r::BridgeDetector} class BridgeDetector { 9 | ~BridgeDetector(); 10 | 11 | bool detect_angle(); 12 | Polygons coverage(); 13 | %name{coverage_by_angle} Polygons coverage(double angle); 14 | Polylines unsupported_edges(); 15 | %name{unsupported_edges_by_angle} Polylines unsupported_edges(double angle); 16 | double angle() 17 | %code{% RETVAL = THIS->angle; %}; 18 | double resolution() 19 | %code{% RETVAL = THIS->resolution; %}; 20 | %{ 21 | 22 | BridgeDetector* 23 | BridgeDetector::new(expolygon, lower_slices, extrusion_width) 24 | ExPolygon* expolygon; 25 | ExPolygonCollection* lower_slices; 26 | long extrusion_width; 27 | CODE: 28 | RETVAL = new BridgeDetector(*expolygon, *lower_slices, extrusion_width); 29 | OUTPUT: 30 | RETVAL 31 | 32 | %} 33 | }; 34 | -------------------------------------------------------------------------------- /xs/xsp/ConditionalGcode.xsp: -------------------------------------------------------------------------------- 1 | %module{Slic3r::XS}; 2 | 3 | %{ 4 | #include 5 | #include "libslic3r/ConditionalGCode.hpp" 6 | %} 7 | 8 | 9 | %package{Slic3r::ConditionalGCode}; 10 | 11 | %{ 12 | PROTOTYPES: DISABLE 13 | std::string apply_math(std::string input) 14 | CODE: 15 | RETVAL = Slic3r::apply_math(input); 16 | OUTPUT: 17 | RETVAL 18 | %} 19 | -------------------------------------------------------------------------------- /xs/xsp/Extruder.xsp: -------------------------------------------------------------------------------- 1 | %module{Slic3r::XS}; 2 | 3 | %{ 4 | #include 5 | #include "libslic3r/Extruder.hpp" 6 | %} 7 | 8 | %name{Slic3r::Extruder} class Extruder { 9 | Extruder(unsigned int id, StaticPrintConfig* config) 10 | %code%{ RETVAL = new Extruder (id, dynamic_cast(config)); %}; 11 | ~Extruder(); 12 | void reset(); 13 | double extrude(double dE); 14 | double retract(double length, double restart_extra); 15 | double unretract(); 16 | double e_per_mm(double mm3_per_mm); 17 | double extruded_volume(); 18 | double used_filament(); 19 | 20 | unsigned int id() 21 | %code%{ RETVAL = THIS->id; %}; 22 | 23 | double E() 24 | %code%{ RETVAL = THIS->E; %}; 25 | double set_E(double val) 26 | %code%{ RETVAL = THIS->E = val; %}; 27 | double absolute_E() 28 | %code%{ RETVAL = THIS->absolute_E; %}; 29 | double set_absolute_E(double val) 30 | %code%{ RETVAL = THIS->absolute_E = val; %}; 31 | double retracted() 32 | %code%{ RETVAL = THIS->retracted; %}; 33 | double set_retracted(double val) 34 | %code%{ RETVAL = THIS->retracted = val; %}; 35 | double restart_extra() 36 | %code%{ RETVAL = THIS->restart_extra; %}; 37 | double set_restart_extra(double val) 38 | %code%{ RETVAL = THIS->restart_extra = val; %}; 39 | double e_per_mm3() 40 | %code%{ RETVAL = THIS->e_per_mm3; %}; 41 | double retract_speed_mm_min() 42 | %code%{ RETVAL = THIS->retract_speed_mm_min; %}; 43 | 44 | double filament_diameter(); 45 | double filament_density(); 46 | double filament_cost(); 47 | double extrusion_multiplier(); 48 | double retract_length(); 49 | double retract_lift(); 50 | int retract_speed(); 51 | double retract_restart_extra(); 52 | double retract_length_toolchange(); 53 | double retract_restart_extra_toolchange(); 54 | }; 55 | -------------------------------------------------------------------------------- /xs/xsp/GCodeSender.xsp: -------------------------------------------------------------------------------- 1 | %module{Slic3r::XS}; 2 | 3 | %{ 4 | #include 5 | #include "libslic3r/GCodeSender.hpp" 6 | %} 7 | 8 | %name{Slic3r::GCode::Sender} class GCodeSender { 9 | GCodeSender(); 10 | ~GCodeSender(); 11 | 12 | bool connect(std::string port, unsigned int baud_rate); 13 | void disconnect(); 14 | bool is_connected(); 15 | bool wait_connected(unsigned int timeout = 3); 16 | int queue_size(); 17 | void send(std::string s, bool priority = false); 18 | void pause_queue(); 19 | void resume_queue(); 20 | void purge_queue(bool priority = false); 21 | std::vector purge_log(); 22 | std::string getT(); 23 | std::string getB(); 24 | }; 25 | -------------------------------------------------------------------------------- /xs/xsp/GCodeTimeEstimator.xsp: -------------------------------------------------------------------------------- 1 | %module{Slic3r::XS}; 2 | 3 | %{ 4 | #include 5 | #include "libslic3r/GCodeTimeEstimator.hpp" 6 | %} 7 | 8 | %name{Slic3r::GCode::TimeEstimator} class GCodeTimeEstimator { 9 | GCodeTimeEstimator(); 10 | ~GCodeTimeEstimator(); 11 | 12 | float time %get{time}; 13 | void parse(std::string gcode); 14 | void parse_file(std::string file); 15 | }; 16 | -------------------------------------------------------------------------------- /xs/xsp/GUI.xsp: -------------------------------------------------------------------------------- 1 | %module{Slic3r::XS}; 2 | 3 | %{ 4 | #include 5 | #include "slic3r/GUI/xsGUI.hpp" 6 | %} 7 | 8 | 9 | %package{Slic3r::GUI}; 10 | 11 | void disable_screensaver() 12 | %code{% Slic3r::GUI::disable_screensaver(); %}; 13 | 14 | void enable_screensaver() 15 | %code{% Slic3r::GUI::enable_screensaver(); %}; 16 | -------------------------------------------------------------------------------- /xs/xsp/GUI_3DScene.xsp: -------------------------------------------------------------------------------- 1 | %module{Slic3r::XS}; 2 | 3 | #include 4 | #include "slic3r/GUI/3DScene.hpp" 5 | 6 | %name{Slic3r::GUI::_3DScene::GLVertexArray} class GLVertexArray { 7 | GLVertexArray(); 8 | ~GLVertexArray(); 9 | void load_mesh(TriangleMesh* mesh) const 10 | %code%{ THIS->load_mesh(*mesh); %}; 11 | size_t size() const 12 | %code%{ RETVAL = THIS->verts.size(); %}; 13 | void* verts_ptr() const 14 | %code%{ RETVAL = THIS->verts.empty() ? 0 : &THIS->verts.front(); %}; 15 | void* norms_ptr() const 16 | %code%{ RETVAL = THIS->verts.empty() ? 0 : &THIS->norms.front(); %}; 17 | Clone< Pointf3 > get_point(int i); 18 | }; 19 | 20 | %package{Slic3r::GUI::_3DScene}; 21 | %{ 22 | 23 | void 24 | _extrusionentity_to_verts_do(Lines lines, std::vector widths, std::vector heights, bool closed, double top_z, Point* copy, GLVertexArray* qverts, GLVertexArray* tverts) 25 | CODE: 26 | _3DScene::_extrusionentity_to_verts_do(lines, widths, heights, closed, 27 | top_z, *copy, qverts, tverts); 28 | 29 | %} -------------------------------------------------------------------------------- /xs/xsp/LayerHeightSpline.xsp: -------------------------------------------------------------------------------- 1 | %module{Slic3r::XS}; 2 | 3 | %{ 4 | #include 5 | #include "libslic3r/LayerHeightSpline.hpp" 6 | %} 7 | 8 | %name{Slic3r::LayerHeightSpline} class LayerHeightSpline { 9 | LayerHeightSpline(); 10 | Clone clone() 11 | %code%{ RETVAL = THIS; %}; 12 | 13 | void setObjectHeight(coordf_t object_height); 14 | bool hasData(); 15 | bool setLayers(std::vector layers) 16 | %code%{ RETVAL = THIS->setLayers(layers); %}; 17 | bool updateLayerHeights(std::vector heights) 18 | %code%{ RETVAL = THIS->updateLayerHeights(heights); %}; 19 | bool layersUpdated(); 20 | bool layerHeightsUpdated(); 21 | void clear(); 22 | std::vector getOriginalLayers(); 23 | std::vector getInterpolatedLayers(); 24 | coordf_t getLayerHeightAt(coordf_t height); 25 | }; 26 | -------------------------------------------------------------------------------- /xs/xsp/MotionPlanner.xsp: -------------------------------------------------------------------------------- 1 | %module{Slic3r::XS}; 2 | 3 | %{ 4 | #include 5 | #include "libslic3r/MotionPlanner.hpp" 6 | %} 7 | 8 | %name{Slic3r::MotionPlanner} class MotionPlanner { 9 | MotionPlanner(ExPolygons islands); 10 | ~MotionPlanner(); 11 | 12 | int islands_count(); 13 | Clone shortest_path(Point* from, Point* to) 14 | %code%{ RETVAL = THIS->shortest_path(*from, *to); %}; 15 | }; 16 | -------------------------------------------------------------------------------- /xs/xsp/PerimeterGenerator.xsp: -------------------------------------------------------------------------------- 1 | %module{Slic3r::XS}; 2 | 3 | %{ 4 | #include 5 | #include "libslic3r/PerimeterGenerator.hpp" 6 | %} 7 | 8 | %name{Slic3r::Layer::PerimeterGenerator} class PerimeterGenerator { 9 | PerimeterGenerator(SurfaceCollection* slices, double layer_height, Flow* flow, 10 | StaticPrintConfig* region_config, StaticPrintConfig* object_config, 11 | StaticPrintConfig* print_config, ExtrusionEntityCollection* loops, 12 | ExtrusionEntityCollection* gap_fill, SurfaceCollection* fill_surfaces) 13 | %code{% RETVAL = new PerimeterGenerator(slices, layer_height, *flow, 14 | dynamic_cast(region_config), 15 | dynamic_cast(object_config), 16 | dynamic_cast(print_config), 17 | loops, gap_fill, fill_surfaces); %}; 18 | ~PerimeterGenerator(); 19 | 20 | void set_lower_slices(ExPolygonCollection* lower_slices) 21 | %code{% THIS->lower_slices = lower_slices; %}; 22 | void set_layer_id(int layer_id) 23 | %code{% THIS->layer_id = layer_id; %}; 24 | void set_perimeter_flow(Flow* flow) 25 | %code{% THIS->perimeter_flow = *flow; %}; 26 | void set_ext_perimeter_flow(Flow* flow) 27 | %code{% THIS->ext_perimeter_flow = *flow; %}; 28 | void set_overhang_flow(Flow* flow) 29 | %code{% THIS->overhang_flow = *flow; %}; 30 | void set_solid_infill_flow(Flow* flow) 31 | %code{% THIS->solid_infill_flow = *flow; %}; 32 | 33 | Ref config() 34 | %code{% RETVAL = THIS->config; %}; 35 | 36 | void process(); 37 | }; 38 | -------------------------------------------------------------------------------- /xs/xsp/PlaceholderParser.xsp: -------------------------------------------------------------------------------- 1 | %module{Slic3r::XS}; 2 | 3 | %{ 4 | #include 5 | #include 6 | #include "libslic3r/PlaceholderParser.hpp" 7 | %} 8 | 9 | %name{Slic3r::GCode::PlaceholderParser} class PlaceholderParser { 10 | PlaceholderParser(); 11 | ~PlaceholderParser(); 12 | Clone clone() 13 | %code{% RETVAL = THIS; %}; 14 | 15 | void update_timestamp(); 16 | void apply_env_variables(); 17 | void apply_config(DynamicPrintConfig *config) 18 | %code%{ THIS->apply_config(*config); %}; 19 | void set(std::string key, std::string value); 20 | %name{set_multiple} void set(std::string key, std::vector values); 21 | std::string process(std::string str) const; 22 | }; 23 | -------------------------------------------------------------------------------- /xs/xsp/SlicingAdaptive.xsp: -------------------------------------------------------------------------------- 1 | %module{Slic3r::XS}; 2 | 3 | %{ 4 | #include 5 | #include "libslic3r/SlicingAdaptive.hpp" 6 | %} 7 | 8 | %name{Slic3r::SlicingAdaptive} class SlicingAdaptive { 9 | SlicingAdaptive(); 10 | ~SlicingAdaptive(); 11 | void clear(); 12 | void add_mesh(TriangleMesh *mesh); 13 | void prepare(coordf_t object_size); 14 | float next_layer_height(coordf_t z, coordf_t quality_factor, coordf_t min_layer_height, coordf_t max_layer_height); 15 | float horizontal_facet_distance(coordf_t z, coordf_t max_layer_height); 16 | }; 17 | -------------------------------------------------------------------------------- /xs/xsp/SupportMaterial.xsp: -------------------------------------------------------------------------------- 1 | %module{Slic3r::XS}; 2 | 3 | #include 4 | #include "libslic3r/SupportMaterial.hpp" 5 | 6 | %package{Slic3r::Print::SupportMaterial}; 7 | %{ 8 | 9 | SV* 10 | MARGIN() 11 | PROTOTYPE: 12 | CODE: 13 | RETVAL = newSVnv(SUPPORT_MATERIAL_MARGIN); 14 | OUTPUT: RETVAL 15 | 16 | %} -------------------------------------------------------------------------------- /xs/xsp/XS.xsp: -------------------------------------------------------------------------------- 1 | %module{Slic3r::XS}; 2 | %package{Slic3r::XS}; 3 | 4 | #include 5 | 6 | %{ 7 | 8 | %} 9 | 10 | %package{Slic3r}; 11 | %{ 12 | 13 | SV* 14 | VERSION() 15 | CODE: 16 | RETVAL = newSVpv(SLIC3R_VERSION, 0); 17 | OUTPUT: RETVAL 18 | 19 | SV* 20 | GITVERSION() 21 | CODE: 22 | RETVAL = newSVpv(SLIC3R_GIT, 0); 23 | OUTPUT: RETVAL 24 | 25 | void 26 | xspp_test_croak_hangs_on_strawberry() 27 | CODE: 28 | try { 29 | throw 1; 30 | } catch (...) { 31 | croak("xspp_test_croak_hangs_on_strawberry: exception catched\n"); 32 | } 33 | %} 34 | -------------------------------------------------------------------------------- /xs/xsp/mytype.map: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/slic3r/Slic3r/026c1380e0ad12176dd2fc8cdf8f6f181deeb071/xs/xsp/mytype.map --------------------------------------------------------------------------------