Commit Graph

2539 Commits

Author SHA1 Message Date
Eric Price
cf8ad66373 Fix boolean operations (#17119)
* add BRepAlgoAPI wrapper files to CMakeList

* introduce wrapper for BRepAlgoAPI_BooleanOperation and derivatives, set sensible default Fuzzyness for boolean operations

* allow default fuzzyness to be set in settings - including off

* backwards compatibility with OCCT 7.3.3 - removed newer paramateres from wrapper

* added missing header

* reverted src/Mod/Part/App/OpenCascadeAll.h to original state

* implement some changes suggested by @wwmayer

* removed unneeded destructor definitions

* moved getDefaultFuzzyValue into its own helper class

* removed unneeded references to base class default constructor

* default to SetRunParallel(Standard_True) as suggested by @FlachyJoe

* fixed license header as requested

* Added new method to autocalculate fuzzyness to BooleanOperation base class and use it for those parts that do not call the obsolete constructor but also do not set precision

* implemented static variable solution as suggested by @wwmayer

* added helix for test case

* Refactoring FCRepAlgoAPI to FCBRepAlgoAPI

* Added Test Case (fuse cylinder with helix with different working and non-working Fuzzy values)

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

* increased default value of FuzzyBoolean and made tests more robust for compatibility with OCCT 7.3

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

* fixes for FREECAD_USE_PCH - allow testing of FREECAD_USE_PCH on linux with cmake switch (default OFF)

* removed surplus line - wasn't needed after all

* included precompiled as instructed

* set anti-corruption flag in boolean operations, ensures source shape is not damaged in OCCT 7.1 and higher

* fix #17085

* disable subtests that were too specific for now

* fixed all CLI tests - see comments in Pull Request https://github.com/FreeCAD/FreeCAD/pull/17119#issuecomment-2420772452

* Update src/Mod/PartDesign/PartDesignTests/TestTopologicalNamingProblem.py

suggested updated test by CalligaroV

Co-authored-by: Vincenzo Calligaro <vincenzo.calligaro@gmail.com>

* Update tests/src/Mod/Part/App/TopoShapeExpansion.cpp

suggested updated test by CalligaroV

Co-authored-by: Vincenzo Calligaro <vincenzo.calligaro@gmail.com>

* Update tests/src/Mod/Part/App/TopoShapeExpansion.cpp

suggested updated test by CalligaroV

Co-authored-by: Vincenzo Calligaro <vincenzo.calligaro@gmail.com>

* Update tests/src/Mod/Part/App/TopoShapeExpansion.cpp

suggested updated test by CalligaroV

Co-authored-by: Vincenzo Calligaro <vincenzo.calligaro@gmail.com>

* Update tests/src/Mod/Part/App/TopoShapeExpansion.cpp

suggested updated test by CalligaroV

Co-authored-by: Vincenzo Calligaro <vincenzo.calligaro@gmail.com>

* Update tests/src/Mod/Part/App/TopoShapeExpansion.cpp

suggested updated test by CalligaroV

Co-authored-by: Vincenzo Calligaro <vincenzo.calligaro@gmail.com>

* Update tests/src/Mod/Part/App/TopoShapeExpansion.cpp

suggested updated test by CalligaroV

Co-authored-by: Vincenzo Calligaro <vincenzo.calligaro@gmail.com>

* Update tests/src/Mod/Part/App/TopoShapeExpansion.cpp

suggested updated test by CalligaroV

Co-authored-by: Vincenzo Calligaro <vincenzo.calligaro@gmail.com>

* Update tests/src/Mod/Part/App/TopoShapeExpansion.cpp

suggested updated test by CalligaroV

Co-authored-by: Vincenzo Calligaro <vincenzo.calligaro@gmail.com>

* Update tests/src/Mod/Part/App/TopoShapeExpansion.cpp

suggested updated test by CalligaroV

Co-authored-by: Vincenzo Calligaro <vincenzo.calligaro@gmail.com>

* Update tests/src/Mod/Part/App/TopoShapeExpansion.cpp

suggested updated test by CalligaroV

Co-authored-by: Vincenzo Calligaro <vincenzo.calligaro@gmail.com>

* Update tests/src/Mod/Part/App/TopoShapeExpansion.cpp

suggested updated test by CalligaroV

Co-authored-by: Vincenzo Calligaro <vincenzo.calligaro@gmail.com>

* Update tests/src/Mod/Part/App/TopoShapeExpansion.cpp

suggested updated test by CalligaroV

Co-authored-by: Vincenzo Calligaro <vincenzo.calligaro@gmail.com>

* Update tests/src/Mod/Part/App/TopoShapeExpansion.cpp

suggested updated test by CalligaroV

Co-authored-by: Vincenzo Calligaro <vincenzo.calligaro@gmail.com>

* Update tests/src/Mod/Part/App/TopoShapeExpansion.cpp

Co-authored-by: Vincenzo Calligaro <vincenzo.calligaro@gmail.com>

* remove surplus tests from github suggestion interface bug

* hide the BooleanFuzzy variable - can now be only set by manually editing the config file
i
in FCParamGroup "Boolean"
<FCFloat Name="BooleanFuzzy" Value="10.000000000000"/>

* Suggestion by @FlachyJoe - add validity checks to the base and tool shape in any direct boolean op

---------

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
Co-authored-by: Vincenzo Calligaro <vincenzo.calligaro@gmail.com>
2024-10-21 18:38:51 +02:00
David Carter
0804d80ebf Materials: Child ignoring parent material
Inherit the material from the parent object when creating a new object,
such as during a boolean operation, or when extruding a sketch.

fixes #15503
2024-10-21 18:20:20 +02:00
wmayer
e3246e13a0 PD: Explicitly switch off AllowCompound for some tests to make them succeed
Fixes #17363
2024-10-21 18:12:40 +02:00
wmayer
990b9b27fe Part/PD: Fix cone creation if both radii are equal
The cone features in Part and PartDesign automatically create a cylinder if top and bottom radius are identical. However, the algorithm
ignores the angle and always creates a full cylinder.
2024-10-21 17:53:25 +02:00
mwganson
5b6e886a3c [PartDesign DuplicateSelected] do not put duplicated feature into active body if it is already in another body -- addresses issue #6278 2024-10-21 17:37:15 +02:00
Florian Foinant-Willig
ef2156d0f6 Fix uptoshape crash when selecting a face without assigned shape 2024-10-17 20:26:14 -05:00
Florian Foinant-Willig
aa78eb351e PartDesign: Fix body shape not updated 2024-10-16 08:33:02 -05:00
Yorik van Havre
e8fc9cf45f crowdin translations 2024-10-14 17:56:08 +02:00
Yorik van Havre
6c08b5a63c updated ts files 2024-10-14 17:56:08 +02:00
wmayer
7e473beed0 PD: Disable PartDesign_CompDatums & PartDesign_CompSketches if dialog is open
A group command is not disabled if its default command is disabled. This allows it to invoke the command when it should be impossible.
To fix the problem override the isActive() method in the sub-classes CmdPartDesignCompDatums & CmdPartDesignCompSketches

This fixes #16294
2024-10-14 17:55:12 +02:00
Florian Foinant-Willig
0c59bfc718 Disable closed Loft for less than 3 profiles 2024-10-14 17:35:54 +02:00
wmayer
f9547e8231 PD: Fix crash when clicking on invalid edge in task panel
Fixes #10843
2024-10-13 13:34:14 -05:00
Florian Foinant-Willig
c1c9cb63e0 Fix duplicate calculation at Task validation 2024-10-07 17:46:21 +02:00
Yorik van Havre
6c3c559225 Merge pull request #16963 from FlachyJoe/fix_primitivePlacement
PartDesign: Fix primitive placement
2024-10-07 17:39:27 +02:00
mwganson
dfafbfb040 [PartDesign AllowCompound] recompute all features when AllowCompound property is changed either from true to false or from false to true 2024-10-07 08:56:07 -05:00
Florian Foinant-Willig
142f2aff39 [PD Helix] allow refinement to fail 2024-10-03 21:54:07 -05:00
Florian Foinant-Willig
22131b3c93 [PD] Fix subtractive primitive placement 2024-10-02 13:40:21 +02:00
Florian Foinant-Willig
2276ffbf0a [PD] fix change primitive AttachmentOffset move the body 2024-10-02 13:40:17 +02:00
Eric Price
594010d9f0 PadDesign: Work around issue 16690
This is a stopgap measure, I don't know if the underlying issue is fully understood - but this prevents it from happening in the given test case.

By overriding the base for the pocket prism, which is a trick also applied by
TopoShape::makeElementPrismUntil() if the prism creation fails on first try, the bug where said prism goes to the wrong shape is avoided - this on its own would however break a pad in the inverse case, so we only do that when pocketing
2024-09-30 17:47:47 +02:00
Eric Price
256ad7a01a PartDesign: Loft Intelligence - Select the whole sketch if the selected shape is … (#16791)
* Loft Intelligence - Select the whole sketch if the selected shape is a component of a sketch that is not a vertex (Fix #16630)

In fa8f29aed4 FeatureLoft.cpp was refactured, dropping some functionality, mainly the ability to create lofts to entire sketches or other 2d shapes if a single component that was not a single vertex was selected as either the base shape or a section

the old code was:

1     auto getSectionShape =
2          [](App::DocumentObject* feature, const std::vector<std::string> &subs) -> TopoDS_Shape {
3              if (!feature ||
4                  !feature->isDerivedFrom(Part::Feature::getClassTypeId()))
5                  throw Base::TypeError("Loft: Invalid profile/section");
6
7              auto subName = subs.empty() ? "" : subs.front();
8
9              // only take the entire shape when we have a sketch selected, but
10             // not a point of the sketch
11             if (feature->isDerivedFrom(Part::Part2DObject::getClassTypeId()) &&
12                 subName.compare(0, 6, "Vertex") != 0)
13                 return static_cast<Part::Part2DObject*>(feature)->Shape.getValue();
14             else {
15                 if(subName.empty())
16                     throw Base::ValueError("No valid subelement linked in Part::Feature");
17                 return static_cast<Part::Feature*>(feature)->Shape.getShape().getSubShape(subName.c_str());
18             }
19         };

this commit forward-ports the missing functionality provided by line 7-12 in above snippet

* Code cleanup as suggested by (#16791)
2024-09-24 15:01:26 -05:00
Florian Foinant-Willig
490d6c5abc [PD] Fix Pad uptoface with custom direction (#16539)
* [PD] Fix Pad uptoface with custom direction

* Add unit test
2024-09-24 11:30:01 -05:00
Yorik van Havre
abd5c3ca31 Translations (#16754)
* Updated ts files

* merged crowdin translations

* [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>
2024-09-23 14:09:56 -04:00
Benjamin Nauck
fdfb9fd2c6 Reuse Std_Delete shortcut instead of hardcoding Delete (#16682)
* Reuse Std_Delete shortcut in TaskBooleanParameters

* Reuse Std_Delete shortcut in TaskDressUpParameters

* Reuse Std_Delete shortcut in TaskLoftParameters

* Reuse Std_Delete shortcut in TaskPipeParameters

* Reuse Std_Delete shortcut in TaskSapeBinder

* Reuse Std_Delete shortcut in TaskTransformedParameters

* Reuse Std_Delete shortcut in TaskExtrudeParameters

* Reuse Std_Delete shortcut in TaskSections

* Reuse Std_Delete shortcut in MaterialSave

* Reuse Std_Delete shortcut in Array2D

* Reuse Std_Delete shortcut in TaskFemConstraint

* [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>
2024-09-23 10:53:39 -05:00
Florian Foinant-Willig
22fbfeddc2 [PD] Fix Pad uptoshape and add unit test 2024-09-22 17:22:36 -05:00
bgbsww
c5ad54d5a8 Update method names and clean 2024-09-22 14:44:50 -04:00
Zheng, Lei
b2d6787571 Transfer FeatureHole code 2024-09-21 14:53:33 -04:00
Florian Foinant-Willig
8b9f5bdc4f [PD] fix pad uptoface and uptoshape (#16030)
* [PD] fix Pad UpToFace and UpToShape
* specify struct pointers for Win
* Rename variables for MSVC compatibility - windows.h defines 'near' and 'far' as macros
* Add unit test

---------

Co-authored-by: Chris Hennes <chennes@pioneerlibrarysystem.org>
2024-09-19 08:51:18 -05:00
Yorik van Havre
56dbb6532a Translations (#16582)
* updated ts files

* merged crowdin translations

* [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>
2024-09-19 09:36:54 +02:00
bgbsww
e4ad21e48f If we are creating a Sketch inside a Body that is in a link, use link position 2024-09-18 08:35:20 -05:00
bgbsww
0f53f2195d Add override flag for recomputes; set it in relevant tests with old files. 2024-09-16 17:49:35 +02:00
Yorik van Havre
7b3eca8396 Translations (#16389)
* Translations: Updated ts files

* Translations: Merged crowdin translations

* [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>
2024-09-09 18:25:52 +02:00
Florian Foinant-Willig
355610cfb3 [PD] Fix helix placement 2024-09-09 18:11:25 +02:00
wmayer
6812aca7f8 PD: Fix compiler warning 2024-09-03 16:26:52 +02:00
bgbsww
85c1f5c47c Toponaming: Fix ctrl selection issues by looking up element names and setting up detail path 2024-09-02 18:28:11 +02:00
bgbsww
24bb499c1f Cleanup element map in Revolution and add test (#15959) 2024-09-02 17:59:44 +02:00
wwmayer
e98ffc3060 PartDesign: Prepare for clang-format (#16048)
* PartDesign: Prepare for clang-format

* [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>
2024-09-02 17:48:26 +02:00
bgbsww
2a541c9536 Toponaming: Remove remaining FC_USE_TNP_FIX defines 2024-08-31 13:21:10 -05:00
Yorik van Havre
b065691032 Merged crowdin translations 2024-08-28 17:51:34 +02:00
Yorik van Havre
5df158352a Updated ts files 2024-08-28 17:50:59 +02:00
wmayer
c80fd64c82 PD: Fix compiler warning 2024-08-26 23:55:17 +02:00
bgbsww
34030c9ece Toponaming: Run black on the entire toponaming python test file. 2024-08-26 11:19:47 -05:00
wmayer
3e33f184b4 Core: Rename ViewProviderPythonFeature to ViewProviderFeaturePython
Fixes #15888
2024-08-26 18:14:22 +02:00
bgbsww
ecf7e51ab3 Toponaming: Remove all FC_USE_TNP_FIX protected old code 2024-08-26 11:12:48 -05:00
bgbsww
8c08549f5a Update to Toposhape versions and fix shapebinder references with test (#16036)
* Update to Toposhape versions and fix shapebinder references with test

* Update src/Mod/PartDesign/PartDesignTests/TestShapeBinder.py

---------

Co-authored-by: Chris Hennes <chennes@pioneerlibrarysystem.org>
2024-08-26 10:50:18 -05:00
Alfredo Monclus
70d0d50746 fix(PD): threadtype combobox too small for metric fine 2024-08-25 19:35:25 -05:00
Florian Foinant-Willig
ffb2ebe4c6 [PD] helix fix 2024-08-24 20:38:58 -05:00
bgbsww
c8c657eefe Fix shape color / materials issues in fuse 2024-08-22 18:53:55 -05:00
wmayer
0dae7353d1 PD: Make PD tests more robust
If in the user settings the refinement is switched off several PD tests will fail. This change explicitly sets the Refine property to True to guarantee correct behaviour
2024-08-18 11:50:33 -05:00
bgbsww
f0982d1d61 Toponaming: Fuse call makeElementRefine; remove deprecated refineSha… (#15897)
* Toponaming:  Fuse call makeElementRefine; remove deprecated refineShapeIfActive
* Part/Toponaming: import code for MultiFuse::execute() from LS3
* added expected values of testRefine

Co-authored-by: Zheng, Lei <realthunder.dev@gmail.com>
Co-authored-by: CalligaroV <vincenzo.calligaro@gmail.com>
Co-authored-by: Chris Hennes <chennes@pioneerlibrarysystem.org>
2024-08-18 11:49:05 -05:00
bgbsww
a1ce983035 Toponaming: Missing shape hasher line; fixed cleaned Transformed 2024-08-13 07:07:59 -04:00