Commit Graph

28 Commits

Author SHA1 Message Date
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
PaddleStroke
077745d737 PartDesign: Fix App::Line as ref for polar pattern 2025-03-06 17:31: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
Florian Foinant-Willig
6adc675a12 PartDesign: modernize type checking 2023-10-23 18:08:16 +02:00
Kacper Donat
6d7fea506c PD: Add offset / overall angle modes for PolarPatterns
This commit adds two separate modes for defining angular spacing between
elements in the PD's Polar Pattern:

1. Overall Angle - which behaves exactly like it behaved before,
2. Offset Angle - which allows user to specify separation angle between
   consecutive elements.

This change is analogue to that introduced for LinearPattern in previous
commits.
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
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
3704ad68d8 [PD] make constraints static class member
the MSVC IDE warned me about different floatAngle definitions in PD
2021-03-03 15:58:22 +01:00
wmayer
eccc5bfe1a PD: [skip ci] fix angle check in PolarPattern::getTransformations() 2021-03-03 10:39:41 +01: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
David Osterberg
52c0558f91 PartDesign: Allow use of circle edge as axis in PolarPattern 2021-03-01 14:48:24 +01:00
wmayer
356db441a6 PD: [skip ci] PolarPattern: Support 1 occurrence
This is analogous to support 1 occurrence of the linear pattern feature: 81a5ec5e55
2021-03-01 13:58:02 +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
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
2aa4d2c210 switch polar pattern to coordinate system axis 2016-04-12 18:12:06 +02:00
Jan Rheinländer
4c9b9adde6 Fixed usage of std::abs() in polar pattern 2016-04-12 18:12:00 +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