Commit Graph

2562 Commits

Author SHA1 Message Date
PaddleStroke
ad22aa3a8c PartDesign: Fix newSketch not working when editing a body from an external file. 2024-11-29 12:00:41 -05:00
wmayer
007b98df0e PD: Add test case to show the fix for the crash with active objects 2024-11-28 17:15:39 +01:00
wmayer
ab0b63e1e3 PD: Avoid touching the document when opening pad or pocket dialog 2024-11-28 17:11:42 +01:00
wmayer
2b4b8e4479 PD: Cleanup code of TaskRevolutionParameters 2024-11-22 11:59:21 -05:00
mwganson
fb642e9c9f [PartDesign] change claimChildren() function to include all profile objects except for other Part Design features 2024-11-22 11:51:30 -05:00
wmayer
ac14e2c960 MSVC: Fix compiler warnings 2024-11-22 16:53:00 +01:00
wmayer
4c5e3979ce PD: move refine model parameter to separate function 2024-11-22 11:59:49 +01:00
wmayer
01f5095aa8 PD: Fix convoluted event handling of dress-up task boxes 2024-11-22 11:55:46 +01:00
wwmayer
7a0154d1b1 PD: Add test case for #17184 (#17707) 2024-11-11 18:21:15 -03:00
Alfredo Monclus
78d57469af fix(PD): initialization of thread class and fit 2024-11-11 18:18:30 +01:00
Florian Foinant-Willig
b341dd1e64 Fix revolution with ShapeBinder profile (#17489)
* Fix revolution with ShapeBinder profile

* Remove log level init

---------

Co-authored-by: Chris Hennes <chennes@pioneerlibrarysystem.org>
2024-11-11 17:48:18 +01:00
Eric Price
f90c6f56d3 increase tolerance on helical shapes to avoid crash / broken geometry (#17356)
* increase tolerance on helical shapes to avoid crash

fix #17113
fix #9377
fix #11083

* added test cases for additive and subtractive helix

* fixed whitespace issue, reduced turncount for speed

* relaxed large scale testcases for OCCT 7.3 and below, work around windows CI error #17394

* Further reduce max size in test for buggy Ubuntu OCCT
2024-11-11 17:44:27 +01:00
Yorik van Havre
56a897cc96 Translations (#17725)
* 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-11-11 17:01:52 +01:00
wmayer
6b490fc8af PD: Fix default display mode of ViewProviderBoolean
Make sure that by default display mode is set to 'Flat Lines' instead of 'Group' as otherwise it won't show the result object
2024-11-05 16:24:33 -05:00
wmayer
4ac5c0bbed PD: If needed open another transaction for sketch creation
When creating a sketch in PartDesign a dialog is opened that gives the user the possibility to perform another action that may close the
active transaction. To make sure the creation of the sketch can be undone a new transaction must be opened.
2024-11-03 00:16:26 +01:00
wmayer
bd813f1df0 Tests: Add unit test to demonstrate failure of #17553 2024-11-02 23:45:02 +01:00
mwganson
4fd0e2c89d [PartDesign Groove/Revolution] minor dialog improvements, addresses issue #13298 2024-10-27 12:12:36 +01:00
wmayer
de647c5324 Fix compiler warnings 2024-10-26 00:48:04 +02:00
Chris Hennes
277c0215e7 Merge pull request #17435 from kadet1090/remove-midplane-twolengths
PD: Fix TwoLengths and Midplane both enabled
2024-10-24 22:29:17 -05:00
PaddleStroke
66d50e9b6e Update Workbench.cpp 2024-10-24 21:52:38 -05:00
PaddleStroke
b1d5d4c105 Part Design: Remove legacy/modern workflow checks. 2024-10-24 21:52:38 -05:00
Kacper Donat
d1451b2502 PD: Fix TwoLengths and Midplane both enabled
This scenario makes no sense, so it is removed from the code.
2024-10-23 21:16:57 +02:00
wmayer
6acfe3475b Part: Use Base::toRadians to convert degree to radian 2024-10-22 22:37:01 -05:00
Eric Price
aba60775f6 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
e4bf988db2 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
91ccd0ea07 PD: Explicitly switch off AllowCompound for some tests to make them succeed
Fixes #17363
2024-10-21 18:12:40 +02:00
wmayer
faa4db15cd 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
82e285424f [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
c8a5bdc59d Fix uptoshape crash when selecting a face without assigned shape 2024-10-17 20:26:14 -05:00
Florian Foinant-Willig
57db5acfbb PartDesign: Fix body shape not updated 2024-10-16 08:33:02 -05:00
Yorik van Havre
d79015a908 crowdin translations 2024-10-14 17:56:08 +02:00
Yorik van Havre
a698c75581 updated ts files 2024-10-14 17:56:08 +02:00
wmayer
e6f5946a9b 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
df8c9d5def Disable closed Loft for less than 3 profiles 2024-10-14 17:35:54 +02:00
wmayer
f26c696500 PD: Fix crash when clicking on invalid edge in task panel
Fixes #10843
2024-10-13 13:34:14 -05:00
Florian Foinant-Willig
151be5af1a Fix duplicate calculation at Task validation 2024-10-07 17:46:21 +02:00
Yorik van Havre
2a624e681c Merge pull request #16963 from FlachyJoe/fix_primitivePlacement
PartDesign: Fix primitive placement
2024-10-07 17:39:27 +02:00
mwganson
502f3182f8 [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
8945971578 [PD Helix] allow refinement to fail 2024-10-03 21:54:07 -05:00
Florian Foinant-Willig
84ab834044 [PD] Fix subtractive primitive placement 2024-10-02 13:40:21 +02:00
Florian Foinant-Willig
49ff068db8 [PD] fix change primitive AttachmentOffset move the body 2024-10-02 13:40:17 +02:00
Eric Price
531f1b609f 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
17323f274f 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 301194a69682633debfc919c4e146811d1b29617 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
1d204f57ec [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
3395a8d4a7 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
779fda5e4a 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
8161537def [PD] Fix Pad uptoshape and add unit test 2024-09-22 17:22:36 -05:00
bgbsww
98ce43e770 Update method names and clean 2024-09-22 14:44:50 -04:00
Zheng, Lei
2f0279d75f Transfer FeatureHole code 2024-09-21 14:53:33 -04:00
Florian Foinant-Willig
e157f0616a [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