Commit Graph

57 Commits

Author SHA1 Message Date
FEA-eng
b9efb481a2 PartDesign: Correct typo in multiple solids error (#23642)
* PartDesign: Update FeatureFillet.cpp

* PartDesign: Update FeaturePipe.cpp

* PartDesign: Update FeatureLoft.cpp

* PartDesign: Update FeatureExtrude.cpp

* PartDesign: Update FeatureGroove.cpp

* PartDesign: Update FeatureBoolean.cpp

* PartDesign: Update FeatureChamfer.cpp

* PartDesign: Update FeatureHole.cpp

* PartDesign: Update FeatureDraft.cpp

* PartDesign: Update FeatureRevolution.cpp

* PartDesign: Remove empty lines added by GitHub editor

* PartDesign: Remove empty lines added by GitHub editor

* PartDesign: Remove empty lines added by GitHub editor

* PartDesign: Remove empty lines added by GitHub editor

* PartDesign: Remove empty lines added by GitHub editor

* PartDesign: Remove empty lines added by GitHub editor

* PartDesign: Remove empty lines added by GitHub editor

* PartDesign: Remove empty lines added by GitHub editor

* PartDesign: Remove empty lines added by GitHub editor
2025-09-04 14:36:15 +00:00
FEA-eng
0bf22ffca8 PartDesign: Update missed error message about multiple solids (#23392)
* PartDesign: Update FeatureLoft.cpp

* PartDesign: Update FeatureExtrude.cpp

* PartDesign: Update FeaturePipe.cpp

* PartDesign: Remove empty lines added by GitHub editor

* PartDesign: Remove empty lines added by GitHub editor
2025-08-27 09:37:53 +00:00
FEA-eng
b7c233b94e PartDesign: Update error message about multiple solids (#23286) 2025-08-22 18:29:50 +00:00
Ladislav Michl
9a5d934eab PD: Fix loft between curved faces
Fixes issue 19183 also reported in the forum:
https://forum.freecad.org/viewtopic.php?p=806495
https://forum.freecad.org/viewtopic.php?t=88234

The actual reason for the failure is that the new code uses
FaceMakerBullseye method which expects coplanar wires.
The code was using FaceMakerCheese previously which changed
in LinkStage with their commit 93ce3edfe7ff
("PD: use FaceMakerBullseye for feature Loft")
and was imported here with TNP mitigations.

As changing it back would cause different regressions, lets
try different facemakers until one succeeds.

Fixes: fa8f29aed4 ("Toponaming/Part: Fix all getBaseTopoShape calls...")
Co-authored-by: Benjamin Nauck <benjamin@nauck.se>
Co-authored-by: Werner Mayer <wmayer@freecad.org>
2025-08-03 19:14:09 +02:00
wmayer
48785dfd0e PD: Fix crash in Loft::getSectionShape
The passed DocumentObject pointer can be null which is nowhere checked.
This fixes issue 19545

Fixes: 256ad7a01a ("PartDesign: Loft Intelligence - Select the whole sketch if the selected shape is ...")
2025-07-18 09:57:29 -05:00
wmayer
23d93e45ff PD: Correctly handle single solid rule for loft with and without base 2025-06-25 00:14:15 +02:00
wmayer
eb52dd4a9a PD: Fix regression about single-solid check
For several PD features the single-solid check fails. The regression
is caused by PR 13960 and reported as issue 19002. The reason for the
failure is that the first solid of the output shape is retrieved and
then checked for a single solid. This test will always pass, of course.

The single-solid is fixed for these features:
* Pad
* Pocket (never worked there)
* Fillet
* Chamfer
* Groove (never worked there)
* Revolution (never worked there)
* Loft

Fixes: 935bdf9a0f ("PartDesign: Refactor single-solid rule enforcement")
2025-06-25 00:09:33 +02:00
theo-vt
13e7952ccc PartDesign: Fix hole centered on point edge case (#21257)
* Light refactor of getTopoShape function

* Fix hole edge case

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

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

* Update src/Mod/Part/App/PartFeature.cpp

Co-authored-by: Kacper Donat <kadet1090@gmail.com>

* Update src/Mod/Part/App/PartFeature.cpp

Co-authored-by: Kacper Donat <kadet1090@gmail.com>

* Update src/Mod/Part/App/PartFeature.cpp

Co-authored-by: Kacper Donat <kadet1090@gmail.com>

* Update src/Mod/Part/App/PartFeature.cpp

Co-authored-by: Kacper Donat <kadet1090@gmail.com>

* Refactor simplifyCompound()

* Use Base::Flags<GetShapeOption>

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

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

* Shorten enum name and move it from class scope to namespace scope

* [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>
Co-authored-by: Kacper Donat <kadet1090@gmail.com>
2025-05-29 22:37:54 +02:00
bofdahof
965af2bf9a PartDesign: apply std::ranges 2025-03-16 17:17:15 -05:00
Chris Hennes
cb93a4ae18 Merge branch 'main' of https://github.com/FreeCAD/FreeCAD into bgbsww-toponamingAddFeatureRefine 2025-02-11 20:58:58 -06:00
Chris Hennes
a56756d814 PD: Add onlyHaveRefined() to FeatureRefine 2025-02-07 21:44:43 -06:00
Benjamin Nauck
dd6aa9f3c7 Prefer to use BaseClass's isDerivedFrom<T> over non template or Base::Type's
Regex based changes, manually verified
2025-01-27 16:08:18 +01:00
Florian Foinant-Willig
70184ba59d PartDesign: decouple refine and other geometric computation (#17008) 2024-12-02 10:57:30 -06:00
Florian Foinant-Willig
0c59bfc718 Disable closed Loft for less than 3 profiles 2024-10-14 17:35:54 +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
bgbsww
ecf7e51ab3 Toponaming: Remove all FC_USE_TNP_FIX protected old code 2024-08-26 11:12:48 -05:00
MisterMaker
d62444e230 Update FeatureLoft.cpp (#15851)
caused compile issues on MSVC with PCH.
See
https://forum.freecad.org/viewtopic.php?t=89702
4925957185
2024-08-11 19:38:36 -04:00
bgbsww
4925957185 Toponaming: fix loft mistake and complete test 2024-08-08 09:12:48 -05:00
bgbsww
6a5207f7a8 Toponaming: Cleanup review notes 2024-07-23 23:58:56 -05:00
wmayer
9b198c7704 MSVC: Fix warnings and build failure 2024-06-12 10:36:58 -05:00
bgbsww
12619b2c2d TopoNaming: restore defenses against multisolids when enabled 2024-05-21 21:42:05 -04:00
Kacper Donat
935bdf9a0f PartDesign: Refactor single-solid rule enforcement
This refactors a single solid rule checking code from using the solid
count directly to using well abstracted `isSingleSolidRuleSatisfied`
method. This makes code easier to read and is the basis for next step
which is allowing users to disable this checks.
2024-05-20 12:25:36 -04:00
bgbsww
b72a8c4222 Toponaming: Bring in Chamfer, Fillet code and add tests (#14035)
* Toponaming: bring in missing code fragments in Sketcher

* Toponaming: Fix infinite recursion, remove debug cruft, rough in fillet test

* Bring in missing code; fix chamfers

* Toponaming: Add code for fillets and test
2024-05-15 19:43:30 -04:00
bgbsww
fa8f29aed4 Toponaming/Part: Fix all getBaseTopoShape calls. Tests and missing code. 2024-04-26 21:15:11 -05:00
Chris Hennes
80b29d2dbf Gui: Minor translation fixes 2023-05-11 18:31:34 -05:00
Chris Hennes
1995d84edd PD: Add translation to error messages 2023-04-28 11:32:56 -05:00
wmayer
580b775690 clang: fix -Wunused-parameter, -Wunused-variable, -Wswitch 2023-03-12 15:05:21 +01:00
Alexander Golubev
088f51632b PD: Fix Loft's Closed option
Closes: https://github.com/FreeCAD/FreeCAD/issues/6156
2023-03-09 01:48:32 +01:00
berniev
da9ebc572f Mod: redundant void 2 2022-08-08 10:27:50 +02:00
wmayer
3608ee7f51 PD: modernize C++11
* use nullptr
2022-03-23 19:26:14 +01:00
Uwe
7162c1a1f4 [PD] final work to remove unused includes 2022-02-22 02:18:49 +01:00
wmayer
b428fb2afa PD: handle Base::Exception in Loft::execute 2021-12-15 16:24:42 +01:00
Ajinkya Dahale
bc90f4480b [PD] Use compare to compare strings instead of substr
Used when finding subelements of a feature. Many of the comparisons used to also
check for string lengths, but as far as I can tell they are not strictly
necessary (see https://www.cplusplus.com/reference/string/string/substr/) and
just `substr` can be used without them. However, `compare` explicitly is for
comparing, and does not make a new object that `substr` does.
2021-11-28 22:05:46 +01:00
Ajinkya Dahale
ab26d4d0d2 [PD] Change some strings and comments in loft code
Suggestions by @donovaly.
2021-11-22 04:16:02 +01:00
Ajinkya Dahale
4483c7afd1 [PD] Refactor Loft::execute() and support points for sections
This is a combination of 4 commits. Original commit messages follow.

[PD] Initial support for point sections in loft

This commit allows the last section in a loft to be a single vertex of a solid.
Currently single vertices of sketches or datum points are NOT supported.

[PD] Allow loft "profiles" to be points

Most reliably done in dialog-based workflow.

[PD] Allow loft last section to be sketch point

[PD] Refactor `Loft::execute`

Makes it easier to support adding a single-vertex sketch in profile or sections
field when selecting the sketch in tree (i.e. without selecting subelements).

[PD] Refactoring after PR #5176 is merged
2021-11-22 04:16:02 +01:00
Uwe
640ecca830 [PD] fix typos 2021-11-13 00:29:33 +01:00
Uwe
cc242aae7d [PD] handle changed property for loft and pipe
- this was missing in PR #5155
2021-11-11 01:24:53 +01:00
Ajinkya Dahale
03a8ff7841 [PD] Support adding solid faces for loft and pipe sections
With these changes, one face per solid can be added as either the first
"profile" or subsequent sections in loft and pipe.

This commit depends on `App::PropertyXLinkSubList` preserving the order in which
sections are added.

A minor change this also adds is that when a solid's face is selected that face
is mentioned in the fields instead of the solid (eg `Box:Face1` instead of
`Box`).
2021-11-09 23:05:29 +01:00
David Osterberg
7803740edd PartDesign: Subtractive Loft. Raise error when base is null.
Previously Subtractive loft would create a shape if there is no base
object. This is because the code is shared with Additive Loft, where
that is the right thing to do. Now we check for this, and return error
if there is nothing to subtract from.
2021-02-15 19:50:51 +01:00
asapelkin
e951094af9 use emplace_back instead of push_back where justified 2019-11-21 14:48:09 +01:00
Abdullah Tahiri
a415ad72e1 PartDesign: 3rdParty to PCH 2019-05-02 07:12:27 +02:00
wandererfan
7e781bcfd0 Revise multiple solids message 2018-07-13 10:23:42 -03:00
wandererfan
883a726d52 Fix #3401 warning on multiple solid
- PartDesign only uses the first result shape
  of an operation and discards the rest without
  warning.

- this also fixes #1707
2018-07-13 10:23:42 -03:00
luzpaz
56111a0810 Typos: user-facing and trivial
Several typos and uniformity fixes.
Note: 
*SCL/SimpleDataTypes.py is a upstream stepcode file whose fiz has been submitted upstream and accepted.
*the header of Tools/generateBase/generateMetaModel_Module.xsd  had redundant data. It has been removed. Please double check it.
2017-12-02 14:00:57 +01:00
wmayer
949c86d364 Port to occ7.2:
+ Standard_Failure::Caught() is now marked as deprecated and should be replaced with standard C++ exception handling
2017-09-01 16:27:46 +02:00
Peter Lama
a75a98ef27 Use OCCT Handle macro for Handle_ classes
This is the result of running OCCT's upgrade script provided
with OCCT 7.0. See
https://www.opencascade.com/content/freecad-occt710-and-windows-rtti-data-missing#comment-form
and
https://www.forum.freecadweb.org/viewtopic.php?f=4&t=21405&start=120#p169019
for why this is necessary for OCCT >= 7.1
2017-04-20 12:27:34 +02:00
DeepSOIC
320763d78a PartDesign: port to use FaceMaker
Minimalistic port. Only re-use code that was duplicate before.
2016-10-01 23:13:44 +03:00
wmayer
e8b36592c0 fix Coverity issues 2016-08-21 18:46:40 +02:00
Stefan Tröger
83ce80f133 fixes #0002512 Allow multi-face part design tools 2016-05-18 23:54:18 +02:00
Stefan Tröger
f712f5e4ac PartDesign: Modeling features work with faces
-Rename Sketchbased to ProfileBased to show new behavior
-Adopt ProfileBased to make the relevant helper functions work with faces too
-Adopt features for unified use of helper functions
-Adopt commands to allow face selection
2016-04-12 18:12:22 +02:00