Commit Graph

958 Commits

Author SHA1 Message Date
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
Florian Foinant-Willig
df8c9d5def Disable closed Loft for less than 3 profiles 2024-10-14 17:35:54 +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
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
Florian Foinant-Willig
05f7047c66 [PD] Fix helix placement 2024-09-09 18:11:25 +02:00
wmayer
e53f976fcb PD: Fix compiler warning 2024-09-03 16:26:52 +02:00
bgbsww
d1ac4551aa Cleanup element map in Revolution and add test (#15959) 2024-09-02 17:59:44 +02:00
wwmayer
c5384dc36a 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
608c80b5a3 Toponaming: Remove remaining FC_USE_TNP_FIX defines 2024-08-31 13:21:10 -05:00
wmayer
a27aee999b PD: Fix compiler warning 2024-08-26 23:55:17 +02:00
bgbsww
e4a509cc77 Toponaming: Remove all FC_USE_TNP_FIX protected old code 2024-08-26 11:12:48 -05:00
bgbsww
5c2bd8b57e 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
Florian Foinant-Willig
096c5d215b [PD] helix fix 2024-08-24 20:38:58 -05:00
bgbsww
cb3df1d59c 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
0ab5887fe1 Toponaming: Missing shape hasher line; fixed cleaned Transformed 2024-08-13 07:07:59 -04:00
Chris Hennes
a1c586d7e2 Merge pull request #15845 from bgbsww/bgbsww-toponamingTransformedFixes
Toponaming: Fix transformed; abstract index element name generation
2024-08-12 08:48:11 -04:00
MisterMaker
c3b88f3b5a Update FeatureLoft.cpp (#15851)
caused compile issues on MSVC with PCH.
See
https://forum.freecad.org/viewtopic.php?t=89702
3976595dc3
2024-08-11 19:38:36 -04:00
bgbsww
5b7e03013e Toponaming: Fix transformed; abstract index element name generation 2024-08-10 23:02:05 -04:00
bgbsww
04d44075f2 Toponaming: Make FeatureThickness elementMap aware 2024-08-09 16:40:07 -04:00
bgbsww
fcd6d10748 Toponaming: fix loft mistake and complete test 2024-08-08 09:12:48 -05:00
bgbsww
4fd5b0b562 Toponaming: Additional element map changes to transform 2024-08-08 09:09:46 -05:00
Chris Hennes
9b898346a7 Revert "[PD] Revert 316506f, back to shell algo for some helix cases (#15678)"
This reverts commit 50add521d67939bfac2b259e54b77600fa03af25.
2024-08-06 18:54:46 -05:00
Florian Foinant-Willig
84e25ed38d [PD] Revert 316506f, back to shell algo for some helix cases (#15678)
* [PD] Revert 316506f, back to shell algo for some helix cases

* fix test accuracy
2024-08-05 10:40:00 -05:00
bgbsww
cfb4514df7 Toponaming: Update tests, implement missing subtractive operation tests,
fix helix and revolution
2024-07-30 09:12:58 -05:00
bgbsww
aade704d01 Toponaming: Cleanup review notes 2024-07-23 23:58:56 -05:00
luzpaz
bc150dc73c Fix trailing newlines and minor typo fixes 2024-07-23 16:16:30 +02:00
bgbsww
678f35fda2 Toponaming: Cleanup 2024-07-21 17:40:42 -04:00
bgbsww
19e450a667 Refactor all element name pairs into clearer struct names - renames 2024-07-20 16:32:12 -04:00
Zheng, Lei
af080ef0fe Toponaming: Missing getSubObject code in PartDesign::Body and SketchObject::getSubObject 2024-07-15 11:59:15 -04:00
bgbsww
ae6f7f25e8 Toponaming: Missing suppress property and code 2024-07-15 09:38:13 -05:00
Max Wilfinger
8ff5a1f688 Fix source string typos mentioned on Crowdin (#15261) 2024-07-08 17:18:31 -05:00
Max Wilfinger
86b1c2e863 Activate Part/Part Design check and refine preferences by default (#14406)
* Activate Part/Part Design check and refine preferences by default

* added bool in .ui

* Update tests

* Fix Sketcher tests
2024-07-01 10:50:42 -05:00
pre-commit-ci[bot]
3d6a490003 Review cleanups 2024-06-28 11:57:43 -05:00
bgbsww
08859462ea Toponaming: Cleanups 2024-06-28 11:57:43 -05:00
Zheng, Lei
3dbc1d7393 Toponaming: Transfer in missing Code for BaseFeatures and Sketches 2024-06-28 11:57:43 -05:00
mosfet80
5f38b52114 [MOD:PART] removed unused parameter (#14252)
d variable are never used

Co-authored-by: Chris Hennes <chennes@pioneerlibrarysystem.org>
2024-06-24 10:41:39 -05:00
wmayer
636fa43c99 MSVC: Fix warnings and build failure 2024-06-12 10:36:58 -05:00
Florian Foinant-Willig
b9dfc493b8 Fix can't pad a sketch on datum plane (#14397)
* Fix can't pad a sketch on datum plane

* Add a unit test for Pad a sketch on datum plane
2024-06-10 11:21:32 -05:00
Kacper Donat
988d31bed8 GUI: Add UI for Up To Shape feature
Add UI for Up To Shape feature and overall refactor of Pad / Pocket.
2024-06-10 18:05:21 +02:00
Chris Hennes
7abadaf7f3 Merge pull request #14485 from bgbsww/bgbsww-toponamingFixDressUpShadowSubs
Toponaming fix dress up shadow subs
2024-06-03 21:01:22 -05:00
bgbsww
617e63bc23 Toponaming: reformat code 2024-06-03 19:29:01 -04:00