Commit Graph

609 Commits

Author SHA1 Message Date
Andrew Shkolik
90198413e7 fixes #19831 - additional code to cover projection of split curve edge 2025-02-28 12:33:56 -06:00
Andrew Shkolik
db78be8e59 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
5c7a65bdb9 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
146d8a356b 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
f0aa12497a 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
809c9f2109 [Sketcher] Incorporate suggestions by hyarion from #18916 2025-01-30 09:34:03 +01:00
Ajinkya Dahale
d4ed28888c [Sketcher] More refactor of delConstraintOnPoint 2025-01-30 09:34:03 +01:00
Ajinkya Dahale
e1d39925c2 [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
d01e6db9cd [Sketcher] Refactor deleteUnusedInternalGeometryWhenBSpline 2025-01-30 09:34:03 +01:00
Ajinkya Dahale
a817bcd5ac [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
53f7fbd66e [Sketcher] Use replaceGeometries() in trim 2025-01-30 09:34:03 +01:00
Ajinkya Dahale
916086ad9c [Sketcher] Move trim sub-steps to different functions 2025-01-30 09:34:03 +01:00
Ajinkya Dahale
10e34c8363 [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
6f535f19fb 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
6a3eb2ab49 Use is<T>() when possible 2025-01-27 16:08:18 +01:00
Chris Hennes
b4816e36a7 Sketcher: Refactor C++20 code 2025-01-20 20:57:34 -06:00
Ajinkya Dahale
af9b577621 [Sketcher] Refactor and fix an issue in transferConstraints 2025-01-16 15:56:22 +05:30
Ajinkya Dahale
60b610c8dc [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
edbe6a54d7 [Sketcher] Fix "used" B-spline poles being deleted 2025-01-16 15:56:22 +05:30
Ajinkya Dahale
8bc51aa5ee [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
e71b25d942 [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
a04b30deda [Sketcher] Further refactor modifyBSplineKnotMultiplicity 2025-01-16 15:55:14 +05:30
Ajinkya Dahale
8b6d5728e7 [Sketcher] Incorporate review of #18665
...by hyarion on December 29.
2025-01-16 15:55:14 +05:30
Ajinkya Dahale
0c2e621141 [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
e38e3f17d1 [Sketcher] Refactor SketchObject::trim
Cognitive complexity down to 57.
2025-01-16 15:55:14 +05:30
Ajinkya Dahale
8cb30c3c53 [Sketcher] Refactor SketchObject::modifyBSplineKnotMultiplicity 2025-01-16 15:55:14 +05:30
Ajinkya Dahale
da71365ff3 [Sketcher] Refactor SketchObject::insertBSplineKnot() 2025-01-16 15:55:14 +05:30
Ajinkya Dahale
6b5bc1f277 [Sketcher] Refactor SketchObject::trim()
1. Use `Part::GeomCurve::createArc()`
2. Refactor constraint logic in `trim`
2025-01-16 15:55:14 +05:30
Ajinkya Dahale
6df0b167e3 [Sketcher] Refactor internal geometry operations
* Use range-for and rearrange for understandability.
* Break down into individual functions by geomtype.
* Also refactor `exposeInternalGeometryForType<Part::GeomBSplineCurve>`
* Use `Constraint::involves...()` in delete internal

Suppress clang-tidy/clazy warnings by using `[[maybe_unused]]`.

Co-authored-by: Chris Hennes <chennes@pioneerlibrarysystem.org>
2025-01-16 15:54:47 +05:30
Ajinkya Dahale
ff10a6db36 [Sketcher] Helper functions for deleting geometry
Some tests probably needed
2025-01-16 15:52:02 +05:30
Ajinkya Dahale
a4f74f6d97 [Sketcher] Write SketchObject::replaceGeometries() 2025-01-16 15:52:02 +05:30
Ajinkya Dahale
2422566faa [Sketcher] Refactor SketchObject::join() (expected trivial)
No tests are added since this commit only adjusts if-then statements.
2025-01-16 15:52:02 +05:30
Ajinkya Dahale
c9fc8270aa [Sketcher] Some trivial for loop changes in SketchObject
No tests added since this should be no more different than existing code.
2025-01-16 15:52:02 +05:30
Jiří Pinkava
b04f1244a4 Sketcher: clean-up geometry history configuation
Keep code almost 1:1 with LS3 branch, just ensure the variable is
initialized and code is documented
2024-12-16 12:07:40 -05:00
wmayer
b5ad887edd Sketcher: Fix warning [-Wmaybe-uninitialized] 2024-12-10 12:32:41 -05:00
luzpaz
09be35359e Fix various typos
Found via `codespell -q 3 -L aci,addmin,ake,aline,alle,alledges,alocation,als,ang,anid,anormal,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,hist,iff,incrementin,indexin,indicies,initialisation,initialise,initialised,initialises,initialisiert,inout,ist,itsel,kilometre,leadin,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,renderin,rin,ro,rougly,sectionin,seperator,serie,shs,sinc,siz,som,strack,substraction,te,technic,thist,thru,tread,tru,ue,uint,unter,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"`
2024-12-10 15:09:51 +01:00
Syres916
b12c7c42e8 [Sketcher] [Post 1.0] Allow CarbonCopy to work with SketchObjectPython (#15594) 2024-12-09 11:31:04 -06:00
Chris Hennes
7a0fc120d1 Merge pull request #18273 from Ondsel-Development/sk_group_drag
Sketcher: Group dragging
2024-12-09 12:29:49 -05:00
Chris Hennes
ea7e17ba00 Merge pull request #18126 from Ondsel-Development/core_LCS2
Core datums : Card2 : Core implementation
2024-12-06 12:12:04 -05:00
PaddleStroke
17e6aa9629 Sketcher: Rename movePoint to moveGeometries. 2024-12-06 16:45:47 +01:00
PaddleStroke
fd0121236b Sketcher: Fix first external geo deletion failure. 2024-12-05 15:23:25 +01:00
wmayer
d2250d1f56 Fix compiler warnings 2024-12-04 09:50:09 -05:00
PaddleStroke
95c3d4febc Sketcher: Group dragging 2024-12-04 10:58:29 +01:00
Ajinkya Dahale
1a851a38b1 [Sketcher] Use variable for frequently used static cast in trim 2024-12-04 00:57:41 +05:30
Ajinkya Dahale
f16556647b [Sketcher] Remove some commented code from SketchObject::trim()
...and replace with a TODO
2024-12-04 00:57:41 +05:30
Ajinkya Dahale
c0f800615e [Sketcher] Use switch-case in getPointForGeometry()
Minor readability improvement.
2024-12-04 00:57:41 +05:30
Ajinkya Dahale
fbc6445198 [Sketcher] Refactor SketchObject::trim()
1. Use `Part::GeomCurve::createArc()`
2. Refactor constraint logic in `trim`
2024-12-04 00:57:40 +05:30
Ajinkya Dahale
680b4bdb2e [Sketcher] Some trivial for loop changes in SketchObject 2024-12-04 00:57:40 +05:30
Ajinkya Dahale
d652db63f0 [Sketcher] Attempt to fix toponaming issue on trim refactor
TNP fix algorithm doesn't seem to like when edge with geoId 0 is deleted/made
construction after new geometry is added. Instead, we just ensure that one of
the newly added geometries becomes geoId 0 instead.

Making a `generateId(const Part::Geometry*)` was part of earlier attempts, but
still appears to remain relevant. This part can be reverted if necessary.
2024-12-04 00:57:40 +05:30
Ajinkya Dahale
30e95ee86a [Sketcher] Refactor SketchObject::trim()
DO NOT MERGE because not complete: not all constraints are not transferred.

Includes:

* Adjust `deriveConstraintsForPieces` for trim
* Make sure new points are constrained on the cutting edges
* Add constraints at trim end(s) dependent on pre-exisiting ones with cutting curve(s). Also change tests to reflect that auto-coincidence can now be applied to non-periodic curves as well.

Known issue(s):
* Some redundant constraints may be added under certain circumstances (e.g. in
presence of perpendicular-via-point)
2024-12-04 00:57:40 +05:30