Commit Graph

428 Commits

Author SHA1 Message Date
tamasmeszaros
11b994a702 Rotfinder fixes wip 2021-08-16 11:29:22 +02:00
tamasmeszaros
27b1174558 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
Roman Beránek
e13535f822
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
tamasmeszaros
8fdb0fddc0 Get rid of Contour3D 2021-06-08 10:28:23 +02:00
tamasmeszaros
e6f97358bc Refactored hollowing backend to use indexed_triangle_mesh 2021-06-08 10:28:23 +02:00
tamasmeszaros
f12187b53d wip on hollowing refactor 2021-06-08 10:27:35 +02:00
tamasmeszaros
1009f78862 SLA backend refactored, except Hollowing 2021-06-08 10:27:35 +02:00
Lukáš Hejl
7f29647d67 Added missing includes (GCC 11.1) 2021-05-29 19:55:20 +02:00
Vojtech Bubnik
70b4915f9c TriangleMeshSlicer: Got rid of admesh! 2021-05-18 15:05:30 +02:00
Vojtech Bubnik
308d6b7809 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
tamasmeszaros
68d2427a34 Fix marching squares test crash in debug builds 2021-05-17 14:54:47 +02:00
Vojtech Bubnik
7d4b3f2992 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
Vojtech Bubnik
09a80d954c 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
Vojtech Bubnik
9fbba855ef 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
tamasmeszaros
a15c16d40d Use new libnest backend for MinAreaBoundingBox wrapper 2021-04-21 17:21:43 +02:00
tamasmeszaros
ad19ab219d New custom backend for libnest2d using libslic3r types
Adapted to new clipper->eigen mod
2021-04-21 16:02:25 +02:00
Vojtech Bubnik
7112ac61b6 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
tamasmeszaros
bed3321324 Small improvement to "least supports" method 2021-04-07 12:51:02 +02:00
tamasmeszaros
773116b777 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
tamasmeszaros
5443f77489 Increase performance of "best misalignment" method 2021-04-07 12:51:02 +02:00
tamasmeszaros
f3e3aabec7 Least supports optimization revived.
Fix missing include on Win32


Cleanup benchmarking code
2021-04-07 12:51:02 +02:00
tamasmeszaros
0194094afa Method selection implemented 2021-04-07 12:51:02 +02:00
tamasmeszaros
46fd722f3c Unite cancel callback and status function 2021-04-07 12:51:02 +02:00
tamasmeszaros
de8bb00fa9 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
tamasmeszaros
7760d3fbc4 Add new execution framework
Inspired by std::execution
2021-04-07 12:51:02 +02:00
tamasmeszaros
4293a68aaa Reverting to old rotation optimizer object-function.
Keep the performance optimizations though
2021-04-07 12:51:02 +02:00
tamasmeszaros
6d58546aef Fix unmarked failed holes on first gizmo opening 2021-03-16 09:31:03 +01:00
tamasmeszaros
4b9de0398f 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
tamasmeszaros
a62262666a Exclude triangles of original interior mesh and drillholes from trimming 2021-03-08 17:38:10 +01:00
tamasmeszaros
1ec154012e Add working version of triangle trimming for hollowed meshes 2021-03-08 17:38:10 +01:00
tamasmeszaros
b8c1c13666 Add max_concurrency method for various execution policies 2021-03-08 17:38:10 +01:00
tamasmeszaros
e3c2e513fa 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
tamasmeszaros
527e675294 Use triangle removal only for visualized mesh 2021-03-08 17:38:10 +01:00
tamasmeszaros
82954ba715 Group hollowing result (including grid) into one struct 2021-03-08 17:38:10 +01:00
tamasmeszaros
e57eca0289 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
tamasmeszaros
a7255235e5 Remove gcc warning about uninitialized values 2021-03-03 15:19:24 +01:00
Vojtech Bubnik
cceaae84fb Silencing compiler warning in AGGRaster on Visual Studio 2021-02-19 18:57:45 +01:00
tamasmeszaros
bf9f908685 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
Vojtech Bubnik
8049dd1f72 Trying to fix the remaining OSX warnings 2021-02-10 19:07:09 +01:00
Vojtech Bubnik
db2d78ff21 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
Lukas Matena
a7728634f0 Clang: silence -Wdeprecated-declarations for now
RPi: hopefully silence a warning
2021-02-08 17:52:29 +01:00
Lukas Matena
1834ebe981 Fixing Clang warnings 3 2021-02-08 17:52:29 +01:00
Lukas Matena
b85de89751 Fixing Clang warnings 2 2021-02-08 17:52:29 +01:00
Lukas Matena
2d32c80b75 Fixing GCC warnings 2 2021-01-29 10:46:52 +01:00
Vojtech Bubnik
eef800b5c4 FIXME on ExPolygon::overlaps(), which should be commutative. 2021-01-22 15:32:45 +01:00
Vojtech Bubnik
62bdc192d8 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
tamasmeszaros
edb8b9f46d Cover various overhang types cumulatively 2020-10-16 11:14:57 +02:00
tamasmeszaros
fb1f3589ed Use rotated bounding box to calculate eccentricity 2020-10-16 11:14:57 +02:00
Vojtech Bubnik
90ddffa83c This broke the SLA support point generator test. Why? 2020-10-15 13:35:45 +02:00
Vojtech Bubnik
19a115260a A little bit cheaper triangle random sampling + documentation. 2020-10-15 07:58:13 +02:00
Lukas Matena
b178d0af38 Wipe tower - small refactoring and fix
Collection of data from internal wipe tower gcode generator now uses move semantics.
Part of gcode at the end of priming was erroneously not exported (extruder current reset etc.)
2020-09-25 12:35:20 +02:00
tamasmeszaros
20bd7b99f9 Significant performance improvements for elevated and non-elevated case
Apply bruteforce for elevated models
2020-09-10 19:35:45 +02:00
tamasmeszaros
d527122046 Performance optimizations and bugfix 2020-09-10 14:03:30 +02:00
tamasmeszaros
3b7ea5587e Fix build on win 2020-09-10 14:03:30 +02:00
tamasmeszaros
0d4c67b9a3 Mostly working, inefficiencies remain, status indication partly broken 2020-09-10 14:03:30 +02:00
tamasmeszaros
b4b9af4100 cosmethics
Comments and cosmethics
2020-09-10 14:03:30 +02:00
tamasmeszaros
c10ff4f503 fixing optimizer and concurrency::reduce 2020-09-10 14:03:30 +02:00
tamasmeszaros
c193d7c930 Brute force optimization code, buggy yet
wip


wip


wip refactor
2020-09-10 14:03:30 +02:00
tamasmeszaros
b4e30cc8ad rotation finder experiments
wip
2020-09-10 14:03:30 +02:00
tamasmeszaros
50836914fc Calibration changes to address new algorithm behavior. 2020-09-10 13:37:58 +02:00
tamasmeszaros
26d5c30366 Improvements to support point generator
- Separate the 3 bands -- dangling, sloping and full overhanging -- regions and handle them with different support force deficits.

- Use a heuristic for overhanging edges to increase the number of support points generated for them


- Try to make overhangs and slopes deficit depend on stable area.
2020-09-10 13:19:17 +02:00
tamasmeszaros
19e1d877aa Don't use sla::EncodedRaster in SLAImport, revive opencsg sandbox 2020-08-27 23:14:42 +02:00
Lukas Matena
a95509ce36 Changed internal coordinates of drain holes
Drain holes reference position was saved slightly above the mesh to avoid problem when the hole is placed on flat or nearly flat surface
The depth of the hole was internally bigger than what the user has set to compensato for it
However, this leads to problem with scaling and makes reprojection of the holes on the mesh complicated

This commit changes the reference point to the point on the mesh and the extra elevation is handled when rendering and drilling the hole.
The change is reflected in 3MF drain holes versioning so that old 3MFs are loaded correctly.
Reprojection on the mesh after reload from disk/fix through netfabb has been enabled.
2020-08-24 08:11:12 +02:00
tamasmeszaros
4ef52af906 Add dedicated tests for support point generation 2020-08-18 11:41:14 +02:00
tamasmeszaros
7158690ddd Fix build on win and rpi 2020-08-13 15:09:22 +02:00
tamasmeszaros
1003c32f76 Merge branch 'tm_minor_refactor' 2020-08-13 14:36:47 +02:00
tamasmeszaros
929cea59f3 replace ccr_::enumerate with flexible for_each
enumerate is unusual and would only work effectively with random access iterators

this for_each takes advantage of tbb blocked_range
replace ccr_::enumerate with flexible for_each

enumerate is unusual and would only work effectively with random access iterators

this for_each takes advantage of tbb blocked_range
2020-08-13 14:35:14 +02:00
tamasmeszaros
f3c0bf46d4 finish optimizer interface and remove commented code 2020-08-03 19:06:57 +02:00
tamasmeszaros
927b81ea97 Working small-to-normal support merging
Fixed fatal bug with anchors for mini supports

Make the optimization cleaner in support generatior

Much better widening behaviour

Add an optimizer interface and the NLopt implementation into libslic3r

New optimizer based only on nlopt C interfase
Fix build and tests
2020-08-03 19:05:30 +02:00
tamasmeszaros
8cb115a035 Add possible manipulation of small support diameter. 2020-08-03 19:05:30 +02:00
tamasmeszaros
7c655b5d7e Fix junction made below ground level. 2020-08-03 19:05:30 +02:00
tamasmeszaros
1eec6c473c Rename EigenMesh3D to IndexedMesh and SupportConfig to SupportTreeConfig 2020-08-03 19:05:30 +02:00
tamasmeszaros
645fbed88b Make compile time support tree conf params constexpr 2020-08-03 19:05:30 +02:00
tamasmeszaros
f19b3a2344 Id-s put in a base class for support tree primitives 2020-08-03 19:05:30 +02:00
tamasmeszaros
301a168b89 Fix bugs and non working tests
Fix failing tests


Try to fix build on windows


Try to fix failng tests on Mac
2020-08-03 19:05:30 +02:00
tamasmeszaros
184f64f828 Separate support tree routing and meshing, remove Common.hpp/.cpp .
* Remove Common.hpp and Common.cpp, move things into their respective modules in sla.
2020-08-03 19:05:30 +02:00
tamasmeszaros
2ff04e6f68 Bugfixes for support generator
* Fix support heads floating in air
* Fix failing tests for the bridge mesh intersection
* Fix failing assertions
WIP refactoring support tree gen, as its a mess.
2020-08-03 19:05:30 +02:00
tamasmeszaros
ed460a3e7e Remove the headless step of support support tree gen 2020-08-03 19:05:30 +02:00
tamasmeszaros
7b6565abeb Improvements on mini pillars 2020-08-03 19:05:30 +02:00
tamasmeszaros
0622322146 Create smaller supports in problematic areas with established strategies
Completely remove the concept of CompactBridge.

Replace it with Heads having the same back radius as front radius. 

Try to apply the same rules for mini supports as in the route_to_model step.

Increased accuracy of bridge_mesh_intersect shot from support points


Refining mini support integration
2020-08-03 19:05:30 +02:00
tamasmeszaros
38239f09e3 Fix remove_bottom_points function 2020-08-03 19:03:02 +02:00
tamasmeszaros
f53289ae2d Fix support and hole point reprojection after reload and netfabb 2020-06-10 14:16:11 +02:00
tamasmeszaros
10c59b0d00 Fix the tests after EigenMesh3D refactor 2020-06-02 17:15:08 +02:00
Lukas Matena
3ced59d2a3 Reenabled SLIC3R_HOLE_RAYCASTER before unit tests are updated properly
There are still tests of removing holes on slices and raycasting on unaltered mesh (which was eventually superseded by CGAL boolean operations)
2020-05-27 10:05:54 +02:00
Lukas Matena
55395e046f EigenMesh3D does not store a copy of the mesh
Instead, it stores a pointer to extern TriangleMesh (which must not be destroyed before the EigenMesh3D object)
2020-05-27 00:51:11 +02:00
Lukas Matena
1f833921a2 More code cleaning,...
optimizations regarding normals calculation
removed unused EigenMesh3D(const Contour3D &other) constructor
removed unused class si_result
2020-05-27 00:51:11 +02:00
Lukas Matena
d85fa8e9ab EigenMesh3D now stores TriangleMesh inside, not a mesh in Eigen format
Rotfinder was apparently building the AABB tree needlessly
2020-05-27 00:51:11 +02:00
Lukas Matena
9224a6a3e6 Removed some unused code
- removed define USE_AABB_INDIRECT (which switched between old and new AABB implementation)
- removed define SLIC3R_SLA_NEEDS_WINDTREE (relied on igl and was not used anyway)
- new define SLIC3R_HOLE_RAYCASTER (hides currently unused code)
- slight include cleanup
- removed obsolete source file SupportTreeIGL.cpp
2020-05-27 00:51:11 +02:00
Lukas Matena
cdf80c3b3f Switched to new AABB tree implementation for raycasting 2020-05-27 00:13:38 +02:00
Lukas Matena
02838eaa30 Slight include cleanup 2020-05-26 13:45:36 +02:00
tamasmeszaros
f91c27b2ff Do reprojection also after netfabb repair 2020-05-13 14:53:20 +02:00
tamasmeszaros
f7a43f9757 Reproject support and hole points after a reload from disk op. 2020-05-13 14:53:20 +02:00
tamasmeszaros
4fe99c7569 Fix missing support mini sticks 2020-05-11 14:07:21 +02:00
tamasmeszaros
217477a9ff SLA archive import with miniz, marching square bugfixes
Fix compilation on Windows


Fix array subscript out of range error in MarchingSquares


Fix normals of mesh constructed from slices


Improve performance of mesh construction from slices
2020-04-23 19:12:07 +02:00
tamasmeszaros
247fca6d55 Initial version of sl1 import with sla::Raster refactor. 2020-04-23 19:05:32 +02:00
Lukas Matena
a380053a17 Merge branch 'lm_gizmos' into lm_fdm_supports_gizmo 2020-04-07 17:16:48 +02:00
bubnikv
c27297f6cc 64bit coord_t
Vec3i as a vertex index to TriangleMesh constructor
2020-03-25 14:35:41 +01:00
Lukas Matena
08daddb5de WIP: First working implementation of the triangle selector for the FDM support gizmo 2020-03-19 11:15:17 +01:00
Lukas Matena
6918f11100 Removed SLA unused code
Mostly the dead-ends that were tried when hollowing was being implemented
2020-03-03 15:53:26 +01:00
tamasmeszaros
e3a583292a Promote max_bridges_on_pillar to be a runtime parameter.
This way the user greater control over support tree branching and the amount of pillars created.
2020-03-02 12:43:00 +01:00