Commit Graph

33 Commits

Author SHA1 Message Date
wmayer
cf0412b7e2 PD: Support of plane in linear pattern feature 2025-09-26 23:45:23 +02:00
Markus Reitböck
5b6a0b1852 PartDesign: use CMake to generate precompiled headers on all platforms
"Professional CMake" book suggest the following:

"Targets should build successfully with or without compiler support for precompiled headers. It
 should be considered an optimization, not a requirement. In particular, do not explicitly include a
 precompile header (e.g. stdafx.h) in the source code, let CMake force-include an automatically
 generated precompile header on the compiler command line instead. This is more portable across
 the major compilers and is likely to be easier to maintain. It will also avoid warnings being
 generated from certain code checking tools like iwyu (include what you use)."

Therefore, removed the "#include <PreCompiled.h>" from sources, also
there is no need for the "#ifdef _PreComp_" anymore
2025-09-23 22:39:36 +02:00
PaddleStroke
7e57b6e7b0 PartDesign: FeatureLinearPattern fix Axis-Y not working (#23637)
* PartDesign: FeatureLinearPattern prevent error message

* To squash
2025-09-08 18:26:30 +02:00
paddle
8b7290e91a PartDesign: Patterns: Tooltips. 2025-08-26 09:13:17 +02:00
PaddleStroke
5d2037c820 PartDesign: Transform rework 2025-08-26 08:46:51 +02:00
Benjamin Nauck
65a0fb0ed4 PartDesign: Add #include <limits> where used 2025-03-31 23:52:18 +02:00
Benjamin Nauck
98876d070d PartDesign: Use std::numeric_limits and std::numbers instead of defines 2025-03-29 13:32:38 +01:00
wmayer
b3a1fd9676 App: Add methods to get base and direction of datum element
Add the methods DatumElement::getBasePoint() and DatumElement::getDirection() to hide implementation details and guarantee consistent behaviour.

Using the methods fixes several regressions in:
* Constraint::getDirection
* PolarPattern::getTransformations
2025-01-02 13:24:57 +01:00
PaddleStroke
3c1358da10 Core: Rename 'OriginFeature' file to 'Datums' 2024-11-26 15:36:48 +01:00
Ulices
fa0702956c PartDesign: Update Length/Offset when Occurrences changes (#12069)
* Add 'HACK:'/`NOTE:` tags to get special highlightning

* [PD] Bugfix: Update Length/Offset when Occurrences changes

Fix #12068
2024-01-21 18:52:34 -06:00
Florian Foinant-Willig
6adc675a12 PartDesign: modernize type checking 2023-10-23 18:08:16 +02:00
wmayer
4c509c03ef PD: wrong direction determined for linear pattern
A selected edge of a sketch is not in local coordinates and thus its corresponding axis mustn't be multiplied with the sketch placement as
this will lead to a wrong direction vector.

Forum: https://forum.freecad.org/viewtopic.php?t=82022
2023-10-23 10:53:29 -05:00
Kacper Donat
1c70983c60 PD: Keep Length and Offset in sync for LinearPattern
As Length and Offset represents the same concept in different way it is
useful to keep them in sync when it is possible. Update to one of them
will update the other with approperiate value. This behaviour behaviour
works only if both properties are not coming from expression engine -
those will stay not touched.
2023-08-27 12:45:53 +02:00
al
2b1108439f PD: Add offset / overall length modes for LinearPattern
This commit adds support for two separate modes of defining distance
between elements in PD's Linear Pattern.

1. Overall Length - which works exactly like it works before,
2. Spacing - which allows user to explicitly define distance (offset) between
   features.
2023-08-27 12:45:53 +02:00
Jolbas
c001732663 PartDesign: Return directly if occurrences is 1
In LinearPattern and PolarPattern. Skip all checks if occurrences is 1. Allows Expressions on Length/Angle that evaluates to 0 if Occurrences is 1.

Co-Authored-By: 0penBrain <48731257+0penBrain@users.noreply.github.com>
2023-03-30 23:02:03 +02:00
Uwe
07ddfc88de [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
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
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
4327cd5ccb Mod: make sure to call the base class' handleChangedPropertyType 2021-09-15 14:07:32 +02:00
donovaly
8b9afbd921 [PD] fix property issues
- Helix: the property Turns has the App::PropertyFloatConstraint thus also the pointer to it must have the same property

- LinearPattern and Helix: make constraints static class member (forgot this in commit 3704ad68)

- Draft: make the constraint const

- PolarPattern and LinearPattern assure that the header file is loaded at last to avoid potential troubles
2021-07-11 01:43:38 +02:00
donovaly
7f1b47d118 [PD] disallow invalid polar and linear pattern settings
as discussed in 356db441a6 we should disallow invalid property settings
2021-03-03 07:45:08 +01:00
Yann Diorcet
81a5ec5e55 LinearPattern: Support 1 occurrence
When using linear pattern with expression, this can be usefull to have only one
occurence (the original one), which can't be done with the following
implemenation. This commit change this behaviour by allowing this value.
2020-12-30 14:49:54 +01:00
luz.paz
d38f18af23 PartDesign: [skip ci] fix header uniformity
This PR fixes header uniformity across all PartDesign WB files
2019-12-22 00:58:38 +01:00
wmayer
7acdb56d92 Replace Base::Exception with appropriate subclass 2018-11-14 19:28:00 +01:00
wmayer
19cd040415 in linear pattern handle selected edge of a 2d part object 2018-09-27 11:04:30 +02:00
Alexander Golubev
797d6d3a11 App/Origin: big refactoring
- Rebase App::Origin on App::DocumentObject
 - Keep all control over the Origin structure inside the Origin and it's
   ViewProvider
 - Add OriginFeature class as common base for App::Plane and App::Line
 - Rebase App::Plane and App::Line on top of newly created class and
   move to the file.
 - Change Origin's ViewProvider API associated with temporary display
 - Lots of associated changes to files
 - Several minor fixes
 - Lots of new bugs
2016-04-12 18:12:18 +02:00
Stefan Tröger
d6440b4143 switch linear pattern to coordinate system axis 2016-04-12 18:12:05 +02:00
jrheinlaender
880587a627 Allow datum lines and planes for Transformed features' references 2016-04-12 18:11:50 +02:00
jrheinlaender
8df84e76c4 PartDesign module moving float -> double 2013-03-25 17:42:29 +04:30
wmayer
ce0e6e5cef Make FeaturePython Python binding a template class to avoid code duplication 2013-03-22 00:34:18 +01:00
logari81
525cddaaf3 PartDesign: Refactor pattern features and gui
- remove StdDirection,StdAxis and StdMirrorPlane properties
- support sketch H_Axis, V_Axis, N_axis as valid references in patterns
- polish reference selection gui (unified for standard axes and custom references)
2013-01-09 23:18:38 +01:00
jrheinlaender
b30a49ece3 PartDesign: implement Transform and Pattern features 2012-09-07 11:55:26 +02:00