Commit Graph

296 Commits

Author SHA1 Message Date
enricoturri1966
af6ebbda61 Tech ENABLE_OUT_OF_BED_DETECTION_IMPROVEMENTS - Enable detection of collision with circular printbed in backend 2021-09-30 14:51:09 +02:00
enricoturri1966
c3f7227a9d Fixed conflicts after merge with master 2021-09-30 10:31:25 +02:00
YuSanka
37b45d048c Improvements for statistics information:
+ Show 2 groups of errors: "Auto-repared" and "Remaning".
 + Use different icons for volumes with/without remaining errors
 + Fixed update of the ObjectList warnings icons after switch the color mode of a PrusaSlicer
 + Some code refactoring: Use same code for tooltips for "exclamation"-icon from an ObjectList and from a Sidebar->ObjectInfo
2021-09-21 17:20:12 +02:00
enricoturri1966
8acb9029eb Merge branch 'master' of https://github.com/prusa3d/PrusaSlicer into et_sinking_objects_collision 2021-09-21 13:52:10 +02:00
Vojtech Bubnik
53a5c23d0f 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
enricoturri1966
c64fb41ea0 Fix of detection of the out of bed state for sinking objects in backend 2021-09-17 14:47:19 +02:00
Lukas Matena
e03bcc7c4e Fix several warnings 2021-09-15 16:36:59 +02:00
Vojtech Bubnik
01451d2e63 Removed the PRUS format parser. WIP: admesh eradication:
stl_stats are newly only accessed by TriangleMesh::stats(),
most of the direct access to TriangleMesh::stl is gone with the exception
of parsing input files (3MF, AMF, obj).
2021-09-14 11:58:14 +02:00
enricoturri1966
15ce5d271b Fixed conflicts after merge with master 2021-09-01 13:28:10 +02:00
Lukáš Hejl
a79d268c0e Added versioning of the structure of stored data for all three painting gizmos (fdm supports, seam and multi-material). 2021-08-31 15:05:11 +02:00
Lukas Matena
ff08edc441 Fixed undo/redo issue when clear method of FacetsAnnotation and ModelConfig
reset timestamp to 1. This led to a bug where e.g. deleting painted facets
through the respective item in object list followed by  possible other actions
and undo restored the painted facets from the time when the project was loaded.
I'm not sure if there was any other situation where this problem manifested.
2021-08-31 09:16:09 +02:00
enricoturri1966
d5d79c5654 Tech ENABLE_SAVE_COMMANDS_ALWAYS_ENABLED -> 1st installment: Allow to save/load empty projects 2021-08-26 10:38:14 +02:00
enricoturri1966
64ef8279a6 Fixed sinking object popping up on bed when adding a modifier 2021-08-26 08:34:43 +02:00
enricoturri1966
756daa0164 Fixed manipulation of sinking multipart objects resulting in wrong object/parts positioning 2021-08-25 15:01:15 +02:00
enricoturri1966
3e283d0acb Fixed update of backend after the changes introduced with b3010a817b (Do not allow objects to be placed fully below bed) and pop object on the bed when only one part is left 2021-08-25 12:39:46 +02:00
enricoturri1966
c4252b8746 #6806 - Fixed naming of multipart objects when loaded from 3mf files 2021-08-23 09:57:35 +02:00
Vojtech Bubnik
864fd014f0 Fixed previous commit 2021-08-05 17:34:04 +02:00
Vojtech Bubnik
bc5cc8e463 follow-up to a86e7107a5:
Make is_converted_from_meters / is_converted_from_inches exclusive-or.
Maybe it would be better to make a single enum from the two booleans,
if they are exclusive-or?
2021-08-05 15:35:44 +02:00
Lukas Matena
47bfe5ab3e CLI: Ensure that objects are on bed by default, new CLI config option:
'dont-ensure-on-bed' (which allows to override). This was the original
behaviour in Slic3r and Sli3rPE, probably broken long ago when CLI
was ported from  Perl.
Also, --scale-to-fit should now work again (#5772)
2021-08-04 12:15:37 +02:00
Lukáš Hejl
a66c6fbdfa Added invalidation of the sliced object when gap-fill enabled/disabled if the object is painted using the multi-material painting gizmo.
Filtering of unprintable regions in multi-material segmentation depends on if gap-fill is enabled or not. So sliced object is invalidated when gap-fill was enabled/disabled by option "gap_fill_enabled" or by changing "gap_fill_speed" to force recomputation of the multi-material segmentation.
2021-08-03 13:03:06 +02:00
Vojtech Bubnik
95e9fdc932 Fixed splitting of triangle meshes, where the splitting function
may produce a single triangle, which is then removed by the repair function.
2021-07-29 15:02:50 +02:00
Lukáš Hejl
dc7f547a39 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
enricoturri1966
f4b466ee93 Techs DISABLE_ALLOW_NEGATIVE_Z_FOR_SLA and ENABLE_ALLOW_NEGATIVE_Z set as default 2021-07-22 11:26:31 +02:00
enricoturri1966
635622c039 Disable reload from disk for built-in objects 2021-07-16 12:30:47 +02:00
Vojtech Bubnik
1a72c78934 Merge branch 'vb_mmu_top_bottom' 2021-07-13 11:08:52 +02:00
tamasmeszaros
c90c350526 Fix crash after SL1 import 2021-06-29 11:40:50 +02:00
Vojtech Bubnik
05ccafeeb5 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
c5304750d9 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
69ffe12fd2 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
enricoturri1966
7130cfb1e3 Added missing assignment into ModelObject::assign_copy() 2021-06-10 13:32:53 +02:00
Vojtech Bubnik
e4f36339e8 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
enricoturri1966
cf1731feea Tech ENABLE_ALLOW_NEGATIVE_Z -> Added threshold to detect if an object is sinking 2021-06-08 10:07:47 +02:00
YuSanka
392bf4f2d0 Follow-up 7eebd56b5f - fixed a typo
+ added add_negative.svg for dark mode
2021-06-02 14:36:49 +02:00
YuSanka
611b91bc1f Fixed DnD for "Model part" volumes inside the object
Fixed volumes order inside the object
2021-06-02 12:54:56 +02:00
Vojtech Bubnik
a15d4cdede Fixed compilation on GCC 2021-05-28 15:22:00 +02:00
Vojtech Bubnik
9eace9acac 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
f2e0cd1557 Bugfixes after PrintRegion refactoring. 2021-05-28 15:14:34 +02:00
YuSanka
32242f0217 Update extruder show/hide and default extruder color in respect to the volume type 2021-05-28 13:41:36 +02:00
Vojtech Bubnik
a9dd568efc WIP: Integration of MMU painting into the slicing back-end. 2021-05-27 14:29:51 +02:00
Vojtech Bubnik
4c3781b884 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
aa6cc8eef7 Some fixes after preceding merge. Moved mmu_segmented_region_max_width
from PrintConfig to PrintObjectConfig.
2021-05-26 16:14:52 +02:00
YuSanka
4d1bce166c Fixed DnD function for volumes inside the object in respect to the volume type 2021-05-26 15:36:48 +02:00
Vojtech Bubnik
4809689dcb Merge remote-tracking branch 'remotes/origin/lh_multi_material_segmentation' into vb_print_regions 2021-05-26 15:23:35 +02:00
Vojtech Bubnik
725e8f8c57 Merge remote-tracking branch 'remotes/origin/master' into vb_print_regions 2021-05-26 14:38:34 +02:00
Vojtech Bubnik
08935fb858 WIP PrintRegion refactoring: Another round of bug fixing, negative volumes
seem to work.
2021-05-26 12:41:06 +02:00
enricoturri1966
4286abe211 Tech ENABLE_ALLOW_NEGATIVE_Z -> New implementation for method ModelObject::convex_hull_2d() 2021-05-20 09:32:17 +02:00
Vojtech Bubnik
c454619aa8 Merge remote-tracking branch 'remotes/origin/master' into vb_print_regions 2021-05-19 14:00:21 +02:00
Vojtech Bubnik
3b388024f1 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
58b7b74fb3 Merge remote-tracking branch 'remotes/origin/master' into vb_print_regions 2021-05-19 09:40:24 +02:00
Vojtech Bubnik
11e02fcd44 WIP: Refactoring of PrintRegions 2021-05-19 09:38:51 +02:00