Commit Graph

582 Commits

Author SHA1 Message Date
Lukáš Hejl
36bd65d810 Added a missing include (GCC11.1 without PCH). 2022-06-08 21:12:00 +02:00
Vojtech Bubnik
e2405b51da Fixed typo in thumbnail_QOI tag. 2022-06-08 21:12:00 +02:00
Vojtech Bubnik
8ed6d1b466 WIP: Implemented support for QOI G-code thumbnail format as requested
by the RepRapFirmware team due to their low RAM budget for decompression.
Bundled the QOI image compression library.
2022-06-08 21:12:00 +02:00
Lukas Matena
5792190515 Fix of incorrect MMU filament estimate 2022-06-08 21:09:39 +02:00
PavelMikus
27a7ddccb6 improve visibility estimation via distance to plane weighting.
increase angle importance, improve alignment
2022-06-08 10:28:21 +02:00
PavelMikus
c09781d61d optimize embedding computation
fix seed of random generators
set high angle importance for nearest mode
2022-06-07 11:12:48 +02:00
PavelMikus
1e7b4a6720 Implementation of ShortEdgeCollapse
Replaced QEC by edge collapse in occlusion computation
2022-06-07 11:12:48 +02:00
PavelMikus
b5b39195f4 Added throw_if_canceled callback to all slower sections 2022-06-07 11:12:48 +02:00
PavelMikus
c23d1488c9 Performance improvements 2022-06-07 11:12:48 +02:00
PavelMikus
a4201321e8 Hopefully improved the seam placer performance a lot 2022-06-07 11:12:48 +02:00
PavelMikus
6da220062c Mac OS pre 10.13 does not fully support std::optional (method .value() is not allowed)
This commit replaces usage of .value() calls with .operator*()
2022-06-07 11:12:48 +02:00
PavelMikus
d59d8eebde Full occlusion guided seam placer backport 2022-06-07 11:12:48 +02:00
Lukas Matena
70fa8ef29d Enforce first layer on experimental wipe tower (#7090) 2022-06-02 09:28:09 +02:00
Lukas Matena
3b94494c4f Fix of #8186: incorrect count of toolchanges reported:
broken for o long time, probably since 58a811a
2022-04-12 13:39:14 +02:00
enricoturri1966
fab6619641 #8032 - GCodeProcessor - Fixed parsing of LAYER_CHANGE tag for spiral vase mode 2022-03-23 17:17:23 +01:00
enricoturri1966
1fb41a8e22 #4881 - #5073 - #6336 - GCodeProcessor::AxisCoords using doubles in place of floats 2022-02-02 11:22:45 +01:00
Vojtech Bubnik
7da4bebe7a WIP GCode substitutions: Changed the format of gcode_substitutions by
adding an empty comment as a fourth parameter to each substitution.
In the future, we will provide a UI to show / edit the comment.
2022-01-27 17:02:16 +01:00
Vojtech Bubnik
9828abb443 GCode find/replace: Another try to make a sensible "default" behavior
with the boost::regex implementation:
With no "single line", don't accept new lines with a dot '.'.
2022-01-26 13:57:30 +01:00
Vojtech Bubnik
a7520f47a6 GCodeFindReplace: Implemented perl's "match single line" option
to the back-end.
2022-01-25 16:28:18 +01:00
Lukas Matena
ed508d49d6 Changed the inner seam replacement threshold to 3*nozzle_diameter 2022-01-25 15:40:28 +01:00
Lukas Matena
b86effada0 Fixed one possible crash and a warning 2022-01-25 15:40:28 +01:00
Lukas Matena
9e23795137 Trying to make the inner seam placement a bit more intelligent:
place external seams first, then place inner seam using the normal seam placement
function, only limited to vicinity of the closest external seam.
2022-01-25 15:40:27 +01:00
Lukas Matena
3cc907b361 Seams: changed the overhang penalty calculation, it might have been too much compared to the rest
Also reduced penalty for flat surfaces a bit, based on some testing (hopefully it is not overfitting on the test models)
2022-01-25 15:40:27 +01:00
Lukas Matena
689f923aaf Seam fixes:
- turned off staggering
- fixed a bug in one of the heuristics (distance between indices measured instead of actual distance)
2022-01-25 15:40:27 +01:00
Vojtech Bubnik
79a0345201 Further GCodeFindReplace adjustmnets of regular expressions:
match_single_line: ^$ will NOT match \n
2022-01-25 10:36:30 +01:00
Vojtech Bubnik
6817120932 GCodeFindReplace: Removed boost::match_not_dot_newline | boost::match_not_dot_null 2022-01-25 09:40:24 +01:00
enricoturri1966
803d797bd7 Merge branch 'master' of https://github.com/prusa3d/PrusaSlicer into et_gcode_z_offset 2022-01-20 13:46:03 +01:00
Lukas Matena
06cca525d0 Added a missing include for gcc 2022-01-19 15:16:46 +01:00
enricoturri1966
76ce53f095 Tech ENABLE_Z_OFFSET_CORRECTION - Correction of toolpaths zs when z offset is set 2022-01-18 15:53:59 +01:00
YuSanka
f497ba7bf0 Follow-up to 99f510d4 - fixed a typo 2022-01-17 12:29:47 +01:00
Vojtech Bubnik
aa62868ccb WIP G-code find & replace: Unit tests and some bug fixes. 2022-01-17 12:29:47 +01:00
Vojtech Bubnik
2da3d80a62 Fixing compilation on non-MSVC. 2022-01-17 12:29:46 +01:00
Vojtech Bubnik
d4fd95bd4a WIP: G-code find & replace: Support for non-regular expression,
whole word and case insensitive search.
2022-01-17 12:29:46 +01:00
Vojtech Bubnik
add1e994fa WIP G-code Find-Replace: Optimize regexps, process complete G-code,
not only G-code of layers.
2022-01-17 12:29:46 +01:00
Vojtech Bubnik
658f01b64b WIP: G-code find / replace using a new gcode_substitutions PrintConfig
parameter.
2022-01-17 12:29:46 +01:00
Lukáš Hejl
c54b8908dd Follow-up of 878dce1fdf. 2022-01-17 12:25:02 +01:00
Lukáš Hejl
878dce1fdf Workaround for "Internal compiler error" in 32-bit MSVC (19.29.30037) compiler after dc00f0bf98. 2022-01-17 12:22:19 +01:00
Lukáš Hejl
dc00f0bf98 Modified variable offset in the avoid crossing perimeters to not cause scars on thin objects (#7699).
Previously, the minimum contour width was chosen too conservative and, on some thin objects, only allowed minimal (or non) offset. This could result in travels being planned along the outer perimeter.

Now, the minimum contour width is chosen much smaller at the start and tested if the variable offset wasn't failed (the outer contour broke up into more parts, more or fewer holes, etc.).
If any problem is detected, the variable offset is recalculated with a larger minimum contour width.
2022-01-14 00:59:25 +01:00
Vojtech Bubnik
4ebfe58352 Merge branch 'master' of https://github.com/Prusa3D/PrusaSlicer 2022-01-10 15:24:27 +01:00
Vojtech Bubnik
07d0484e32 Fix of Empty G1 before starting bridging perimeter #7714 2022-01-10 15:24:19 +01:00
Lukas Matena
b3726f1f88 Fixed RRF time estimate,
so it does not use  min feedrate limits from previously selected printer (RRF itself does not support them)
2022-01-10 12:52:21 +01:00
n8bot
bfb721f302 Add compatibility for Machine Limits and RRF (PR #7347) 2022-01-10 12:52:21 +01:00
enricoturri1966
7ed80e0a8d Tech ENABLE_SPIRAL_VASE_LAYERS - 1st installment - Per-layer preview for spiral vase mode 2022-01-06 11:43:05 +01:00
Lukáš Hejl
285e2a32a2 Fixed issues in inner_offset() in the avoid crossing perimeters that caused in some cases travels to follow the first perimeter instead of the second one. 2021-12-16 08:57:04 +01:00
Lukáš Hejl
729ffc9dd6 Fixed that external travels led inside holes (around the perimeter) instead of inside the model when the avoid crossing perimeters was enabled.
Caused by changed behaviour of offset/expand functions when called on CW polygons (holes) after 7ff76d0768. When it is called expand on CW polygons (holes), they shrunk instead of expanded.
2021-12-16 08:56:29 +01:00
Lukáš Hejl
08402abf2b Used double instead of float for computing distance between two polygon vertices in precompute_polygon_distances() in the avoid crossing perimeters.
Using a float instead of a double caused accumulation of error in the calculated distance, which in rare cases triggered an assert in get_shortest_direction().
2021-12-14 14:49:00 +01:00
Lukas Matena
e9b9c48cae Fixed rear seam option, which was not always respected,
the problem was originally introduced in b8c898b, recent
seam changes probably made it more visible
2021-12-08 16:18:54 +01:00
Lukáš Hejl
7f951c2df8 Fixed an issue that travels could lead through a hole when the avoid crossing perimeters was enabled at the same with "External perimeter first" or "Detect thin walls". 2021-12-02 09:35:20 +01:00
Vojtech Bubnik
a89020abd7 Trying to fix compilation issues due to _() macro being used by mpl. 2021-11-30 18:06:01 +01:00
Vojtech Bubnik
f51162f238 Improved G-code post processor error reporting in case the G-code
post processor did not edit the G-code in place.
2021-11-30 14:16:04 +01:00
enricoturri1966
ef059404b3 Tech ENABLE_FIX_SUPERSLICER_GCODE_IMPORT set as default 2021-11-30 12:01:22 +01:00
enricoturri1966
a3874a410f Tech ENABLE_FIX_PREVIEW_OPTIONS_Z set as default 2021-11-30 10:55:00 +01:00
enricoturri1966
9af9b9b35d Tech ENABLE_OUT_OF_BED_DETECTION_IMPROVEMENTS set as default 2021-11-16 12:39:54 +01:00
Vojtech Bubnik
cc44089440 New BuildVolume class was created, which detects build volume type (rectangular,
circular, convex, concave) and performs efficient collision detection agains these build
volumes. As of now, collision detection is performed against a convex
hull of a concave build volume for efficency.

GCodeProcessor::Result renamed out of GCodeProcessor to GCodeProcessorResult,
so it could be forward declared.

Plater newly exports BuildVolume, not Bed3D. Bed3D is a rendering class,
while BuildVolume is a purely geometric class.

Reduced usage of global wxGetApp, the Bed3D is passed as a parameter
to View3D/Preview/GLCanvas.

Convex hull code was extracted from Geometry.cpp/hpp to Geometry/ConvexHulll.cpp,hpp.
New test inside_convex_polygon().
New efficent point inside polygon test: Decompose convex hull
to bottom / top parts and use the decomposition to detect point inside
a convex polygon in O(log n). decompose_convex_polygon_top_bottom(),
inside_convex_polygon().

New Circle constructing functions: circle_ransac() and circle_taubin_newton().

New polygon_is_convex() test with unit tests.
2021-11-16 10:15:51 +01:00
Vojtech Bubnik
4e9f906848 Cooling buffer used to remove F word from G1 Fxxx lines if the feed rate
did not change compared to the preceding value creating empty "G1" lines.
The empty "G1" lines are now removed.
Improves Features fail with extra G1 moves when above a certain layer height and Detect Thin Walls is enabled #5176
Improves Thin wall detection causes miniature loops to be added, and emits empty G1 commands #3058
2021-11-02 12:11:53 +01:00
enricoturri1966
19387186a5 #7110 - Fixed calculation of estimated times for layers 2021-10-25 12:31:19 +02:00
Lukas Matena
19eb984d72 SeamPlacer: one more heuristic to get rid of long travels 2021-10-22 13:16:08 +02:00
Lukas Matena
59502e7861 Seam placement improvements 2021-10-22 13:16:08 +02:00
enricoturri1966
2c0815f537 Fixed conflicts after merge with master and ported changes into gouraud shaders to gouraud_mod shaders 2021-10-19 11:27:11 +02:00
Vojtech Bubnik
32ebfa66e9 Fix of M106 on every new layer #7094
after parallelization of CoolingBuffer:
Remember the last fan speed emitted at the previous layer.
2021-10-18 14:56:02 +02:00
Lukáš Hejl
4d47e9a184 Allow travels processed by the avoid crossing perimeters move further away from the outer perimeter. 2021-10-18 12:51:20 +02:00
Vojtech Bubnik
1ca24f0bd0 Fixed visualization of G-code in G-code viewer after 07e7e11590
Fix of prusa-gcodeviewer changes modification time of the viewed gcode file #7005
2021-10-15 14:31:57 +02:00
enricoturri1966
7be17d89e6 Fixed conflicts after merge with master 2021-10-14 10:48:46 +02:00
Vojtech Bubnik
7ff76d0768 New ClipperUtils functions: opening(), closing() as an alternative
for offset2() with clear meaning.
New ClipperUtils functions: expand(), shrink() as an alternative
for offset() with clear meaning.
All offset values for the new functions are positive.

Various offsetting ClipperUtils (offset, offset2, offset2_ex) working
over Polygons were marked as unsafe, sometimes producing invalid output
if called for more than one polygon. These functions were reworked
to offset polygons one by one. The new functions working over Polygons
shall work the same way as the old safe ones working over ExPolygons,
but working with Polygons shall be computationally more efficient.

Improvements in FDM support generator:
1) For both grid and snug supports: Don't filter out supports for which
   the contacts are completely reduced by support / object XY separation.
2) Rounding / merging of supports using the closing radius parameter is
   now smoother, it does not produce sharp corners.
3) Snug supports: When calculating support interfaces, expand the projected
   support contact areas to produce wider, printable and more stable interfaces.
4) Don't reduce support interfaces for snug supports for steep overhangs,
   that would normally not need them. Snug supports often produce very
   narrow support interface regions and turning them off makes the support
   interfaces disappear.
2021-10-14 09:11:31 +02:00
enricoturri1966
405a7e84d6 Fix in seams detection (restore detection after wiping) 2021-10-13 11:13:31 +02:00
enricoturri1966
8befc43739 Seams detection now takes in account for overhang perimeters 2021-10-12 12:03:34 +02:00
enricoturri1966
19572068a5 Revert of e28ebf9386 2021-10-12 11:49:51 +02:00
enricoturri1966
e28ebf9386 Removed threshold to detect seams to be shown in preview 2021-10-12 09:53:23 +02:00
enricoturri1966
4ff13a5d63 Tech ENABLE_OUT_OF_BED_DETECTION_IMPROVEMENTS - Reworked detection of collision with printbed. The detection uses now different algorithms in dependence of the printbed type (rectangular, circular, convex) to improve performance. 2021-10-06 13:47:54 +02:00
enricoturri1966
0b78e009b4 #7050 - GCodeProcessor: Fixed processing of gcode lines M109 2021-10-04 09:02:03 +02:00
Lukas Matena
4ca2401b69 Several minor improvements and fixed warnings 2021-10-01 14:31:22 +02:00
enricoturri1966
2483a9f036 Added missing include 2021-09-27 13:02:56 +02:00
enricoturri1966
8ecdea152f Follow-up of 721e396edc - Same fix applied to GCodeProcessor::process_G28() and GCodeProcessor::process_M402() 2021-09-27 12:08:26 +02:00
enricoturri1966
721e396edc #7016 - Fixed GCodeProcessor::process_M132() 2021-09-27 11:35:58 +02:00
enricoturri1966
7ca9024fca #7008 - GCodeViewer - Fixed loading of gcodes generated by SuperSlicer 2021-09-27 11:22:36 +02:00
Vojtech Bubnik
07e7e11590 Fix of prusa-gcodeviewer changes modification time of the viewed gcode file #7005
This is a regression wrt. PrusaSlicer 2.4.0-alpha1 due to the G-code
processing optimization and parallelization.
Related to GCode Viewer changes files modified date in windows #5079
2021-09-27 10:02:54 +02:00
Vojtech Bubnik
ac7674b85a Fixed visualization of G-code lines in G-code viewer (3D view).
Improved speed of parsing external G-code.
2021-09-21 15:30:37 +02:00
Vojtech Bubnik
8a2a9dba2f Eradicated admesh from TriangleMesh:
TriangleMesh newly only holds indexed_triangle_set and
TriangleMeshStats. TriangleMeshStats contains an excerpt of stl_stats.
TriangleMeshStats are updated when initializing with indexed_triangle_set.

Admesh triangle mesh fixing is newly only used when loading an STL.
AMF / 3MF / OBJ file formats are already indexed triangle sets, thus
they are no more converted to admesh stl_file format, nor fixed
through admesh repair machinery. When importing AMF / 3MF / OBJ files,
volume is calculated and if negative, all faces are flipped. Also
a bounding box and number of open edges is calculated.

Implemented its_number_of_patches(), its_num_open_edges()
Optimized its_split(), its_is_splittable() using a visitor pattern.

Reworked QHull integration into TriangleMesh:
    1) Face normals were not right.
    2) Indexed triangle set is newly emitted instead of duplicating
       vertices for each face.

Fixed cut_mesh(): Orient the triangulated faces correctly.
2021-09-20 17:12:22 +02:00
enricoturri1966
0b1e716e22 Tech ENABLE_RETRACT_ACCELERATION set as default 2021-09-17 08:21:25 +02:00
enricoturri1966
d52ee52098 Tech ENABLE_FIX_IMPORTING_COLOR_PRINT_VIEW_INTO_GCODEVIEWER set as default 2021-09-14 15:05:33 +02:00
Vojtech Bubnik
dc4b783e9e Pimping up SpiralVase code, fix of 03b6048684 2021-09-10 12:10:00 +02:00
Vojtech Bubnik
03b6048684 Follow-up to beee18f229
WIP to G-code export parallelization through pipelining:
Decoupled CoolingBuffer from GCode / GCodeWriter, ready to be
pipelined on a different thread.
2021-09-10 11:43:59 +02:00
enricoturri1966
8701dd0c76 Merge branch 'master' of https://github.com/prusa3d/PrusaSlicer into et_fix_options_z 2021-09-09 10:34:47 +02:00
enricoturri1966
fe8e2ae0d1 ENABLE_GCODE_VIEWER_STATISTICS - Fixed calculation of time required by GCodeProcessor 2021-09-09 09:35:58 +02:00
enricoturri1966
d3382b666f Fixed build on MAC 2021-09-08 15:47:27 +02:00
Vojtech Bubnik
beee18f229 Follow-up to b5a007a683
WIP to G-code export parallelization through pipelining:
GCodeProcessor is called during the G-code export,
the G-code is no more reopened and re-read, but it is pipelined
from the G-code generator.
2021-09-08 15:06:12 +02:00
enricoturri1966
6f678c09d1 Tech ENABLE_FIX_PREVIEW_OPTIONS_Z - Enable fixing the z position of seams (and other options) in preview 2021-09-08 14:30:40 +02:00
Vojtech Bubnik
0da0a7b2a0 Fix of recent GCode / GCodeProcessor refactoring: Don't close a FILE
twice.
2021-09-07 17:58:06 +02:00
Vojtech Bubnik
32733b7db9 GCodeProcessor collects positions of line ends for GCodeViewer,
GCodeViewer no more parses G-code just to extract line end positions.
Removed start_mapping_gcode_window(), void stop_mapping_gcode_window(),
they are no more needed.
2021-09-07 15:42:56 +02:00
Vojtech Bubnik
e30ff22b8a GCodePostProcessor - use C files instead of C++ streams, C files are faster.
Also fixed a regression - crashes on undefined cancellation callback.
2021-09-07 14:20:21 +02:00
enricoturri1966
51df3cd163 Merge branch 'master' of https://github.com/prusa3d/PrusaSlicer 2021-09-07 12:25:35 +02:00
enricoturri1966
761c06ed92 GCodeViewer - Fixed crash when importing gcode generated with Simplify3D and switching to tool view 2021-09-07 12:25:30 +02:00
Vojtech Bubnik
771a892776 Optimization of GCodeProcessor for speed. 2021-09-07 11:18:12 +02:00
enricoturri1966
d35183921b Revert of 7b4c98d727, clamp toolpaths widths increased to 2mm and added default values for toolpaths width and height 2021-09-07 09:41:14 +02:00
Vojtech Bubnik
428509ac00 Pimped up GCodeProcessor::TimeProcessor::post_process():
replaced implicit lambda capture with explicit listing of captured
context for readability and code correctness. Captured this as const.
2021-09-06 18:08:13 +02:00
enricoturri1966
7b4c98d727 #6828 - Clamping of toolpaths width performed only for gcodes files produced by 3rd part softwares (Tech ENABLE_CLAMP_TOOLPATHS_WIDTH) 2021-09-06 14:31:10 +02:00
Vojtech Bubnik
86d06b0be9 G-code processor tiny change: In place initialization 2021-09-03 17:22:53 +02:00
enricoturri1966
f44d2e14a1 Removed debug code 2021-08-19 09:47:01 +02:00
enricoturri1966
81113218cc Added retract acceleration member variable to GCodeProcessor and modified GCodeProcessor::process_M204() method 2021-08-19 09:38:51 +02:00
Vojtech Bubnik
e947a29fc8 Follow-up to 7c01ddf996
1) Starting with this commit, configuration block exported into G-code
   is delimited by "; prusaslicer_config = begin" and "; prusaslicer_config = end".
   These delimiters look like any other key / value configuration pairs
   on purpose to be compatible with older PrusaSlicer config parsing from G-code.
2) Config parser from G-code newly searches for "; generated by ..."
   comment over the complete G-code, thus it is compatible with various
   post processing scripts extending the G-code at the start.
3) Config parser from G-code parses PrusaSlicer version from
   the "; generated by PrusaSlicer ...." header and if the G-code was
   generated by PrusaSlicer 2.4.0-alpha0 and newer, it expects that
   the G-code already contains the "; prusaslicer_config = begin / end"
   tags and it relies on these tags to extract configuration.
4) A new simple and robust parser was written for reading project configuration
   from 3MF / AMF, while a heuristic parser to read config from G-code located
   at the end of the G-code file was used before.
2021-08-12 15:27:46 +02:00