Commit Graph

15 Commits

Author SHA1 Message Date
Lukáš Hejl
0ea67565d6 Cleaned up of 0a6490bab9 2021-05-28 17:36:56 +02:00
Lukáš Hejl
ed6bdbd07b Added cancellation to MMU segmentation. 2021-05-28 05:57:32 +02:00
Vojtech Bubnik
aa6cc8eef7 Some fixes after preceding merge. Moved mmu_segmented_region_max_width
from PrintConfig to PrintObjectConfig.
2021-05-26 16:14:52 +02:00
Vojtech Bubnik
4809689dcb Merge remote-tracking branch 'remotes/origin/lh_multi_material_segmentation' into vb_print_regions 2021-05-26 15:23:35 +02:00
Lukáš Hejl
94364508d1 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
53f6d451ff Fixed compiler warnings 2021-05-03 21:50:40 +02:00
Lukáš Hejl
60a1eecd6e Fixed possible warnings 2021-05-03 21:13:13 +02:00
Lukáš Hejl
00b369c54c 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
0f7bbd626e Parallelization of regions merging for MMU segmentation. 2021-05-03 21:01:52 +02:00
Lukáš Hejl
ea73c79293 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
ff250f5d36 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
8ae1d180c7 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
ea402ff871 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
Vojtech Bubnik
3ae74a5ca8 1) New methods PrintObject::num_regions() and ::has_region() to make
the code more readable and to highlight where PrintObject::region_volumes
   are actually set and consumed.
2) Replaced Slic3r::clamp() with std::clamp(). They differ in the order
   of their parameters, thus hopefully no new bugs were introduced.
3) Some refactoring of MultiMaterialSegmentation for efficiency.
2021-04-22 11:41:26 +02:00
Vojtech Bubnik
08d553d411 MMU segmentation refactoring: Most of the MMU segmentation code
was extracted to its own file.
2021-04-20 15:07:05 +02:00