Commit Graph

127 Commits

Author SHA1 Message Date
andrea
93525ff7eb removed references to OCC<7 2022-06-25 14:29:24 +02:00
Uwe
66e4c37a25 fix some occurrences where size() is misused as Boolean
- as suggested by @wwmayer: 4d51d1d0b1 (r69648152)
2022-03-27 21:38:15 +02:00
wmayer
3608ee7f51 PD: modernize C++11
* use nullptr
2022-03-23 19:26:14 +01:00
wmayer
5e0789e2f1 PD: fix const correctness in ProfileBased 2022-02-28 18:10:58 +01:00
Uwe
fd19d1a7b0 [PD] more work to remove unused includes 2022-02-21 02:18:17 +01:00
Uwe
7c44008e2d [PD] App: remove unused includes 2022-02-20 20:41:46 +01:00
wmayer
95f583a677 Part: fix typos in make* functions 2022-02-16 12:48:02 +01:00
Uwe
7786e24fcd [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
dc332a5ca0 [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
5c9bffb73d PD: fix 'stack-use-after-scope' crash 2022-02-08 17:16:59 +01:00
Uwe
cfdf334b7f [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
59c470dedf PD: fix bad formatting 2022-01-23 11:07:59 +01:00
Uwe
62ed6b509e [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
f84d32d1b6 [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
6167e9f77a PD: 0004759: Bad error message when creating pad with 0 length 2021-12-07 10:09:11 +01:00
wmayer
501c3dc657 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
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
wmayer
d34a5616a2 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
069e765db0 [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
9fe1f56824 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
eab17ddff5 Fix various typos 2021-07-31 09:46:50 +02:00
wmayer
b4b1cbedb1 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
cf11f38875 [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
f1d6c78cbe PartDesign: Allow use of circle edge as axis in ProfileBased 2021-03-01 14:48:24 +01:00
wmayer
bc5311b3ee PD: fixes #0004567: Pattern from a feature type UpToFace and Offset > copy whole body 2021-02-24 17:08:20 +01:00
wmayer
2389b4779a PD: [skip ci] code refactoring
Move adding offset to face from getUpToFace() to addOffsetToFace()
2021-02-24 16:08:03 +01:00
David Osterberg
43de589732 PartDesign: Fix throughall distance when throughall is used together with midplane 2021-02-20 20:12:47 +01:00
David Osterberg
f0d3e19a4e 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
59ec3cb141 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
b33f92898b 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
7cbc9cf5f0 [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
dc65b055e5 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
618089d6d8 remove deprecated std::binary_function 2020-05-11 13:46:37 +02:00
Zheng, Lei
4dd16c58ed PartDesign: allow multiple faces in feature ProfileBased 2020-03-20 16:38:00 +01:00
wmayer
4b89ed3415 make UpToLast option for pad working again 2019-06-17 16:14:13 +02:00
wmayer
972ec50f28 fixes #0003979: Pocket with mode 'up to face' doesn't work correctly 2019-06-15 23:54:10 +02:00
Abdullah Tahiri
a415ad72e1 PartDesign: 3rdParty to PCH 2019-05-02 07:12:27 +02:00
wmayer
87bf7094a5 PVS: V601 The bool type is implicitly cast to the double type
PVS: V668 There is no sense in testing pointer against null, as the memory was allocated using the 'new' operator. The exception will be generated in the case of memory allocation error
2019-03-13 14:09:10 +01:00
wmayer
7acdb56d92 Replace Base::Exception with appropriate subclass 2018-11-14 19:28:00 +01:00
DeepSOIC
46621a85d4 PartDesign: Refine property for primitives #3488 2018-09-11 07:16:49 +02:00
Markus Lampert
0b40519f3f Changed all catch types to references for polymorphic exceptions. 2018-08-08 15:45:30 +02:00
luz.paz
505488c4f9 Misc. typos
Found via `codespell`
2018-04-25 09:41:33 -03:00
DeepSOIC
27701ae852 PartDesign: #2683 add Refine property
resolves #2683

Adds Refine property to sketch-based and transformation features. The
property is initialized according to preferences, and can be altered in
property editor on per-feature basis.
2018-01-20 13:58:39 +01:00
wmayer
50c280fdb6 fixes #0003141: Unexpected behaviour using pad to face on padded shape binder 2018-01-05 19:35:21 +01:00
Kurt Kremitzki
fdf66b3e88 PDN: Check both parallel and antiparallel cases before trying Revolve 2017-08-12 14:09:39 +02:00
wmayer
488c1a1fdf handle exception thrown by BRepBuilderAPI_RefineModel 2017-07-23 15:46:57 +02:00
AjinkyaDahale
6a385f5ee3 Possible solution to a problem in pad/pocket up-to-face
Somehow we weren't able to pad/pocket up-to-face when the profile sketch
is made on a datum plane
2017-03-19 18:09:14 -03:00
Sergo
02166ed4be couple of tests and fix to avoid crash on selected edge 2017-03-18 19:09:16 +01:00
Sergo
4325ea4e53 same axis and profile only for sketches 2017-03-18 19:09:16 +01:00
sergo
e77e6aa115 fix getAxis for faces 2017-03-18 19:09:16 +01:00