Commit Graph

38 Commits

Author SHA1 Message Date
9957a5b90f Disabled "expensive checks" in debug mode, TriangleSelector 2021-08-20 16:46:38 +02:00
894850f868 Reworked visualization of selected triangles by seed fill and bucket fill inside the multi-material painting gizmo. Now is drawn boundary around a selected area, and also all triangles inside the selected area are drawn with a darker color. 2021-08-10 21:38:48 +02:00
ac50bd0f06 Forced recomputation of seed fill selected areas when the seed fill angle is changed by ALT+mouse wheel. 2021-08-06 16:46:48 +02:00
fa0744e4e9 Fixed an issue that some triangles weren't selected when bucket fill was used in the multi-material painting gizmo. 2021-08-03 13:03:06 +02:00
4a4328a4bd Reworked bucket fill so that all neighboring triangles are computed based on information about triangle neighbors. 2021-07-29 11:45:02 +02:00
dc7f547a39 Get rid of unnecessary double calling of TriangleSelector::reset() in some cases when TriangleSelector::deserialize() is called. 2021-07-29 11:45:01 +02:00
125918a606 Optimized seed fill and bucket fill selection to recompute selection only in case the cursor is pointing on a non-selected triangle. 2021-07-19 11:30:40 +02:00
e9bd4b8f0f Fixed a crash in the multi-material gizmo when bucket fill is selected. 2021-07-19 11:30:35 +02:00
2724e0930d Added the bucket fill tool into the multi-material gizmo. Also, the multi-material gizmo was reworked to show only options applicable for a chosen painting tool. 2021-07-16 09:19:40 +02:00
d7bc4468b8 Fixed compiler warnings 2021-06-20 16:39:10 +02:00
69ffe12fd2 Renamed create_face_neighbors_index() to its_face_edge_ids().
Renamed its_create_neighbors_index() / its_create_neighbors_index_par() to its_face_neighbors() / its_face_neighbors_par().
New variant of its_face_edge_ids() to create edge IDs from face neighbors.
Fixed some incorrect use of _NDEBUG, it should be NDEBUG.
PrintObject::slice_support_volumes() returns newly Polygons, which are cheaper than ExPolygons.
Updated SeamPlacer and SupportMaterial to use regions defined as Polygons, not ExPolygons.
TriangleSelector::get_facets_strict() returning a patch with T-joints retriangulated.
New slice_mesh_slabs() - slicing projections of a triangle patch into top / bottom layers of slices, for MMU top / bottom segmentation.
TriangleMeshSlicer - use 64 mutexes instead of one when scattering sliced triangles into layers. This makes a big difference on modern many core desktop computers.
When applying MM segmented regions to input regions, the split regions are now re-merged with 10x higher positive offset epsilon to avoid creating gaps.
When testing for existence of paint-on supports or seam, use a more efficient has_facets() test, which does not deserialize into the expensive TriangleSelector tree structure.
GLIndexedVertexArray newly uses Eigen::AlignedBox<float, 3> for efficiency instead of our double based BoundingBoxf3.
Improved MMU painting refresh speed by optimizing generation of the vertex buffers.
Refactored MMU segmentation - projection of painted surfaces from top / bottom.
	1) Parallelized.
	2) Using the new slice_mesh_slabs() instead of projecting one triangle by the other and merging them with Clipper.
2021-06-20 15:21:12 +02:00
ed99bfd3e0 TriangleSelector:
1) Fixing yesterday's regression in deserialization of older painted 3MFs
   (order of triangle children is now reversed, thus the serialization
    / deserialization has to take it into account).
2) WIP extraction into facets to triangulate T-joints.
2021-06-16 10:52:00 +02:00
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
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
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
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
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
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
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
37c604568d Fixed that seed fill left all triangles split instead of merging them. 2021-05-28 17:42:28 +02:00
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
60a1eecd6e Fixed possible warnings 2021-05-03 21:13:13 +02:00
7d7c2efec1 Added seed fill for MMU segmentation 2021-04-27 06:48:09 +02:00
1ea93f1181 Fixed compiler warnings 2021-04-27 00:41:20 +02:00
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
d7786d058b Fixed a typo in TriangleSelector.cpp (probably not causing any bug, just a warning) 2021-02-11 07:32:22 +01:00
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
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
41a0d75606 Painter gizmos should now work with non-uniformly scaled models 2020-10-06 12:06:39 +02:00
1b6c75e98f Sphere selection added as an option for painting gizmos 2020-10-01 00:05:01 +02:00
0097301194 Experiment with spherical cursor (painting gizmos) 2020-09-30 17:34:11 +02:00
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
99cbfb7545 Fixes of two crashes in paint-on supports 2020-08-12 11:08:10 +02:00
fa4a160a2c TriangleSelector: 3MF loading and saving 2020-07-24 17:47:16 +02:00
8c0e65042a TriangleSelector: edge limit is derived from cursor size 2020-07-24 17:47:16 +02:00
abe1cf6c61 TriangleSelector: backend is aware of divided triangles 2020-07-24 17:47:16 +02:00
fa32a6bb47 TriangleSelector: 'Select by angle' and 'reset selection' functions fixed 2020-07-24 17:47:16 +02:00
438f758a2a TriangleSelector: Separated frontend/backend, support of multiple volumes, etc. 2020-07-24 17:47:16 +02:00