Commit Graph
100 Commits
Author SHA1 Message Date
Lukáš Hejl 8da083b702 Fixed compilation on Linux 2021-06-30 08:56:35 +02:00
Lukáš Hejl f10ec4d21c Merge branch 'lh_multi_material_segmentation_fix' 2021-06-28 08:11:17 +02:00
Lukáš Hejl cb93c8ce99 Used function smooth_outward in multi-material segmentation to get rid of artifacts arisen after merging multi-volume objects. 2021-06-28 08:09:06 +02:00
Lukáš Hejl a426093f12 Replaced boost::rtree in multi-material segmentation with much faster ClosestPointInRadiusLookup. 2021-06-28 08:09:06 +02:00
Lukáš Hejl ce738102c6 Optimized the projection of painted triangles in multi-material segmentation. Added heuristics to skip most of the expensive calculations in cases where it is certain that performing these calculations would be useless. 2021-06-28 08:09:06 +02:00
Lukáš Hejl 48789e5ae1 Added a limitation on the number of usable extruders in the multi-material gizmo. If a printer has more extruders than this limit, a notification about it is shown. 2021-06-28 08:09:06 +02:00
Lukáš Hejl 23b26cb3f3 Fixed the issue where the object wasn't displayed after pressing the ESC key in the multi-material painting gizmo.
key in the multi-material painting gizmo.
Fixed also a similar issue in support and seam gizmos where an object was displayed with the wrong color after pressing the ESC key.
2021-06-28 08:09:06 +02:00
Lukáš Hejl 684b66125e Fixed an issue where multi-material segmentation ignored the last extruder. 2021-06-17 19:26:40 +02:00
Lukáš Hejl 2e54648b97 Fixed a multi-material painting gizmo crash when extruders colors aren't initialized, which happens when switching between SLA and FDM printer. 2021-06-16 17:05:24 +02:00
Lukáš Hejl b32202e597 Fixed incorrectly displayed custom supports and seams in the support and seam gizmos after 7377fc34ac. 2021-06-16 13:41:35 +02:00
Lukáš Hejl ccb53f71b6 Merge branch 'lh_multi_material_segmentation_fix' 2021-06-16 06:06:07 +02:00
Lukáš Hejl 6ddd88e596 Fixed an issue where the color of the first extruder always replaced the default color after painting in a multi-material gizmo.
multi_material_segmentation_by_painting is now returning only the painted region. Regions with default colors that aren't painted by multi-material gizmo aren't returned.
2021-06-16 06:06:37 +02:00
Lukáš Hejl ae1a799cf4 Fixed an issue for multi-volume objects where the seed fill visualization in the multi-material gizmo didn't disappear after the mouse was moved to another volume. 2021-06-16 06:06:34 +02:00
Lukáš Hejl c59cf5de40 Fixed layers with the wrong color after multi-material segmentation on objects with multiple objects. 2021-06-16 06:06:34 +02:00
Lukáš Hejl 21b38db488 Added using the move operator in some parts of multi-material segmentation. 2021-06-16 06:06:34 +02:00
Lukáš Hejl a06e42d01f Moved debug prints out of parallel cycles, and more debug prints were added for multi-material segmentation. 2021-06-16 06:06:34 +02:00
Lukáš Hejl 15a1b51339 Refactoring and cleanup of painting gizmos. 2021-06-16 06:06:34 +02:00
Lukáš Hejl 8a77fa38f0 Modified MMU painting gizmo behavior so that all triangles aren't painted by default by the first extruder, which was causing several problems.
This commit also fixed the following issues:
1) After loading a 3MF with painted triangles using the MMU painting gizmo, the painted triangles might not be displayed correctly in the MMU painting gizmo.
2) The MMU segmentation was unnecessarily executed for all layers and not just for the painted layers.
3) Object's base color wasn't changed when the assigned extruder for that object was changed while the MMU paint gizmo was opened.
4) Changing the base color of an object was only possible by removing all painted triangles.
2021-06-16 06:06:34 +02:00
Lukáš Hejl b2677f513c Fixed a possible crash when closing the MMU painting gizmo cause by a non-virtual destructor. 2021-06-16 06:06:33 +02:00
Lukáš Hejl 7377fc34ac Fixed cracks in MMU painting gizmo. All triangles, even not painted triangles, are now rendered inside MMU painting gizmo.
The cracks were caused by using glPolygonOffset to resolve Z-fighting. All triangles of the object were firstly rendered entirely with a base color. And then paint triangles were drawn over these already rendered triangles.
2021-06-16 06:06:33 +02:00
Lukáš Hejl de9ed9ee3e Follow-up of 39fd8065a1: Apply changes also for MMU painting gizmo, so shader->start_using() is called only once. 2021-06-16 06:06:33 +02:00
Lukáš Hejl c751f2d638 Show info about multi-material segmentation in ObjectList. 2021-06-16 06:06:33 +02:00
Lukáš Hejl bfd83f925d Fixed build on MacOS.
Based on information in https://stackoverflow.com/a/46115028, structured bindings in C++17 don't name variables, and because of that, it is impossible to capture these variables in lambda functions.
2021-06-13 16:22:44 +02:00
Lukáš Hejl cc913d52ef Added name for items in undo/redo stack inside multi-material gizmo. 2021-06-03 18:11:48 +02:00
Lukáš Hejl 94877a0ec0 Fixed the wrong transformation matrix for "Clipping of view" when is used a printer with multiple extruders. 2021-06-03 08:00:46 +02:00
Lukáš Hejl edf8d22aba Fixed an issue when the option "Inner brim only" doesn't generate brim inside the object in some cases, and issue that top-level brim was ignoring an offset around the object without a brim.
Also, some possible warnings were fixed.
2021-06-02 10:33:16 +02:00
Lukáš Hejl 660acede9e Sphere brush color in MMU painting gizmo is now the same as color used for painting. 2021-05-31 14:23:12 +02:00
Lukáš Hejl 2438e3a891 Fixed issue that the lower half of the object was shown darker than the upper half of the object after slicing with MMU segmentation. 2021-05-31 07:26:38 +02:00
Lukáš Hejl 02a0955a5f Fixed possible wrongly filled ZIP headers in case that pState->m_zip64 is sets to true. 2021-05-29 19:56:20 +02:00
Lukáš Hejl 7f29647d67 Added missing includes (GCC 11.1) 2021-05-29 19:55:20 +02:00
Lukáš Hejl 2cbf7728bb Fixed that seed fill left all triangles split instead of merging them. 2021-05-28 17:42:28 +02:00
Lukáš Hejl 726a48383f Cleaned up of 0a6490bab9 2021-05-28 17:36:56 +02:00
Lukáš Hejl 0a6490bab9 Added cancellation to MMU segmentation. 2021-05-28 05:57:32 +02:00
Lukáš Hejl 281ac1f2f1 Added missing includes (GCC 9.3) 2021-05-27 16:47:31 +02:00
Lukáš Hejl 671c2ace17 Fixed a modification time for files appended using the streaming interface in the miniz library. 2021-05-25 10:38:29 +02:00
Lukáš Hejl ed9c93f85a Added missing includes (GCC 9.3) 2021-05-21 07:42:37 +02:00
Lukáš Hejl f50046b31b Modified streaming interface in miniz library to use ZIP64 extension only for files exciding the limits.
The modification is based on a preallocation space in the Extra field using a phony custom block in the Local file header. This space is eventually overwritten by the ZIP64 extension if the file exceeds 4GiB.
Also were fixed differences from PKZip specification in the streaming interface.
2021-05-20 19:44:12 +02:00
Lukáš Hejl 4d2c2070f8 Added missing includes (GCC 9.3) 2021-05-07 12:51:10 +02:00
Lukáš Hejl 46a14abbaa Added default object color in MMU segmentation according to the default extruder color for printing the object. 2021-05-04 08:13:04 +02:00
Lukáš Hejl 781e6607c8 Fixed updating of extruders list in MMU segmentation gizmo after adding extruders and reloading 3MF with different extruder count and colors. 2021-05-04 07:59:16 +02:00
Lukáš Hejl 71c60a5187 Follow-up of 168b4afbc2: Replaced forgotten lslices in the top and bottom layer propagation in MMU segmentation. 2021-05-03 22:11:04 +02:00
Lukáš Hejl cd5fea8b42 Fixed compiler warnings 2021-05-03 21:50:40 +02:00
Lukáš Hejl 2d3eef4e84 Fixed possible warnings 2021-05-03 21:13:13 +02:00
Lukáš Hejl fa8c319721 Fixed MMU segmentation for cases when a contour was whole colored by one color and a hole was whole colored by a different color. 2021-05-03 21:06:46 +02:00
Lukáš Hejl 5bfdaa7ac8 Parallelization of regions merging for MMU segmentation. 2021-05-03 21:01:52 +02:00
Lukáš Hejl 2e9f0d6eaf Fixed a few cases of missing colored segments in MMU segmentation.
Occasionally, some input polygons contained self-intersections that caused problems with Voronoi diagrams and consequently with the extraction of colored segments by function extract_colored_segments.
Also, occasionally input polygons contained several points very close together (distance between points is 1 or so). Such close points sometimes caused that the Voronoi diagram has self-intersecting edges around these vertices. This consequently leads to issues with the extraction of colored segments by function extract_colored_segments.
2021-05-03 20:56:39 +02:00
Lukáš Hejl 168b4afbc2 Fixed MMU segmentation for multi-volume objects.
MMU segmentation no longer works directly on lslices, instead of it works on custom merged regions. So lslices in PrintObject are no longer overwritten because of MMU segmentation.
All regions are scaled by SCALED_EPSILON before merging and shrunk back by SCALED_EPSILON after merging. That fixed issues with multi-volume objects when very close regions weren't merged.
Also, small expolygons and holes are filtered out that fixed missing segmentation at the boundary of two volumes in the case of multi-volume objects.
2021-05-03 20:37:14 +02:00
Lukáš Hejl 62592cab48 Added missing include (GCC 11.1) 2021-05-01 22:33:59 +02:00
Lukáš Hejl 0a8a3f6d8c Fixed build on Windows. 2021-04-30 15:40:27 +02:00
Lukáš Hejl d11d15aa1e Rework of MMU segmentation gizmo to support more than three colors. 2021-04-30 15:58:25 +02:00
Lukáš Hejl 576c5b78e9 Added seed fill for MMU segmentation 2021-04-27 06:48:09 +02:00
Lukáš Hejl be1b4ce18c Fixed compiler warnings 2021-04-27 00:41:20 +02:00
Lukáš Hejl 8a19cf9d64 Extended support of MMU segmentation backed for more than three colors.
Serialization and deserialization in TriangleSelector were extended to support up to 16 materials (3 unused states left for possible later extension). These changes also affect the encoding of data from custom supports and seams, but it is backward compatible with the previous encoding. And for custom supports and seams, it is produced exactly the same data encoding as before.
2021-04-27 00:37:49 +02:00
Lukáš Hejl db55bd706e Fixed case in MMU segmentation when the infinity-edge in the Voronoi diagram has vertex0(), and vertex1() equals nullptr. 2021-04-27 00:36:22 +02:00
Lukáš Hejl 1b144e80bd Added hiding of MMU segmentation gizmo when it is selected printer with only one extruder. 2021-04-27 00:35:43 +02:00
Lukáš Hejl 49928e131c Added missing include (GCC 9.3) 2021-04-21 06:08:46 +02:00
Lukáš Hejl 40d9e51b5e WIP: Added support for top and bottom layers for MMU segmentation. 2021-04-19 19:21:06 +02:00
Lukáš Hejl 368b48b0a0 WIP: Allows regions of MMU segmentation to be trimmed by chosen width. 2021-04-19 07:12:42 +02:00
Lukáš Hejl f49ceb1e0f WIP: MMU segmentation without top and bottom layers 2021-04-19 07:04:50 +02:00
Lukáš Hejl e3c33844d5 WIP: Duplicated the FDM support gizmo for the MMU segmentation 2021-04-19 07:01:11 +02:00
Lukáš Hejl dd4b26ba25 Fix of 7bd412a2ca 2021-04-05 20:32:41 +02:00
Lukáš Hejl 7bd412a2ca A few test cases for Voronoi diagrams.
A few test cases collected from multi-material segmentation. All new test cases are suppressed not to fail a building process.
2021-04-05 16:47:00 +02:00
Lukáš Hejl 1b3b4c5694 Added missing include (GCC 9.3) 2021-03-22 10:30:49 +01:00
Lukáš Hejl 08a826d237 Added a missing includes 2021-03-12 10:30:06 +01:00
Lukáš Hejl a53de51b22 Fix of 8f293f0cb5
When was set use_external_mp_once to true then after first calling the avoid crossing perimeters this flag was reset which cases that on the second call of the avoid crossing perimeters the travel move didn't process as external.
2021-02-25 23:30:22 +01:00
Lukáš Hejl 77d007c484 Fixed calculation of a distance from begin of a contour in the avoid crossing perimeters.
The total length of a contour was incorrectly computed, which could cause the longest detour was selected instead of the shortest one in some cases.
2021-02-23 20:56:36 +01:00
Lukáš Hejl dc576b0511 Fixed inner offset in the avoid crossing perimeters.
Minimum contour width was used incorrectly, which could lead to breaking contour to more disconnected polygons.
2021-02-23 20:43:34 +01:00
Lukáš Hejl e123dfa8a4 Fixed wrong orientation of infill and gap-fill extrusion.
When an island contains exactly one infill ExtrusionEntity, this extrusion was oriented to maximize travel distance from the end of the previous extrusion of perimeters instead of minimizing it.
2021-02-23 20:07:40 +01:00
Lukáš Hejl 8f293f0cb5 Fixed unnecessary travels after calling the avoid crossing perimeters when the wipe is enabled.
When the avoid crossing perimeters was enabled, and the wipe was enabled, there were unnecessary travels in the opposite direction than the wipe travel.
2021-02-18 14:41:56 +01:00
Lukáš Hejl 81878a6f79 Fix of #5537 - GUI_App::post_init could be in some cases called before GUI_App::init_openg when GCode viewer is used.
The solution adds a status flag to GUI_App::init_openg and ensures that GUI_App::post_init isn't called before initialization in GUI_App::init_openg is done.
2020-12-22 12:28:00 +01:00
Lukáš Hejl dc2e7aeb4e Fixed wrong generation of Adaptive Cubic and Support Cubic infill when infill extrusion width is set in percent. 2020-12-21 14:14:06 +01:00
Lukáš Hejl 181642b85b Fix of #5528 - Request re-slicing when bottom_solid_layers changes and spiral_vase is enabled. 2020-12-21 09:15:33 +01:00
Lukáš Hejl 80251e0cf9 Fixed of unintentional disabling of wipe even in cases when avoid crossing perimeters weren't applied due to exceeding the maximum detour length. 2020-12-16 13:17:09 +01:00
Lukáš Hejl d59f345fbb Fix of #5443 - Assigned input file path for ModelVolume also for AMF archives 2020-12-15 14:18:11 +01:00
Lukáš Hejl e62f014049 Corrected side text for avoid crossing perimeters max detour 2020-12-15 14:03:52 +01:00
Lukáš Hejl 161fb86c43 Fixed percentages in avoid crossing perimeters max detour 2020-12-15 13:49:35 +01:00
Lukáš Hejl 0ca337ac7a Apply avoid crossing perimeters also for supports. 2020-12-15 06:46:44 +01:00
Lukáš Hejl bb2eecb42c Fix of #4060 - Add check for the case that all ranges of a volume do not contain any Z. 2020-12-09 07:28:18 +01:00
Lukáš Hejl 0ad135ff93 Fix of #4732 - In spiral vase mode, use the number of layers instead of the value of bottom solid layers if a printed object has a smaller number of layers than the value of bottom solid layers. 2020-12-09 07:21:14 +01:00
Lukáš Hejl 4c35250531 Fix of #5004 - Disable retract on layer change also for filament overrides. 2020-12-09 07:16:01 +01:00
Lukáš Hejl 98055de28c External paths avoid crossing perimeters of holes 2020-12-03 09:43:21 +01:00
Lukáš Hejl f25e5c0ec6 Merge remote-tracking branch 'origin/master' into lh_avoid_crossing_perimeters 2020-12-01 14:31:22 +01:00
Lukáš Hejl f0616b0736 Fixed return value of liang_barsky_line_clipping 2020-12-01 14:28:27 +01:00
Lukáš Hejl f917b83706 Fixed compiler warnings 2020-11-29 17:29:11 +01:00
Lukáš Hejl 87879034f6 Merge remote-tracking branch 'origin/master' into lh_avoid_crossing_perimeters
# Conflicts:
#	src/libslic3r/MotionPlanner.cpp
#	src/libslic3r/libslic3r.h
2020-11-29 17:27:23 +01:00
Lukáš Hejl dd97eaa812 Fixed case when lslices in Layer is empty 2020-11-29 17:26:02 +01:00
Lukáš Hejl f16e8f1a72 Fixed uninitialized variable in ElephantFootCompensation 2020-11-29 14:00:34 +01:00
Lukáš Hejl 55c282d85d Revamp of implementation of the avoid crossing perimeters algorithm.
The strategy for the avoid crossing perimeters algorithm has been redesigned. But external travels (travel between objects or supports) have not been solved yet. For these travels is used a direct path between two points.
Much of the code has been reworked, which leads to significant speedup compared to the previous implementation.
Also, several potential bugs have been fixed.
2020-11-29 13:58:36 +01:00
Lukáš Hejl f394d26f83 Added missing includes to fix build on gcc 9 2020-11-20 15:19:49 +01:00
Lukáš Hejl 606db666fc Fix missing include 2020-11-20 14:22:24 +01:00
Lukáš Hejl 49ce613be7 Enable previous heuristics which was disabled by mistake 2020-11-16 14:37:42 +01:00
Lukáš Hejl c702b3b71d Add heuristics for removing unnecessary detours 2020-11-16 14:22:32 +01:00
Lukáš Hejl 9936b8e34e Add missing includes 2020-11-16 14:22:32 +01:00
Lukáš Hejl 3db66af716 Fix another compiler warning 2020-11-16 14:22:32 +01:00
Lukáš Hejl 266e6dee5d Fix compiler warnings 2020-11-16 14:22:32 +01:00
Lukáš Hejl c00c7eaed3 Rework of outer borders to reduce unnecessary detours along the border.
The resulting path now contains all intersection with borders, which allows eliminating more unnecessary detours and more simplify the path.
2020-11-16 14:22:32 +01:00
Lukáš Hejl ef9de07740 Disabling wipe for avoid crossing perimeters 2020-11-16 14:22:32 +01:00
Lukáš Hejl 7f94e9fa59 Fixed perimeters crossing when supports are printed. 2020-11-16 14:22:32 +01:00
Lukáš Hejl 2afeea5b6f Fixed division by zero when the layer is empty 2020-11-16 14:22:32 +01:00
Lukáš Hejl 3e98e2a4bd Fixed avoiding of other printed objects, again
Calling std::move on itself causes that the first polygon is empty, which results in disabling this feature on Linux.
This was fixed before, but I accidentally reverted it when AvoidCrossingPerimeters was moved to separate file.
2020-11-16 14:22:32 +01:00