-
-
Notifications
You must be signed in to change notification settings - Fork 882
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
CURA 10724 smooth operator #1891
Commits on Jun 24, 2023
-
Add a smooth action, which will smooth small segments (maximum resolution) of a polygon, whom deviate more than a certain angle (wall transition angle) compared to a fluid motion line between the segment before and after. Smoothing is done by moving the first point of the small middle segment to the first point of the previous point with a smooth distance (need to add this to the front end). The second point of the middle segment is moved to the second point of the last segment. If either the previous or next segment is shorter then the smooth distance, then that point in the middle segment is removed Contributes to CURA-10724 Contributes to Ultimaker/Cura#14811
Configuration menu - View commit details
-
Copy full SHA for 0e93b77 - Browse repository at this point
Copy the full SHA 0e93b77View commit details -
reverted premature optimization
First make sure that the smoothing works, by not skipping any math steps. Contributes to Ultimaker/Cura#14811 Contributes to CURA-10724
Configuration menu - View commit details
-
Copy full SHA for 9789cf0 - Browse repository at this point
Copy the full SHA 9789cf0View commit details -
Don't use costly angle calculations
Shift with vectors instead Contributes to Ultimaker/Cura#14811 Contributes to CURA-10724
Configuration menu - View commit details
-
Copy full SHA for e17eb83 - Browse repository at this point
Copy the full SHA e17eb83View commit details
Commits on Jun 25, 2023
-
Moved concepts to types and util namespace
Bring a bit more order to this [CURA-10724]
Configuration menu - View commit details
-
Copy full SHA for 4097e93 - Browse repository at this point
Copy the full SHA 4097e93View commit details -
Configuration menu - View commit details
-
Copy full SHA for 42093f7 - Browse repository at this point
Copy the full SHA 42093f7View commit details -
Allow uniform coordinate query with std::get
This would allow for getting a x,y,z coordinate for a IntPoint, or 3D point, described as a struct or vector/array/tuple etc. Will be expanded to accommodate Arachne types. ``` struct Point{ int X; int Y; } Point p_struct{ .X = 1, .Y = 2. }; std::array<int, 2> p_array { 1, 2 }; auto x_struct = std::get<"X">(p_struct); auto x_array = std::get<"X">(p_array); ``` [CURA-10724]
Configuration menu - View commit details
-
Copy full SHA for 46d414b - Browse repository at this point
Copy the full SHA 46d414bView commit details -
This allows for reusing the logic for Arachne types. [CURA-10724]
Configuration menu - View commit details
-
Copy full SHA for f834149 - Browse repository at this point
Copy the full SHA f834149View commit details
Commits on Jun 26, 2023
-
Configuration menu - View commit details
-
Copy full SHA for 7f2f1cf - Browse repository at this point
Copy the full SHA 7f2f1cfView commit details -
Configuration menu - View commit details
-
Copy full SHA for 726fd09 - Browse repository at this point
Copy the full SHA 726fd09View commit details -
Configuration menu - View commit details
-
Copy full SHA for a455e3a - Browse repository at this point
Copy the full SHA a455e3aView commit details
Commits on Jun 27, 2023
-
Configuration menu - View commit details
-
Copy full SHA for fc19696 - Browse repository at this point
Copy the full SHA fc19696View commit details -
Refactor smooth action and fix pointer issues
Update smooth action to handle changing path size, cycle views, and filtering out removed points. The previous implementation had issues with sliding views due to the path size change. Also, fix range constraints and improve readability. This refactor improves the algorithm's accuracy and performance by better handling the changing path size and filtering out points marked for removal. Additionally, the updated range constraints and readability make it easier to understand and maintain the code. Contributes to CURA-10724
Configuration menu - View commit details
-
Copy full SHA for 34858fa - Browse repository at this point
Copy the full SHA 34858faView commit details
Commits on Jun 28, 2023
-
Refactor smooth action in utils codebase
The `smooth` action codebase has been heavily refactored to improve readability, avoid redundancy and make the codebase more efficient. Importantly, third-party library RangeV3 has been more efficiently used, unnecessary headers were removed, and unnecessary debug logs were deleted. Also, reusable shifting operation for p1 (towards p0) and p2 (towards p3) were extracted to a new function, `shiftPointTowards`. Contributes to CURA-10724
Configuration menu - View commit details
-
Copy full SHA for 24a795a - Browse repository at this point
Copy the full SHA 24a795aView commit details
Commits on Jun 29, 2023
-
Optimize smoothing function and fix error in shift_points
The smoothing function has been optimized and a bug with the shift_points function has been fixed. The operator in the smoothing function has been made "constexpr" to potentially improve performance. The way "windows" are generated has been restructured to make it clearer and eliminate redundancy. In shift_points, the subtraction used to alter point's coordinates was replaced with addition to rectify a mistake. The distance calculation in the smoothing function has been adjusted from an incorrect dot product into a correct hypotenuse calculation. These changes should help in improving the efficiency and correctness of the smoothing function. Contributes to CURA-10724
Configuration menu - View commit details
-
Copy full SHA for 5b86ae8 - Browse repository at this point
Copy the full SHA 5b86ae8View commit details -
Refactor SmoothTest for more reliable results
The existing tests for the smooth function were simplified and adjusted. It applies the smoothing function to those points and then verifies that the original polygon remains the same after smoothing. This change will make the test more reliable as it verifies that smoothing algorithm doesn't alter essential data. Contributes to CURA-10724
Configuration menu - View commit details
-
Copy full SHA for 5c36cce - Browse repository at this point
Copy the full SHA 5c36cceView commit details
Commits on Jul 1, 2023
-
Extended geometrical type concepts
This commit adds more granular checks for geometrical types (2D & 3D points) in the geometry header. It introduces concepts to inspect whether types are represented as tuple, range, or named fields. Moreover, it checks if an object is of type segment or a range of segments. This refactoring enhances versatility for geometrical types, ensuring greater type safety and readability in the code. Contribute to CURA-10724
Configuration menu - View commit details
-
Copy full SHA for 4a15a2c - Browse repository at this point
Copy the full SHA 4a15a2cView commit details -
Add functionality to access 2D and 3D point coordinates by index or c…
…haracter This commit addresses the need of accessing point coordinates more flexibly. It introduces functions to access the coordinates of 2D and 3D points either by coordinate index (e.g. 0 for X, 1 for Y in a 2D point) or by character (e.g. 'x' or 'X' for X-coordinate). It makes handling points more intuitive and comes in handy when the specific type of point (2D or 3D) is not of interest. Additionally, accessing coordinates of a junction by index or character is also implemented, further enhancing the ease of use. Contributes to CURA-10724
Configuration menu - View commit details
-
Copy full SHA for db25559 - Browse repository at this point
Copy the full SHA db25559View commit details -
Update comment syntax in geometry.h
In this commit, the syntax for the comments in the geometry.h file has been updated. The "\\" syntax was replaced by "@" as the latter is more standard for Doxygen usage. This change allows for better parsing and generation of documentation by Doxygen, and aligns with common practices in the software industry. Contributes to CURA-10724
Configuration menu - View commit details
-
Copy full SHA for 6027c54 - Browse repository at this point
Copy the full SHA 6027c54View commit details -
Refactor smoothing function, remove unused parameter and improve read…
…ability The smoothing function in `smooth.h` was refactored to improve code readability and maintainability. The 'smooth_distance' parameter was removed as it was not being utilized. The core logic of the function remains unchanged, and several variable names were updated to better reflect their context and function. Introduced a clearer, more accurate method to calculate the cosine of the angle deviation which is also generally optimized for smaller values of the `fluid_angle`. This is a more computational efficient approach since for 'Curved' interpolations, the `fluid_angle` is usually small which solves the primary problem. Contributes to CURA-10724
Configuration menu - View commit details
-
Copy full SHA for 4e1c55f - Browse repository at this point
Copy the full SHA 4e1c55fView commit details -
Refactor smoother functionality in WallToolPaths
Moved the 'smoother' logic from the 'slicer' and 'WallToolPaths' execution to occur earlier in the 'prepared_outline' execution. This change intentional to reduce redundancy and improve the efficiency of our slicing process by ensuring we're smoothing the polygons just once. This could also help reduce the amount of crashes in the Voronoi generation/usage An unnecessary smoother function call with redundant parameters was also removed from src/slicer.cpp." Contributes to CURA-10724
Configuration menu - View commit details
-
Copy full SHA for 41e260a - Browse repository at this point
Copy the full SHA 41e260aView commit details -
Refine path smoothing algorithm
Updated the path smoothing algorithm by refining the condition checks and optimizing certain calculations for better efficiency. - Introduced a condition to handle open paths. - Corrections in comments for better understanding. - Loop stop condition refined to prevent unwanted iterations. - Compute function introduced to calculate magnitudes, making the code cleaner. - Reorganized functions for better readability. - Deviation calculation and filtering methods optimized for better performance. This update is aimed at enhancing the performance of path smoothing. Contributes to CURA-10724
Configuration menu - View commit details
-
Copy full SHA for 099a636 - Browse repository at this point
Copy the full SHA 099a636View commit details -
Merge branch '5.4' into CURA-10724_smooth_operator
# Conflicts: # src/WallToolPaths.cpp
Configuration menu - View commit details
-
Copy full SHA for f4756d0 - Browse repository at this point
Copy the full SHA f4756d0View commit details -
Update smoothing parameters in test
Updated the parameters in the SmoothTest of CURA utility tests. The third parameter of the smoothing function has been removed due to recent changes in the CURA engine algorithm. Consequently, the expected results of test were also updated to match the output from the updated smoothing function. Contributes to CURA-10724
Configuration menu - View commit details
-
Copy full SHA for 5b6bdc7 - Browse repository at this point
Copy the full SHA 5b6bdc7View commit details -
Configuration menu - View commit details
-
Copy full SHA for f8544c1 - Browse repository at this point
Copy the full SHA f8544c1View commit details -
fix ranged 2d and 3d point concepts on Apple Clang 13
I hate Apple Clang! Contribute to CURA-10724
Configuration menu - View commit details
-
Copy full SHA for 925c8ff - Browse repository at this point
Copy the full SHA 925c8ffView commit details -
Update Geometry checks for compiler support of std::integral
Due to varying support for the C++20 feature std::integral, preprocessor checks were added to the Geometry utility. This ensures that the Geometry utility functions will compile and run as expected across different compilers, especially older ones or those that don't fully support C++20 yet. Additionally, if std::integral is not supported, standard member accessing is used instead. This modification enhances the code's robustness and compatibility. Contributes to CURA-10724
Configuration menu - View commit details
-
Copy full SHA for eda05c1 - Browse repository at this point
Copy the full SHA eda05c1View commit details -
Add note with stack-overflow comment
Such that future developers are aware of struggles we had to support Apple Clang. _The pain is real... never give up... word!_ Contributes to CURA-10724
Configuration menu - View commit details
-
Copy full SHA for 5cd147b - Browse repository at this point
Copy the full SHA 5cd147bView commit details -
Adjust Arachne type checks for different C++ versions
This commit addresses potential compatibility issues with different versions of C++ by adding conditionals to the `junction` concept in the `arachne.h` utility file. As some versions may not support the `std::integral` check, we fall back to directly assessing `val.w` if the C++ version is older or a particular library version with compatibility issues is detected. This change ensures successful compilation across varying environments. Contributes to CURA-10724
Configuration menu - View commit details
-
Copy full SHA for 414f9c6 - Browse repository at this point
Copy the full SHA 414f9c6View commit details -
Refactor std::integral usage for C++ compatibility
This commit removes the preprocessor conditions that were originally put in to cope with an issue in Clang13 C++20. A fallback version of the integral concept has been added in the std namespace if the C++ version is below 201703L or if the library version is lesser than the Clang13 version. This allows for a cleaner and more compatible codebase across various C++ versions. In addition, "include/utils/types/generic.h" is now being included in "include/utils/types/geometry.h", "include/utils/types/arachne.h" and "include/utils/actions/smooth.h" everywhere std::integral might be used. Contributes to CURA-10724
Configuration menu - View commit details
-
Copy full SHA for 973c653 - Browse repository at this point
Copy the full SHA 973c653View commit details -
Configuration menu - View commit details
-
Copy full SHA for 1694fdc - Browse repository at this point
Copy the full SHA 1694fdcView commit details -
Configuration menu - View commit details
-
Copy full SHA for ab6d68c - Browse repository at this point
Copy the full SHA ab6d68cView commit details
Commits on Jul 2, 2023
-
Refactor angle checking in smoothing utility
The angle checking in the smoothing utility now check against actual angles instead of the cosine angle. This is slightly more computational heavy but needed since otherwise a lot of points where missed. The function `isWithinDeviations` has also been renamed to `isWithinAllowedDeviations` for clarity. Contributes to CURA-10724
Configuration menu - View commit details
-
Copy full SHA for f9a3538 - Browse repository at this point
Copy the full SHA f9a3538View commit details -
Often the first segments weren't filtered, by concatenating the tail to the front we also take these last elements into account. Also, adjusted the conditions in if-statements for better accuracy and introduced variables for allowed deviations and smoothing distance for better code consistency. Contributes to CURA-10724
Configuration menu - View commit details
-
Copy full SHA for f694ca4 - Browse repository at this point
Copy the full SHA f694ca4View commit details -
Configuration menu - View commit details
-
Copy full SHA for 9cc8e97 - Browse repository at this point
Copy the full SHA 9cc8e97View commit details -
Configuration menu - View commit details
-
Copy full SHA for 1edab47 - Browse repository at this point
Copy the full SHA 1edab47View commit details -
Replace 'tail' with 'single' in smoothing process
This change replaces the 'tail' view with a 'single' view in the smoothing process of the model. The change ensures that the smoothing process takes into consideration the entire model, instead of ignoring the first point (head). The 'single' view denotes the single element at the back of the range 'tmp'. This small adjustment ensures the smoother start of the 3D model's path and addresses a specific corner case where the first point was being neglected. Contributes to CURA-10724
Configuration menu - View commit details
-
Copy full SHA for bc2a8c2 - Browse repository at this point
Copy the full SHA bc2a8c2View commit details -
The filter condition has been altered to be less aggressive, since the intend is to smooth out the small sudden deviations. With this in mind the removal of points is also discarded since this can introduce self- intersecting shapes, which will result in hard crashes, but more importantly introduce to much of a deviation from the intended shape. Contribute to CURA-10724
Configuration menu - View commit details
-
Copy full SHA for 6220a38 - Browse repository at this point
Copy the full SHA 6220a38View commit details -
Add logging for prepared outline in WallToolPaths
Added a debug log line for 'prepared_outline' in 'WallToolPaths.cpp' to capture and trace its parameters. This is to help troubleshoot issues related to polygon simplification and self-intersection fixes in complex polygons as it wasn't clear if the existing adjustments solved all occurrences. Contributes to CURA-10724
Configuration menu - View commit details
-
Copy full SHA for 8173e59 - Browse repository at this point
Copy the full SHA 8173e59View commit details -
Reorder includes and add logging in SkeletalTrapezoidation
This commit reorders the includes in SkeletonTrapezoidation.cpp for better code organization and adds a logging line to aid troubleshooting. The logger will now print values of polys, section_type, and layer_idx when constructing from polygons, giving better visibility into their state in case of issues. Contributes to CURA-10724
Configuration menu - View commit details
-
Copy full SHA for 0ad51a4 - Browse repository at this point
Copy the full SHA 0ad51a4View commit details -
Skip smoothing for support walls
Added condition to skip smoothing process for sections that are of section type 'support'. This is done to improve performance and eliminate unnecessary computation as these support walls do not require smoothing. Contributes to CURA-10724
Configuration menu - View commit details
-
Copy full SHA for ded69d4 - Browse repository at this point
Copy the full SHA ded69d4View commit details
Commits on Jul 3, 2023
-
Use ranges concepts instead of std
Apple Clang 13 doesn't have full support yet. Contributes to CURA-10724
Configuration menu - View commit details
-
Copy full SHA for 40a8fab - Browse repository at this point
Copy the full SHA 40a8fabView commit details -
Configuration menu - View commit details
-
Copy full SHA for 95234f7 - Browse repository at this point
Copy the full SHA 95234f7View commit details -
Revert "Check against apple_clang instead of apple-clang"
This reverts commit 95234f7.
Configuration menu - View commit details
-
Copy full SHA for 140da4e - Browse repository at this point
Copy the full SHA 140da4eView commit details -
Configuration menu - View commit details
-
Copy full SHA for b7ef734 - Browse repository at this point
Copy the full SHA b7ef734View commit details -
Configuration menu - View commit details
-
Copy full SHA for 4bf339e - Browse repository at this point
Copy the full SHA 4bf339eView commit details -
Configuration menu - View commit details
-
Copy full SHA for 9fee071 - Browse repository at this point
Copy the full SHA 9fee071View commit details -
Configuration menu - View commit details
-
Copy full SHA for 3cc85bc - Browse repository at this point
Copy the full SHA 3cc85bcView commit details -
Improve code readability and add assertions
Applied review comments. This commit addresses several changes in the code to improve readability and add more assertions where necessary. Redundant comments have been removed, such as the namespace declaration in geometry.h for readability. Grammar mistakes in comments were corrected for the same reason in smooth.h. In get.h and generic.h, a static assertion was added to restrict the size of the string value to one character, ensuring concise point coordinate inputs. In generic.h, a comment was added to indicate why we are adding a manual implementation of integral and floating point, due to lack of support in older versions of Apple Clang. These changes were made to improve the quality and maintainability of the code. Contributes to CURA-10724
Configuration menu - View commit details
-
Copy full SHA for 49ea674 - Browse repository at this point
Copy the full SHA 49ea674View commit details -
Quick mock test for green marks
Write some actual tests CURA-10724
Configuration menu - View commit details
-
Copy full SHA for a7caa49 - Browse repository at this point
Copy the full SHA a7caa49View commit details -
Switched the order of the smoothing
Smoothing can probably introduce some self-intersections. Which can result in crashes CURA-10724
Configuration menu - View commit details
-
Copy full SHA for be715bc - Browse repository at this point
Copy the full SHA be715bcView commit details -
Configuration menu - View commit details
-
Copy full SHA for d7fd718 - Browse repository at this point
Copy the full SHA d7fd718View commit details
Commits on Jul 4, 2023
-
Configuration menu - View commit details
-
Copy full SHA for 5044f34 - Browse repository at this point
Copy the full SHA 5044f34View commit details