602 Commits

Author SHA1 Message Date
Martin Šach
b2e8580fd8 Add retraction for any travels that would happen during layer change 2024-02-14 16:58:47 +01:00
Martin Šach
f64aea6499 Fix: Cap speed by max_volumetric_speed even for dynamic overhangs. 2024-02-07 10:12:43 +01:00
Lukas Matena
601d61ca86 Fixed placeholders extruded_volume and similar: wipe tower was not included 2024-02-07 09:55:37 +01:00
Lukas Matena
642535eecb Added const Print backpointer into GCodeGenerator 2024-02-07 09:55:37 +01:00
Lukas Matena
e4030321f7 Calculate wipe tower filament consumption per layer 2024-02-07 09:55:37 +01:00
Lukáš Hejl
8ce089c6ff SPE-2098: Pick a required extruder before a color change for multi-extruder printers.
When we need to perform a color change on an extruder that isn’t used within the layer, we perform a tool change to select the correct extruder. Then, we perform the color change, and finally, we perform another tool change to switch back to the original extruder.
2024-02-06 11:23:09 +01:00
Lukáš Hejl
1071645967 Separate color change handing from emit_custom_color_change_gcode_per_print_z() into emit_custom_color_change_gcode_per_print_z(). 2024-02-06 11:23:09 +01:00
Lukáš Hejl
145fb92e07 SPE-2098: Emit M600 instead of M601 for multi-tool printers. 2024-02-06 11:23:09 +01:00
Lukáš Hejl
ff3612840c SPE-2098: Pass color_change_extruder also into Color Change G-code.
Some minor refactoring of ProcessLayer::emit_custom_gcode_per_print_z();
2024-02-06 11:23:09 +01:00
Nohus
540b800a5c SPE-1922: Place M600 after unretract to prevent printer returns at the position that was already printed with the previous color.
This fixes #2672 caused by the default implementation of M600 that returns back to XY position before M600.
2024-02-01 09:34:01 +01:00
Lukáš Hejl
7d31f8c0ba SPE-2120: Fix another crash caused by using GCodeGenerator::last_position when it doesn't have an assigned value.
This behavior was there for a long time, but it was uncovered when std::optional was used.
2024-01-23 12:33:19 +01:00
Martin Šach
194d53ea25 Fix z_offset handling in gcode.cpp. Fixes #11843. 2024-01-23 09:28:25 +01:00
Martin Šach
812c40e887 Unify GCodeGenerator travel to first layer position.
* Fixes SPE-2116. The reason for this bug was forgotten change in
  WipeTowerIntegration after change in gcode.cpp.
* Prevents future similar bugs by unifing the functionality to a method.
2024-01-23 09:00:58 +01:00
Martin Šach
8cbea4982a Add lift before the first travel move in GCode.cpp 2024-01-23 09:00:58 +01:00
Lukáš Hejl
cda2446649 SPE-2120: Fix crash caused by using GCodeGenerator::last_position when it doesn't have an assigned value.
This behavior was there for a long time, but it was uncovered when std::optional was used.
2024-01-22 10:28:08 +01:00
Martin Šach
f9283728d6 During first layer change, do not actually move z.
This enables the user to set his own z in start gcode. Fixes #11843.
2024-01-17 12:22:22 +01:00
Lukáš Hejl
5ddcea806b Add to GCodeGenerator::last_position only when it has an assigned value.
This behavior was there for a long time, but it was uncovered when std::optional was used.
2024-01-17 12:22:22 +01:00
Lukáš Hejl
da57489874 Implement lift before obstacles that take into account already extruder extrusions on the current layer.
Ignore the first intersection of the travel path with the object from which the travel starts.

Created a new class TravelObstacleTracker, for wrapping all data structures related to lift before obstacles.
2024-01-17 12:22:22 +01:00
Lukáš Hejl
1b0ba60280 Rename m_last_obj_copy to m_current_instance and use struct instead of std::pair.
Also, instead of storing the shift of the instance, store the instance index.
2024-01-17 12:22:22 +01:00
SachCZ
ff30d7aad3 Replace last_pos and helpers with optional in GCode.cpp 2024-01-17 12:22:22 +01:00
SachCZ
7f397cd7b3 Implement ramping layer change using a tag in gcode
During layer change, instead of generating the gcode, generate a placeholder tag. Then at the end of layer processing replace this tag with a ramping travel move.
This solves the issue, that one does not know the starting point of the current layer where the layer change gcode would be originally generate.
The ramping layer changes uses smoothing of the ramping travel. Also it is adjusted in such a way that it increases the ramp angle when the travel is too short, to always reach the next layer.
2024-01-17 12:22:19 +01:00
Lukáš Hejl
413241fcbc Remove unused variable path_length from GCodeGenerator::_extrude().
This variable hasn't been used since the beginning.
2024-01-05 22:38:16 +01:00
Lukas Matena
e0a03c7970 Merge branch 'master_271' into HEAD 2023-12-13 15:49:26 +01:00
Lukas Matena
2d130c71b6 Move binary gcode checkbox to Printer Settings 2023-12-11 15:40:35 +01:00
Lukas Matena
1ee6e42642 Simplify binary metadata generation 2023-12-11 12:34:52 +01:00
Martin Šach
1d9bd1c62c Disable helical layer change when there is no layer change retraction 2023-12-08 14:10:11 +01:00
Lukas Matena
64a9b546fd Added wipe tower weight into G-code metadata 2023-12-08 14:05:12 +01:00
Martin Šach
01502f6a14 Fix SPE-2068: Helical layer changes out of bed bounds. 2023-12-07 14:58:49 +01:00
Martin Šach
466ac9105e Fix: Spiral vase missing perimeter 2023-12-07 14:45:08 +01:00
Martin Šach
c3132e91c8 Fix SPE-2068: Helical layer change generating travels out of bounds. 2023-12-06 10:50:13 +01:00
Martin Šach
e298593a2e Refactor: Separate gcode generator layer changes utilities to a file. 2023-12-06 09:49:56 +01:00
Martin Šach
e13d3cdbf2 Refactor: Move gcode travel utils to a separate file. 2023-12-06 09:49:56 +01:00
Martin Šach
2175fc3f4d Fix lift before obstacle over multiple instances. 2023-12-06 09:49:56 +01:00
Martin Šach
f6efd3a501 Fix: Spiral vase missing perimeter 2023-12-04 10:03:34 +01:00
Justin Schuh
0b68210849 Fix of #11648: Prevent overhang fan speeds from spilling into infill. 2023-11-14 11:15:15 +01:00
Martin Šach
5927a20905 Fix layer change enable 2023-11-10 12:19:39 +01:00
Martin Šach
384d245be7 Add basic implementation of an obstacle finding algorithm during travels.
A line distancer over previous layer is constructed. It is then queried
during travel planing. If an obstacle is found in the travel path,
the travel algorithm ensures minimal elevation before the obstacle.
2023-11-10 12:19:39 +01:00
Martin Šach
a4a7ac4a4e Add helical layer change.
Previously the layer change was straight up which caused stringing.
To solve this, a helical travel is implemented when changing layers.
2023-11-10 12:19:39 +01:00
Martin Šach
49455cf427 Replace GCode.cpp travel_to with more general z-hop strategy.
The new travel has an initial flat part, sloped part and
once the travel height reaches maxima a flat part again.
Also, the notion of extruder lift is removed. It is used no more.
Consequently the retract_lift parameter lost its original meaning.
2023-11-10 12:19:39 +01:00
Lukas Matena
eeedeeca13 Fix of #6832, SPE-1956: total toolchanges not counted correctly when wipe tower is disabled 2023-11-02 13:58:45 +01:00
Lukas Matena
30861c81d2 Removed G2/3 R option, it does not work correctly 2023-10-17 13:32:05 +02:00
Vojtech Bubnik
f1952b9591 Fix of SPE-1933
Fixing crash with pressure equalizer enabled.
This crash was introduced with ArcWelder integration.
2023-10-04 11:30:41 +02:00
Vojtech Bubnik
a0441dac14 ArcWelder:
Reducing the chance of creating segments shorter than G-code quantization
distance.
Improving fitting by non-linear least squares.
2023-10-02 09:59:06 +02:00
Lukas Matena
f599ddca8f Label objects: use non-convex projection if it only contains one (Ex)Polygon, remove unused code, tidy includes 2023-09-26 11:24:19 +02:00
Lukas Matena
501cfb64f9 Label objects: integrating the recently merged PR:
- code from @jschuh's functions moved into respective functions in LabelObjects class
- name no longer contains object_id, instance_id is newly 1-based
- replacing banned characters using std::replace_if
2023-09-26 11:24:19 +02:00
Justin Schuh
e659e96b04 Support Klipper exclude_objects feature (PR #10618):
comment by @lukasmatena: The functions are not called anywhere because of how I resolved conflicts. I will integrate the functions into current PrusaSlicer in the next commit.
2023-09-26 11:24:19 +02:00
Lukas Matena
fe3cf27394 Label objects: refactoring + fix of object/instance indexing when instances are rotated/out-of-bed 2023-09-26 11:24:19 +02:00
Lukas Matena
37dc3378ec Label objects: List of objects moved before custom start gcode, quotes added for M486 A on RRF 2023-09-26 11:24:18 +02:00
Lukas Matena
ef31e4f487 LabelObjects: differentiate based on firmware flavor, change M486 N to M486 A 2023-09-26 11:24:18 +02:00
Lukas Matena
395a5639cc Label objects: rename Marlin -> Firmware-specific, updated tooltip 2023-09-26 11:24:18 +02:00