Commit Graph

206 Commits

Author SHA1 Message Date
YuSanka
70ef0f25ef Information from DoubleSlider is saved to Model
GCode creating can work with that values.
2019-10-10 16:03:58 +02:00
Lukas Matena
7b45014721 GCode.cpp: Removed a failing assert that was no longer needed
The situation it checked happens when the wipe tower is lower than the tallest print object.
The function processes that correctly.
2019-10-10 09:54:27 +02:00
bubnikv
564eddd99d FDM Print refactoring:
Layer newly remembers bounding boxes of slices,
the bounding boxes are used by G-code generator & newly the support
generator.
Slices are stored as ExPolygons, not ExPolygonCollection.
2019-10-01 17:17:08 +02:00
Lukas Matena
61cee54dd3 Merge branch 'master' into lm_low_wipe_tower 2019-10-01 13:24:25 +02:00
bubnikv
331c187b39 Rest of the path chaining has been replaced with the new algorithm.
PolylineCollection.cpp/hpp was removed, use Polylines instead.
Various first_point() / last_point() now return references, not copies.
2019-09-27 18:17:21 +02:00
bubnikv
4b35ebe6e5 Merge branch 'master' of https://github.com/Prusa3d/PrusaSlicer 2019-09-27 09:52:57 +02:00
bubnikv
e65ab90c16 Fix of G-code path planning: Infill lines were incorrectly ordered
for islands with another islands in their holes.

Improvement of chaining of infill lines for 3D honeycomb, Gyroid and
Honeycomb infill: New TSP chaining algorithm is used.
2019-09-27 09:51:07 +02:00
bubnikv
10eecb2cab Reworked Traveling Salesman Problem code for simplicity and robustness.
The TSP algorithm is newly used for planning of the printing order
of objects AND their instances.
2019-09-26 16:39:50 +02:00
Lukas Matena
7861fa5086 Whitespace changes to supress misleading indentation warnings
These appear in newer gcc when spaces and tabs are mixed
2019-09-24 16:01:01 +02:00
Lukas Matena
abaebb489a Added a config option to not print sparse layers on the wipe tower 2019-09-20 10:54:20 +02:00
Lukas Matena
04f051ff61 Wipe tower now doesn't print sparse layers, it is instead lower than the object 2019-09-20 10:54:20 +02:00
bubnikv
a9182fb0b3 Merge branch 'master' into dev 2019-09-13 16:19:35 +02:00
bubnikv
345d73e0d6 Merge branch 'master' of https://github.com/Prusa3d/PrusaSlicer 2019-09-13 16:17:23 +02:00
Lukas Matena
ee7132a23d Fixup of 4f89672 + allowing negative support_contact_z 2019-09-13 15:47:00 +02:00
bubnikv
4f89672816 Fixed false positives of missing layers due to support layer snapping
to avoid layers thinner than min_layer height, and possibly due to
the fact, that empty support extrusions may get generated
for support layers with non-empty support polygons.

Fix of Empty layers detection added to GCode.cpp (6ab1cec)
2019-09-13 15:18:42 +02:00
bubnikv
bb896b4c13 Merge remote-tracking branch 'remotes/origin/lm_brimskirt' 2019-09-12 15:53:20 +02:00
Enrico Turri
84f589ad5c Merge branch 'master' of https://github.com/prusa3d/PrusaSlicer into dev 2019-09-11 09:15:58 +02:00
Enrico Turri
44c3493f7d GCodeAnalyzer: Fixed a crash when encountering an invalid toolchange 2019-09-11 08:39:29 +02:00
bubnikv
6ba43ebacb Merge remote-tracking branch 'remotes/origin/master' into dev 2019-09-09 17:49:07 +02:00
Lukas Matena
822bc7a91c Fix of previous commit, tooltip update 2019-09-09 16:02:39 +02:00
Lukas Matena
499fdeddd1 Custom toolchange gcode is searched for tool-changing command
If the custom toolchange gcode switches extruder to the one that is expected, PrusaSlicer does not issue its own T command
Otherwise, this command is inserted just after the custom gcode, even in case it is not empty
This should prevent issues such as #2884 and #2886 from being reported
2019-09-09 13:05:18 +02:00
bubnikv
751b9e69fa Fixed stack overflows in G-code generator. 2019-09-09 10:18:17 +02:00
Lukas Matena
a985a2720f Fixed some more warnings, moved function to get ExtrusionRole name into ExtrusionEntity.hpp
So it can be called from wherever it may be needed
2019-09-06 15:55:07 +02:00
Enrico Turri
bdbaecb7f8 Merge branch 'dev' of https://github.com/prusa3d/PrusaSlicer into dev 2019-09-05 09:55:08 +02:00
Enrico Turri
9b550fbd5b Improved time estimator post-processing 2019-09-05 09:54:44 +02:00
Lukas Matena
805a5d22a1 Fixed couple of warnings in WipeTower.cpp, ToolOrdering.cpp and GCode.cpp 2019-09-04 14:56:35 +02:00
bubnikv
9cbfe8f5ef Make sure the "avoid crossing perimeters" class is resetted
at the start of G-code export.
2019-08-26 09:55:00 +02:00
bubnikv
de43f579a9 Refactoring of AvoidCrossingPerimeters::init_external_mp() 2019-08-25 09:01:01 +02:00
Lukas Matena
3addae3bb4 GCode.cpp: Avoid crossing perimeters performance optimization 2019-08-23 13:06:29 +02:00
Enrico Turri
9cabb03f72 GCodeTimeEstimator uses annotated gcode in place of processing m600 lines to detect color print changes.
WARNING -> After this commit the exported gcode will contain the extra lines used by the time estimator. They will be removed by a future commit when a new post-process method will be implemented.
2019-08-21 14:43:14 +02:00
Enrico Turri
85ed363951 GCodeAnalyzer uses annotated gcode in place of processing m600 lines to detect color print changes 2019-08-21 14:09:20 +02:00
bubnikv
2e7d5e5bc1 Merge branch 'master' of https://github.com/Prusa3d/PrusaSlicer 2019-08-20 16:22:37 +02:00
bubnikv
fd3fe75d1c Reworked the rename_file() function on Windows to work reliably and
atomically. The code was taken from the llvm project, it is complex
and hopefully it covers all the Windows file system quirks. Vojtech
has highest hopes, that this will fix the various PrusaSlicer.ini
file corruptions.

Enabled the locales switching and error handling on Linux as well,
where now the missing locales are reported and running the locale-gen
tool is recommended.
2019-08-20 16:19:30 +02:00
Lukas Matena
53939796a6 GCode.cpp: Fix of temperature change before print
Function set_extruder can be called before moving to the first layer, m_layer_index is then -1. We definitely don't want to set temperature for second layer in that case.
2019-08-20 14:22:31 +02:00
bubnikv
778e499827 Merge remote-tracking branch 'remotes/origin/lm_wipe_tower_linear_advance' 2019-08-20 09:19:22 +02:00
Lukas Matena
92bdb68e11 Extended the error message when empty layers are detected 2019-08-19 15:50:49 +02:00
Lukas Matena
0f32223ba0 WipeTower: linear advance is disabled immediately before ramming, not before moving to the wipe tower
Linear advance is reset by filament start gcode after a toolchange. However, not all moves to the wipe tower
end with a toolchange (brim, empty grid) and it would therefore disable linear advance until the next toolchange
This should solve https://github.com/prusa3d/PrusaSlicer/issues/2770
2019-08-16 00:20:51 +02:00
Lukas Matena
4cca6f8724 Allowed the skirt to intersect brim (https://github.com/prusa3d/PrusaSlicer/issues/724)
Brim lines are split at the intersection so there is no overextrusion.
2019-08-15 12:27:49 +02:00
Lukas Matena
c189140221 Fixed a false positive empty layer report
Reported in https://github.com/prusa3d/PrusaSlicer/issues/2752 and was a result of setting support contact z distance to negative value.
This lowered the maximum allowed print_z of the next layer, even though previous layer had object layers too, so the penalty from the contact z should not have been applied.
Fixed simply by rejecting the negative contact_z.
2019-08-13 11:02:58 +02:00
Lukas Matena
8e4f777bd3 One more fix on the empty layers detection - support contact z distance is taken into account
If it wasn't, anything with raft would be rejected unless contact z was zero. We do not want that.
2019-08-07 12:02:30 +02:00
Lukas Matena
f61c982111 GCode.cpp: fixed detection of empty layers so it doesn't give false positives
That could happen on empty support layers which do not necessarily matter, since their spacing is not generally synchronized with the object
The new hopefully correct logic is "if there are extrusions on a layer, check that last layer with extrusions is at most the new layer height below
This is a fixup of changes from 0de6e53 and 6ab1cec
2019-08-07 10:54:36 +02:00
bubnikv
7e1d2daf78 Merge branch 'master' of https://github.com/Prusa3d/PrusaSlicer 2019-08-05 14:30:42 +02:00
bubnikv
731e5abd88 Fixed a regression issue where excessive memory was allocated
for the GLVolumes before sending to the GPU driver. The following commits
were partially reverted:

4269c8b23c Removed GLVolume non-VBO rendering
d15698e21e GLVolume and GLIndexedVertexArray refactored to send data to gpu at the first render call

Namely, the GLVolume buffers are "shrink to size"'d before sending their
content to the OpenGL driver, and the vertex buffers are populated
as quickly as possible from the GLVolume, so that the same buffer is not
kept twice in RAM on systems, where the RAM is shared with the graphics
card.

Also the memory allocation reporting was improved for the GLVolumes.
2019-08-05 14:30:32 +02:00
Lukas Matena
0de6e53219 Followup of 6ab1cec - empty layers are ok if there are only other empty layers on top of them
Also fixed a possible crash in Print.cpp when preparing the wipe tower layers
2019-08-04 22:57:59 +02:00
Lukas Matena
6ab1cec48c Empty layers detection added to GCode.cpp
Added detection of empty layers so the wipe tower doesn't trip on them (it is not printable anyway).
This should improve wipe tower reliability with supports, objects standing on edges, etc.
I also turned an assert into exception throw to prevent hard crashes and nonsense output.
2019-08-02 16:54:18 +02:00
Enrico Turri
c791ba776f Added absolute time to estimated time for color print and fixed a bug in showing estimated times for print color for silent mode 2019-08-02 12:05:02 +02:00
bubnikv
f8218eb903 Reworked the FFF Print::update() to process the filament retract
override values and to store them into the output G-code.
2019-07-25 14:39:19 +02:00
Lukas Matena
eb29c3e01d Wipe tower accounts for extruder offsets
Also, in case of non-single-extruder printer with the wipe tower, first wiping line was printed where the border should have been - fixed
2019-07-19 13:00:10 +02:00
Lukas Matena
fca5562c6c Process start_filament_gcode in case of usual single extruder printer
Reported in https://github.com/prusa3d/PrusaSlicer/issues/2652
2019-07-19 10:02:52 +02:00
Lukas Matena
52ab8a5f19 Wipe tower fix (do not skip the first toolchange when printing without the wipe tower)
Also, test multi.t updated so it matches new logic of inserting custom gcodes
2019-07-16 13:10:09 +02:00
Lukas Matena
004e2719b1 Merge branch 'master' into lm_warnings 2019-07-15 13:26:55 +02:00
bubnikv
ab7ecc1819 Merge remote-tracking branch 'remotes/origin/vb_undo_redo' 2019-07-15 11:34:18 +02:00
Lukas Matena
e674c586b0 Merge branch 'lm_improving_wipe_tower'. Summary of changes:
- wipe tower respects max volumetric flow, slowing down with PVA etc is not hardcoded anymore
- wipe tower is now allowed for multiple-extruder printers. single extruder stuff is not used in that case (ramming, cooling, etc.)
- start/end filament and toolchange custom gcodes are now inserted differently than before - see 41164a9
- some refactoring, e.g. the abstract WipeTower class was eradicated
2019-07-15 10:25:38 +02:00
Lukas Matena
2ee572bd31 GCodeAnalyzer now recognizes tool-changing commands with MakerWare and Sailfish flavor
These firmwares use M135 Tn and M108 Tn commands for changing active tool, which the analyzer did not recognize. The toolpaths were then rendered in wrong color, extruder offset etc. This surfaced in issue https://github.com/prusa3d/PrusaSlicer/issues/2566
2019-07-12 12:56:41 +02:00
Enrico Turri
25d916f144 Color change time estimates 2019-07-08 08:40:20 +02:00
bubnikv
c7cc760067 Merge remote-tracking branch 'origin/master' into vb_undo_redo 2019-07-04 20:22:15 +02:00
YuSanka
136e5156bc Fixed colot_print issues:
* Disabled color change information for the SLA and FFF-multimaterial presets
* Corrected switch between "color print" and "feature type" on Preview
2019-07-02 14:06:58 +02:00
Lukas Matena
4b9e366f00 Multimaterial print - making sure that temperatures will be changed with SE printer without the wipe tower 2019-06-26 14:50:12 +02:00
bubnikv
a710e7e7e4 WIP: Undo / Redo stack.
Integration of the "cereal" serialization library.
Serialization / deserialization of the DynamicConfig / DynamicPrintConfig.
DynamicPrintConfig serializes ordinal identifiers instead
of the option key strings to conserve space.
2019-06-26 13:26:49 +02:00
Lukas Matena
cb916c4dda Fixed warnings in libslic3r 2019-06-25 16:04:29 +02:00
Lukas Matena
05e6dbbe4b Wipe tower - refactoring (removed the abstract WipeTower class)
- abstract class WipeTower and its descendant WipeTowerPrusaMM were merged into a single (non-abstract) WipeTower class
- all uses of WipeTower::xy struct were replaced by Eigen Vec2f (it is no longer necessary to be independent on libraries that PrusaSlicer uses)
- the WipeTowerPrusaMM.hpp/.cpp will be renamed in the next commit (hopefully it will retain its git history that way)
2019-06-17 10:16:07 +02:00
Lukas Matena
678d0e18a7 WipeTowerIntegration class: print_z is not passed around, ToolChangeResult objects are aware of it 2019-06-14 14:43:40 +02:00
Lukas Matena
aee376762e Changed handling of priming extrusions to allow injection of filament and toolchange custom gcodes
The priming extrusions were handled separately from the rest of the wipe tower toolchanges. In order to be able to use the logic from previous commit for them (custom toolchange gcodes etc), some unpleasant code shuffling was needed
2019-06-14 14:42:07 +02:00
Lukas Matena
41164a9cb3 Multimaterial printing: Changed the way how custom gcodes are inserted
Each toolchange now emits:
- end filament custom gcode
- toolchange custom gcode; if not provided, a standard Tn command is inserted
- start filament gcode

Hopefully it is now consistent for SE/ME printers with/without the wipe tower
The priming line does not work - will be fixed in the next commit
2019-06-14 14:38:58 +02:00
Thomas Moore
da1aea889f Enable wipe tower for all multi-extruder configurations 2019-06-14 12:28:52 +02:00
Lukas Matena
6f7051c3b1 GCode preview shows correct volumetric flow for the wipe tower
The neccessary annotations for the GCodeAnalyzer were missing
2019-06-14 12:28:52 +02:00
Bryan Smith
0ea6f895c5 Write the total toolchanges statistic to the end of the GCODE file like the other statistics. 2019-06-05 11:23:44 -04:00
Bryan Smith
f364b956fc Add [total_toolchanges] placeholder for filename and custom gcode sections. 2019-06-05 11:23:44 -04:00
Bryan Smith
3d8bd85187 Add new [total_layer_count] placeholder everywhere [layer_num] is avalible.
Missed adding [total_layer_count] to layer_gcode


Revert "Add new [total_layer_count] placeholder everywhere [layer_num] is avalible."

This reverts commit e29e766224a14e1f237908c3e5507ac5586ca5b7.

Revert "Missed adding [total_layer_count] to layer_gcode"

This reverts commit f07907a8acc450e9ae1220c6a9fe4f7c7e6d896c.

Better way to add [total_layer_count]
2019-06-03 14:47:18 +02:00
bubnikv
04397c7948 Changed the G-code export and send to OctoPrint GUI code
to store the G-code next to the project file if it exists,
and to process the project name with the PlaceholderParser.
2019-05-17 16:27:00 +02:00
Lukas Matena
cf3b992269 GCode.cpp: Update the 'current_extruder' placeholder even if filament start gcode is empty 2019-05-06 14:48:59 +02:00
Lukas Matena
08cb5bc2c7 Wipe tower uses correct gcodes for RepRap gcode flavor (M907->M906, M900->M572 - should fix #1843)
Also, fixed proper setting of the extruder current during toolchange (was broken since 6da83c7)
2019-04-24 12:09:58 +02:00
bubnikv
d83a013d6b Export of filament statistics into G-code for multi-material prints
has been rewritten to be easier to parse.

Old format
; filament used = 19248.8mm (46.3cm3)
; filament used = 57.4
; filament cost = 1.5
; filament used = 8007.6mm (19.3cm3)
; filament used = 23.9
; filament cost = 0.6
; filament used = 0.0mm (0.0cm3)
; filament used = 0.0mm (0.0cm3)
; filament used = 0.0mm (0.0cm3)
; total filament cost = 2.1

New format
; filament used [mm] = 1600.7,1600.7,1600.7,1600.7,1600.7
; filament used [cm3] = 3.9,3.9,3.9,3.9,3.9
; filament used [g] = 4.8,4.8,4.8,4.8,4.8
; filament cost = 1.5,1.5,1.5,1.5,1.5
; total filament used [g] = 24.0
; total filament cost = 7.5

Where the non-printing extruders are filled in with zeros, and
the trailing non-printing extruders are not exported.

; filament used [g]
and
; filament cost
are only printed if non zero (material density and cost are defined)
2019-04-16 14:25:50 +02:00
Enrico Turri
ea3d30bff1 Fix of #2082 -> Added lines M73 P100 and M73 Q100 to gcode to signal that print is finished 2019-04-08 11:54:58 +02:00
bubnikv
e0e1e2b682 Improved SLA layer view: Low layer shall be rendered from the slice above,
triangulated slices are shifted slightly away from the clipping planes.

FDM: Ported a "(bridged)" G-code comment from upstream.
2019-03-26 10:38:50 +01:00
Enrico Turri
f5b5e48ad7 Added cancel mechanism to GCodeAnalyzer::calc_gcode_preview_data() 2019-03-12 11:57:39 +01:00
Enrico Turri
219ea04c23 Fix of #1812 (GCode Anayzer take in account extruder offsets for multiextruder printers) 2019-03-06 10:22:10 +01:00
Enrico Turri
8a29ec2204 GCode Anayzer take in account extruder offsets 2019-03-05 15:03:56 +01:00
Enrico Turri
8a6d29f7d8 Workaround to fix inconsistencies of width of gcode preview extrusion paths 2019-03-01 09:55:43 +01:00
bubnikv
a56f7d60e5 Fixed an issue, where the output G-code file name was not always updated
from the current Model/ModelObjects.
Fixed a possible race condition in updating Print::m_placeholder_parser
with the proposed filename / filename base.
Improved documentation (source code comments).
2019-02-03 10:41:14 +01:00
bubnikv
c82d346c1a Fixed a bug in initialization of some StaticPrintConfig derived classes.
Merged implementation of support for "Octoprint-Cancelobject" #972
thanks @supermerill
2019-01-31 15:09:16 +01:00
bubnikv
57bd0889c3 Disabled the experimental pressure equalizer. 2019-01-29 18:07:45 +01:00
bubnikv
aaaffd7f90 Fixes Add [layer_num] and [layer_z] to Custom Tool change G-code #1651 2019-01-29 12:02:48 +01:00
Lukas Matena
ed1aad9de4 PURGING FINISHED gcode comment only emitted on layers where some purging was happening 2019-01-21 14:05:28 +01:00
bubnikv
54299d8eb0 Fix of https://github.com/prusa3d/Slic3r/issues/1631
This is a fix of a long standing bug, where an extrusion is incorrectly
drawn from the end of the last wipe move. Interestingly enough,
this bug is in Slic3r at least since 1.2.9, but lucky enough
it only occured for single perimeter, no infill prints with wipe after
retract enabled, and only if the two successive slices were discretized
exactly the same, which is quite unlikely.
2019-01-14 19:57:41 +01:00
bubnikv
2f4adc1906 Implemented [filament_extruder_id] placeholder #1568 2019-01-07 15:12:40 +01:00
bubnikv
026bc801e3 Fix of #1505, #1541
Fixed a regression issue in initialization of the "Avoid external perimeters"
feature.
2019-01-07 12:20:48 +01:00
bubnikv
567b367061 Disabled the print bed mesh temporarily,
bumped up the build version to alpha2,
fixed one minor issue in G-code generator
2019-01-04 16:48:41 +01:00
bubnikv
8bc04e640a The G-code export was reshuffled a bit to reduce peak memory consumption.
Namely, the time estimate memory is released before the G-code
preview data is created from the G-code analyser data.
2018-12-18 17:34:21 +01:00
bubnikv
1e6900afa2 Logging of memory usage for the GCodeAnalyzer and GCodePreviewData. 2018-12-18 15:55:45 +01:00
bubnikv
bffcaeff41 Time estimator: Added consumed memory tracing, replaced std::map
with std::vector for lower memory consumption.
2018-12-18 14:10:31 +01:00
bubnikv
771928d916 Logging of memory allocations on Windows during the slicing process
when the SLIC3R_LOGLEVEL >= info.
2018-12-18 11:31:41 +01:00
bubnikv
9f43e7d375 Fixed a harless assert in PrintObject consturctor.
Fixed a bug in G-code generator regarding the seam hiding.
2018-12-07 11:21:05 +01:00
bubnikv
c586ca4ae0 Implemented compatible_printer / compatible_printer_condition
for filaments and SLA materials.

Fixed compatible_printers / compatible_prints dialog to show
system profiles as well.
2018-12-04 17:56:49 +01:00
YuSanka
c010e14460 Suppress ColorPrint for the multi-material printing 2018-11-28 16:03:25 +01:00
YuSanka
360133246c Fixed ColorPrint current layer identification 2018-11-28 16:03:24 +01:00
YuSanka
f8bc7cb959 Implementation of the "ColorPrint" on the 3DScene 2018-11-26 16:28:12 +01:00
YuSanka
2fa055903f "SLA Print Settings" implementation (start) 2018-11-19 14:05:29 +01:00
bubnikv
c2e46350f2 Separated Print / PrintObject into PrintBase.cpp/h to support SLAPrint 2018-11-08 14:23:17 +01:00
Lukas Matena
377350db33 When iterating over PrintObject regions, use PrintObject::region_volumes (see also yesterday's commit 3eea327) 2018-11-07 15:17:29 +01:00
Lukas Matena
9ca9e2a545 Merge branch lm_colorprint_integration into dev_native + deleting ticks outside slider range 2018-11-07 14:44:47 +01:00
bubnikv
3eea327ef0 WIP: When iterating over PrintObject's regions, use the region count
by PrintObject::region_volumes. This is due to the way Print::apply()
works, it does not invalidate an existing PrintObject if a new region
is added to the print.
2018-11-06 15:31:26 +01:00
bubnikv
fd1c5dd218 WIP: SL1 profiles, SL1 in wizard, switching between FFF / SLA 2018-10-31 16:22:36 +01:00
bubnikv
a45e9c0a03 WIP: Slicing from GUI. 2018-10-18 18:06:40 +02:00
bubnikv
1f4c758e71 Logging of G-code processing 2018-09-25 16:57:18 +02:00
bubnikv
0558b53493 WIP: Moved sources int src/, separated most of the source code from Perl.
The XS was left only for the unit / integration tests, and it links
libslic3r only. No wxWidgets are allowed to be used from Perl starting
from now.
2018-09-19 11:02:24 +02:00