Commit Graph

26 Commits

Author SHA1 Message Date
Lukáš Hejl
ce2c69676c 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
Vojtech Bubnik
2b5d1fcaf7 TriangleSelector optimizations:
1) When splitting a triangle, vertices are now properly shared with
   the neighbor triangles, if these are already split.
   Please note that the splitting may not be regular if the splitting
   thershold is changed between splitting calls. Still the new code
   shares the vertices accross shared edges properly.
2) Triangles resp. vertices are newly reused after deleted using
   linked lists of released triangles resp. vertices.
   This mechanism replaces the old mechanism of reusing already split
   triangles.
2021-06-15 14:43:46 +02:00
Lukáš Hejl
99c37e5c41 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
Vojtech Bubnik
611ea4383d TriangleSelector - some memory optimization.
Don't store traingle normal, but reference the source triangle,
which stores its normal.
2021-06-11 12:27:58 +02:00
Vojtech Bubnik
a47250ad9b TriangleSelector refactoring for readability and a bit of performance,
added some comments, improved encapsulation through private attributes,
removed recursive call through std::function etc.
2021-06-11 11:02:47 +02:00
Vojtech Bubnik
a9430f2f3f TriangleSelector::get_facets() refactoring to share vertices.
TriangleSelector::valid refactored to m_valid and valid()
and bool members moved next to each other to shrink data structure
size due to memory alignment.
2021-06-10 12:43:31 +02:00
Vojtech Bubnik
e4f36339e8 Support / seam / MMU painting serialization / deserialization:
Changed the serialization structure
	std::map<int, std::vector<bool>>
to a significantly more compact
	std::pair<std::vector<std::pair<int, int>>, std::vector<bool>>
Such change shall significantly improve efficiency of Undo / Redo stack.
2021-06-10 09:26:30 +02:00
Lukáš Hejl
37c604568d Fixed that seed fill left all triangles split instead of merging them. 2021-05-28 17:42:28 +02:00
Lukáš Hejl
a935389c1b 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
60a1eecd6e Fixed possible warnings 2021-05-03 21:13:13 +02:00
Lukáš Hejl
7d7c2efec1 Added seed fill for MMU segmentation 2021-04-27 06:48:09 +02:00
Lukáš Hejl
1ea93f1181 Fixed compiler warnings 2021-04-27 00:41:20 +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
Lukas Matena
d7786d058b Fixed a typo in TriangleSelector.cpp (probably not causing any bug, just a warning) 2021-02-11 07:32:22 +01:00
Lukas Matena
ee1cb97ea4 FDM supports gizmo 'autoset by angle' improvements:
- Extra dialog for autosetting by angle in FDM supports gizmo was removed
- Highlighting facets by angle is now controlled by a slider in the main gizmo dialog
- User is allowed to paint even when using the slope highlighter
- The button to turn highlighted facets to blockers was removed, it made no sense
- Highlighted facets are now rendered in light blue
2021-02-08 17:49:36 +01:00
Lukas Matena
29207ef0b7 Fix of #5632 (painter gizmos not working correctly with scaled objects)
This was broken since 8bcdbb7.
2021-01-05 17:06:05 +01:00
Lukas Matena
41a0d75606 Painter gizmos should now work with non-uniformly scaled models 2020-10-06 12:06:39 +02:00
Lukas Matena
1b6c75e98f Sphere selection added as an option for painting gizmos 2020-10-01 00:05:01 +02:00
Lukas Matena
0097301194 Experiment with spherical cursor (painting gizmos) 2020-09-30 17:34:11 +02:00
Lukas Matena
8e113adee0 Renamed FacetSupportType to EnforcerBlockerType
So it's not misleading if we use it for seam painting
2020-08-18 12:00:26 +02:00
Lukas Matena
99cbfb7545 Fixes of two crashes in paint-on supports 2020-08-12 11:08:10 +02:00
Lukas Matena
fa4a160a2c TriangleSelector: 3MF loading and saving 2020-07-24 17:47:16 +02:00
Lukas Matena
8c0e65042a TriangleSelector: edge limit is derived from cursor size 2020-07-24 17:47:16 +02:00
Lukas Matena
abe1cf6c61 TriangleSelector: backend is aware of divided triangles 2020-07-24 17:47:16 +02:00
Lukas Matena
fa32a6bb47 TriangleSelector: 'Select by angle' and 'reset selection' functions fixed 2020-07-24 17:47:16 +02:00
Lukas Matena
438f758a2a TriangleSelector: Separated frontend/backend, support of multiple volumes, etc. 2020-07-24 17:47:16 +02:00