Commit Graph

3433 Commits

Author SHA1 Message Date
Lukáš Hejl
216589fdb1 Get rid of unnecessary double storage of processed input polygons in the multi-material segmentation as ExPolygons and also as Polygons. All processed input polygons are now stored as ExPolygons. 2021-07-29 11:45:02 +02:00
Lukáš Hejl
38866b65b0 Get rid of unnecessary double calling of TriangleSelector::reset() in some cases when TriangleSelector::deserialize() is called. 2021-07-29 11:45:01 +02:00
Lukáš Hejl
2569da95d5 Parallelized the projection of painted regions in multi-material segmentation. 2021-07-29 11:45:01 +02:00
Lukáš Hejl
7a60f1793c Fixed a possible overflowing of a painted area to an unpainted area in multi-material segmentation.
It was reworked graph generation for multi-material segmentation. Now only oriented arcs in one direction are added to the graph for input polygons. This direction matches the direction of the lines in the input polygons.
2021-07-29 11:45:01 +02:00
Lukas Matena
a54f5fb41a Render statistics now shows actual SwapBuffers() calls per second 2021-07-28 12:50:01 +02:00
enricoturri1966
502906178f Merge branch 'master' of https://github.com/prusa3d/PrusaSlicer into et_sinking_contours 2021-07-27 09:04:52 +02:00
Vojtech Bubnik
eb6392dccd New slice_mesh() variant slicing with a single plane only, running
on a single thread only (not parallelized).
The new slice_mesh() is used to calculate contour of objects sunken
below the print bed.
2021-07-26 17:02:56 +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
YuSanka
e79bcee739 Fixed update of the default menu after changing of the mode.
+ Added check for the output directory for the G-code extport.
2021-07-26 14:41:38 +02:00
tamasmeszaros
ca67d880ec Fix issues with finding new deps on win 2021-07-26 13:07:20 +02:00
tamasmeszaros
7ed0d6b886 Fix broken hole drilling 2021-07-26 12:28:57 +02:00
enricoturri1966
8df2525355 Fixed conflicts after merge with master 2021-07-23 11:40:07 +02:00
Lukas Matena
d3b1b1f3d5 Fix of clipping plane for SLA supports,
probably broken since 1009f78
2021-07-23 11:32:36 +02:00
enricoturri1966
8ebb2e2a29 Fixed import of color print view from gcode files into GCodeViewer 2021-07-23 11:27:07 +02:00
enricoturri1966
c9aa88db0d Merge branch 'master' of https://github.com/prusa3d/PrusaSlicer into et_sinking_contours 2021-07-22 13:00:47 +02:00
enricoturri1966
15b8e68c59 Tech ENABLE_SEAMS_VISUALIZATION set as default 2021-07-22 12:58:33 +02:00
enricoturri1966
59606a0ef6 Tech ENABLE_START_GCODE_VISUALIZATION set as default 2021-07-22 12:32:08 +02:00
enricoturri1966
d5ad47d0ca Tech ENABLE_SCROLLABLE_LEGEND set as default 2021-07-22 12:18:38 +02:00
enricoturri1966
2dd7091cc3 Tech ENABLE_MODIFIED_DOWNSCALE_ON_LOAD_OBJECTS_TOO_BIG set as default 2021-07-22 11:55:08 +02:00
enricoturri1966
5c6810d0bc Fixed conflicts after merge with master 2021-07-22 11:46:00 +02:00
enricoturri1966
65b3be92fe Techs DISABLE_ALLOW_NEGATIVE_Z_FOR_SLA and ENABLE_ALLOW_NEGATIVE_Z set as default 2021-07-22 11:26:31 +02:00
enricoturri1966
81c78d0ecc Tech ENABLE_EXTENDED_M73_LINES set as default 2021-07-22 09:55:39 +02:00
enricoturri1966
7817105abe Tech ENABLE_GCODE_WINDOW set as default 2021-07-22 09:37:02 +02:00
enricoturri1966
5faac3c105 Tech ENABLE_VALIDATE_CUSTOM_GCODE set as default 2021-07-22 09:13:12 +02:00
enricoturri1966
b80fb40fcd Tech ENABLE_GCODE_LINES_ID_IN_H_SLIDER set as default 2021-07-22 08:35:21 +02:00
YuSanka
232309a879 Don't save shapes directory to the "last_dir" 2021-07-21 16:13:40 +02:00
enricoturri1966
2d8f35561a Merge branch 'master' of https://github.com/prusa3d/PrusaSlicer into et_sinking_contours 2021-07-21 15:35:41 +02:00
enricoturri1966
22f04ca46e Tech ENABLE_SINKING_CONTOURS -> 1st installment 2021-07-21 15:30:57 +02:00
Filip Sykala
b225fadfde Allow skip edge with only one triangle during simplification 2021-07-21 15:23:48 +02:00
enricoturri1966
9264b79be7 Tech ENABLE_RELOAD_FROM_DISK_FOR_3MF set as default 2021-07-21 14:10:05 +02:00
Filip Sykala
87a6c8cb73 Merge branch 'master' into fs_QuadricEdgeCollapse 2021-07-21 07:52:57 +02:00
YuSanka
097afc6598 Follow-up bf981ae049 : Small improvements 2021-07-20 15:22:52 +02:00
Filip Sykala
5ac2809426 Merge branch 'master' into fs_QuadricEdgeCollapse 2021-07-20 12:05:58 +02:00
enricoturri1966
c61785f775 Tech ENABLE_SEQUENTIAL_LIMITS set as default 2021-07-20 12:05:15 +02:00
YuSanka
bf981ae049 Temporary workaround for compatibility with older Slicer:
To the "physical_printer" added "preset_name" option as a duplicate of the "preset_names" but like one string.
Note: It will works just for printer preset names without ";" (see #5503)
2021-07-20 10:18:59 +02:00
enricoturri1966
7d3e176a58 GCodeViewer -> Fixed loading of machine limits data from config contained into gcode files 2021-07-20 09:38:35 +02:00
Filip Sykala
bc3da9973b Merge branch 'master' into fs_QuadricEdgeCollapse 2021-07-20 08:22:06 +02:00
Filip Sykala
25a4887075 QEC: When collapsing edge flip normal than check other edges in triangle
Quadric is calculated with double precission of normal
Fix calculation of normal for changed triangles
2021-07-19 15:46:41 +02:00
Lukáš Hejl
5405ab1986 Optimized seed fill and bucket fill selection to recompute selection only in case the cursor is pointing on a non-selected triangle. 2021-07-19 11:30:40 +02:00
Lukáš Hejl
5b67fafb75 Fixed a crash in the multi-material gizmo when bucket fill is selected. 2021-07-19 11:30:35 +02:00
Filip Sykala
c444ef81bd Fix status function 2021-07-19 10:12:19 +02:00
Filip Sykala
86a3fd00a5 Merge branch 'master' into fs_QuadricEdgeCollapse 2021-07-19 09:18:55 +02:00
enricoturri1966
bf7b554235 Disable reload from disk for built-in objects 2021-07-16 12:30:47 +02:00
Lukáš Hejl
51b94f4747 Added the bucket fill tool into the multi-material gizmo. Also, the multi-material gizmo was reworked to show only options applicable for a chosen painting tool. 2021-07-16 09:19:40 +02:00
Lukas Matena
8c23678fa0 Limited brim width to 200 mm (larger values make slicer hang or crash due to arithmetic overflow) 2021-07-15 09:55:25 +02:00
Lukas Matena
b5fea72618 Speed-up of painted seams 2021-07-15 09:49:36 +02:00
YuSanka
4257ffddde GalleryDialog: Changes the paths to the system and custom galleries 2021-07-14 17:41:37 +02:00
Lukas Matena
49ae885834 Correctly convert legacy bool 'draft_shield' to enum 2021-07-14 16:02:04 +02:00
Lukas Matena
b466f18326 Draft shield option is now an enum (Disabled/Limited/Enabled) 2021-07-14 16:02:04 +02:00
Lukas Matena
6eeedf2bc6 Skirt is now generated around brims, unless 'draft shield' is checked 2021-07-14 16:02:04 +02:00
Lukas Matena
63566a92b3 Merged psSkirt and psBrim 2021-07-14 16:02:04 +02:00
enricoturri1966
ef8ddacdfc Delayed rendering of transparent volumes 2021-07-14 13:20:57 +02:00
tamasmeszaros
782e220890 Fix crash when all the holes fail to drill 2021-07-13 16:02:58 +02:00
Vojtech Bubnik
47f265f77f Fixed R-Pi build 2021-07-13 14:08:44 +02:00
Vojtech Bubnik
106d9f7ca0 MMU segmentation: Implemented filtering of unprintable regions in
top/bottom propagation.
2021-07-13 14:00:21 +02:00
Vojtech Bubnik
28219142c5 Tracing MMU top / bottom segmentation open lines at "trace" level. 2021-07-13 11:19:20 +02:00
Vojtech Bubnik
19e3998bd0 Merge branch 'vb_mmu_top_bottom' 2021-07-13 11:08:52 +02:00
Vojtech Bubnik
25fa3eddf0 Fixed slab slicing for special cases (slicing plane intersects object
plane).
2021-07-13 11:06:59 +02:00
Filip Sykala
756d2694eb FIX: Mutable priority queue 2021-07-12 16:36:08 +02:00
Oleksandra Yushchenko
d6fdf2d5c2
Modifiers Gallery (#6703)
* Added GalleryDialog

* GalleryDialog improvements:
* Added DnD functionality
* Added "Delete custom shapes" function
2021-07-12 15:20:50 +02:00
Lukáš Hejl
569b7d7dab Removed unnecessary backward compatibility with old multi-material painted 3MF from the early stage of development. 2021-07-12 13:37:33 +02:00
Lukas Matena
dca6db8635 Added a missing locale switch needed for custom gcode validation when switching tabs 2021-07-12 09:38:32 +02:00
Filip Sykala
b2238834fb Merge branch 'master' into fs_QuadricEdgeCollapse 2021-07-09 13:40:58 +02:00
Vojtech Bubnik
5bbe76003e MutablePriorityQueue: Added is_trivially_copyable test for queue value
types, added [] accessors.
2021-07-09 13:25:41 +02:00
Vojtech Bubnik
e4fd6a828f 1) Fixed a significant bug in MutablePriorityQueue when setting
the indices allowing rescheduling of values in the middle of the queue.
2) Implemented a cache friendly variant - MutableSkipHeapPriorityQueue
   based on
   https://playfulprogramming.blogspot.com/2015/08/cache-optimizing-priority-queue.html
   https://github.com/rollbear/prio_queue/blob/master/prio_queue.hpp
2021-07-09 12:53:29 +02:00
Filip Sykala
2c0b89e4a7 FIX Simplify test 2021-07-09 10:31:05 +02:00
Filip Sykala
e26bffadd8 Add throw_on_cancel and statusfn into QEC 2021-07-09 09:09:52 +02:00
Filip Sykala
c00dca7810 Speed up QEC by move error directly into MutablePriorityQueue
Memory optimization: Change size_t to 32bit int
Lightweight Error structure for faster PriorityQueue
2021-07-08 18:08:27 +02:00
Filip Sykala
ed9152d004 Merge branch 'master' into fs_QuadricEdgeCollapse 2021-07-07 16:52:10 +02:00
Lukas Matena
3fa78b52b2 Slightly improved 'no first layer extrusions' error message 2021-07-02 17:05:31 +02:00
Lukas Matena
1d3b259c0a Fixed incorrect use of _NDEBUG instead of NDEBUG
Some debugging code was compiled even in release mode because of this
2021-06-30 11:59:16 +02:00
Lukas Matena
ffc0e36570 Fixed locales switching on macOS 2021-06-30 10:02:51 +02:00
Vojtech Bubnik
f02821a82d Renamed the "marlinfirmware" firmware flavor to "marlin2". 2021-06-29 17:55:26 +02:00
tamasmeszaros
7fce368cca Fix crash after SL1 import 2021-06-29 11:40:50 +02:00
David Kocik
b14345012d PrusaLink - cherrypick pick from stable branch
Added to config enums, visible in Physical Printer Dialog and class derived from Octoprint
2021-06-28 12:36:01 +02:00
Lukáš Hejl
cb93c8ce99 Used function smooth_outward in multi-material segmentation to get rid of artifacts arisen after merging multi-volume objects. 2021-06-28 08:09:06 +02:00
Lukáš Hejl
a426093f12 Replaced boost::rtree in multi-material segmentation with much faster ClosestPointInRadiusLookup. 2021-06-28 08:09:06 +02:00
Lukáš Hejl
ce738102c6 Optimized the projection of painted triangles in multi-material segmentation. Added heuristics to skip most of the expensive calculations in cases where it is certain that performing these calculations would be useless. 2021-06-28 08:09:06 +02:00
Vojtech Bubnik
211110ce53 Fixing some compiler warnings. 2021-06-27 17:45:41 +02:00
Vojtech Bubnik
e4e8c5df12 As an example of using the enum_bitmask infrastructure for type safe
sets of optional boolean parameters, the cut function "keep upper",
"keep lower" and "flip lower" boolean parameters were converted into
a single type safe enum_bitmask. Such a coding style is certainly
wordier than the original code, but much safer and more readable
than the error prone "boolean, boolean, boolean" function call
parameter list.
2021-06-27 17:36:25 +02:00
Vojtech Bubnik
0f3cabb5d9 Support for forward compatibility of configurations, user and system
config bundles, project files (3MFs, AMFs). When loading these files,
the caller may decide whether to substitute some of the configuration
values the current PrusaSlicer version does not understand with
some reasonable default value, and whether to report it. If substitution
is disabled, an exception is being thrown as before this commit.
If substitution is enabled, list of substitutions is returned by the
API to be presented to the user. This allows us to introduce for example
new firmware flavor key in PrusaSlicer 2.4 while letting PrusaSlicer
2.3.2 to fall back to some default and to report it to the user.

When slicing from command line, substutions are performed by default
and reported into the console, however substitutions may be either
disabled or made silent with the new "config-compatibility" command
line option.

Substitute enums and bools only.  Allow booleans to be parsed as
    true: "1", "enabled", "on" case insensitive
    false: "0", "disabled", "off" case insensitive
This will allow us in the future for example to switch the draft_shield
boolean to an enum with the following values: "disabled" / "enabled" / "limited".

Added "enum_bitmask.hpp" - support for type safe sets of options.
See for example PresetBundle::load_configbundle(...
LoadConfigBundleAttributes flags) for an example of intended usage.

WIP: GUI for reporting the list of config substitutions needs to be
implemented by @YuSanka.
2021-06-27 16:57:05 +02:00
Vojtech Bubnik
ad336e2cc0 Because of a crash in PrusaSlicer 2.3.0/2.3.1 when showing an update
notification with some locales, we don't want PrusaSlicer 2.3.0/2.3.1
to show this notification. On the other hand, we would like PrusaSlicer
2.3.2 to show an update notification of the upcoming PrusaSlicer 2.4.0.
Thus we will let PrusaSlicer 2.3.2 and couple of follow-up versions
to download the version number from an alternate file until
the PrusaSlicer 2.3.0/2.3.1 are phased out, then we will revert to
the original name.
2021-06-25 17:54:43 +02:00
Vojtech Bubnik
9b70efc46a Windows specific: Transactional saving of PrusaSlicer.ini to ensure
that configuration could be recovered in the case PrusaSlicer.ini
is corrupted during saving. The config is first written into a temp file
marked with a MD5 checksum. Once the file is saved, it is
copied to a backup file first, then moved to PrusaSlicer.ini.

When loading PrusaSlicer.ini fails, the backup file will be loaded
instead, however only if its MD5 checksum is valid.

The following "Fixes" comments are for github triggers. We implemented
a workaround, not a fix, we don't actually know how the data corruption
happens and why. Most likely the "Move file" Windows API is not atomic
and if PrusaSlicer crashes on another thread while moving the file,
PrusaSlicer.ini will only be partially saved, with the rest of the file
filled with nulls. We did not "fix" the issue, we just hope that our
workaround will help in majority of cases.

Fixes prusaslicer wont open 2.3 windows 10 #5812
Fixes Won't Open - Windows 10 #4915
Fixes PrusaSlicer Crashes upon opening with "'=' character not found in
line error" #2438
Fixes Fails to open on blank slic3r.ini %user%\AppData\Roaming\Slic3rPE
2021-06-25 16:44:06 +02:00
Vojtech Bubnik
204ae62449 Slight improvement in cost of background slicing cancellation. 2021-06-23 16:37:18 +02:00
Vojtech Bubnik
3a5a0575ef Fixed after removing TBB deprecated APIs 2021-06-23 15:24:05 +02:00
Filip Sykala
38c83844a2 Merge branch 'master' into fs_QuadricEdgeCollapse 2021-06-23 13:59:03 +02:00
Filip Sykala
f8d759ad64 Assert check of new vertex can't be used general on All models(depends on scale)
Fix variable name in compare function
Remove second triangle from  MPQ
2021-06-23 12:16: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
Filip Sykala
1196fac551 Parallel QEC initialization 2021-06-23 09:50:27 +02:00
tamasmeszaros
2096a6dbbf Fix error reporting when cgal mesh boolean crashes.
Change error report when catching SEH on cgal mesh boolean.
2021-06-22 18:13:35 +02:00
tamasmeszaros
49c6ce76d0 Search for suitable rotation when arranging items larger than the bed 2021-06-22 11:23:32 +02:00
Filip Sykala
892c246700 Fix Linux warnings
../src/libslic3r/QuadricEdgeCollapse.cpp:110:39: warning: suggest parentheses around '&&' within '||' [-Wparentheses]
../src/libslic3r/QuadricEdgeCollapse.cpp:394:38: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
../src/libslic3r/QuadricEdgeCollapse.cpp:395:38: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
../src/libslic3r/QuadricEdgeCollapse.cpp:514:26: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
../src/libslic3r/QuadricEdgeCollapse.cpp:514:42: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
2021-06-22 10:01:14 +02:00
Vojtech Bubnik
c0715866ff Win32 specific: SEH handler on background thread. Catches Windows
structured exceptions (hard crashes, segmentation faults...),
converts them to Slic3r::HardCrash exceptions and displays the exception
using the usual PrusaSlicer way.
The SEH handler is installed on the main background slicing thread
as of now, therefore hard crashes in TBB worker threads are not handled.
2021-06-22 09:54:08 +02:00
Filip Sykala
7c13cfa1d9 Add test checking diference in volume before/after simplification
FIX warnings
..\src\libslic3r\QuadricEdgeCollapse.cpp(173): warning C4056: overflow in floating-point constant arithmetic
..\src\libslic3r\QuadricEdgeCollapse.cpp(232): warning C4056: overflow in floating-point constant arithmetic
2021-06-22 09:41:38 +02:00
Filip Sykala
e3cdeda673 Add quadric edge collapse 2021-06-22 09:21:16 +02:00
Vojtech Bubnik
d291bb397b Fixed compiler warnings 2021-06-20 16:39:10 +02:00
Vojtech Bubnik
0d70a2be69 Renamed create_face_neighbors_index() to its_face_edge_ids().
Renamed its_create_neighbors_index() / its_create_neighbors_index_par() to its_face_neighbors() / its_face_neighbors_par().
New variant of its_face_edge_ids() to create edge IDs from face neighbors.
Fixed some incorrect use of _NDEBUG, it should be NDEBUG.
PrintObject::slice_support_volumes() returns newly Polygons, which are cheaper than ExPolygons.
Updated SeamPlacer and SupportMaterial to use regions defined as Polygons, not ExPolygons.
TriangleSelector::get_facets_strict() returning a patch with T-joints retriangulated.
New slice_mesh_slabs() - slicing projections of a triangle patch into top / bottom layers of slices, for MMU top / bottom segmentation.
TriangleMeshSlicer - use 64 mutexes instead of one when scattering sliced triangles into layers. This makes a big difference on modern many core desktop computers.
When applying MM segmented regions to input regions, the split regions are now re-merged with 10x higher positive offset epsilon to avoid creating gaps.
When testing for existence of paint-on supports or seam, use a more efficient has_facets() test, which does not deserialize into the expensive TriangleSelector tree structure.
GLIndexedVertexArray newly uses Eigen::AlignedBox<float, 3> for efficiency instead of our double based BoundingBoxf3.
Improved MMU painting refresh speed by optimizing generation of the vertex buffers.
Refactored MMU segmentation - projection of painted surfaces from top / bottom.
	1) Parallelized.
	2) Using the new slice_mesh_slabs() instead of projecting one triangle by the other and merging them with Clipper.
2021-06-20 15:21:12 +02:00
Oleksandra Yushchenko
fd071421cb
DarkMode for MSW (#6632)
* MSW specific: Dark Mode: First implementation

* Use menu instead of NoteBook

* Implemented MessageDialog
+ Fixed DarkMode for all dialogs and ColorPicker

* MSW DarkMode: Added missed updates for the switching between modes

* MSW DarkMode: Updated all existed context menus after switching of the mode
+ Added markers for the menu item witch is related to the selected tab

* Used wxFrame instead of wxDialog for SettingsDialog
(this change allow us to use menu bar in SettingsDialog)

+ fix for #6548 - Prusa Slicer 2.3.1 not activating non-modal settings window if settings window is minimized

* Implemented "Always use Dark mode colors" preference option

* Fixes for non_MSW build

* Next fixes for non-MSW builds

* Preferences: Fixed selection of the Settings Layout for non-MSW platforms
+ Updated DarkMode for colorpickers

* Windows DarkMode next fixes

* MSWDarkMode: Suppress to use system color to the PrusaSlicer
Select "Preferences -> Use Dark color mode (experimental)" to allow dark mode for the application

* Fixed MSW build

* MSWDarkMode: Upadteed color mode for ExtruderSequenceDialog and for dialogs related to the DoubleSlider

* Implemented Auto recreation of the PrusaSlicer when color mode is changed.

* Preferences: Added option "Set settings tabs as menu items (experimental)"
2021-06-18 19:46:04 +02:00
tamasmeszaros
d3de14170a Fix build for unixes 2021-06-17 22:21:34 +02:00
Lukáš Hejl
684b66125e Fixed an issue where multi-material segmentation ignored the last extruder. 2021-06-17 19:26:40 +02:00