Commit Graph

291 Commits

Author SHA1 Message Date
Vojtech Bubnik
8a2a9dba2f Eradicated admesh from TriangleMesh:
TriangleMesh newly only holds indexed_triangle_set and
TriangleMeshStats. TriangleMeshStats contains an excerpt of stl_stats.
TriangleMeshStats are updated when initializing with indexed_triangle_set.

Admesh triangle mesh fixing is newly only used when loading an STL.
AMF / 3MF / OBJ file formats are already indexed triangle sets, thus
they are no more converted to admesh stl_file format, nor fixed
through admesh repair machinery. When importing AMF / 3MF / OBJ files,
volume is calculated and if negative, all faces are flipped. Also
a bounding box and number of open edges is calculated.

Implemented its_number_of_patches(), its_num_open_edges()
Optimized its_split(), its_is_splittable() using a visitor pattern.

Reworked QHull integration into TriangleMesh:
    1) Face normals were not right.
    2) Indexed triangle set is newly emitted instead of duplicating
       vertices for each face.

Fixed cut_mesh(): Orient the triangulated faces correctly.
2021-09-20 17:12:22 +02:00
Vojtech Bubnik
f9a5ee725d Follow-up to ae7d6db1d9
Exporting G-code on a worker thread did not work correctly as the worker
threads were using user's locale, not "C" locale.
The "C" locale is newly enforced to TBB worker threads by
name_tbb_thread_pool_threads_set_locale()
2021-09-13 13:04:12 +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
e6f97358bc Refactored hollowing backend to use indexed_triangle_mesh 2021-06-08 10:28:23 +02:00
tamasmeszaros
1009f78862 SLA backend refactored, except Hollowing 2021-06-08 10:27:35 +02:00
Vojtech Bubnik
20ba7c0a1f New parameter "Slicing Mode" for supporting 3DLabPrint airplane models.
S3D's strategy for merging self intersecting models is "Even / Odd"
which PrusaSlicer now supports as an alternative to "Positive" rule.
Also added a "Close Holes" option to fill in all internal structures.
3D-Labprint Models aren't sliceable (till years) #3062 #3708
2021-06-01 11:10:12 +02:00
tamasmeszaros
d48ca7fd03 Fix incorrect mesh shown on plater after hollowing 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
Lukas Matena
abd5a9a46e Add a notification when custom support enforcers are not used due to supports being off
It is now emitted from Print::validate and has a hyperlink to enable supports
2021-03-04 09:35:22 +01:00
Vojtech Bubnik
e42e25c933 1) Storing the physical_printer_settings_id into the 3MF, AMF, GCode.
2) Activating the physical_printer_settings_id when loading from 3MF, AMF, GCode.
   The physical printer is only activated if it references the printer_settings_id
   loaded from the same file.
3) When loading the presets from 3MF, AMF, GCode, the "external" profiles
   are no more created for profiles which differ from the local profiles
   the loaded profiles reference. Instead, the referenced profile is activated
   and modified with the loaded preset. If the referenced profile does not
   exist, but the profile refers to a system profile with the "inherits"
   fileds, the system profile is loaded and modified instead.
   This works for all profiles with the exception of multi-extruder
   printer with multiple filament profiles modified. In that case
   the first modified filament profile will be loaded as modified,
   while the other modified profiles will be loaded as "external".

This should fix
Physical printer + 3mf file, wrong preset used to generate gcode #5178
and possibly
https://github.com/prusa3d/PrusaSlicer/issues/5272
2020-12-04 10:48:51 +01:00
Vojtech Bubnik
6531061d09 Support for naming slicer own threads for debugging.
The following threads are named with this commit:
slic3r_main, slic3r_BackgroundSlicingProcess,
slic3r_tbbpool_xx_yy where xx is a one based index of the TTB thread
and yy is the platform thread ID.
2020-10-22 13:54:15 +02:00
Vojtech Bubnik
447f4b8303 Polishing of NotificationManager:
Fixed pairing of PrintObjects with slicing warning notifications.
Removed or commented out dead code.
Added documentation.
2020-10-14 16:49:06 +02:00
Vojtech Bubnik
7a799be426 DynamicPrintConfig::normalize() renamed to normalize_fdm(),
optimization of Print::apply()
2020-09-24 19:03:33 +02:00
Vojtech Bubnik
54976e29bb New class ModelConfig wrapping DynamicPrintConfig and a timestamp
to help with detecting "not changed" event when taking
Undo/Redo snapshot or synchronizing with the back-end.

Converted layer height profile and supports / seam painted areas
to the same timestamp controlled structure.
2020-09-24 15:34:13 +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
8cb115a035 Add possible manipulation of small support diameter. 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
247fca6d55 Initial version of sl1 import with sla::Raster refactor. 2020-04-23 19:05:32 +02: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
tamasmeszaros
6deb6a776d Do EFC for the first faded layers of SLA, interpolate efc parameters
Compensated slices have negative orientation...


Move efc to common params


Fix elefant foot compensation reversed contours


Remove redundant assertions and don't apply absolute correction if zero
2020-02-18 17:39:36 +01:00
tamasmeszaros
41d77b492c Added new parameter elefant_foot_min_width 2020-02-14 09:21:00 +01:00
tamasmeszaros
96d5c8c35d Add elephant foot compensation to SLA print
Work in progress


Convert efc input to the right scaling


Apply EFC on the slice index to make it visible in the preview.
2020-02-14 09:21:00 +01:00
tamasmeszaros
25e303493e Revert c55173eb as it breaks features.
Output file name is not picked up in the SLA export file dialog.
2020-02-12 18:25:18 +01:00
Enrico Turri
c55173eba4 Follow-up of 00ecafe3d5 -> Fix of #3650 moved into 'SLAPrint::output_filename()' as the previous fix was breaking the export from GUI 2020-02-12 15:39:04 +01:00
Lukas Matena
227cc4dc33 Fixed conflicts after merge
slaposHollowing was divided into slaposHollowing and slaposDrillHoles on master
This commit takes this into account on the code that was merged from lm_drilling_backend_rebased
2020-02-03 15:42:54 +01:00
Lukas Matena
a1d4dab999 Merge branch 'master' into lm_drilling_backend_rebased 2020-02-03 15:20:16 +01:00
tamasmeszaros
36e92b0141 Put hole drilling into separate step 2020-01-31 08:58:21 +01:00
bubnikv
9ef65b23d8 Implemented loading of hollowed SLA mesh into the scene
in place of the normal mesh.

WIP: The code is inefficient (it does not store the timestamp
of the hollowed mesh, therefore it refreshes the hollowed mesh on each
scene update) and if the hollowing gets invalidated, the original mesh
is currently not being reloaded and the hollowed mesh is still visible.
2020-01-30 17:58:49 +01:00
Lukas Matena
5ae2f8a467 Function sla_trafo made accessible from outside SLAPrint.cpp unit 2020-01-29 10:07:10 +01:00
tamasmeszaros
7591637c89 Bugfixes and refactoring for SLA backend
remove duplicate code


Mark conversion constructors of EigenMesh3D `explicit`


Working on mesh simplification for hollowed interior


Fix bug SPE-1074: crash with empty supports and disabled pad.


fix regression after refactor


Remove unfinished code


Fix missing includes and dumb comments
2020-01-24 14:26:19 +01:00
Lukas Matena
1c0aedbbe5 Hollowing gizmo can now trigger the backend calculation 2020-01-24 10:53:40 +01:00
Lukas Matena
d58ee47e4d Fixed incorrect hole normal transformation when the object is anisotropically scaled 2020-01-24 10:53:40 +01:00
tamasmeszaros
a3a99d7a07 Do not translate the normal of drainhole points. 2020-01-08 10:49:54 +01:00
tamasmeszaros
f874b61881 Transform the position AND the normals of drainhole points 2020-01-08 10:10:24 +01:00
Lukas Matena
c6e112a060 Merge branch 'lm_tm_hollowing' into lm_hollow_gizmo 2019-11-22 12:04:54 +01:00
Lukas Matena
9dd18a8d6d Started work on extending EigenMesh3D to account for possible drain holes when raycasting 2019-11-19 11:33:49 +01:00
tamasmeszaros
7011c58faa Merge branch 'master' into lm_tm_hollowing 2019-11-18 17:50:56 +01:00
tamasmeszaros
d4d037792d Holes are now visible on slices in preview. 2019-11-13 15:55:37 +01:00
tamasmeszaros
4e067c42f0 SLAPrint steps moved to separate module.
* Lambdas replaced with class methods
2019-11-12 16:54:59 +01:00
tamasmeszaros
c22423a219 Merge branch 'tm_openvdb_integration' into lm_tm_hollowing
* Refactor file names in SLA dir
2019-11-11 12:55:22 +01:00
YuSanka
49175c3112 Merge remote-tracking branch 'origin/master' into ys_resin_cost 2019-11-08 19:33:18 +01:00
tamasmeszaros
ac8eab5fa8 Enhanced hollowing scheme, closing distance working as expected. 2019-11-08 16:51:43 +01:00
tamasmeszaros
4b08865809 hollowing params renamed, filtering generalized 2019-11-08 09:21:30 +01:00
tamasmeszaros
bc3d22348a Hollowing params: accuracy and smoothness 2019-11-07 09:34:34 +01:00
tamasmeszaros
a82f1268f3 Hollowed interior is now visible in preview 2019-11-06 14:26:15 +01:00
tamasmeszaros
bdf6f7342e Hollowing step in SLAPrint process, PrintConfig params added. 2019-11-06 13:38:43 +01:00
tamasmeszaros
07fb9f6559 Add oversampling and gaussian filter to hollowing.
* Additional steps hollowing and drilling in SPAPrint
* Remove SLABoilerPlate.hpp as it was empty.
2019-11-05 14:48:00 +01:00
Enrico Turri
296d79abf7 ENABLE_THUMBNAIL_GENERATOR -> Fixed thumbnail generation for SLA and 3mf 2019-10-24 15:56:10 +02:00
tamasmeszaros
be7428d66e sla::Raster interface clarified and covered with tests.
Also renamed sla::SupportTreeAlgorithm to SupportTreeBuildsteps.
2019-10-01 14:58:37 +02:00
tamasmeszaros
705e82ec8e Deeper test coverage for support tree generation.
Restructuring for testability.
2019-10-01 14:58:37 +02:00