Commit Graph

51 Commits

Author SHA1 Message Date
Kacper Donat
935bdf9a0f 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
fa8f29aed4 Toponaming/Part: Fix all getBaseTopoShape calls. Tests and missing code. 2024-04-26 21:15:11 -05:00
Florian Foinant-Willig
c7d85ff9d9 [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
d7a95b4e90 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
bf3ccbc5b6 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
94ca51b779 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
d472927bba Correct PartDesign Helix feature negative angles (#11399)
* Correct PartDesign Helix feature negative angles

* Whitespace
2023-11-27 10:51:12 -06:00
wmayer
2a88c7c7df modernize C++: use bool literals 2023-08-06 01:35:39 +02:00
Chris Hennes
1995d84edd PD: Add translation to error messages 2023-04-28 11:32:56 -05:00
luzpaz
129d5882a7 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
b2eb67e806 [PartDesign] Improve Helix calculation for straight shape (#7674) 2022-10-31 23:26:10 +01:00
berniev
da9ebc572f Mod: redundant void 2 2022-08-08 10:27:50 +02:00
Uwe
ea81ce76b4 [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
3608ee7f51 PD: modernize C++11
* use nullptr
2022-03-23 19:26:14 +01:00
Uwe
9b7572e9a9 [PD] FeatureHelix: simplify code
- also rename some variables for better readability
- remove unused includes
2022-02-19 00:48:11 +01:00
luz paz
19e984f8c9 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
2ba95b3423 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
88063627d2 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
0a27540479 [PD] refine helix intersection calculation 2021-12-24 01:40:25 +01:00
Uwe
3cff3202ef [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
7156b33ec4 [PD] fix compilation issue with Helix
I introduced it with commit 7dad9a90
2021-12-19 21:58:19 +01:00
Uwe
3d03f0a468 [PD] style improvements for Helix
all done automatically by MSVC
2021-12-19 17:52:33 +01:00
Uwe
7dad9a908f [PD] small code improvements for Helix 2021-12-19 17:34:14 +01:00
jbaehr
f4fe2efe19 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
bb3d02298d 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
7dcd59d9fb 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
b6f9f39ffc Fix various typos and grammatical refinements 2021-12-09 08:57:52 -06:00
Uwe
6efd5f1bf6 [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
Uwe
3f76c7869a [PD] Helix: improve variable naming
use unique variable names
2021-12-05 21:59:06 +01:00
Uwe
d2dc6ca7dd [PD] rewrite a Helix function
rewrite the function to check if helix might intersect itself to make it better readable/understandable
2021-12-05 21:28:52 +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
Uwe
955af2fa8d [PD] use existing definition for PI in Helix
- also a lot of style fixes kindly done by MSVC
2021-11-29 12:05:10 +01:00
Uwe
35683883cb [PD] allow negative helix growth
Helices that become smaller with every turn are geometrically perfectly valid. Therefore we cannot forbid this.

(For example when creating a helix from a face you often cannot move it so that you can apply a positive growth.)
2021-11-29 11:29:27 +01:00
Uwe
1358cd021f [PD] prevent invalid helix geometry
in the height-turns-growth model height and growth must not be equally zero
2021-11-29 01:34:03 +01:00
Jonas Bähr
169c38622c [PD] Helix: Offer profile's normal as axis
Previously, only the vertical and horizontal axis of the profile was
selectable in the task panel of the additive/subtractive helix. Now the
profile's normal axis can be selected, too. This now allows to create
helical extrusions or "twisted pockets".

The order of the GUI entries was chosen to be in line with the order of
axis selection of the multi-transform parameters.
The actual feature's implementation needed adaption for this special case
as in some places a unit vector (`gp_Dir`) was derived from the cross-
product of axis and profile normal -- a null-vector when the axis *is*
the normal. This caused the gp_Dir's ctor to throw.
2021-11-28 23:57:41 +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
wmayer
9f93bf3b3c PD: remove superfluous code block from Helix::execute 2021-03-28 13:38:53 +02:00
wmayer
ac3ce00b63 PD: replace error-prone strings with enum to handle different helix modes 2021-03-28 13:37:13 +02:00
tomate44
415034d1eb PartDesign Helix: update NbTurns in Pitch-Height-Angle mode 2021-03-28 13:13:10 +02:00
David Osterberg
98b52b09d6 PartDesign: New input mode, and allow spirals to be created 2021-03-10 15:36:40 +01:00
donovaly
965250246a [PD] use same helix angle step as for other features
All other PD features use a step size of 1.0 for angles.

(Personally also for me a step of 5 is not convenient)
2021-03-04 11:08:41 +01:00
wmayer
ac23438eb6 PD: [skip ci] in the helix task dialog use the value range defined in the helix feature 2021-03-03 17:40:11 +01:00
donovaly
f982112e24 [PD] set constraints for helix properties
at the moment it is possible by a click to set e.g. -1 turn which would cause an error
2021-03-03 17:25:40 +01:00
David Osterberg
0d97fb6f5a PartDesign: Fix helix for OCC versions < 7.5.0 2021-02-19 20:02:11 +01:00
David Osterberg
6bcd37093c PartDesign: Mild code cleanup of Helix 2021-02-18 21:51:44 +01:00
David Osterberg
1d0466d6f2 PartDesign: Improve Helix parameter proposals
The previous initial proposed parameters could cause self intersection
when the user switches axis
2021-02-15 16:48:42 +01:00
David Osterberg
3e2780a511 PartDesign: Fix sign error in Helix 2021-02-06 08:22:37 +01:00
David Osterberg
692900d085 PartDesign: fix regression in Helix 2021-02-05 20:55:34 +01:00
David Osterberg
8efbe8861f PartDesign: [Helix] Fix helix starting point bug 2021-02-05 19:17:00 +01:00