Sketcher: Centered Rectangle tool creates unnecessary center point and unnecessary constraint
Problem description
When Center Rectangle tool is used to create a rectangle centered around the preexisting point (like origin or any other existing point), the tool still creates a center point and assigns coincident constraint between it and preexisting point, while the same could have been achieved by simply assigning symmetry constraint using preexisting point. A new center point should only be created when a centered rectangle is created around empty (non-existent) point in space.
Workbench affected?
Sketcher
Steps to reproduce
Steps to reproduce:
- Start FreeCAD 1.1.3
- Select File/New document menu item
- Click on New Body in Tasks pane
- Click on New Sketch in Tasks pane
- Select XY pane (or any other, it does not matter)
- Select Centered Rectangle tool
- Place mouse over coordinate origin point, ensure that the mouse pointer shows coincident constraint icon as a hint, left-click, then move the mouse out to any reasonable XY offset and left click to finish (no need to enter dimensions as constraints, although it can be done too, result will be the same).
- Scroll to the end Constraints list in Tasks pane to examine the last constraint in the list. It will be a coincident constraint between two points: coordinate origin and a newly created center point of the rectangle. Such arrangement is a waste of one point and one constraint.
Expected behavior
When a centered rectangle is created using preexisting point as a center, such preexisting point should be reused and a symmetry constraint should be applied directly to this point as a center. New center point should be only created when user selects empty space as a center point.
Actual behavior
In reality Centered Rectangle blindly creates a new (and redundant) center point and then applies a coincident constraint between that new redundant point and the point selected by the user as a center. This causes a waste of one point and one constraint. The same effect could have been achieved by simply applying a symmetry constraint between two diagonally opposite corner points and the preexisting point selected by the user. Redundant points and constraints add up in complex sketches and cause unnecessary complexity. This is especially detrimental given the fact that FreeCAD does not allow renaming elements (only allows renaming constraints), which makes it impossible to at least mitigating such redundancy by clearly naming it. Such artifact forces users to not use Centered Rectangle tool and instead use Rectangle tool and apply symmetry constraint manually, as it allows creating sketches with less waste.
Development version About Info (in Safe Mode)
OS: Windows 10 build 19044
Architecture: x86_64
Version: 1.1.3.20260725 (Git shallow)
Build date: 2026/07/25 04:52:02
Build type: Release
Branch: grafted,grafted
Hash: 145529fe741292ff0b3977a01195bf0247425794
Python 3.11.14, Qt 6.8.3, Coin 4.0.3, Vtk 9.3.1, boost 1_86, Eigen3 3.4.0, PySide 6.8.3
shiboken 6.8.3, xerces-c 3.3.0, IfcOpenShell 0.8.4, OCC 7.8.1
Locale: English/United States (en_US)
Navigation Style/Orbit Style/Rotation Mode: CAD/Rounded Arcball/Window center
Stylesheet/Theme/QtStyle: FreeCAD.qss/FreeCAD Light/
Logical DPI/Physical DPI/Pixel Ratio: 96/125.865/1.5Last known good version (optional)
Source: FreeCAD/FreeCAD