* Fix rotation expression handling
- Make added rotation angle unit the same as the original expression unit
- Keep rotated angle expressions within the accepted [-180, +180] range
In older versions of FreeCAD the boolean order was base + result. After
TNP mitigation the order was changed to be result + base. For the
resulting shape that does not matter, but order of edges can differ if
arguments are in a different order.
This can impact refine algorithm which may pick other face as the base
one and result in a differnt shape after refining. This commit restores
previous order. For most files it should not make any difference, but it
may fix some older files.
To support all cases we introduce FuseOrder compatibility property that
will be set to FeatureFirst for files saved with 1.0 to preserve
behavior.
* Sketcher: add reverse mapping correction to Carbon Copy
* [pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
* Replace M_PI with std::numbers::pi
* Replace vector initialization with Base::Vector3d::UnitX/UnitY, apply suggestions from code review
Co-authored-by: Kacper Donat <kadet1090@gmail.com>
* Fix guard clause logic, apply suggestions from code review
* Replace std::numbers::pi with pi via `using std::numbers`
* Fix issues reported by the linter
---------
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
Co-authored-by: Kacper Donat <kadet1090@gmail.com>
* part design: partdesign: pd: fix regression issue #26223 add sketch sub element names for refs in revolutions
* refractor code to remove else blocks as every condition has a return statement, make lsp happy
Using these commands by mistake can result in broken interface and the
shortcuts are way too easy to hit by mistake. The feature is rarely (if
at all) used - so there is no need to have easy to hit shortcuts.
Calling BRepMesh_IncrementalMesh repeatedly would accumulate BRep_CurveRepresentation instances attached to the BRep_TEdges of the shape. We now clean added triangulations before adding a new one, which improves performance in the long run.
Co-authored-by: Kacper Donat <kadet1090@gmail.com>
* BIM: fix deletion of BuildingPart in strict IFC mode
Add `sg = FreeCADGui.ActiveDocument.ActiveView.getSceneGraph()` to `onDelete`.
* BIM: fix deletion of BuildingPart in strict IFC mode
Explicitly call `obj.ViewObject.Proxy.attach(obj.ViewObject)`.
* BIM: fix deletion of BuildingPart in strict IFC mode
In `ifc_vp_buildingpart` call `attach` from `ArchBuildingPart.ViewProviderBuildingPart`.
* SVG export: use a set to match edges instead of a list
Lookup in edge list becomes O(1), significantly improving SVG export speed
* [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>
The ApplicationDirectories::findHomePath() on BSD uses sysctl()
to find the path to the running executable. On FreeBSD, we need
to include sys/sysctl.h for that - and as it is not included anywhere
else, add it to the includes directly in front of this function,
with a suitable ifdef.
* Part: fix Part_EditAttachment nesting handling
Fixes#26264.
The previous 'fix' (#25887) did not consider that the object to-be-attached may not be in the global space.
The code in this PR has been tested on the forum:
https://forum.freecad.org/viewtopic.php?p=862968#p862968
* [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>
Improves the point-based TSP solver to match tunnel solver behavior
for open routes (no endpoint constraint). Now applies 2-opt and
relocation optimizations that allow reversing or relocating segments
to the end of the route, resulting in better path optimization when
the ending point is flexible. Now links tsp_solver with
Python3::Python and uses add_library for compatibility with FreeCAD
and Fedora packaging.
src/Mod/CAM/App/tsp_solver.cpp:
- Add optimization limit variables for controlled iteration
- Add 2-opt and relocation optimizations for open routes
- Use Base::Precision::Confusion() for epsilon values
- Track last improvement step for efficient loop control
src/Mod/CAM/App/CMakeLists.txt:
- Switch tsp_solver from pybind11_add_module to add_library
- Link tsp_solver with pybind11::module and Python3::Python
- Update include directories for consistency