Commit Graph

33 Commits

Author SHA1 Message Date
73ea766b86 ImGui sliders clamping:
ImGuiWrapper::slider_float now clamps the value returned by imgui by default. Bare ImGui::SliderFloat
allows entering off-scale values when entered by keyboard, which is not nice. The protection can
be turned off by the last optional parameter.
2021-07-22 15:50:48 +02:00
0f5f924edf Fixed cursor size clamping in MMU segmentation gizmo 2021-07-22 11:03:09 +02:00
cb22ab84a9 Fix bucket/seed fill tooltips (#6720) 2021-07-19 07:56:50 +02:00
eb7f105194 Fixed an issue when the object in the multi-material gizmo had the wrong default color when the multi-material gizmo was first time opened after loading a painted 3MF file with different extruders colors than in the printer profile in Slicer. 2021-07-16 11:39:50 +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
13edc8eca2 Added input validation in painting gizmo (some values led to a crash) 2021-07-14 15:57:22 +02:00
f7fcc9b4d7 Fixed compilation in debug mode by removing the forgotten assert. 2021-07-13 12:56:01 +02:00
14bfc30ec4 Triangle normals and lighting are computed inside the fragment shader for the multi-material painting gizmo.
It results in a six-fold reduction of the amount of data transferred into GPU because there is no need to duplicate vertices for every triangle. Also, normals aren't needed to be transferred to GPU.
2021-07-13 11:23:36 +02:00
bc10148ff2 Default object color is shown in the multi-material painting gizmo when the user switches to a printer with fewer extruders than the number of extruders used to paint the object. 2021-07-13 11:23:36 +02:00
2a04382245 Speed up the rendering of triangles in painting gizmos by only copying triangle data to the GPU when triangles were changed by painting. 2021-07-13 11:23:36 +02:00
1a72c78934 Merge branch 'vb_mmu_top_bottom' 2021-07-13 11:08:52 +02:00
a0c0a64508 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
f33310871c 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
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
d7e663e2ef 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
8fbd9f40e7 Refactoring and cleanup of painting gizmos. 2021-06-16 06:06:34 +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
7c58250e5b 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
1316e17053 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
bea06e46a3 Show info about multi-material segmentation in ObjectList. 2021-06-16 06:06:33 +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
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
5e1a9a728f Added name for items in undo/redo stack inside multi-material gizmo. 2021-06-03 18:11:48 +02:00
6f72ac08d9 Sphere brush color in MMU painting gizmo is now the same as color used for painting. 2021-05-31 14:23:12 +02:00
42d7738da1 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
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
0d7eada5dc 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
60a1eecd6e Fixed possible warnings 2021-05-03 21:13:13 +02:00
cf78d2a9dc Rework of MMU segmentation gizmo to support more than three colors. 2021-04-30 15:58:25 +02:00
7d7c2efec1 Added seed fill for MMU segmentation 2021-04-27 06:48:09 +02:00
37720e9b28 Added hiding of MMU segmentation gizmo when it is selected printer with only one extruder. 2021-04-27 00:35:43 +02:00
ef8718327b WIP: Duplicated the FDM support gizmo for the MMU segmentation 2021-04-19 07:01:11 +02:00