Commit graph

9 commits

Author SHA1 Message Date
Noisyfox
fe4a72ec94
Upgrade clipper & improve multi-thread performance (#7177)
Some checks are pending
Build all / Build All (push) Waiting to run
Build all / Flatpak (push) Waiting to run
* Clipper: Verify range of int32 coordinates on input.

Cherry-picked from prusa3d/PrusaSlicer@fa7debf49d

Co-authored-by: Vojtech Bubnik <bubnikv@gmail.com>

* ClipperLib: Optimized PointInPolygon() to calculate cross products
 with int64s instead of doubles.

Cherry-picked from prusa3d/PrusaSlicer@9dca8403fe

Co-authored-by: Vojtech Bubnik <bubnikv@gmail.com>

* Reworked the ClipperLib / Polygon types to use
the tbb::scallable_allocator to better scale on multiple threads.

Cherry-picked from prusa3d/PrusaSlicer@9cde96993e

Co-authored-by: Vojtech Bubnik <bubnikv@gmail.com>

* use tbb::scallable_allocator for Polygons and ExPolygon::holes
to better scale on multiple threads

Cherry-picked from prusa3d/PrusaSlicer@b67ad6434d

Co-authored-by: Vojtech Bubnik <bubnikv@gmail.com>

* Fixed compilation on GCC and CLang

Cherry-picked from prusa3d/PrusaSlicer@b3b44681a9

Co-authored-by: Vojtech Bubnik <bubnikv@gmail.com>

* Remove clipper2 which is not used

* Removed shiny profiler from clipperlib

Cherry-picked from prusa3d/PrusaSlicer@7e77048593

Co-authored-by: Vojtech Bubnik <bubnikv@gmail.com>

* ClipperLib: Further optimization of memory allocation using scalable_allocator.
ClipperLib: SimplifyPolygon() - changed default winding number to positive,
      added strictly_simple parameter.
ClipperUtlis simplify_polygons() - removed "remove_collinear" parameter

Cherry-picked from prusa3d/PrusaSlicer@a7e17df25f

Co-authored-by: Vojtech Bubnik <bubnikv@gmail.com>

* ClipperLib: emplace_back() instead of push_back().

Cherry-picked from prusa3d/PrusaSlicer@2e150795b1

Co-authored-by: Vojtech Bubnik <bubnikv@gmail.com>

* Fixed issue in a 32bit clipper, where IntersectPoint() checked for
the Y coordinate of the calculated intersection point for validity,
but the Y coordinate was already rounded to 32bits, thus an overflow
may have in rare cases masked invalidity of the result.

Cherry-picked from prusa3d/PrusaSlicer@b39c33414f

Co-authored-by: Vojtech Bubnik <bubnikv@gmail.com>

* Fixed Vojtech's out of boundary assert in Clipper library.

Cherry-picked from prusa3d/PrusaSlicer@0a202dcff3

Co-authored-by: Vojtech Bubnik <bubnikv@gmail.com>

* Update clipper to 6.4.2.

Cherry-picked from prusa3d/PrusaSlicer@b8b3cccb40

Co-authored-by: Lukáš Hejl <hejl.lukas@gmail.com>

* Try fix cmake opencv

---------

Co-authored-by: Vojtech Bubnik <bubnikv@gmail.com>
Co-authored-by: Lukáš Hejl <hejl.lukas@gmail.com>
2025-06-18 17:50:44 +08:00
Dipl.-Ing. Raoul Rubien, BSc
3ecca6116d
fixes compiler warnings (#9619)
* compiler warnings: adds SYSTEM to [target_]include_directories to skip warnings originating from dependencies

* compiler warnings: uninitialized/unused variables, missing parenthesis, pragma

* compiler warnings: redundant template type, missing curly braces, pass 0 instead of NULL as int argument

* compiler warnings: removes fclose(fp) where fp==nullptr since fclose() has attribute __nonnull((1))

* compiler warnings: uninitialized variables, missing parentheses, missing curly braces

* compiler warnings: ? as lower precedence than <<

* compiler warnings: unused variable

* compiler warnings: unused result

* compiler warnings: undefined/unused variable

* compiler warnings: uninitialized variable
2025-06-14 21:05:25 +08:00
Noisyfox
8e38ac234f
Fix rare crash when calculating bridge expansion (#9287)
* Fix #12469 - crash caused by bridge expansion.

Handle a very rare case in which the algorithm picks a wrong
polygon for expansion seed.

(cherry picked from commit 5f843cc93470c96483abcbd47cf8ee5fe38dffe2)

* SPE-2698: Fix crash during regions expansion.

(cherry picked from commit a3f75133c8baead6f8d7bb01722a6bfcdc2e9038)

---------

Co-authored-by: Martin Šach <martin.sachin@gmail.com>
Co-authored-by: Lukáš Hejl <hejl.lukas@gmail.com>
2025-04-13 17:39:28 +08:00
Noisyfox
51916ff058
Avoid using auto as type of Eigen expressions. (#8577)
According to https://eigen.tuxfamily.org/dox/TopicPitfalls.html one
should just avoid using `auto` as the type of an Eigen expression.

This PR fixes most of them I could found in the project. There might be
cases that I missed, and I might update those later if I noticed.

This should prevent issues like #7741 and hopefully fix some mysterious
crashes happened inside Eigen calls.
2025-02-26 23:07:23 +08:00
Noisyfox
b9432f4247
Update anti-vibration algorithm from PrusaSlicer (#7818)
* SPE-1950: Reimplement algorithm for filtering vibrating extractions inside the ensuring infill to make it less computation complex.

Cherry-picked from prusa3d/PrusaSlicer@b3510ac808

Co-authored-by: Lukáš Hejl <hejl.lukas@gmail.com>

* Remove unused file

---------

Co-authored-by: Lukáš Hejl <hejl.lukas@gmail.com>
2024-12-24 22:05:22 +08:00
Adam Johnston
97c60be44b
Fix some broken assertions (#7716)
Fix broken asserts
2024-12-14 11:17:20 +08:00
Noisyfox
9d3d242453
Improve fuzzy skin with modifier (#6759)
* Pass all compatible regions to perimeter generator

* Simplify & unify fuzzify detection

* Simplify `to_thick_polyline`

* Group regions by fuzzy skin settings

* Initial code structure of multi-regional fuzzy skin

* Determine fuzzy type by all compatible regions

* Add fuzzy region debug

* Implement the line split algorithm

* Do splitted fuzzy in classic mode

* Disable debug macros

* Fix infinit loop issue when segment points are out of order

* Fix path connection

* Implement splitted fuzzy in Arachne mode
2024-09-23 00:41:17 +08:00
SoftFever
b3fff4ffd5 Removed the copyright and credits in the header of each file. This information is outdated and hard to update. Orca Slicer maintains the autoher info in git history so this is not necessary. 2024-06-15 14:56:44 +08:00
Noisyfox
075a08bca8
Initial port of the new ensure vertical thickness algorithm from PrusaSlicer (#2382)
* Initial port of the new ensure vertical thickness algorithm from PrusaSlicer.

Based on prusa3d/PrusaSlicer@1a0d8f5130

* Remove code related to "Detect narrow internal solid infill" as it's handled by the new ensuring code

* Support different internal solid infill pattern

* Ignore removed options

---------

Co-authored-by: Pavel Mikuš <pavel.mikus.mail@seznam.cz>
Co-authored-by: SoftFever <softfeverever@gmail.com>
2023-10-19 19:55:05 +08:00