Commit Graph

378 Commits

Author SHA1 Message Date
c286a0fcca Rotfinder fixes wip 2021-08-16 11:29:22 +02:00
4c940c9168 Increase minimum oversampling for grid conversion in hollowing
To avoid generation of broken meshes when the space for hollowing is tight
2021-07-26 14:51:22 +02:00
50b4f08e37 drop deprecated TBB components (#6590)
Quite some time ago, many of the TBB components were deprecated in favor
of their near-equivalents in the STL or, in the case of task_scheduler_init,
were broken up and reconstituted under a less ad-hoc logic. Every time a header
file marked deprecated gets included, a rather loud warning is emitted, which
leads to a complete TBB's domination over the stderr stream during build time,
making it harder to notice _legitimate_ warnings.

Instead of merely muting the output with TBB_SUPPRESS_DEPRECATED_MESSAGES,
perform a genuine migration away from the deprecated components with the added
benefit of achieving a source compatibility with oneTBB, the successor to TBB
which has dropped the deprecated API for good.

What got replaced for what?

| Deprecated				| Replacement					|
| ------------------------------------- | --------------------------------------------- |
| `tbb::atomic`				| `std::atomic`					|
| `tbb::mutex`				| `std::mutex`					|
| `tbb::mutex::scoped_lock`		| `std::scoped_lock<std::mutex>`		|
| `tbb::mutex::scoped_lock` (empty)	| `std::unique_lock<std::mutex>` (deferred)	|
| `tbb::task_scheduler_init`		| `tbb::global_control`				|
| `tbb::this_thread`			| `std::this_thread`				|

Signed-off-by: Roman Beranek <roman.beranek@prusa3d.com>
2021-06-23 11:48:48 +02:00
0ecba516a3 Get rid of Contour3D 2021-06-08 10:28:23 +02:00
c451fc94ba Refactored hollowing backend to use indexed_triangle_mesh 2021-06-08 10:28:23 +02:00
5d85a57ae6 wip on hollowing refactor 2021-06-08 10:27:35 +02:00
997c446a05 SLA backend refactored, except Hollowing 2021-06-08 10:27:35 +02:00
e90d131878 Added missing includes (GCC 11.1) 2021-05-29 19:55:20 +02:00
39e17fd6b9 TriangleMeshSlicer: Got rid of admesh! 2021-05-18 15:05:30 +02:00
499d8405e9 WIP: Reworked slicing
1) Slicing code moved to TriangleMeshSlicer.cpp,hpp from TriangleMesh.cpp,hpp
2) Refactored to use as little as possible of admesh.
2021-05-17 20:25:59 +02:00
6df8b09e84 Fix marching squares test crash in debug builds 2021-05-17 14:54:47 +02:00
e9aaea38eb Fix of safety_offset() after ClipperUtils refactoring.
Fixes Solid infill where there should be none #6482
Also the safety offsetting was revised to be enabled only where needed,
the "do safety offset" is now easy to discover by
a new ApplySafetyOffset::Yes enum, and safety offset over union, which
is better done by offset() / offset_ex() has been replaced with
new union_safety_offset() / union_safety_offset_ex() functions, which
better convey their meaning and which could be better optimized than
union() with the safety offset applied.
2021-05-05 12:16:47 +02:00
f191b4611d Further rework of ClipperUtils: Replaced many to_polygons() /
to_expolygons() calls with templated ClipperUtils variants to avoid
memory allocation and copying.
2021-05-03 11:39:53 +02:00
96a7a52715 Clipper optimization:
1) Removed the already commented-out scaling / unscaling when doing
   "safe offsetting"
2) Removed some of the "safe offsetting" at calls where it never was used.
3) Reworked Clipper & ClipperUtils to pass Polygons / ExPolygons / Surfaces
   as input parameters without conversion to ClipperLib::Paths. This
   should save a lot of memory allocation and copying.
4) Reworked conversions from ClipperLib::Paths & PolyTree to Polygons /
   ExPolygons to use the move operator to avoid many unnecessary allocations.
5) Reworked some "union with safe ofsetting" to "offset_ex", which should
   be cheaper.
2021-04-30 11:49:57 +02:00
c5c73f4257 Use new libnest backend for MinAreaBoundingBox wrapper 2021-04-21 17:21:43 +02:00
f3af547441 New custom backend for libnest2d using libslic3r types
Adapted to new clipper->eigen mod
2021-04-21 16:02:25 +02:00
6007f7ee49 Replacing ClipperLib::IntPoint with Eigen point as a first step to
make the ClipperLib paths and polygons compatible with Slic3r paths
and polygons without conversions and memory allocations.
2021-04-14 09:22:51 +02:00
27229c0b5f Small improvement to "least supports" method 2021-04-07 12:51:02 +02:00
6f04f1b1d9 Allow auto-rotation of objects not completely inside bed.
Don't use SLAPrintObject as the input for optimization. Use ModelObject and pass the print config to the optimization in RotoptimizeJob::prepare()
2021-04-07 12:51:02 +02:00
b0d2df95e4 Increase performance of "best misalignment" method 2021-04-07 12:51:02 +02:00
f21e0ae0ff Least supports optimization revived.
Fix missing include on Win32


Cleanup benchmarking code
2021-04-07 12:51:02 +02:00
97e7350911 Method selection implemented 2021-04-07 12:51:02 +02:00
c9b787af67 Unite cancel callback and status function 2021-04-07 12:51:02 +02:00
a8420ca83c Speed up rotation optimizer
- No float to double conversion
- Solving issue of random (very similar) results due to the parallel summation of floats
2021-04-07 12:51:02 +02:00
192269b2c7 Add new execution framework
Inspired by std::execution
2021-04-07 12:51:02 +02:00
44076d12db Reverting to old rotation optimizer object-function.
Keep the performance optimizations though
2021-04-07 12:51:02 +02:00
efe6426340 Fix unmarked failed holes on first gizmo opening 2021-03-16 09:31:03 +01:00
32c5acd5fd Drill holes one by one and display warning of any of them fails
Drill with cgal::minus for now
2021-03-16 09:31:03 +01:00
4baba84eb0 Exclude triangles of original interior mesh and drillholes from trimming 2021-03-08 17:38:10 +01:00
946cee7904 Add working version of triangle trimming for hollowed meshes 2021-03-08 17:38:10 +01:00
8af4e594de Add max_concurrency method for various execution policies 2021-03-08 17:38:10 +01:00
4352ec1929 Do grid redistance even with zero closing distance
This prevents having a leftover grid with zero at the exterior boundary. Trimming expects zero at (offset + closing distance) inwards
2021-03-08 17:38:10 +01:00
dfe9554da3 Use triangle removal only for visualized mesh 2021-03-08 17:38:10 +01:00
f827e15f81 Group hollowing result (including grid) into one struct 2021-03-08 17:38:10 +01:00
a38e6dcaf0 Add voxel scale to openvdb metadata.
To be able to retrieve that information from a generated grid alone.

To avoid the copying of input mesh (for scaling) when doing the hollowing

Also remove some unused stuff from OpenVDBUtils
2021-03-08 17:38:10 +01:00
abc5834923 Remove gcc warning about uninitialized values 2021-03-03 15:19:24 +01:00
26776faf70 Silencing compiler warning in AGGRaster on Visual Studio 2021-02-19 18:57:45 +01:00
4da8e5ef4c Remove warning from zero division.
By changing the initial value of pixel size to 1. from 0.
2021-02-11 11:26:25 +01:00
4e581807be Trying to fix the remaining OSX warnings 2021-02-10 19:07:09 +01:00
d62aace663 Reduction on compiler warnings, mainly on MSVC.
Fix of the new gap_fill_enable flag: Take it into account when comparing
regions.
2021-02-10 17:29:07 +01:00
c5b19648ec Clang: silence -Wdeprecated-declarations for now
RPi: hopefully silence a warning
2021-02-08 17:52:29 +01:00
f968cfd2d5 Fixing Clang warnings 3 2021-02-08 17:52:29 +01:00
301ac20fa1 Fixing Clang warnings 2 2021-02-08 17:52:29 +01:00
f7e26b5655 Fixing GCC warnings 2 2021-01-29 10:46:52 +01:00
0ce4f989de FIXME on ExPolygon::overlaps(), which should be commutative. 2021-01-22 15:32:45 +01:00
db97a97116 Fix of [2.3.0-alpha4] Crash - several models cause crash when slicing #5208
Fixed some issues in internal anchors of the Adaptive Cubic infill.
The ugly and dangerous implicit casting operators in Line, MultiPoint,
Polyline and Polygon were made explicit.
2020-11-24 16:01:08 +01:00
eabc09ca36 Cover various overhang types cumulatively 2020-10-16 11:14:57 +02:00
ef968100fd Use rotated bounding box to calculate eccentricity 2020-10-16 11:14:57 +02:00
57bd0f2a60 This broke the SLA support point generator test. Why? 2020-10-15 13:35:45 +02:00
377294d67f A little bit cheaper triangle random sampling + documentation. 2020-10-15 07:58:13 +02:00