This commit introduces PreviewUpdateScheduler class that is responsible
to schedule the true recompute of the preview. View Providers (or other
components) can use this service to ask for the preview recompute to
happend at a time that is convinent for a program and that won't impact
performance.
The provided implementation uses Queued Connections in Qt to calculate
preview essentially on next run of the event loop. It allows business
logic in FreeCAD (like property propagation) to execute fully and then
recompute preview once. This greately reduces number of recompute calls
for previews.
This recompute seemed unnecessary, and caused slowdowns when opening the file and recomputing. This decreases the time necessary to both open and recompute files that use boolean operations, and should not change anything regarding preview computation when the dialog is open.
* Part: Fix orientation of internal shells of a solid
If a solid consists of multiple shells then it can happen that the
internal shells have incorrect orientation that leads to a broken solid.
This fixes issue https://github.com/FreeCAD/FreeCAD/issues/24994
* Part: Add method Feature::fixSolids
This method explicitly checks for solids with the error
'BRepCheck_EnclosedRegion' that means that internal shells of a solid
are wrong.
Using ShapeFix_Solid fixes the solid.
---------
Co-authored-by: wwmayer <wmayer@freecad.org>
This reverts commit 527b2de560.
The `bakeInTransform()` call uses `transformGeometry()` which converts
planar faces to BSplineSurfaces. This prevents the refine algorithm
(BRepBuilderAPI_RefineModel) from detecting and merging coplanar faces,
breaking the Refine option for Boolean operations.
This matches Part WB's Boolean behavior which does not use
`bakeInTransform()` and has working refine functionality.
* PartDesign: Enable drag and drop of shapeBinders
* [pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
---------
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
In older versions of FreeCAD the boolean order was base + result. After
TNP mitigation the order was changed to be result + base. For the
resulting shape that does not matter, but order of edges can differ if
arguments are in a different order.
This can impact refine algorithm which may pick other face as the base
one and result in a differnt shape after refining. This commit restores
previous order. For most files it should not make any difference, but it
may fix some older files.
To support all cases we introduce FuseOrder compatibility property that
will be set to FeatureFirst for files saved with 1.0 to preserve
behavior.
* part design: partdesign: pd: fix regression issue #26223 add sketch sub element names for refs in revolutions
* refractor code to remove else blocks as every condition has a return statement, make lsp happy
* part design: fix issue #25639 use c++ exception to prevent crash
* [pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
---------
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
This fixes positioning of some previews for booleans that were misplaced
after #24750 was merged. It restores previous code that was correct for
most cases. The reason for some previews being misaligned is described
in the #25578 - the preview actually shows how the result should be but
due to some shortcuts taken in code the result is incorrect.
This commit removes a ton of dead code from FeatureBoolean. It might
been ported here from the Link branch but it is not used and it is
confusing. The reason for having that code here is also not really
obvious so there is no reason to keep it.