Commit Graph

632 Commits

Author SHA1 Message Date
Kacper Donat
b300c80b90 Base: Use explicit pointer syntax for freecad_cast (#20694)
* Base: Use explicit pointer syntax for freecad_cast

This aligns our custom cast with other casts

* All: Use explicit pointer syntax for freecad_cast
2025-04-11 14:11:33 +00:00
Ajinkya Dahale
23ecf94ab6 [Sketcher] Make trimmed curve(s) construction based on original 2025-04-10 09:20:18 +02:00
Ajinkya Dahale
08a66afbc8 [Sketcher] Add missing check when transforming constraints for trim
Fixes https://github.com/AstoCAD/FreeCAD/issues/24.
2025-04-10 09:20:18 +02:00
Ajinkya Dahale
2779f0b29f [Sketcher] Add missing check in deriveConstraintsForPieces
Fixes #19770.
2025-04-10 09:20:18 +02:00
Ajinkya Dahale
358942b771 [Sketcher] Fix issue in SketchObject::transferConstraints
Small but major oversight.
2025-04-10 09:20:18 +02:00
Ajinkya Dahale
f0d30cb570 [Sketcher] Adjust constraint changes when trimming
1. No longer applying equality constraints between new (circular) pieces since
they may cause issues.
2. Only transfer equality with a different curve to one of the pieces.
3. Re-added certain constraints (that applied to both ends of the original
curve) that were incorrectly excluded from modification/deletion at a certain
step.
4. Use C++20 `std::erase_if()` in trim
2025-04-10 09:20:18 +02:00
Kacper Donat
35a9673a75 Base: Rename Base::freecad_dynamic_cast into freecad_cast
This is to make it shorter and easier to use. QT does the same thing
with their qobject_cast.
2025-04-07 10:32:28 -05:00
luzpaz
7a12d2f96f Fix various typos (#20651)
* Fix various typos
Found via `codespell -q 3 -L aci,addmin,ake,aline,alle,alledges,alocation,als,ang,anid,anormal,anull,aply,apoints,ba,beginn,behaviour,bloaded,bottome,brushin,bu,byteorder,calculater,cancelled,cancelling,cas,cascade,centimetre,childrens,childs,colour,colours,commen,connexion,currenty,documentin,dof,doubleclick,dum,eiter,elemente,ende,feld,finde,findf,findn,fle,freez,graphin,groupe,hist,iff,incrementin,indexin,indicies,initialisation,initialise,initialised,initialises,initialisiert,inout,ist,itsel,kilometre,leadin,localy,lod,mantatory,matc,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,renderin,re-use,re-used,re-using,rin,ro,rougly,sectionin,seperator,sergent,serie,shs,sinc,siz,som,stpo,strack,substraction,te,technic,thist,thru,tread,tru,ue,uint,unter,uupper,uptodate,vas,vertexes,vew,wallthickness,whitespaces -S "./.git,*.po,*.ts,*.pdf,./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,./src/Base/StackWalker.cpp,./build/doc/SourceDoc,./tools/build/WindowsInstaller/lang,./src/Mod/TechDraw/Templates/locale"`

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

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

---------

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
2025-04-05 22:58:20 -05:00
Benjamin Nauck
4b589088f6 Sketcher: Add #include <limits> where used 2025-03-31 23:52:38 +02:00
Chris Hennes
e7156aa326 Merge pull request #20496 from hyarion/refactor/cppify-constants 2025-03-29 18:43:40 -05:00
ashimabu
0317206930 Sketcher: Explicitly check fullyConstrainedChanged on solve (#20236) 2025-03-29 14:25:58 -05:00
Benjamin Nauck
b4eb28e50e Sketcher: Use std::numeric_limits and std::numbers instead of defines 2025-03-29 13:32:39 +01:00
Chris Hennes
061876db82 Merge pull request #14176 from mosfet80/cleanmodPart
[mod:part] clean code
2025-03-17 11:13:19 -05:00
Chris Hennes
5f623390fb Merge pull request #20142 from bofdahof/ranges
Apply C++20 std::ranges (mainly to std::find)
2025-03-17 03:08:27 -05:00
bofdahof
34881bc82e Sketcher: apply std::ranges 2025-03-16 17:18:12 -05:00
Luz Paz
17102251e5 Fix various typos 2025-03-14 12:37:12 -04:00
Chris Hennes
71906499c4 Merge pull request #19843 from Shkolik/sketcher_spline_intersection
fix #19831 Sketcher: Create external Intersection geometry not working with complex surfaces
2025-03-11 21:44:28 +00:00
Andrew Shkolik
27dd14174e fix #18356 Sketcher: External reference line defaults to geometry, but vertex does not 2025-03-04 21:29:54 -06:00
mosfet80
e38de93dfd Merge branch 'FreeCAD:main' into cleanmodPart 2025-03-04 15:26:14 +01:00
Andrew
f3643af82b Merge pull request #19747 from Shkolik/sketcher_datums_projection
fix #18894 Sketcher: Create external projection geometry not working with datum objects
2025-03-02 16:20:45 -06:00
Andrew Shkolik
e0cc02f730 Merge branch 'sketcher_spline_intersection' of https://github.com/Shkolik/FreeCAD into sketcher_spline_intersection 2025-02-28 12:34:14 -06:00
Andrew Shkolik
ec24bd8c21 fixes #19831 - additional code to cover projection of split curve edge 2025-02-28 12:33:56 -06:00
Andrea
0fbb300fe4 [mod:part] fix compile warning
.
2025-02-25 08:49:20 +01:00
pre-commit-ci[bot]
ceac12c388 [pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
2025-02-25 07:45:29 +00:00
Andrew Shkolik
0921ed2969 fix #19831 Sketcher: Create external Intersection geometry not working with complex surfaces
Co-authored-by: Zheng Lei <realthunder.dev@gmail.com>
2025-02-25 01:36:25 -06:00
Andrew
0aed23ca81 fixes #19582 Sketcher - cannot project BSpline from another sketch (#19700)
Also fixes some other types of external geo

---------

Co-authored-by: Andrew Shkolik <andrew.shkolik@selerix.com>
Co-authored-by: realthunder <realthunder.dev@gmail.com>
2025-02-24 10:17:24 -06:00
Andrea
de9bd5e1ce change MIN_boost_version
ubuntu version 20.04 is no longer supported.
The minimum boost version used for freecad is now 1.74 (ubuntu 22.04) https://launchpad.net/ubuntu/jammy/+package/libboost-system-dev
2025-02-15 13:33:32 -06:00
mosfet80
cf5d66d201 clean SketchObject.cpp (#15728)
* clean SketchObject.cpp

Code clean 
small optimization

* Restore comment

---------

Co-authored-by: Chris Hennes <chennes@pioneerlibrarysystem.org>
2025-02-10 11:04:26 -06:00
Ajinkya Dahale
80fa694270 [Sketcher] Incorporate suggestions by hyarion from #18916 2025-01-30 09:34:03 +01:00
Ajinkya Dahale
9238a7c1fd [Sketcher] More refactor of delConstraintOnPoint 2025-01-30 09:34:03 +01:00
Ajinkya Dahale
0358ff7ce2 [Sketcher] Refactor SketchObject::delConstraintOnPoint()
Note that for distance constraints we remove even if the constraint is not on the point.
2025-01-30 09:34:03 +01:00
Ajinkya Dahale
ab2e4adb31 [Sketcher] Refactor deleteUnusedInternalGeometryWhenBSpline 2025-01-30 09:34:03 +01:00
Ajinkya Dahale
502b7b9a3f [Sketcher] Fix some issues in trim
1. Don't bother deleting internal geometry first.
2. Don't assume all new constraints are well formed.
2025-01-30 09:34:03 +01:00
Ajinkya Dahale
909e5bfafb [Sketcher] Use replaceGeometries() in trim 2025-01-30 09:34:03 +01:00
Ajinkya Dahale
c8c8c2c208 [Sketcher] Move trim sub-steps to different functions 2025-01-30 09:34:03 +01:00
Ajinkya Dahale
77bb7ab2d4 [Sketcher] Move internal functions out of trim
Towards making it a function class or similar.
2025-01-30 09:34:03 +01:00
Benjamin Nauck
dd6aa9f3c7 Prefer to use BaseClass's isDerivedFrom<T> over non template or Base::Type's
Regex based changes, manually verified
2025-01-27 16:08:18 +01:00
Benjamin Nauck
ae15d98fd3 Use is<T>() when possible 2025-01-27 16:08:18 +01:00
Chris Hennes
666ede9019 Sketcher: Refactor C++20 code 2025-01-20 20:57:34 -06:00
Ajinkya Dahale
51cf34a596 [Sketcher] Refactor and fix an issue in transferConstraints 2025-01-16 15:56:22 +05:30
Ajinkya Dahale
73253bd2d4 [Sketcher] Fix issues in knot operations
For some reason this is not caught in the tests.
2025-01-16 15:56:22 +05:30
Ajinkya Dahale
aa1122c774 [Sketcher] Fix "used" B-spline poles being deleted 2025-01-16 15:56:22 +05:30
Ajinkya Dahale
821bc2ecdf [Sketcher] Incorporate review of #18665 by kadet
1. Replace `find_if` with `any_of` when the iterator is not used.
2. Use PascalCase for templated class.
2025-01-16 15:56:19 +05:30
Ajinkya Dahale
c6f5739763 [Sketcher] Refactor SketchObject::split
1. Now uses `Part::Geometry::createArc`.
2. Removed type-specific codes. It can be generalized now.
2025-01-16 15:55:14 +05:30
Ajinkya Dahale
e6becd0b61 [Sketcher] Further refactor modifyBSplineKnotMultiplicity 2025-01-16 15:55:14 +05:30
Ajinkya Dahale
12102abd6b [Sketcher] Incorporate review of #18665
...by hyarion on December 29.
2025-01-16 15:55:14 +05:30
Ajinkya Dahale
226d24792d [Sketcher] Fix some issues in trim
Fixes fails at cases where one (or both) of the remaining segments is (are)
degenerate. This existed pre-refactor.

Fixes cases where there are some constraints on internal geometry that do not
get deleted cleanly.

Also fixes a memory leak.
2025-01-16 15:55:14 +05:30
Ajinkya Dahale
e4f906c23b [Sketcher] Refactor SketchObject::trim
Cognitive complexity down to 57.
2025-01-16 15:55:14 +05:30
Ajinkya Dahale
3832db01ff [Sketcher] Refactor SketchObject::modifyBSplineKnotMultiplicity 2025-01-16 15:55:14 +05:30
Ajinkya Dahale
6ba1b0b7a9 [Sketcher] Refactor SketchObject::insertBSplineKnot() 2025-01-16 15:55:14 +05:30