Commit Graph

3489 Commits

Author SHA1 Message Date
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
tamasmeszaros
976dd72b8b Catching of sigsegv and sigfpe with structured exceptions on win 2021-06-17 15:17:21 +02:00
tamasmeszaros
a5529aff1e Implement custom integer->string conversion for hashing
Converts to hexadecimal, reversed order which is faster.
2021-06-17 15:40:22 +02:00
Vojtech Bubnik
d0411223be TriangleSelector:
1) Fixing yesterday's regression in deserialization of older painted 3MFs
   (order of triangle children is now reversed, thus the serialization
    / deserialization has to take it into account).
2) WIP extraction into facets to triangulate T-joints.
2021-06-16 10:52:00 +02:00
Lukáš Hejl
6ddd88e596 Fixed an issue where the color of the first extruder always replaced the default color after painting in a multi-material gizmo.
multi_material_segmentation_by_painting is now returning only the painted region. Regions with default colors that aren't painted by multi-material gizmo aren't returned.
2021-06-16 06:06:37 +02:00
Lukáš Hejl
c59cf5de40 Fixed layers with the wrong color after multi-material segmentation on objects with multiple objects. 2021-06-16 06:06:34 +02:00
Lukáš Hejl
21b38db488 Added using the move operator in some parts of multi-material segmentation. 2021-06-16 06:06:34 +02:00
Lukáš Hejl
a06e42d01f Moved debug prints out of parallel cycles, and more debug prints were added for multi-material segmentation. 2021-06-16 06:06:34 +02:00
Lukáš Hejl
8a77fa38f0 Modified MMU painting gizmo behavior so that all triangles aren't painted by default by the first extruder, which was causing several problems.
This commit also fixed the following issues:
1) After loading a 3MF with painted triangles using the MMU painting gizmo, the painted triangles might not be displayed correctly in the MMU painting gizmo.
2) The MMU segmentation was unnecessarily executed for all layers and not just for the painted layers.
3) Object's base color wasn't changed when the assigned extruder for that object was changed while the MMU paint gizmo was opened.
4) Changing the base color of an object was only possible by removing all painted triangles.
2021-06-16 06:06:34 +02:00
Vojtech Bubnik
154e552006 TriangleSelector optimizations:
1) When splitting a triangle, vertices are now properly shared with
   the neighbor triangles, if these are already split.
   Please note that the splitting may not be regular if the splitting
   thershold is changed between splitting calls. Still the new code
   shares the vertices accross shared edges properly.
2) Triangles resp. vertices are newly reused after deleted using
   linked lists of released triangles resp. vertices.
   This mechanism replaces the old mechanism of reusing already split
   triangles.
2021-06-15 14:43:46 +02:00
enricoturri1966
a2788f3a73 GCode Viewer -> Fixed used filament for gcode files produced by other slicers 2021-06-15 09:39:33 +02:00
Vojtech Bubnik
2f8190e6d0 Workaround of boost::filesystem::copy_file() incompatibility
on some file systems (eCrypt ...)
Should fix #4716 #6588
2021-06-14 12:19:13 +02:00
Lukáš Hejl
bfd83f925d Fixed build on MacOS.
Based on information in https://stackoverflow.com/a/46115028, structured bindings in C++17 don't name variables, and because of that, it is impossible to capture these variables in lambda functions.
2021-06-13 16:22:44 +02:00
Vojtech Bubnik
e17b57d6bd Fixing previous TriangleSelector refactoring. 2021-06-11 17:59:33 +02:00
Vojtech Bubnik
403bb926c8 Fixed regression bug after PrintRegions refactoring:
Fixed crash if an object is outside the print bed, its modifier inside
the print bed and the modifier gets deleted.
2021-06-11 17:29:16 +02:00
Vojtech Bubnik
6bade1b24a TriangleSelector - some memory optimization.
Don't store traingle normal, but reference the source triangle,
which stores its normal.
2021-06-11 12:27:58 +02:00
Vojtech Bubnik
74ab3e108e TriangleSelector refactoring for readability and a bit of performance,
added some comments, improved encapsulation through private attributes,
removed recursive call through std::function etc.
2021-06-11 11:02:47 +02:00
enricoturri1966
841f8c6715 Added missing assignment into ModelObject::assign_copy() 2021-06-10 13:32:53 +02:00
Vojtech Bubnik
4ada2ed093 TriangleSelector::get_facets() refactoring to share vertices.
TriangleSelector::valid refactored to m_valid and valid()
and bool members moved next to each other to shrink data structure
size due to memory alignment.
2021-06-10 12:43:31 +02:00
Vojtech Bubnik
95f4690e25 Support / seam / MMU painting serialization / deserialization:
Changed the serialization structure
	std::map<int, std::vector<bool>>
to a significantly more compact
	std::pair<std::vector<std::pair<int, int>>, std::vector<bool>>
Such change shall significantly improve efficiency of Undo / Redo stack.
2021-06-10 09:26:30 +02:00
tamasmeszaros
b5771a5787 try to fix build on windows 2021-06-08 11:53:38 +02:00
tamasmeszaros
904387520e Fix the build 2021-06-08 11:02:29 +02:00
tamasmeszaros
0ca17b0798 Make new split always default if feasible 2021-06-08 10:34:32 +02:00
tamasmeszaros
97529ff6b7 Add parallel version of neighbors index creation, make it default 2021-06-08 10:34:32 +02:00
tamasmeszaros
b4d540ec4c Improve its_split for large number of parts 2021-06-08 10:34:32 +02:00
tamasmeszaros
c4507842a0 Add new (winner) neighbor index based on measurements 2021-06-08 10:34:32 +02:00
tamasmeszaros
b14b000c73 Add triangle mesh split to perf comparison 2021-06-08 10:34:32 +02:00
tamasmeszaros
c8be2cdceb Added measuring sandbox for neighbors index creation 2021-06-08 10:34:32 +02:00
tamasmeszaros
c542e6e14b Corrected mesh split implementation 2021-06-08 10:28:23 +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
enricoturri1966
1c35dfe591 Tech ENABLE_ALLOW_NEGATIVE_Z -> Added threshold to detect if an object is sinking 2021-06-08 10:07:47 +02:00
Lukas Matena
1f29a2593b Fixed two more locales-related issues
One warning was also fixed
2021-06-07 12:31:41 +02:00
Lukas Matena
d2874f2e34 Fixed a memory leak during locales switching on macOS and
removed frequent locales switching during gcode processing
2021-06-05 07:09:23 +02:00
Vojtech Bubnik
8d325008d1 Small MMU segmentation optimization 2021-06-04 08:46:02 +02:00
Vojtech Bubnik
9efe58e6c7 Merge remote-tracking branch 'remotes/origin/master' into vb_print_regions 2021-06-02 18:25:11 +02:00
YuSanka
4b5e568f14 Follow-up 7eebd56b5f - fixed a typo
+ added add_negative.svg for dark mode
2021-06-02 14:36:49 +02:00
YuSanka
7eebd56b5f Fixed DnD for "Model part" volumes inside the object
Fixed volumes order inside the object
2021-06-02 12:54:56 +02:00
Lukáš Hejl
edf8d22aba Fixed an issue when the option "Inner brim only" doesn't generate brim inside the object in some cases, and issue that top-level brim was ignoring an offset around the object without a brim.
Also, some possible warnings were fixed.
2021-06-02 10:33:16 +02:00
Yuri D'Elia
35195dc593
Add <cfloat> for missing DBL_MAX declaration (#6582)
Fixes build on linux/gcc10.
2021-06-01 19:54:53 +02:00
Vojtech Bubnik
0bfc53f5a5 VertexFaceIndex: vertex index to incident face indices built for
indexed_triangle_set.
2021-06-01 19:30:26 +02:00
Vojtech Bubnik
9aa520baf3 Fix of previous commit: Mixed up ClipperLib::pftPositive and pftNonZero 2021-06-01 12:33:14 +02:00
Vojtech Bubnik
73e0099c55 Merge remote-tracking branch 'remotes/origin/master' into vb_print_regions 2021-06-01 11:19:53 +02:00
Vojtech Bubnik
7681eb8496 PrintRegion refactoring: Fixed a crash when an object is moved from outside
the print bed inside and it becomes printable.
2021-06-01 11:12:55 +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
Lukas Matena
580dc890b8 Wipe tower: use normal retraction when moving to the tower, not toolchange retraction
This does not make sense, there is always an unretraction when the head arrives at the tower.
2021-05-31 21:23:03 +02:00
Lukas Matena
4657e0d670 Improvement related to 'separate z travel speed':
default to zero = use good old travel speed. This is to
ensure backwards compatibility with existing profiles
2021-05-31 21:21:53 +02:00
Martin Budden
bd6badf123 Added option to independently set z axis travel speed 2021-05-31 21:20:43 +02:00
Vojtech Bubnik
df87f1b929 Fixed some compiler warnings 2021-05-31 14:48:26 +02:00
Vojtech Bubnik
033d9f3a5e Merge remote-tracking branch 'remotes/origin/master' into vb_print_regions 2021-05-31 14:05:53 +02:00
Vojtech Bubnik
8c95212aae Bugfix of PrintRegion refactoring: Correct invalidation of regions
on object transformation.
2021-05-31 14:04:45 +02:00
enricoturri1966
54b69ea9e5 Merge branch 'master' of https://github.com/prusa3d/PrusaSlicer into et_sequential_limits 2021-05-31 12:55:03 +02:00
enricoturri1966
f0354b43c1 Fixed conflicts after merge with master + fixed rendering of hovered gizmo grabbers 2021-05-31 12:54:48 +02:00
Lukas Matena
0d721bfb07 Slightly reworded 'missing layers' warning, to reflect that it is no longer considered an error 2021-05-31 11:16:28 +02:00
Lukáš Hejl
7f29647d67 Added missing includes (GCC 11.1) 2021-05-29 19:55:20 +02:00
Lukáš Hejl
2cbf7728bb Fixed that seed fill left all triangles split instead of merging them. 2021-05-28 17:42:28 +02:00
Lukáš Hejl
726a48383f Cleaned up of 0a6490bab9 2021-05-28 17:36:56 +02:00
Lukas Matena
fd024eadcd Removed gluProject and gluUnProject calls 2021-05-28 16:44:13 +02:00
Lukas Matena
97b7ef7dc0 Removed GLU calls from all the gizmos 2021-05-28 16:44:13 +02:00
Vojtech Bubnik
f5c7d14e85 Bugfix after refactoring of PrintRegions: Fixed handling of cached_volume_ids 2021-05-28 15:55:18 +02:00
Vojtech Bubnik
fe96a20b50 Fixed compilation on GCC 2021-05-28 15:22:00 +02:00
Vojtech Bubnik
7d3b2b5b6e Merge branch 'vb_print_regions' of https://github.com/Prusa3d/PrusaSlicer into vb_print_regions 2021-05-28 15:14:41 +02:00
Vojtech Bubnik
c02f95dfd6 Bugfixes after PrintRegion refactoring. 2021-05-28 15:14:34 +02:00
YuSanka
8e1cde43a6 Update extruder show/hide and default extruder color in respect to the volume type 2021-05-28 13:41:36 +02:00
Lukáš Hejl
0a6490bab9 Added cancellation to MMU segmentation. 2021-05-28 05:57:32 +02:00
Lukáš Hejl
281ac1f2f1 Added missing includes (GCC 9.3) 2021-05-27 16:47:31 +02:00
Vojtech Bubnik
3e28b4c967 Fix of previous commit 2021-05-27 16:14:54 +02:00
Vojtech Bubnik
99301f89f6 Merge remote-tracking branch 'remotes/origin/master' into vb_print_regions 2021-05-27 16:12:53 +02:00
Vojtech Bubnik
818cb703ed Refactored the ModelVolume bounding box to Eigen::AlignedBox<float>,
separated splitting of LayerRegions by MMU segmentation to its own
function.
2021-05-27 16:12:34 +02:00
Vojtech Bubnik
b5aa09e5ba WIP: Integration of MMU painting into the slicing back-end. 2021-05-27 14:29:51 +02:00
enricoturri1966
b3ca8cb0af Fixed calculation of used filament for gcode viewer (take data from gcode file) 2021-05-27 12:25:59 +02:00
Vojtech Bubnik
9e4d483453 Merge branch 'vb_print_regions' of https://github.com/Prusa3d/PrusaSlicer into vb_print_regions 2021-05-26 16:15:01 +02:00
Vojtech Bubnik
409e1c5cc8 Some fixes after preceding merge. Moved mmu_segmented_region_max_width
from PrintConfig to PrintObjectConfig.
2021-05-26 16:14:52 +02:00
YuSanka
b7769856d1 Fixed DnD function for volumes inside the object in respect to the volume type 2021-05-26 15:36:48 +02:00
Vojtech Bubnik
980ca195f5 Merge remote-tracking branch 'remotes/origin/lh_multi_material_segmentation' into vb_print_regions 2021-05-26 15:23:35 +02:00
Vojtech Bubnik
0d081c90f0 Merge remote-tracking branch 'remotes/origin/master' into vb_print_regions 2021-05-26 14:38:34 +02:00
Vojtech Bubnik
7f1f0d29d0 Will gcc accept this? 2021-05-26 14:33:24 +02:00
Vojtech Bubnik
cba1950a4e Fixing compilation on gcc. 2021-05-26 14:30:25 +02:00
Vojtech Bubnik
e24026bfa5 Making the "Default" extruder transparent for modifier meshes and layer
range modifiers.
2021-05-26 14:25:33 +02:00
Vojtech Bubnik
b3195614cf WIP PrintRegion refactoring: Another round of bug fixing, negative volumes
seem to work.
2021-05-26 12:41:06 +02:00
Vojtech Bubnik
8ab6a615d0 Fixed another compiler warning 2021-05-25 21:17:07 +02:00
Vojtech Bubnik
dd79a2b832 Fixing some compiler warnings 2021-05-25 20:46:31 +02:00
Vojtech Bubnik
8a297be74e Fixing another clang complaint 2021-05-25 20:03:05 +02:00
Vojtech Bubnik
c3cd2c7f55 Fixing an OSX clang quirk. 2021-05-25 19:27:20 +02:00
Vojtech Bubnik
9b9354a2aa WIP: Rework of PrintRegions, bunch of bug fixes. 2021-05-25 18:12:38 +02:00
Vojtech Bubnik
701a0c9576 Two more bugs squished. 2021-05-24 18:07:12 +02:00
Vojtech Bubnik
72d1faa03e WIP PrintRegion refactoring: Squashed some bugs. 2021-05-24 16:55:34 +02:00
Vojtech Bubnik
c8bdc62af4 Fixing compilation on Linux 2021-05-24 15:12:04 +02:00
Vojtech Bubnik
04014db136 Fixing compilation on Linux 2021-05-24 15:08:07 +02:00
Vojtech Bubnik
92b4f0542a Another compilation fix. 2021-05-24 15:00:08 +02:00
enricoturri1966
ec4bf90da3 Merge branch 'master' of https://github.com/prusa3d/PrusaSlicer into et_sequential_limits 2021-05-24 14:43:21 +02:00
enricoturri1966
9d216104e0 Fixed warning 2021-05-24 14:42:57 +02:00
Vojtech Bubnik
fd97a49ccc Fixing the previous commit. 2021-05-24 14:36:27 +02:00
enricoturri1966
7a14005f5a Merge branch 'master' of https://github.com/prusa3d/PrusaSlicer into et_sequential_limits 2021-05-24 14:19:40 +02:00
Vojtech Bubnik
e658fe0698 WIP: PrintRegion refactoring, it finally compiles!
Config/PrintConfig refactoring to support operator< for StaticPrintConfig
derived containers.
2021-05-24 14:10:04 +02:00
Lukas Matena
4a7f078527 Fixed debug build 2021-05-24 12:20:29 +02:00
Lukas Matena
6b6b086948 Fixed tests and windows build 2021-05-24 12:20:29 +02:00
Lukas Matena
c5c6f51ae0 Fixed third batch of locale-dependent calls 2021-05-24 12:20:29 +02:00
Lukas Matena
fef385cd6b Fixed second batch of locale-dependent calls 2021-05-24 12:20:29 +02:00
Lukas Matena
9ee2fc8275 Fixed first batch of locale-dependent calls 2021-05-24 12:20:29 +02:00
Lukas Matena
5a1441f9b7 Created a RAII class to switch LC_NUMERIC to "C" and back 2021-05-24 12:20:29 +02:00
enricoturri1966
6192a3eaf7 Tech ENABLE_SEQUENTIAL_LIMITS -> Improved performance when showing sequential print clearance regions contours while dragging objects 2021-05-24 12:11:49 +02:00
Vojtech Bubnik
740773db85 WIP: Refactoring of PrintRegions. It nearly compiles! 2021-05-21 17:57:37 +02:00
enricoturri1966
77dfeb84bc Merge branch 'master' of https://github.com/prusa3d/PrusaSlicer into et_sequential_limits 2021-05-21 14:58:41 +02:00
Lukáš Hejl
ed9c93f85a Added missing includes (GCC 9.3) 2021-05-21 07:42:37 +02:00
enricoturri1966
d13c550968 Fixed conflicts after merge with master 2021-05-20 15:37:56 +02:00
Vojtech Bubnik
ef9004cee4 Fix of its_collect_mesh_projection_points_above()
Fix of perl integration tests after introduction of not using the mesh
below the print bed.
2021-05-20 13:58:27 +02:00
enricoturri1966
33d489df30 Merge branch 'master' of https://github.com/prusa3d/PrusaSlicer into et_sequential_limits 2021-05-20 10:47:51 +02:00
enricoturri1966
a218e0ef18 Tech ENABLE_ALLOW_NEGATIVE_Z -> New implementation for method ModelObject::convex_hull_2d() 2021-05-20 09:32:17 +02:00
enricoturri1966
8377b6ef4f Fixed typo in its_collect_mesh_projection_points_above() and method TriangleMesh::slice() set as const 2021-05-20 09:09:19 +02:00
Vojtech Bubnik
ff6623b0f4 Fixing 2021-05-19 16:51:25 +02:00
Vojtech Bubnik
116e2b2112 Fixing the slice_mesh() after recent refactoring. 2021-05-19 16:09:45 +02:00
Vojtech Bubnik
68b0d92183 Merge remote-tracking branch 'remotes/origin/master' into vb_print_regions 2021-05-19 14:00:21 +02:00
Vojtech Bubnik
31942e03db Optimization of its_collect_mesh_projection_points_above(): Reserve points. 2021-05-19 13:59:34 +02:00
Vojtech Bubnik
e952aded78 cut_mesh(): new parameter to optionally not triangulate the caps. 2021-05-19 13:52:47 +02:00
Vojtech Bubnik
66cf7ea9d3 Extracting its_collect_mesh_projection_points_above() out of
its_convex_hull_2d_above(), so that the projected points may get
collected over multiple volumes before applying Geometry::convex_hull()
2021-05-19 13:39:56 +02:00
Vojtech Bubnik
5644b98d3b Factored out convex hull calculation from ModelObject::convex_hull_2d()
to Geometry::convex_hull().
Update Geometry::convex_hull() to handle duplicate points.
2021-05-19 13:23:19 +02:00
Vojtech Bubnik
8db2d96c75 Point::ccw() optimization: Calculate with int64, not doubles. 2021-05-19 12:01:30 +02:00
enricoturri1966
0d8a1c3d2a Merge branch 'master' of https://github.com/prusa3d/PrusaSlicer into et_sequential_limits 2021-05-19 11:45:05 +02:00
Vojtech Bubnik
6b54f34ce1 New functions: its_convex_hull_2d_above() 2021-05-19 11:35:42 +02:00
Vojtech Bubnik
682c405fc2 Merge remote-tracking branch 'remotes/origin/master' into vb_print_regions 2021-05-19 09:40:24 +02:00
Vojtech Bubnik
f5f912e6e9 WIP: Refactoring of PrintRegions 2021-05-19 09:38:51 +02:00
enricoturri1966
53397cee17 Merge branch 'master' of https://github.com/prusa3d/PrusaSlicer into et_sequential_limits 2021-05-19 08:40:32 +02:00
enricoturri1966
4a134f5320 Follow-up of c37d18f046 -> Removed assert 2021-05-19 08:39:04 +02:00
enricoturri1966
d60893b990 Merge branch 'master' of https://github.com/prusa3d/PrusaSlicer into et_sequential_limits 2021-05-19 08:27:27 +02:00
Vojtech Bubnik
c28cd957d5 New utility function its_merge_vertices().
Implemented contour simplification inside slice_mesh_ex().
2021-05-18 17:57:55 +02:00
Vojtech Bubnik
78c0199523 TriangleMeshSlicer: Optimized out unnecessary transformations. 2021-05-18 16:12:49 +02:00
Vojtech Bubnik
70b4915f9c TriangleMeshSlicer: Got rid of admesh! 2021-05-18 15:05:30 +02:00
enricoturri1966
221c054e4f Merge branch 'master' of https://github.com/prusa3d/PrusaSlicer into et_sequential_limits 2021-05-18 10:37:39 +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
enricoturri1966
858ea16b95 Merge branch 'master' of https://github.com/prusa3d/PrusaSlicer into et_sequential_limits 2021-05-17 13:05:09 +02:00
enricoturri1966
0605813e68 Faster ModelObject::convex_hull_2d() by using ModelVolume 3D convex hulls 2021-05-17 13:02:38 +02:00
enricoturri1966
c37d18f046 Follow-up of ca14ea4c33 -> Fixed arrange with sinking objects 2021-05-17 12:53:05 +02:00
enricoturri1966
a929b29a0b Merge branch 'master' of https://github.com/prusa3d/PrusaSlicer into et_sequential_limits 2021-05-14 15:06:44 +02:00
enricoturri1966
ca14ea4c33 Tech ENABLE_ALLOW_NEGATIVE_Z -> ModelObject::convex_hull_2d() and sequential_print_horizontal_clearance_valid() modified to take in account for sinking instances 2021-05-14 15:02:54 +02:00
Vojtech Bubnik
221af991c2 Fixed update of PrintRegions after removing an object.
The bug has been introduced during recent PrintRegion refactoring.
2021-05-14 11:52:33 +02:00
enricoturri1966
6bddacee44 Fixed conflicts after merge with master 2021-05-13 14:10:42 +02:00
enricoturri1966
e330b66981 Small refactoring 2021-05-13 13:57:09 +02:00
enricoturri1966
75677ba810 Tech ENABLE_SEQUENTIAL_LIMITS -> 1st installment of visualization of objects clearance for sequential prints 2021-05-11 13:12:25 +02:00
enricoturri1966
13b0757b8b Tech ENABLE_REDUCED_TOOLPATHS_SEGMENT_CAPS set as default 2021-05-11 10:28:04 +02:00
enricoturri1966
426d2cd725 Tech ENABLE_WARNING_TEXTURE_REMOVAL set as default 2021-05-10 16:05:16 +02:00
enricoturri1966
ca8a42c8b1 Tech ENABLE_SPLITTED_VERTEX_BUFFER set as default 2021-05-10 14:45:17 +02:00
enricoturri1966
137dbbd19f Fixed crash into ProjectDirtyStateManager::update_from_undo_redo_stack() when switching language 2021-05-10 13:06:13 +02:00
enricoturri1966
f786d9c96e Fixed conflicts after merge with master 2021-05-10 10:25:57 +02:00
Vojtech Bubnik
5828decfc7 Fixing multi-material printing after recent refactoring (d21b9aa to 1c6333e) 2021-05-10 09:32:24 +02:00
enricoturri1966
62ad1904e2 Fixed warnings into DoExport 2021-05-07 14:46:10 +02:00
enricoturri1966
389955966c Disabled tech ENABLE_PROJECT_DIRTY_STATE_DEBUG_WINDOW 2021-05-07 13:42:53 +02:00
enricoturri1966
ec9c3891cf Fixed conflicts after merge with master 2021-05-07 13:14:11 +02:00
YuSanka
b9910669e8 Fix of #2825 - Add the length of each filament used 2021-05-07 12:48:34 +02:00
enricoturri1966
ddf59a4a8c Tech ENABLE_SCROLLABLE_LEGEND -> 1st installment of scrollable legend 2021-05-07 12:48:34 +02:00
Vojtech Bubnik
5c35fa4539 Commenting source of Polygon::centroid() algorithm 2021-05-07 11:54:25 +02:00
Vojtech Bubnik
52b3c655ff Fixed Polygon::centroid()
Ported Polygon unit tests from Perl to C++.
2021-05-07 11:42:21 +02:00
Vojtech Bubnik
68fabfea62 Fix of Polygon::area(). 2021-05-07 09:45:27 +02:00
Vojtech Bubnik
feefbc575a Refactored PrintObject::m_region_volumes for extensibility.
WIP for multi-material painting.
2021-05-06 15:48:38 +02:00
Vojtech Bubnik
dd72016159 FDM backend refactoring for const correctness, clarity ... 2021-05-06 15:08:57 +02:00
Vojtech Bubnik
b5573f959b Refactoring for code clarity: Replaced this->m_xxx with m_xxx
as the m_ prefix already signifies a class local variable.
2021-05-06 14:43:36 +02:00
Vojtech Bubnik
f16d4953be Removing offset2 from Perl bindings and other minor cleanup. 2021-05-06 14:29:20 +02:00
enricoturri1966
ff632a9ff2 Tech ENABLE_ALLOW_NEGATIVE_Z-> Disable sinking objects for SLA printer 2021-05-06 14:04:07 +02:00
Vojtech Bubnik
0ca6b12da1 Print/PrintObject/PrintRegion refactoring:
Newly the PrintObjects own PrintRegions and Print contains references
to PrintRegions owned by PrintObjects, so that a PrintRegion of the same
content is referenced by Print only once.

The refactoring is a WIP to support multi-material painting.
2021-05-06 13:01:09 +02:00
Vojtech Bubnik
ee15f00574 FDM backend refactoring: Return PrintRegion by reference, not by pointer.
Added PrintRegion hashing.
2021-05-05 18:13:58 +02:00
Vojtech Bubnik
714149dab2 WIP: Moving ownership of PrintRegions to PrintObjects. 2021-05-05 16:21:55 +02:00
Vojtech Bubnik
a7c67415c7 Another try of fixing compilation on gcc. 2021-05-05 14:34:54 +02:00
Vojtech Bubnik
18001fbb4e Fixing compilation on gcc 2021-05-05 14:32:19 +02:00
Vojtech Bubnik
d6c5961eb0 Factored out the Print::apply() method and its dependending free functions
into PrintApply.cpp module.
2021-05-05 14:30:09 +02:00
Vojtech Bubnik
72ce8cb28d PrintRegion refactoring: Getting rid of the Print pointer. 2021-05-05 14:17:36 +02:00
Vojtech Bubnik
a2de09e11e Fixing unit tests. 2021-05-05 13:19:01 +02:00
enricoturri1966
a91306032c Project dirty state manager -> Fixed crash when loading/saving a 3mf file 2021-05-05 13:17:20 +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
fd3dd1611c Fixed alignment of sparse infill over multiple layers of the same region,
which was broken with 68666de521b1cb15e41ac6728c0e8d3b4b0d4ed0
"Reworked the "new" bridging to respect the bridge_flow_ratio
by maintaining extrusion spacing, but modifying the extrusion width
and / or height."
2021-05-04 18:27:53 +02:00
Vojtech Bubnik
00835c7367 Fixing compilation on clang in debug mode. 2021-05-04 16:13:40 +02:00
Vojtech Bubnik
1aef86f650 Implemented generic mechanism for executing tasks on UI thread synchronously
from the background slicing thread, that supports cancellation.
The generic mechanism is used for generating thumbnails into G-code and
Fixes Fix deadlock when canceling the slicing while gcode is creating thumbnails #6476
Thanks @supermerill for pointing out the issue.
2021-05-04 16:07:32 +02:00
enricoturri1966
cb294e0b3e Follow-up of 15c32d636d -> Small refactoring 2021-05-04 13:31:07 +02:00
enricoturri1966
15c32d636d Seams detection for gcode saved with other slicers 2021-05-04 12:45:51 +02:00
Vojtech Bubnik
5cc6dc59dc Fixed compilation with GCC 2021-05-04 11:22:38 +02:00
Vojtech Bubnik
a7368b9deb Fixing thread-safe StaticConfig creations #6477
fix un-threadsafe code for creating config enum hashtable. #6475
2021-05-04 11:03:26 +02:00
Lukáš Hejl
46a14abbaa Added default object color in MMU segmentation according to the default extruder color for printing the object. 2021-05-04 08:13:04 +02:00
Lukáš Hejl
71c60a5187 Follow-up of 168b4afbc2: Replaced forgotten lslices in the top and bottom layer propagation in MMU segmentation. 2021-05-03 22:11:04 +02:00
Lukáš Hejl
cd5fea8b42 Fixed compiler warnings 2021-05-03 21:50:40 +02:00
Lukáš Hejl
2d3eef4e84 Fixed possible warnings 2021-05-03 21:13:13 +02:00
Lukáš Hejl
fa8c319721 Fixed MMU segmentation for cases when a contour was whole colored by one color and a hole was whole colored by a different color. 2021-05-03 21:06:46 +02:00
Lukáš Hejl
5bfdaa7ac8 Parallelization of regions merging for MMU segmentation. 2021-05-03 21:01:52 +02:00
Lukáš Hejl
2e9f0d6eaf Fixed a few cases of missing colored segments in MMU segmentation.
Occasionally, some input polygons contained self-intersections that caused problems with Voronoi diagrams and consequently with the extraction of colored segments by function extract_colored_segments.
Also, occasionally input polygons contained several points very close together (distance between points is 1 or so). Such close points sometimes caused that the Voronoi diagram has self-intersecting edges around these vertices. This consequently leads to issues with the extraction of colored segments by function extract_colored_segments.
2021-05-03 20:56:39 +02:00
Lukáš Hejl
168b4afbc2 Fixed MMU segmentation for multi-volume objects.
MMU segmentation no longer works directly on lslices, instead of it works on custom merged regions. So lslices in PrintObject are no longer overwritten because of MMU segmentation.
All regions are scaled by SCALED_EPSILON before merging and shrunk back by SCALED_EPSILON after merging. That fixed issues with multi-volume objects when very close regions weren't merged.
Also, small expolygons and holes are filtered out that fixed missing segmentation at the boundary of two volumes in the case of multi-volume objects.
2021-05-03 20:37:14 +02:00
enricoturri1966
ede14251b1 Merge branch 'master' of https://github.com/prusa3d/PrusaSlicer into et_project_dirty_state 2021-05-03 16:05:22 +02:00
Vojtech Bubnik
ab74ea5c90 One more fix after merge. 2021-05-03 15:30:10 +02:00
Vojtech Bubnik
2aadc1cefa Fixing after merge. 2021-05-03 15:28:03 +02:00
Vojtech Bubnik
eb66111eda Merge branch 'vb_clipper_optimization' 2021-05-03 15:24:04 +02:00
Vojtech Bubnik
ef07644bf2 Merge branch 'master' of https://github.com/Prusa3d/PrusaSlicer 2021-05-03 15:23:57 +02:00
Vojtech Bubnik
7563c885a1 Fixing compiler warnings 2021-05-03 15:00:23 +02:00
enricoturri1966
1c3090b11f Tech ENABLE_ALLOW_NEGATIVE_Z-> Layers height editing related fixes 2021-05-03 14:28:55 +02:00
Vojtech Bubnik
96f8744e05 Another fix for C++ conformant compilers 2021-05-03 11:55:23 +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
Lukáš Hejl
62592cab48 Added missing include (GCC 11.1) 2021-05-01 22:33:59 +02:00
enricoturri1966
395164c7a1 Fixed conflicts after merge with master 2021-04-30 14:54:58 +02:00
Lukas Matena
95f5b82d6a Improved MM priming lines placement on circular beds (#6459) 2021-04-30 13:11:33 +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
enricoturri1966
28d01542ed Merge branch 'master' of https://github.com/prusa3d/PrusaSlicer into et_custom_gcode_detection 2021-04-29 11:07:47 +02:00
Vojtech Bubnik
b327314b02 Layer::make_perimeters() - when merging regions, use OffsetEx instead
of safety offset of UnionEx, which may not be robust.
2021-04-29 11:05:11 +02:00
enricoturri1966
9086542a08 Follow-up of 2c6472ebc3 -> Ensure backward compatibility 2021-04-28 16:06:49 +02:00
enricoturri1966
c58572deaa Tech ENABLE_ALLOW_NEGATIVE_Z->Fixed object popping up after editing layer range fields 2021-04-28 11:07:15 +02:00
enricoturri1966
7ae77c06d0 Tech ENABLE_SEAMS_VISUALIZATION -> Added threshold to place seams 2021-04-27 15:12:45 +02:00
enricoturri1966
15f376e468 Tech ENABLE_SEAMS_VISUALIZATION -> Fixed build on Mac 2021-04-27 11:11:21 +02:00
enricoturri1966
2c6472ebc3 Replace label Skirt with Skirt/Brim in preview legend 2021-04-27 10:46:42 +02:00
enricoturri1966
076fdc90c0 Tech ENABLE_SEAMS_VISUALIZATION -> 1st installment of seams visualization in preview 2021-04-27 09:45:15 +02:00
Lukáš Hejl
576c5b78e9 Added seed fill for MMU segmentation 2021-04-27 06:48:09 +02:00
Lukáš Hejl
be1b4ce18c Fixed compiler warnings 2021-04-27 00:41:20 +02:00
Lukáš Hejl
8a19cf9d64 Extended support of MMU segmentation backed for more than three colors.
Serialization and deserialization in TriangleSelector were extended to support up to 16 materials (3 unused states left for possible later extension). These changes also affect the encoding of data from custom supports and seams, but it is backward compatible with the previous encoding. And for custom supports and seams, it is produced exactly the same data encoding as before.
2021-04-27 00:37:49 +02:00
Lukáš Hejl
db55bd706e Fixed case in MMU segmentation when the infinity-edge in the Voronoi diagram has vertex0(), and vertex1() equals nullptr. 2021-04-27 00:36:22 +02:00
Lukas Matena
978b359492 Fix normal direction when exporting STL (#6406)
The export function does not depend on Model/ModelObject::mesh() family of functions,
changing them might break the already too brittle code.
2021-04-26 19:58:08 +02:00
Vojtech Bubnik
d1cfdcb49e Refactoring of StaticPrintConfig & derived classes:
1) Using boost::preprocessor to reduce code duplicities when defining
   new configuration values.
2) Implemented static hash() and operator== on StaticPrintConfig derived
   classes to support hash tables of instances thereof.
2021-04-26 18:37:10 +02:00
Lukas Matena
5783cc62fb Wipe tower priming lines are placed at origin with custom bed shapes
Custom shapes were previously detected as circular and the lines were placed off the bed
2021-04-26 09:21:18 +02:00
Vojtech Bubnik
9f4e9da5c6 Merge branch 'tm_vb_clipper_eigen' 2021-04-23 11:44:25 +02:00
enricoturri1966
d4695827ce Tech ENABLE_ALLOW_NEGATIVE_Z -> Keep sinking instances as sinking after applying rotate gizmo 2021-04-23 08:29:29 +02:00
enricoturri1966
70ec034281 Merge branch 'master' of https://github.com/prusa3d/PrusaSlicer into et_custom_gcode_detection 2021-04-22 15:30:27 +02:00
enricoturri1966
52583bbe30 Extrusions in custom start g-code forced to be at first layer height level 2021-04-22 15:15:19 +02:00
Vojtech Bubnik
38bb7d2950 1) New methods PrintObject::num_regions() and ::has_region() to make
the code more readable and to highlight where PrintObject::region_volumes
   are actually set and consumed.
2) Replaced Slic3r::clamp() with std::clamp(). They differ in the order
   of their parameters, thus hopefully no new bugs were introduced.
3) Some refactoring of MultiMaterialSegmentation for efficiency.
2021-04-22 11:41:26 +02:00
tamasmeszaros
ea26581959 Move iterator stuff from polygon to multipoint 2021-04-22 09:44:08 +02:00
Vojtech Bubnik
3b86cb3a3c Added missing files 2021-04-22 09:26:07 +02:00
Vojtech Bubnik
8d0950ce12 Convincing ClipperLib to use Slic3r's own Point type internally. 2021-04-21 20:15:49 +02:00
tamasmeszaros
a15c16d40d Use new libnest backend for MinAreaBoundingBox wrapper 2021-04-21 17:21:43 +02:00
tamasmeszaros
657d19482b Minor code refinements 2021-04-21 16:49:11 +02:00
tamasmeszaros
d069591514 Write hollow flag to SL1 files if any object is hollowed. 2021-04-21 16:29:12 +02:00
tamasmeszaros
dca67822d1 Eliminate warnings caused by changes to aid new libslic3r backend 2021-04-21 16:02:31 +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
enricoturri1966
82d577645e Merge branch 'master' of https://github.com/prusa3d/PrusaSlicer into et_custom_gcode_detection 2021-04-21 14:52:52 +02:00
Vojtech Bubnik
0c1953a929 Further fixes of the first_layer_height refactoring. 2021-04-21 14:34:49 +02:00
enricoturri1966
c8b83ae011 Tech ENABLE_ALLOW_NEGATIVE_Z -> Allow move gizmo to place an object under the printbed 2021-04-21 12:41:43 +02:00
enricoturri1966
c7771a576b Merge branch 'master' of https://github.com/prusa3d/PrusaSlicer into et_custom_gcode_detection 2021-04-21 12:32:17 +02:00
Vojtech Bubnik
d9ed9149ae 1) Moved first_layer_heigth frrom PrintObjectConfig to PrintConfig.
Thus the first_layer_height is no more object specific. That makes
   a lot of sense due to the brim calculation being performed over
   all layers at once and due to future merging of supports of
   different objects at first layer.
2) Because now first_layer_height is print specific, the relative
   first layer height derived from the object layer height was partially
   disabled: First the relative first layer height is converted to
   an absolute value when importing config, second the side text
   was changed from "mm or %" to "mm". Still the UI allows entering %.

Both changes may be controversial, let's wait for user feedback.
2021-04-21 12:09:43 +02:00
Vojtech Bubnik
4f950343c8 MMU segmentation refactoring: Most of the MMU segmentation code
was extracted to its own file.
2021-04-20 15:07:05 +02:00
enricoturri1966
f486dedb52 Disabled tech ENABLE_PROJECT_DIRTY_STATE_DEBUG_WINDOW 2021-04-20 10:41:38 +02:00
Lukáš Hejl
40d9e51b5e WIP: Added support for top and bottom layers for MMU segmentation. 2021-04-19 19:21:06 +02:00
Lukáš Hejl
368b48b0a0 WIP: Allows regions of MMU segmentation to be trimmed by chosen width. 2021-04-19 07:12:42 +02:00
Lukáš Hejl
f49ceb1e0f WIP: MMU segmentation without top and bottom layers 2021-04-19 07:04:50 +02:00
Lukáš Hejl
e3c33844d5 WIP: Duplicated the FDM support gizmo for the MMU segmentation 2021-04-19 07:01:11 +02:00
Vojtech Bubnik
48a93e40fb After issuing the color change custom G-code, which is most likely
just M600, reset the internal retract counter, so that a retract
will happen after the firmware returns from M600 to the initial position.

Fixes "Blobs on print after manual color change #6362"
2021-04-15 16:29:30 +02:00
enricoturri1966
526233ca47 Modified version of automatic downscale on load of objects too big 2021-04-14 14:46:49 +02:00
Vojtech Bubnik
0625788583 Fixed obvious bug in move operator, discovered by clang lint ran by Tamas. 2021-04-14 14:25:30 +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
Vojtech Bubnik
c1179fc2c7 Marked the unsafe ClipperUtils offset functions with CLIPPERUTILS_UNSAFE_OFFSET
Replaced some of the unsafe offset functions with safe variants.
Please test the
1) print bed from STL function
2) concentric infill
2021-04-13 13:28:37 +02:00
Vojtech Bubnik
e8643125d8 Clipper / ClipperUtils:
1) Let Clipper use int32_t for representing its coordinates. This
   reduces memory and allows to skip conversion between Slic3r Polygon
   and Clipper polygon.
2) Disable additional offset before executing the Clipper Offset algorithm.
   We don't see any reason for that and it required 64bit Clipper coordinates,
   which were disabled with 1).
2021-04-13 11:31:54 +02:00
Vojtech Bubnik
dbd1c09523 FDM snug supports: New parameter "closing radius", inspired by Cura's
support_join_distance
2021-04-12 14:56:36 +02:00