Commit Graph

140 Commits

Author SHA1 Message Date
wmayer
3e09b8ee2d PD: modernize C++: use range-based for loop 2023-08-16 21:54:56 -05:00
Florian Foinant-Willig
63187bf88b PartDesign: UpToFace check isnull
The next line crash if upToFace is null.
2023-07-24 14:40:15 +00:00
Uwe
79aa19d920 [PD] enable padding to touching planes
- this patch is from @@FlachyJoe
- as reported here: https://forum.freecadweb.org/viewtopic.php?p=646231#p646231
it was impossible to pad to a face which is touching the sketch despite is is no parallel to the extrusion Direction
2022-12-12 13:04:05 +01:00
wmayer
319b63cbda PD: remove parameter 'supportface' from ProfileBased::getUpToFace as it's not used any more 2022-12-05 12:46:52 +01:00
Uwe
f79c66dc33 [PD] Pad/pocket: fix wrong error message
- the error can also occur when the mode it not UpToFace (ToFirst or ToLast)
- also add note when Reversed checkbox is enabled since this is no obvious (as discussed in the forum)
- also some whitespace unification and include sorting
2022-12-04 05:37:11 +01:00
Uwe
d02871298a [PD] FeatureSketchBased: fix orthogonal check
- same fix as #7879
- also fix wording on an error message and improve a variable name
2022-12-04 05:31:51 +01:00
berniev
f4ffd15864 Mod: redundant void 2 2022-08-08 10:27:50 +02:00
berniev
53ba98d636 Mod: use empty 2022-08-06 19:30:13 +02:00
Uwe
24468b59ad re-add some nullptr
to be safe since their removal within assert() or bools might have some impact I don't know
2022-07-18 02:32:36 +02:00
Uwe
dfecb337e7 [PD] remove more superfluous nullptr checks 2022-07-18 01:33:28 +02:00
Uwe
ac6235c577 [PD] App: remove superfluous nullptr checks
- also Body: get rid of some nasty single-letter variables
2022-07-17 18:07:00 +02:00
wmayer
da70aa2dc6 PD: fix ProfileBased::getSupportFace() to also handle the case where a support face is selected 2022-07-16 16:08:09 +02:00
wmayer
423aaccd3f PD: rename getUpToFaceFromLinkSub to getFaceFromLinkSub 2022-07-16 15:59:54 +02:00
andrea
c66aadeb60 removed references to OCC<7 2022-06-25 14:29:24 +02:00
Uwe
8a8fe98454 fix some occurrences where size() is misused as Boolean
- as suggested by @wwmayer: 70714eedc9 (r69648152)
2022-03-27 21:38:15 +02:00
wmayer
d1d4b996e7 PD: modernize C++11
* use nullptr
2022-03-23 19:26:14 +01:00
wmayer
d42b9a2fe1 PD: fix const correctness in ProfileBased 2022-02-28 18:10:58 +01:00
Uwe
19bdfc16b8 [PD] more work to remove unused includes 2022-02-21 02:18:17 +01:00
Uwe
f498cd1d32 [PD] App: remove unused includes 2022-02-20 20:41:46 +01:00
wmayer
0c583fb7fa Part: fix typos in make* functions 2022-02-16 12:48:02 +01:00
Uwe
f6d450b947 [PD] change default FaceMaker to Bullseye
Part does already use this FaceMaker since it can also handle islands.

The PR therefore
- uniforms the behavior of PD and Part
- fixes #6366
- enables to use nested sketches for the various PD features like Revolve
2022-02-16 11:20:02 +01:00
Uwe
cb261ed2aa [PD] moves Extrude code to FeatureExtrude
* [PD] moves Extrude code to FeatureExtrude

- since the Extrude code is only used by Pocket/pad, it should better in FeatureExtrude
2022-02-12 19:37:53 +01:00
wmayer
a6860310fc PD: fix 'stack-use-after-scope' crash 2022-02-08 17:16:59 +01:00
Uwe
12b0e0dd92 [PD] add option to create tapered Pad / Pocket
This PR adds the same functionality as provided by Part Extrude.
The used code parts are sorted out to a new helper function that is used by Part and PartDesign.
2022-02-02 01:04:06 +01:00
wmayer
8e51af8ffe PD: fix bad formatting 2022-01-23 11:07:59 +01:00
Uwe
167950a7cd [PD] FeatureSketchBased: only style fixes
to reduce diffs of coming and pending PRs

all fixes were automatically made by MSVC
2022-01-23 04:50:52 +01:00
Uwe
0cd329de73 [PD] sort includes
- to keep the overview
- removed double entries
- will make diff of pending PRs smaller
2022-01-09 21:36:07 +01:00
wmayer
c1289a0d6f PD: 0004759: Bad error message when creating pad with 0 length 2021-12-07 10:09:11 +01:00
wmayer
d4f0eb5bfb PD: fix ProfileBased::getAxis
Introduce an enum to verify the axis depending on the used context.
* For helix no restriction is needed
* For Pad/Pocket the axis must not be parallel with the sketch plane
* For Revolve/Groove the axis must not be perpendicular with the sketch plane
2021-12-02 17:24:18 +01:00
Ajinkya Dahale
5e3ad45ef4 [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
wmayer
dd0afb0b0d PD: If pad/pocket is directly used on several faces then determine the normal of the first face 2021-11-22 11:52:17 +01:00
donovaly
7bfede97b7 [PD] add feature to select pad direction via an edge
This was requested by users in the forum and is indeed very valuable for the usability.
2021-09-20 00:59:16 +02:00
wmayer
fff27ee78b PD: fix ProfileBased::Restore to not affect sub-classes that need to handle changed property types/names 2021-09-15 15:45:24 +02:00
luz paz
4d21ffa904 Fix various typos 2021-07-31 09:46:50 +02:00
wmayer
09f93b2e8d PD: fix several issues in pad:
* pass boolean instead of int to setValue of PropertyBool
* support of symmetric option for two-length mode
* fix bug in TaskPadParameters::updateUI()
* remove strange acronyms from method names
2021-03-22 16:40:15 +01:00
donovaly
2d447d2560 [PD] add along length option for pad
- as discussed here: https://forum.freecadweb.org/viewtopic.php?f=17&t=50466&start=10#p433327
this PR is the first step for new Pad features.
It implements 3 features requested by users:
1. an option to measure the pad length along its direction if there is a custom direction
2. when there are two lengths, the reverse feature should be active
3. the pad dialog shows now always the used pad direction, no matter if it is a custom one or the sketch's normal

- Furthermore there are some code improvements (avoid rounding and blocking signals)

- Also adapt TestPad.py because its test used the case two lengths + reversed but this was not possible before this PR - the reverse option was not take into account for two lengths in FeatureSketchBased.cpp)
Now it is and therefore the test must be updated:
In the test the second sketch has the normal vector 0, -1, 0. As the reverse option is set the pad direction is 0, 1, 0. So in y direction is the length (1mm) and in -y direction is length2 (2mm). This gives together with the other pad of volume 1, a total volume of 4.

- fix UI issue: either reversed or midplane
As noticed by @chennes, when the pad uses symmetric, reversed is not sensible and vice versa.
This commit fixes the missing Gui side for the case midplane is checked and the App side.

- the PR also fix two typos
2021-03-22 16:36:04 +01:00
David Osterberg
c862ec458c PartDesign: Allow use of circle edge as axis in ProfileBased 2021-03-01 14:48:24 +01:00
wmayer
145eb8ea8c PD: fixes #0004567: Pattern from a feature type UpToFace and Offset > copy whole body 2021-02-24 17:08:20 +01:00
wmayer
4c18734d2e PD: [skip ci] code refactoring
Move adding offset to face from getUpToFace() to addOffsetToFace()
2021-02-24 16:08:03 +01:00
David Osterberg
59dd9d72c5 PartDesign: Fix throughall distance when throughall is used together with midplane 2021-02-20 20:12:47 +01:00
David Osterberg
bff55def04 PartDesign: Fix hardcoded through all distance in ProfileBased
Before the throughall distance was 10 m, which is not enough for
many applications. The fix is to use the bounding box of the base shape
together with the sketch profile to calculate dynamically a large enough
length.
2021-02-12 18:37:56 +01:00
David Osterberg
cb2da22e86 PartDesign: New features AdditiveHelix and SubtractiveHelix
These features, based on the code for the Pipe class, allow the user
to simply create a helical sweep within PartDesign workbench.

Sample application is threads, springs, coils, augers, etc.

Also, remove needless requirement for positive cone angle on helixes.

Thanks to @bitacovir for helping with the icons
Thanks to @chennes for review
Thanks to @vosk for review
Thanks to @wwmayer for review

Enforce that links stay within scope for ProfileBased features
This also ensures that the Body itself is not used for creating features within
the body, causing a "Graph not a DAG" error.
2021-02-04 13:01:12 +01:00
wmayer
ad48dd2538 PartDesign: [skip ci] Improve revolution function
+ Fix hard crash when selecting an edge or face of the created feature before selecting option to choose a reference.
+ In ProfileBased::getAxis() convert OCCT into FreeCAD exception to simplify handling of calling instances.
+ Change return value of getReferencedSelection() from void to bool to mkae it easier for calling instance to detect if the selection failed.
  This is needed to avoid to add invalid items to the combo box of the revolution task panel
2020-10-14 15:20:52 +02:00
donovaly
91ef59fdbe [PD] allow to pad in any direction
It saves a lot of work if one can directly pad in any direction and OCC allows this.

This PR adds the possibility to define a custom vector for the padding direction.
2020-09-12 16:33:44 +02:00
wmayer
e9ce75d544 LGTM: [skip ci] fix: Empty branch of conditional
An empty block after a conditional can be a sign of an omission and can decrease maintainability of the code.
Such blocks should contain an explanatory comment to aid future maintainers.
2020-07-26 15:49:14 +02:00
wmayer
5ece278c94 remove deprecated std::binary_function 2020-05-11 13:46:37 +02:00
Zheng, Lei
46618410ce PartDesign: allow multiple faces in feature ProfileBased 2020-03-20 16:38:00 +01:00
wmayer
bd1670fd76 make UpToLast option for pad working again 2019-06-17 16:14:13 +02:00
wmayer
4e5d6be326 fixes #0003979: Pocket with mode 'up to face' doesn't work correctly 2019-06-15 23:54:10 +02:00
Abdullah Tahiri
7b0a501c0a PartDesign: 3rdParty to PCH 2019-05-02 07:12:27 +02:00