Commit Graph

206 Commits

Author SHA1 Message Date
bubnikv
98e49772ed Custom G-code references are now being assigned to ToolOrdering::LayerTools()
and the superfluous M600 (color change) events are filtered out there.

Fixed a handful of compiler warnings.
2020-01-14 11:54:09 +01:00
bubnikv
8bfc986fa7 Refactoring of GCode::process_layer().
Refactoring of GCode export of color changes, extruder switches etc,
so that the "color change" like extruder switches are applied first
at the Wipe Tower / G-code export, so that adding / removing
an extruder switch at the G-code preview slider does not invalidate
slicing.
2020-01-14 10:31:18 +01:00
bubnikv
9038dc21e8 Fixing regression issue after G-code export refactoring. 2020-01-10 15:51:35 +01:00
bubnikv
702a489b03 Fixing compilation isue on non-MS compilers. 2020-01-10 11:53:39 +01:00
bubnikv
15eedef74b Refactoring of ToolOrdering (wipe into infill / object)
Refactoring of GCode::_do_export()
Helper lower_bound and search functions similar to std, but without
needing the value object explicitely.
2020-01-10 11:27:04 +01:00
bubnikv
5bb9ba64c2 Fix of previous commit 2020-01-09 10:14:50 +01:00
bubnikv
de70adca9c Optimization of G-code export: Don't make copies of ExtrusionEntities
when sorting them into Extruders / Islands / Regions.
2020-01-09 10:00:48 +01:00
YuSanka
0aaa7dd076 Small fix for 3e0690b37b 2020-01-08 15:44:39 +01:00
bubnikv
3e0690b37b Further optimizations of G-Code generator when Wipe into object / infill:
Don't do unnecessary tests if it is known that there is
no Wipe into object or infill active.
2020-01-08 15:16:31 +01:00
bubnikv
e0811e4aa5 Optimization of G-code export:
1) Don't allocate ExtruderOverrides if not necessary
2) Use boost::container::small_vector<int32, 3) for ExtruderOverrides
   (usually less than 4 instances are printed))
2020-01-08 14:58:24 +01:00
bubnikv
3d17543d40 Fix of "Don't use bridging perimeters on top of elephant-foot compensation #3011"
If the Elephant foot compensation is applied to the 1st object's layer,
the uncompensated 1st object's slice is newly used for calculation
of bridges, overhans, skirt, brim, raft and supports.

Layer::slices were renamed to Layer::lslices to simplify reading
of the code, to differentiate from LayerRegion::slices.
2020-01-03 14:07:31 +01:00
YuSanka
8824468882 Added function to update of custom_gcode_per_print_z in Model from configuration
considering "colorprint_heights" option.

Changed thumb_up/down icons to better preview (feedback from #3256)

Commented some uncertain code
2019-12-17 14:16:38 +01:00
YuSanka
afcc6bbb08 Code refactoring for Color change implementation 2019-12-17 08:37:50 +01:00
Lukas Matena
c284a65caa Warning fix: removed needless tautological check 2019-12-12 10:45:30 +01:00
Enrico Turri
61ab9e37d6 #3287 - Fixed GCodeAnalyzer and GCodeTimeEstimator when using Machinekit and Mach3/Linuxcnc gcode flavours 2019-12-09 11:40:26 +01:00
YuSanka
805a6c936c Localization improvements: Text correction 2019-12-06 13:58:23 +01:00
Lukas Matena
4ba7cb7ede Fix of the wipe tower starting point
see issues #2968, #3234 and #3248
2019-12-04 13:47:02 +01:00
Enrico Turri
ddd1df1552 ENABLE_THUMBNAIL_GENERATOR -> render printbed into thumbnails 2019-11-28 14:18:24 +01:00
YuSanka
dfd38c7818 Merge remote-tracking branch 'origin/master' into ys_color_print_extension 2019-11-28 09:01:14 +01:00
YuSanka
901a20b3b1 Code cleaning 2019-11-27 15:27:44 +01:00
YuSanka
496e09302f Implemented a message on Printer display for pause print
+ Added new icons
2019-11-27 14:44:33 +01:00
Enrico Turri
1ba3f0a4f6 Transparent background for thumbnails saved into gcode and sl1 files 2019-11-27 13:37:37 +01:00
Enrico Turri
b1047d2e26 ENABLE_THUMBNAIL_GENERATOR -> ENABLE_THUMBNAIL_GENERATOR_PNG_TO_GCODE set as default 2019-11-25 10:30:31 +01:00
Enrico Turri
6df506e482 ENABLE_THUMBNAIL_GENERATOR -> Thumbnails generated using a callback function 2019-11-22 12:39:03 +01:00
YuSanka
bc68b8eaf2 ExtruderSequenceDialog :
Fixed layouts after the second opening of the dialog.
 (Removing any extruder from the sequence does not cause an incorrect layout)
Validation of entered values added
 (0 is not a valid value)
2019-11-16 02:12:37 +01:00
YuSanka
0fb8b2ce09 Delete color changes for unused extruders 2019-11-15 16:36:29 +01:00
Lukas Matena
88514eeb0e Merge branch 'lm_low_wipe_tower' 2019-11-14 10:37:04 +01:00
Enrico Turri
621b8426d3 #3175 - Fixed compatibility with boost v 1.71 2019-11-11 11:21:08 +01:00
YuSanka
6c8bb51f4a Use constant names for G-codes like M600, M601 and "tool_change"(Change extruder) 2019-11-11 09:38:45 +01:00
YuSanka
c4a62819f4 Implemented new color change preview from Gcode
+ Added missed "change_extruder.svg"
2019-11-07 08:13:26 +01:00
Enrico Turri
d8dca69d60 Merge branch 'master' of https://github.com/prusa3d/PrusaSlicer into et_plater_thumbnail 2019-11-05 13:58:13 +01:00
bubnikv
7a7183383f Merge branch 'master' of https://github.com/BryanSmithDev/PrusaSlicer into BryanSmithDev-master 2019-11-05 11:37:40 +01:00
Enrico Turri
76377ee0fe ENABLE_THUMBNAIL_GENERATOR -> Export thumbnails to gcode as png data in lines with max 80 characters length 2019-11-04 15:38:15 +01:00
Enrico Turri
64d5ac0d20 ENABLE_THUMBNAIL_GENERATOR -> Export thumbnails to gcode: max length of gcode lines set to 80 characters 2019-11-04 14:00:26 +01:00
Enrico Turri
c34232214d Merge branch 'master' of https://github.com/prusa3d/PrusaSlicer into et_plater_thumbnail 2019-11-04 11:13:19 +01:00
YuSanka
c564f693e9 Merge remote-tracking branch 'origin/master' into ys_color_print_extension 2019-11-03 19:34:34 +01:00
bubnikv
a72ac57fab adaptive elpehant foot compensation, fixing
GH issues #1757 #2085 #2132 #2423 #2502 #2156 #2773 #2828 #2998 #3001
2019-11-01 19:59:09 +01:00
Enrico Turri
f6453aab1b ENABLE_THUMBNAIL_GENERATOR -> Fixed potential race condition when generating thumbnails 2019-10-30 10:09:58 +01:00
YuSanka
8ebd9ce7c4 Save "color_change" for a selected extruder to G_code 2019-10-29 15:34:35 +01:00
Enrico Turri
2d5c28d6d1 ENABLE_THUMBNAIL_GENERATOR -> Allow for multiple thumbnails into gcode and sl1 files 2019-10-25 13:59:13 +02:00
Enrico Turri
de60b40347 ENABLE_THUMBNAIL_GENERATOR -> Thumbnail data saved into gcode using base64 encoding + debug code to extract thumbnails from gcode 2019-10-25 12:18:10 +02:00
Enrico Turri
982ed95a35 ENABLE_THUMBNAIL_GENERATOR -> Save thumbnail size into gcode 2019-10-25 08:57:13 +02:00
Enrico Turri
5609f53797 ENABLE_THUMBNAIL_GENERATOR -> Add thumbnail data into gcode output 2019-10-24 10:06:31 +02:00
Enrico Turri
4d1153c866 ENABLE_THUMBNAIL_GENERATOR -> WIP: Refactoring and preparation for adding thumbnails to exported gcode and 3mf files 2019-10-23 13:31:24 +02:00
Enrico Turri
1809497c38 Merge branch 'master' of https://github.com/prusa3d/PrusaSlicer into et_plater_thumbnail 2019-10-22 16:03:27 +02:00
Enrico Turri
32a42f2808 Added tech ENABLE_THUMBNAIL_GENERATOR -> 1st installment of generation of thumbnail from plater (WIP) 2019-10-22 16:02:31 +02:00
YuSanka
8dea6c2fd8 Fixed a crash with the following repro:
1) Start PrusaSlicer
2) Select printer: Original Prusa i3 MK2.5
3) Load any stl file
4) In Printer Settings turn on "Support stealth mode"
5) Press "Slice now"
-> crash
All the "machine_XXXXX" vectors in the print config contain a single value instead of two leading to a vector subscript out of range
when read into GCode::_do_export()
2019-10-22 12:50:09 +02:00
YuSanka
ea8695c06c Fixed GCode export for color_print extensions.
M25 is changed to M601
2019-10-16 12:03:51 +02:00
YuSanka
76ec1bc7e3 Improved extruder_selector for DoubleSlider 2019-10-16 10:30:29 +02:00
YuSanka
5d9a136b8a Merge remote-tracking branch 'origin/master' into ys_color_print_extension 2019-10-10 16:17:09 +02:00
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