Commit Graph

233 Commits

Author SHA1 Message Date
31c7eacfbe Ys code refactoring (#6227)
* GUI_ObjectList code refactoring:
The MenuFactory structure contains functions related to the context menu and bitmaps used to different volume types.
The SettingsFactory structure contains functions to getting overridden options, its bundles and bitmaps used to setting categories.

Fixed bugs/crashes:
1. Add object -> Add Settings from 3D scene -> Right click on object => Part's Settings list instead of object's
   (Same behavior if something else but Object is selected in ObjectList)
2. Add settings to the part -> Change part type to the "Support Blocker/Enforcer" -> Settings disappears (it's OK) but =>
   Save Project -> Open project => Support Blocker/Enforcer has a settings
3. Add part for object -> Change type of part -> Change monitor DPI -> old type icon appears
4. Select all instances in ObjectList -> Context menu in 3D scene -> Add Settings -> Select some category -> Crash

* ObjectLayers: Fixed a crash on re-scaling, when some layer range is selected

* Fixed OSX build

* Added menu item "Split to Objects" for multipart objects

+ Fixed bug: Add 2 parts,
             Add some settings for one part
             Delete part without settings => Single part object without settings, but settings are applied for the object.

+ Next refactoring: use same menu for Plater and ObjectList
2021-03-15 10:04:45 +01:00
72fcba1202 SPE-1103 Added menu items for the conversation of the volumes from/to meters
Related to #4521
2021-02-10 20:34:05 +01:00
9b3e81b3e4 Fixes issue #5979 - NULL pointer crash in ModelObject::split()
ModelObject::split() expects a non-NULL new_objects vector where it adds pointers to the new models resulting from the split.
But in the CLI case the caller does not care about this and passes NULL which causes a crash. To fix the crash we could pass
a dummy vector but it turns out that we actually have a use for the results because we should assign a unique name to each
new model the same way as the GUI does. These names show up as comments in the gcode so this change makes the gcode produced
by the GUI and the CLI more similar and diffable.

@lukasmatena has amended the original commit by @combolek (pull request #5991) in order to avoid code duplication
2021-02-10 12:30:06 +01:00
e4df27997e Added check for loaded STL file if it was saved in meters. Related to #4521 (Some files are imported in the wrong size) 2021-02-09 17:04:32 +01:00
c26ba256bc Do not remove custom supports/seams when converting units to imperial 2020-12-14 20:27:19 +01:00
3dbb6fa7ad Fixed retrieving of the "saved in inches" flag from 3MF.
Fixed "import STL from Inches" - it should always scale up even if the
object is bigger than 3x3x3mm.
2020-12-12 18:54:34 +01:00
a6cf909405 Follow-up on aaaa85c1f8
Fix of #5007 - "Reload from disk" causes objects converted to inches to revert to mm
1) Storing and reloading the "source_in_inches" source flag from AMF and 3MF
2) When converting objects with mixed "inches" volumes, do the right thing
   and do not convert those that do not need conversion.
2020-12-12 12:06:15 +01:00
080088b8db Fix of #5007 - "Reload from disk" causes objects converted to inches to revert to mm 2020-12-11 13:57:58 +01:00
ba155e88d7 Fix crash when splitting objects
fixes partially #2209
2020-12-03 14:58:56 +01:00
c6090fc69e Fix arrange with malformed contours 2020-12-03 14:58:09 +01:00
f9d5b20c85 Fix out of bed items after arrange.
Disabled outline decimation for arrange and added very small (EPSILON) safety offset to bed detection boundaries.
2020-12-03 12:00:12 +01:00
21aedc156e Removed the legacy PreviewData.cpp,hpp 2020-11-11 16:38:51 +01:00
f09e65069c Fixed conversion from/to imperial units for objects with parts/modifiers 2020-10-22 15:45:17 +02:00
575da4840f Removed m_ prefix from public member variables. 2020-10-09 13:09:21 +02:00
f1a358509d Fixing Undo / Redo issues after copy / paste due to not updating
ObjectIDs of support painting / seam painting / layer height profile.
2020-10-09 12:26:28 +02:00
4e0a0c5c51 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
b3e936bda3 Refactoring of adaptive cubic / support cubic:
1) Octree is built directly from the triangle mesh by checking
   overlap of a triangle with an octree cell. This shall produce
   a tighter octree with less dense cells.
2) The same method is used for both the adaptive / support cubic infill,
   where for the support cubic infill the non-overhang triangles are
   ignored.
The AABB tree is no more used.
3) Optimized extraction of continuous infill lines in O(1) instead of O(n^2)
2020-09-17 18:39:28 +02:00
f58ee46687 WIP Refactoring of exceptions:
1) All slicer's exceptions are now derived from Slic3r::Exception.
2) New exceptions are defined for slicing errors.
3) Exceptions are propagated to the Plater to show.
It remains to modify the slicing back-end to throw the new SlicingError
exceptions instead of std::runtime_error and to show the other exceptions
by a message dialog instead of a notification.
2020-09-14 18:03:22 +02:00
2e11c4e5b9 Merge branch lm_seam_painter_frontend 2020-09-01 23:03:16 +02:00
58b6d94166 Custom seam: Model integration, backend invalidation, 3MF loading/saving 2020-09-01 22:35:01 +02:00
8e113adee0 Renamed FacetSupportType to EnforcerBlockerType
So it's not misleading if we use it for seam painting
2020-08-18 12:00:26 +02:00
2b2091d46c Modal estimated printing time dialog
Fixed conflicts after merge with master
2020-07-27 14:53:17 +02:00
fa4a160a2c TriangleSelector: 3MF loading and saving 2020-07-24 17:47:16 +02:00
efa8fe63aa TriangleSelector: Schedule restarting background process after edit 2020-07-24 17:47:16 +02:00
abe1cf6c61 TriangleSelector: backend is aware of divided triangles 2020-07-24 17:47:16 +02:00
438f758a2a TriangleSelector: Separated frontend/backend, support of multiple volumes, etc. 2020-07-24 17:47:16 +02:00
9ee4094f7c Merge branch 'master' of https://github.com/prusa3d/PrusaSlicer into et_gcode_viewer 2020-06-05 16:51:11 +02:00
745788157f Object merge: fixed merge of the objects with changed rotation, scale and mirror
+ Fixed get_object_stl_stats()
2020-06-05 13:15:49 +02:00
5bbc804744 Merge branch 'master' of https://github.com/prusa3d/PrusaSlicer into et_gcode_viewer 2020-05-27 14:29:54 +02:00
00878e21e9 Implemented merge of the objects to the one multi-part object
+ Implemented merge of the parts to the one object. But now this function doesn't used.

+ Fixed Model::looks_like_imperial_units()
2020-05-27 11:59:43 +02:00
acd8801d3a Fixed conflicts after merge with master 2020-05-27 10:32:02 +02:00
a8628a040c Include cleanup: do not include Model.hpp from 3DScene.hpp 2020-05-26 13:45:36 +02:00
0ad53b6036 Merge branch 'master' of https://github.com/prusa3d/PrusaSlicer into et_gcode_viewer 2020-05-21 10:15:24 +02:00
45006f6e0d Implemented "from/to imperial units conversation" for loaded objects and volumes 2020-05-20 20:07:31 +02:00
eb232bec0d Merge branch 'master' of https://github.com/prusa3d/PrusaSlicer into et_gcode_viewer 2020-05-19 07:57:19 +02:00
0c3adc6805 GCodeAnalyzer and GCodePreviewData removed from tech ENABLE_GCODE_VIEWER 2020-05-07 10:49:12 +02:00
ced8e42504 Imperial units: Implemented just for the object's position and size 2020-04-29 19:10:13 +02:00
0709d361d1 Merge branch 'lm_fdm_custom_supports_backend' 2020-04-24 15:16:33 +02:00
2275698f1b Add ModelArrange.hpp as extension to Model.hpp, use it for duplicating
Refactored Arrange interface: remove the union based BedShapeHint, replace it with proper function overloads

WARN: this commit is only intermediate, it does not compile.
2020-04-23 18:19:03 +02:00
34e8adeadd Custom supports data change forces invalidation of supports step 2020-04-22 11:16:28 +02:00
1abc17915d Custom supports data are saved into ModelObject and propagate to the backend
Invalidation of supports after they change is not implemented yet.
2020-04-16 16:57:46 +02:00
e3f0a2adf6 Fix arrange for large beds 2020-03-30 13:26:24 +02:00
04e4e01f1a ENABLE_BACKWARD_COMPATIBLE_RELOAD_FROM_DISK - Fixed inconsistencies for splitted and cutted objects 2020-02-07 09:49:48 +01:00
fed51de77f Fixed a crash during cut (typo introduced in 645f13a) 2020-01-31 08:54:41 +01:00
6687c029e8 Fixed regression of 71fa411100
where the PrintObject bounding box was not invalidated correctly
when the transformation matrices of instances changed.

Also refactored PrintObject::size() for const correctness.
2020-01-30 12:22:30 +01:00
322092a2f8 Merge branch 'master' into lm_tm_hollowing 2020-01-23 17:43:18 +01:00
eef74403bf Synchronized mode of color_print data to/from 3mf/amf
+ Code refactoring " CustomGCode extracted to separate namespace and file
2020-01-23 16:11:21 +01:00
a5ccb7a6c2 Merge branch 'master' into lm_tm_hollowing 2020-01-21 13:00:07 +01:00
d0955e38de Platter->Plater 2020-01-20 11:16:49 -05:00
e452247a97 Code refactoring to mode comparison 2020-01-17 12:24:58 +01:00