Commit Graph
100 Commits
Author SHA1 Message Date
Lukáš Hejl bdbeb34158 Accumulate the total estimated print in doubles instead of floats.
Because total print time is typically a big floating point number and the time of trapezoid is typically a small number, summing those numbers leads to a loss in precision. Switching to doubles reduces the loss of precision.

(cherry picked from commit c5982f40196c178bd824c556ac11e8c6f67d5e7a)
2025-11-15 11:11:25 -05:00
Lukáš Hejl bec883e667 SPE-2441: Fix discontinuity between the processed blocks' exit speed and the new first block's entry speed.
This discontinuity affected both time estimation and actual speed visualization.

(cherry picked from commit 90073dce70fb05bda80421158175b851855f0a8f)
2025-11-15 11:11:25 -05:00
Lukáš Hejl f2c3174896 Fixed asserts and calculations in calculateExtrusionAreaDeviationError.
The previous method worked just for near collinear edges. But it was also used for sharp corners, and for those sharp corners, there was an overflow in the computation of weighted width.
Also, the computation of deviation error was wrong for those sharp corners.

(cherry picked from commit 89b9f702d6cd59bc64c93687bc086f17a206cd0b)
2023-12-23 19:29:10 +08:00
Lukáš Hejl 499b9d1be8 Fix various memory leaks
(cherry picked from commit prusa3d/PrusaSlicer@deb17c5920)
2023-11-04 11:41:03 +08:00
Lukáš Hejl 62d9f73d78 Fixed use of an uninitialized variable in TriangleSelector caused the cursor radius in TriangleSelector to be mistakenly reset after undo. 2021-12-17 18:20:43 +01:00
Lukáš Hejl ac841757c5 Merge branch 'lh_avoid_crossing_perimeters_fix' 2021-12-16 08:58:04 +01:00
Lukáš Hejl 285e2a32a2 Fixed issues in inner_offset() in the avoid crossing perimeters that caused in some cases travels to follow the first perimeter instead of the second one. 2021-12-16 08:57:04 +01:00
Lukáš Hejl 729ffc9dd6 Fixed that external travels led inside holes (around the perimeter) instead of inside the model when the avoid crossing perimeters was enabled.
Caused by changed behaviour of offset/expand functions when called on CW polygons (holes) after 7ff76d0768. When it is called expand on CW polygons (holes), they shrunk instead of expanded.
2021-12-16 08:56:29 +01:00
Lukáš Hejl 08402abf2b Used double instead of float for computing distance between two polygon vertices in precompute_polygon_distances() in the avoid crossing perimeters.
Using a float instead of a double caused accumulation of error in the calculated distance, which in rare cases triggered an assert in get_shortest_direction().
2021-12-14 14:49:00 +01:00
Lukáš Hejl 3fd7a5a4b1 Fixed typo in GLGizmoPainterBase::get_projected_mouse_positions() after 7bb38840e1. 2021-12-10 22:37:53 +01:00
Lukáš Hejl 5b56adba59 Added a missing include (GCC11.1 without PCH). 2021-12-08 13:19:27 +01:00
Lukáš Hejl 66d11bd198 Changed OpenGL buffer type to GL_ELEMENT_ARRAY_BUFFER for vertex array indices in GLPaintContour. The previous type GL_ARRAY_BUFFER was used by mistake. 2021-12-08 11:23:35 +01:00
Lukáš Hejl 36b014a8dd Fixed a bug in the precomputation of the data for bucket fill that was triggering assert in TriangleSelector::neighbor_child(). 2021-12-03 14:06:53 +01:00
Lukáš Hejl f88d678a4a Added a missing include (GCC11.1 without PCH). 2021-12-02 21:04:55 +01:00
Lukáš Hejl 0875dc73c7 Merge branch 'lh_cursors' 2021-12-02 12:41:03 +01:00
Lukáš Hejl 7bb38840e1 Replaced the repeated application of Cursors (Sphere or Circle) in painting using 2D and 3D Capsules.
Previously, the Cursor (Sphere or Circle) was repeatedly applied between two mouse positions, creating brushstrokes with ripples on the edges between those mouse positions.
Now, a single capsule (3D or 2D) is applied between those mouse positions, which creates brushstrokes without these ripples.
2021-12-02 12:36:48 +01:00
Lukáš Hejl e898eda320 Refactoring of Cursors in TriangleSelector as preparation for upcoming improvements of painting. 2021-12-02 12:36:48 +01:00
Lukáš Hejl 7f951c2df8 Fixed an issue that travels could lead through a hole when the avoid crossing perimeters was enabled at the same with "External perimeter first" or "Detect thin walls". 2021-12-02 09:35:20 +01:00
Lukáš Hejl e85a0ba248 Added missing includes (GCC11.1 without PCH). 2021-12-02 09:30:03 +01:00
Lukáš Hejl f4125f2db8 Fixed the collision between BuildVolume::Type::Convex and macro Convex defined inside /usr/include/X11/X.h that is included by WxWidgets 3.0. 2021-11-26 13:53:11 +01:00
Lukáš Hejl 9e3e565bb6 Added README.md file for fast_float library. 2021-11-23 17:48:35 +01:00
Lukáš Hejl 8a4323c5b9 Fixed the layout of the painting gizmos after the edit icon for sliders was added. 2021-11-17 11:44:38 +01:00
Lukáš Hejl 9cac904f97 Fix of #7299 (Crash in the multi-material segmentation when some projected triangle is outside the bounding box of the current layer. 2021-11-17 11:44:32 +01:00
Lukáš Hejl c6940970f2 Decreased the minimum diameter of the brush in the multi-material painting gizmo to 0.1 with respect to #7108. 2021-11-12 17:52:12 +01:00
Lukáš Hejl 9c35e0cb75 Added a missing include (GCC 11.1). 2021-11-12 13:29:17 +01:00
Lukáš Hejl f94a1dbb48 Added a missing include (GCC 11.1). 2021-11-10 23:21:36 +01:00
Lukáš Hejl ce1fbbfa7c OSX specific: Fix of #7259 - (Darker colors of objects inside the multi-material gizmo on macOS Monterey on Arm64 CPU)
Since macOS 12 (Monterey), the issue with the opposite direction on macOS running on Arm64 CPU seems to be fixed, and computed triangle normals inside fragment shader using dFdx and dFdy have the right direction.
So the previous patch bad51cdb52 is constrained to just macOS versions before macOS 12 (Monterey).
2021-11-08 11:27:24 +01:00
Lukáš Hejl 69b7fac01f Fixed a compiler warning. 2021-11-05 23:19:01 +01:00
Lukáš Hejl 80695603d6 Merge branch 'lh_mm_segmentation' 2021-11-05 22:53:13 +01:00
Lukáš Hejl e13be90283 Fix of #7109 (Bulges with model's base color on multi-material painted models) 2021-11-05 22:52:52 +01:00
Lukáš Hejl f5a6e53298 Fix of #7235 (Dimples in external perimeter after multi-material segmentation) 2021-11-05 22:52:52 +01:00
Lukáš Hejl b572588fc5 Small refactoring of storing colored polygons in multi-material segmentation.
Previously, colored polygons were stored so that each polygon had a color assigned to it, which made it difficult to perform operations like union or so on all polygons of the same color. Now polygons are stored grouped by their assigned color/extruder.
2021-11-05 22:52:52 +01:00
Lukáš Hejl 54b72fdaa9 Added a missing include (GCC 11.1). 2021-11-05 22:52:13 +01:00
Lukáš Hejl 7ce13b4a26 Merge branch 'lh_mm_segmentation' 2021-11-02 13:22:20 +01:00
Lukáš Hejl 54b0ee6a4a Fix of #7112 (Default color sometimes appeared between two multi-material painted areas) 2021-11-02 13:02:00 +01:00
Lukáš Hejl 3eb4ae309a Small refactoring of post-processing of the projected painted lines in multi-material segmentation. 2021-11-02 13:02:00 +01:00
Lukáš Hejl e04c934253 Added more debug output for multi-material segmentation for debugging projection of the painted lines. 2021-11-02 12:49:46 +01:00
Lukáš Hejl fc3bab9063 Merge branch 'lh_brim_fix' 2021-11-01 15:11:48 +01:00
Lukáš Hejl 78879b2e84 Fixed missing brims for nested objects.
Brim wasn't generated when some object was placed inside the hole of another object.
2021-11-01 15:10:51 +01:00
Lukáš Hejl 30a37d0c25 Fix of #7213: Not generated inner brim after 7ff76d0768. 2021-11-01 15:10:51 +01:00
Lukáš Hejl 3d87904e66 Fixed the bottom layer of multi-material painted objects sunken below the print bed (#7107). 2021-10-25 14:59:05 +02:00
Lukáš Hejl 10f24119d0 Fixed the propagation of painted top and bottom layers for mirrored objects in multi-material segmentation. 2021-10-25 08:43:30 +02:00
Lukáš Hejl 0f9a9de745 Fixed darker colors of objects inside multi-material gizmo when objects are mirrored. 2021-10-25 08:41:41 +02:00
Lukáš Hejl 0791a2b3ed Fix of #7104 (dimples in perimeters after multi-material segmentation) 2021-10-22 11:58:46 +02:00
Lukáš Hejl 978fff1d31 Merge branch 'lh_clipping_plane_painting' 2021-10-21 08:51:19 +02:00
Lukáš Hejl d8a0d0523f Allowed painting in the FDM supports, seam, and multi-material gizmo to only triangles not clipped by a clipping plane. 2021-10-21 08:49:24 +02:00
Lukáš Hejl 5a1809579e Fixed unintended space after ImGui::SliderFloat in the hollow and sla supports gizmos. 2021-10-19 12:54:46 +02:00
Lukáš Hejl aa47729c47 Added a missing include (GCC 11.1). 2021-10-19 11:53:21 +02:00
Lukáš Hejl 25a3ab255b Merge branch 'lh_avoid_crossing_perimeters_offset' 2021-10-18 12:55:06 +02:00
Lukáš Hejl 4d47e9a184 Allow travels processed by the avoid crossing perimeters move further away from the outer perimeter. 2021-10-18 12:51:20 +02:00
Lukáš Hejl c660091bfa Merge branch 'lh_fdm_supports_smart_fill' 2021-10-18 11:35:39 +02:00
Lukáš Hejl 0c2d9f01a6 Fixed z-fighting between contour around the area selected by smart fill and painted triangles inside the FDM support painting gizmo. 2021-10-18 11:35:13 +02:00
Lukáš Hejl b45675b4e1 Follow-up of 6194e67e68 - Separated the part that computed triangles normals and lighting inside the fragment shader into a separate shader mm_gouraud, which is only used for the multi-material painting gizmo. 2021-10-18 11:35:13 +02:00
Lukáš Hejl 912f73d79c Fixed the positioning of the supports painting gizmo. 2021-10-18 11:33:47 +02:00
Lukáš Hejl 552c42d466 Merge branch 'lh_fdm_supports_gizmo' 2021-10-18 11:10:54 +02:00
Lukáš Hejl 6f3baf9262 Added tooltips to the support painting gizmo. Used multi-line text for the label "Highlight overhang by angle". 2021-10-18 10:57:57 +02:00
Lukáš Hejl b2fc50c9d9 Small refactoring of showing tooltips in gizmos. 2021-10-18 10:56:50 +02:00
Lukáš Hejl 6f6f6de506 Added an option to limit painting to triangles only highlighted by "Highlight by angle" in the support painting gizmo. 2021-10-18 10:54:31 +02:00
Lukáš Hejl 2f9ce6bedb Fixed incorrect color assignment in multi-material segmentation caused by intersecting edges due to post-processing of Voronoi diagram.
This issue was occurring mainly on the cylinder objects.
2021-10-14 09:39:23 +02:00
Lukáš Hejl b99be85187 Fixed a warning. 2021-10-07 13:36:06 +02:00
Lukáš Hejl 82bf9c158a Optimized multi-material segmentation to construct Voronoi diagrams only for layers that have more than one color. If the whole layer is painted using the same color, it is not needed to construct a Voronoi diagram. 2021-10-07 13:16:21 +02:00
Lukáš Hejl d2cd14ba7d Merge branch 'lh_fdm_supports_smart_fill' 2021-10-07 13:14:40 +02:00
Lukáš Hejl d6d575f607 Renamed the brush "Pointer" to "Triangles" in the multi-material painting gizmo, and in the FDM supports painting gizmo. 2021-10-07 13:12:36 +02:00
Lukáš Hejl ebdc69bdc9 Fixed the positioning of the painting gizmos. 2021-10-07 13:12:36 +02:00
Lukáš Hejl 542ba1bb9a Added rendering of smart fill and contour around selected areas for the FDM supports painting gizmo. 2021-10-07 13:12:36 +02:00
Lukáš Hejl 2b59a16dc7 Refactored rendering of the contour around areas selected by smart fill to prepare it for the FDM supports painting gizmo. 2021-10-07 13:12:36 +02:00
Lukáš Hejl 8c9c8a9cc4 Prepared the FDM support gizmo for smart fill. 2021-10-07 13:12:36 +02:00
Lukáš Hejl 99edfd22ce Improved the alignment of tool type and brush type in the multi-material gizmo. 2021-10-07 13:12:36 +02:00
Lukáš Hejl dfb4ccdb13 Reworked seam painting gizmo to the same layout as multi-material painting gizmo. 2021-10-07 13:12:36 +02:00
Lukáš Hejl 925d3fad1f Fixed the wrong calculation of caption text size in all painting gizmos, which could lead to showing unintended space after ImGui::SliderFloat. 2021-10-07 13:12:36 +02:00
Lukáš Hejl 6012bf1e03 Removed unintended space after ImGui::SliderFloat in all painting gizmos. 2021-10-07 13:12:36 +02:00
Lukáš Hejl 992a279bef Removed the vertical space in the below information about how to use gizmo for all painting gizmos. 2021-10-07 13:12:36 +02:00
Lukáš Hejl 30d13c99b7 Added a missing include (GCC 11.1). 2021-09-21 22:41:55 +02:00
Lukáš Hejl 40e4116d9a Added a missing include (GCC 11.1). 2021-09-21 10:45:57 +02:00
Lukáš Hejl 1c6ecd9c1a Replaced atof and atoi inside 3MF attribute parsing with fast_float::from_chars and boost::spirit that are faster. 2021-09-14 11:09:43 +02:00
Lukáš Hejl 4f5dddbf11 Merge branch 'lh_gcode_export' 2021-09-11 00:56:34 +02:00
Lukáš Hejl e520454c3e Fixed unit tests after the previous commit. 2021-09-11 00:54:30 +02:00
Lukáš Hejl d2a185ddb6 Optimized export of floating-point value inside emit_axis.
Change the behavior of generated G-code commands. Now all redundancy padding zeros are removed, which makes G-code a little bit smaller.
2021-09-11 00:54:30 +02:00
Lukáš Hejl ad65366ac7 Added fast_float library as a replacement for std::from_chars and strtod. 2021-09-11 00:54:30 +02:00
Lukáš Hejl e3ac2a9e45 Fixed Perl unit tests after 34c4b74af4. 2021-09-11 00:53:45 +02:00
Lukáš Hejl 0bc77cef3e Fixed build on Linux and macOS that was failing because of using std::to_chars and std::from_chars with floating-point values.
The old version of GCC and Clang support only integers to be passed to std::to_chars and std::from_chars. macOS older version of Clang doesn't support std::from_chars at all. So for Linux and macOS, it was replaced std::from_chars with strtod and temporarily was replace std::to_chars with snprintf.
2021-09-07 07:43:17 +02:00
Lukáš Hejl 3b4d10656c Renamed 'Seed fill' to 'Smart fill'. 2021-09-01 14:32:34 +02:00
Lukáš Hejl 8ad109235b Added a missing include (GCC 11.1). 2021-09-01 14:28:42 +02:00
Lukáš Hejl ccf671dcc9 Added versioning of the structure of stored data for all three painting gizmos (fdm supports, seam and multi-material). 2021-08-31 15:05:11 +02:00
Lukáš Hejl 1835dae296 Fixed a bug that the skirt was generated too far from the brim for some objects. 2021-08-31 14:54:37 +02:00
Lukáš Hejl 57f7b49223 Corrected undo/redo snapshot name when entering or leaving multi-material painting gizmo. 2021-08-30 10:41:41 +02:00
Lukáš Hejl 95e4ab9460 Fixed the issue that an object disappeared in a multi-material painting gizmo when the object was almost completely sunk under the bed.
Object disappearance was caused by calling glPolygonOffset for rendered triangles in the multi-material painting gizmo to resolve z-fighting between painted triangles and contours around selected areas using seed/bucket fill.
2021-08-26 12:08:21 +02:00
Lukáš Hejl 1c25078bc3 Added a missing include (GCC 11.1). 2021-08-26 08:43:47 +02:00
Lukáš Hejl 731ac9287e Added a missing include (GCC 11.1) 2021-08-13 12:00:55 +02:00
Lukáš Hejl 2ab0ea4c47 Merge branch 'lh_mm_segmentation' 2021-08-10 22:30:45 +02:00
Lukáš Hejl 18cff61bd2 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
Lukáš Hejl e5ce748b10 Added missing includes (GCC 11.1) 2021-08-10 21:37:10 +02:00
Lukáš Hejl 58f83b5e6a The offset is applied after the elephant food compensation. The value of the brim offset is now also measured from the object after the elephant foot compensation. Thus, the brim offset set to zero means that the brim will touch the object even if elephant foot compensation is enabled. 2021-08-10 09:44:39 +02:00
Lukáš Hejl b174dacc85 Added a missing include (GCC 11.1) 2021-08-07 08:29:32 +02:00
Lukáš Hejl dc4afb5bfc Merge branch 'lh_mm_segmentation' 2021-08-06 16:47:13 +02:00
Lukáš Hejl dd55b55853 Swapped the position of seed fill and bucket fill inside the multi-material gizmo. Changed the default value for the seed fill angle. 2021-08-06 16:46:48 +02:00
Lukáš Hejl 56d4ba7a29 Fixed the issue when the object was selected by seed fill or bucket fill could stay selected when the painting tool was switched to brush. 2021-08-06 16:46:48 +02:00
Lukáš Hejl 666cdeecd9 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
Lukáš Hejl cf2a7f4dfa Fixed the possibility of changing brush size in the multi-material gizmo by ALT+mouse wheel when brush for painting single triangles is selected. 2021-08-06 16:46:48 +02:00
Lukáš Hejl 9b19060334 Merge branch 'lh_mm_segmentation' 2021-08-03 13:07:00 +02:00