Commit Graph

11 Commits

Author SHA1 Message Date
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
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
Vojtech Bubnik
38bb7d2950 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
4f950343c8 MMU segmentation refactoring: Most of the MMU segmentation code
was extracted to its own file.
2021-04-20 15:07:05 +02:00