Commit Graph

73 Commits

Author SHA1 Message Date
Markus Reitböck
88c6f176bb 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
Florian Foinant-Willig
9091048627 Try to auto-fix any invalid generated helix 2025-08-04 17:52:06 +02:00
Benjamin Nauck
21fbf8e539 Use Base::toRadians() instead of manually converting 2025-04-15 07:16:36 +02:00
Benjamin Nauck
913850ef04 PartDesign: Add #include <limits> where used 2025-03-31 23:52:18 +02:00
Benjamin Nauck
c2e885d774 PartDesign: Use std::numeric_limits and std::numbers instead of defines 2025-03-29 13:32:38 +01:00
Chris Hennes
150445b058 Merge branch 'main' of https://github.com/FreeCAD/FreeCAD into bgbsww-toponamingAddFeatureRefine 2025-02-11 20:58:58 -06:00
Chris Hennes
6edce0cafa PD: Add onlyHaveRefined() to FeatureRefine 2025-02-07 21:44:43 -06:00
filson1
f7f81b812c Helix tooltip spelling update in FeatureHelix.cpp 2025-01-29 08:31:26 +01:00
luzpaz
2902ea4995 Trim lines ending with superfluous whitespace 2024-12-22 08:50:37 -05:00
Florian Foinant-Willig
7f20215297 PartDesign: fix helix with negative angle 2024-12-13 11:41:55 -05:00
Florian Foinant-Willig
115667f73a PartDesign: decouple refine and other geometric computation (#17008) 2024-12-02 10:57:30 -06:00
Eric Price
f90c6f56d3 increase tolerance on helical shapes to avoid crash / broken geometry (#17356)
* increase tolerance on helical shapes to avoid crash

fix #17113
fix #9377
fix #11083

* added test cases for additive and subtractive helix

* fixed whitespace issue, reduced turncount for speed

* relaxed large scale testcases for OCCT 7.3 and below, work around windows CI error #17394

* Further reduce max size in test for buggy Ubuntu OCCT
2024-11-11 17:44:27 +01:00
Eric Price
aba60775f6 Fix boolean operations (#17119)
* add BRepAlgoAPI wrapper files to CMakeList

* introduce wrapper for BRepAlgoAPI_BooleanOperation and derivatives, set sensible default Fuzzyness for boolean operations

* allow default fuzzyness to be set in settings - including off

* backwards compatibility with OCCT 7.3.3 - removed newer paramateres from wrapper

* added missing header

* reverted src/Mod/Part/App/OpenCascadeAll.h to original state

* implement some changes suggested by @wwmayer

* removed unneeded destructor definitions

* moved getDefaultFuzzyValue into its own helper class

* removed unneeded references to base class default constructor

* default to SetRunParallel(Standard_True) as suggested by @FlachyJoe

* fixed license header as requested

* Added new method to autocalculate fuzzyness to BooleanOperation base class and use it for those parts that do not call the obsolete constructor but also do not set precision

* implemented static variable solution as suggested by @wwmayer

* added helix for test case

* Refactoring FCRepAlgoAPI to FCBRepAlgoAPI

* Added Test Case (fuse cylinder with helix with different working and non-working Fuzzy values)

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

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

* increased default value of FuzzyBoolean and made tests more robust for compatibility with OCCT 7.3

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

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

* fixes for FREECAD_USE_PCH - allow testing of FREECAD_USE_PCH on linux with cmake switch (default OFF)

* removed surplus line - wasn't needed after all

* included precompiled as instructed

* set anti-corruption flag in boolean operations, ensures source shape is not damaged in OCCT 7.1 and higher

* fix #17085

* disable subtests that were too specific for now

* fixed all CLI tests - see comments in Pull Request https://github.com/FreeCAD/FreeCAD/pull/17119#issuecomment-2420772452

* Update src/Mod/PartDesign/PartDesignTests/TestTopologicalNamingProblem.py

suggested updated test by CalligaroV

Co-authored-by: Vincenzo Calligaro <vincenzo.calligaro@gmail.com>

* Update tests/src/Mod/Part/App/TopoShapeExpansion.cpp

suggested updated test by CalligaroV

Co-authored-by: Vincenzo Calligaro <vincenzo.calligaro@gmail.com>

* Update tests/src/Mod/Part/App/TopoShapeExpansion.cpp

suggested updated test by CalligaroV

Co-authored-by: Vincenzo Calligaro <vincenzo.calligaro@gmail.com>

* Update tests/src/Mod/Part/App/TopoShapeExpansion.cpp

suggested updated test by CalligaroV

Co-authored-by: Vincenzo Calligaro <vincenzo.calligaro@gmail.com>

* Update tests/src/Mod/Part/App/TopoShapeExpansion.cpp

suggested updated test by CalligaroV

Co-authored-by: Vincenzo Calligaro <vincenzo.calligaro@gmail.com>

* Update tests/src/Mod/Part/App/TopoShapeExpansion.cpp

suggested updated test by CalligaroV

Co-authored-by: Vincenzo Calligaro <vincenzo.calligaro@gmail.com>

* Update tests/src/Mod/Part/App/TopoShapeExpansion.cpp

suggested updated test by CalligaroV

Co-authored-by: Vincenzo Calligaro <vincenzo.calligaro@gmail.com>

* Update tests/src/Mod/Part/App/TopoShapeExpansion.cpp

suggested updated test by CalligaroV

Co-authored-by: Vincenzo Calligaro <vincenzo.calligaro@gmail.com>

* Update tests/src/Mod/Part/App/TopoShapeExpansion.cpp

suggested updated test by CalligaroV

Co-authored-by: Vincenzo Calligaro <vincenzo.calligaro@gmail.com>

* Update tests/src/Mod/Part/App/TopoShapeExpansion.cpp

suggested updated test by CalligaroV

Co-authored-by: Vincenzo Calligaro <vincenzo.calligaro@gmail.com>

* Update tests/src/Mod/Part/App/TopoShapeExpansion.cpp

suggested updated test by CalligaroV

Co-authored-by: Vincenzo Calligaro <vincenzo.calligaro@gmail.com>

* Update tests/src/Mod/Part/App/TopoShapeExpansion.cpp

suggested updated test by CalligaroV

Co-authored-by: Vincenzo Calligaro <vincenzo.calligaro@gmail.com>

* Update tests/src/Mod/Part/App/TopoShapeExpansion.cpp

suggested updated test by CalligaroV

Co-authored-by: Vincenzo Calligaro <vincenzo.calligaro@gmail.com>

* Update tests/src/Mod/Part/App/TopoShapeExpansion.cpp

suggested updated test by CalligaroV

Co-authored-by: Vincenzo Calligaro <vincenzo.calligaro@gmail.com>

* Update tests/src/Mod/Part/App/TopoShapeExpansion.cpp

Co-authored-by: Vincenzo Calligaro <vincenzo.calligaro@gmail.com>

* remove surplus tests from github suggestion interface bug

* hide the BooleanFuzzy variable - can now be only set by manually editing the config file
i
in FCParamGroup "Boolean"
<FCFloat Name="BooleanFuzzy" Value="10.000000000000"/>

* Suggestion by @FlachyJoe - add validity checks to the base and tool shape in any direct boolean op

---------

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
Co-authored-by: Vincenzo Calligaro <vincenzo.calligaro@gmail.com>
2024-10-21 18:38:51 +02:00
Florian Foinant-Willig
8945971578 [PD Helix] allow refinement to fail 2024-10-03 21:54:07 -05:00
Florian Foinant-Willig
05f7047c66 [PD] Fix helix placement 2024-09-09 18:11:25 +02:00
Florian Foinant-Willig
096c5d215b [PD] helix fix 2024-08-24 20:38:58 -05:00
Chris Hennes
9b898346a7 Revert "[PD] Revert 316506f, back to shell algo for some helix cases (#15678)"
This reverts commit 50add521d67939bfac2b259e54b77600fa03af25.
2024-08-06 18:54:46 -05:00
Florian Foinant-Willig
84e25ed38d [PD] Revert 316506f, back to shell algo for some helix cases (#15678)
* [PD] Revert 316506f, back to shell algo for some helix cases

* fix test accuracy
2024-08-05 10:40:00 -05:00
bgbsww
cfb4514df7 Toponaming: Update tests, implement missing subtractive operation tests,
fix helix and revolution
2024-07-30 09:12:58 -05:00
luzpaz
bc150dc73c Fix trailing newlines and minor typo fixes 2024-07-23 16:16:30 +02:00
Max Wilfinger
8ff5a1f688 Fix source string typos mentioned on Crowdin (#15261) 2024-07-08 17:18:31 -05:00
bgbsww
9e2a8343a0 Toponaming: Cleanup verified face calls 2024-05-20 17:48:01 -05:00
Kacper Donat
d0a35c8c03 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
7961e82c66 Toponaming/Part: Fix all getBaseTopoShape calls. Tests and missing code. 2024-04-26 21:15:11 -05:00
Florian Foinant-Willig
4beeafbedd [PartDesign] Still a helix fix (#12977)
* [PartDesign] Still a helix fix

If we don't break the helix path at each turns we get a vaild path for
MakePipe (solid) even with an angle.

* Decrease helix tests requirements
2024-03-25 18:31:20 +01:00
Florian Foinant-Willig
cc5d4146cf PartDesign_Helix: use computed wires
use the wires of the computed face instead of the selected ones.
2024-02-26 17:41:21 +01:00
bgbsww
1415e67b23 Correct mistaken Helix patch; use MakePipe for frenet for speed; add tests (#11598)
* Cleanup and switch to using MakePipe

* Cleanup unused include

* Use Frenet mode in building pipe

* Restore original code, add a control property

* Hide property, and init on new objects

* Restore prior behavior for legacy objects

* Clean up git blame; add missing move to keep helix same with new makePipe call

* Remove debug include

* Use doxygen syntax for deprecation comment

* Add unit tests; restore code for angled helixes; optimize zero angle helixes

* Lower test precision to accept platform variations

* Loosen more

* Correct restoration

* Tweak test volumes to match restored helix creation

* Restore helix generation parameter

* Fix test; delint
2024-01-08 13:43:38 -03:00
bgbsww
a118289f5b PartDesign: Fix #9377 - issue with accuracy in AdditiveHelix (#11312)
* Correct precision issue in PartDesign::AdditiveHelix

* Simplify getting the end wires

* Remove extraneous loop per @FlachyJoe

* Switch to using mkPS.Shape per @FlachyJoe

* Incorporate guarded efficiency improvement
2023-11-29 21:26:00 -03:00
bgbsww
a9bf3e86f3 Correct PartDesign Helix feature negative angles (#11399)
* Correct PartDesign Helix feature negative angles

* Whitespace
2023-11-27 10:51:12 -06:00
wmayer
7a3106d31b modernize C++: use bool literals 2023-08-06 01:35:39 +02:00
Chris Hennes
272a84ca5b PD: Add translation to error messages 2023-04-28 11:32:56 -05:00
luzpaz
38a01939e0 Migrate domain name from freecadweb to freecad (#9352)
* Migrate domain name from freecadweb to freecad
* Migrate src/Mod/Material files
* Migrate Stylesheet related files
* Migrate *.svg files
* Migrate miscellaneous files
* Migrate some build files
* Migrate recently added TD AR_IRAM template files

Closes #6415
2023-04-24 15:19:20 -05:00
Flachy Joe
c2c23169e6 [PartDesign] Improve Helix calculation for straight shape (#7674) 2022-10-31 23:26:10 +01:00
berniev
f4ffd15864 Mod: redundant void 2 2022-08-08 10:27:50 +02:00
Uwe
f6cb87f8c4 [PD] fix #6482
The idea with the large factor, introduced in #5363 fixed real bugs, so it should not be reverted.
However we must compensate the factor at the path position movement. Otherwise we get wrong helix positions when the angle is negative.

The PR was tested with the files in the bug reports:
https://forum.freecadweb.org/viewtopic.php?f=3&t=65136
https://forum.freecadweb.org/viewtopic.php?p=572618#p572618
2022-03-23 19:29:02 +01:00
wmayer
d1d4b996e7 PD: modernize C++11
* use nullptr
2022-03-23 19:26:14 +01:00
Uwe
acb3586a5b [PD] FeatureHelix: simplify code
- also rename some variables for better readability
- remove unused includes
2022-02-19 00:48:11 +01:00
luz paz
6394fed4e6 Fix various typos
Found via `codespell -q 3 -L aci,ake,aline,alle,alledges,alocation,als,ang,anid,apoints,ba,beginn,behaviour,bloaded,bottome,byteorder,calculater,cancelled,cancelling,cas,cascade,centimetre,childrens,childs,colour,colours,commen,connexion,currenty,dof,doubleclick,dum,eiter,elemente,ende,feld,finde,findf,freez,hist,iff,indicies,initialisation,initialise,initialised,initialises,initialisiert,inout,ist,kilometre,lod,mantatory,methode,metres,millimetre,modell,nd,noe,normale,normaly,nto,numer,oce,oder,ontop,orgin,orginx,orginy,ot,pard,parm,parms,pres,programm,que,rady,recurrance,rougly,seperator,serie,sinc,strack,substraction,te,thist,thru,tread,uint,unter,vertexes,wallthickness,whitespaces -S ./.git,*.po,*.ts,./ChangeLog.txt,./src/3rdParty,./src/Mod/Assembly/App/opendcm,./src/CXX,./src/zipios++,./src/Base/swig*,./src/Mod/Robot/App/kdl_cp,./src/Mod/Import/App/SCL,./src/WindowsInstaller,./src/Doc/FreeCAD.uml,./build/doc/SourceDocu`
2022-01-12 14:50:39 -06:00
David Österberg
9c142ccb8b PartDesign: Improve orientation behaviour for conical helices (#5363)
* PartDesign: Improve orientation behavior for conical helices

As identified in the forum
https://forum.freecadweb.org/viewtopic.php?f=3&t=65136

The Freenet orientation mode does not give expected results for helices with cone angle.
By using an auxiliary helix that is axially offset it is guaranteed that the orientation frame
is always consistent with a cylindrical coordinate system.

Results will be the same as before when cone angle is 0.
2022-01-09 22:13:15 +01:00
Jonas Bähr
5266ecf36f PD: Use the helix property docs as tooltip in the task panel
By reusing the property docs as tooltip we avoid maintaining the same
information in two places. The propery descriptions have been made
translatable, too, to ensure a fully translatable UI.
The ground work for this was layed by the work on Issue 0002524, long
time ago: https://tracker.freecadweb.org/view.php?id=0002524
2022-01-03 11:40:29 +01:00
Uwe
5022385c4f [PD] refine helix intersection calculation 2021-12-24 01:40:25 +01:00
Uwe
a5166e0b6f [PD] fix Helix creation bug
Helices with zero height and zero growth are valid as long as there are no more than 1.0 turns.
2021-12-24 01:10:21 +01:00
Uwe
08137aaeb8 [PD] fix compilation issue with Helix
I introduced it with commit e87b0f4a
2021-12-19 21:58:19 +01:00
Uwe
b0bf7f5e5f [PD] style improvements for Helix
all done automatically by MSVC
2021-12-19 17:52:33 +01:00
Uwe
0e9decfe33 [PD] small code improvements for Helix 2021-12-19 17:34:14 +01:00
jbaehr
b3ba98fafe PD: Fix helix property visibility/writability (#5254)
[PD]: Fix helix property visibility/writeability

* Hide irrelevant and internal helix properties
- The `HasBeenEdited` property is only used internally to check whether to
  fill certain other parameters with initial values. So there is no need
  show it in the property grid at all.
- The `Outside` property is only used in the subtractive helix and thus
  hidden for the additive helix.

* Make derived helix properties read-only
Depending on the input mode, some properties are primary input, others
are derived. Prior to this change, also the derived properties have been
writable but their values are ignored and overwritten on the next
recompute. Now, when changing the input mode, only the primary input
props are writable.

* Reorder some helix properties
This change puts the reference axis and input mode at the top to become
more prominent. Only "Base" and "Axis" are higher in the list for
consistency with the other axis-based features.
2021-12-19 16:50:51 +01:00
Jonas Bähr
cfb3e7eaf6 PD: Fix assignment of Angle/Growth properties
Depending on the input mode, either `Growth` or `Angle` is used to create
a conical or flat spiral. The respective other can easily be calculated
to give consistent view. This is already done for the other properties,
e.g. `Height` is calculated from `Pitch` and `Turns`.
With this patch, the same is done for `Angle` and `Growth`.
2021-12-19 16:21:51 +01:00
Jonas Bähr
0b1f1ddc50 PD: Enhance the helix property docs
Most strings are based on descriptions from the wiki [1]. Some have been
extended where I saw need. Note that I'm not a native speaker, though.

[1]: https://wiki.freecadweb.org/PartDesign_AdditiveHelix
2021-12-11 23:33:28 +01:00
luz paz
430aadb791 Fix various typos and grammatical refinements 2021-12-09 08:57:52 -06:00
Uwe
31abf0a3e6 [PD] fix calculation of possible Helix intersections
the current routine fails for the growth mode.

This PR fixes this by handling this case separately from the other modes.
2021-12-07 03:19:35 +01:00