* 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>
"Professional CMake" book suggest the following:
"Targets should build successfully with or without compiler support for precompiled headers. It
should be considered an optimization, not a requirement. In particular, do not explicitly include a
precompile header (e.g. stdafx.h) in the source code, let CMake force-include an automatically
generated precompile header on the compiler command line instead. This is more portable across
the major compilers and is likely to be easier to maintain. It will also avoid warnings being
generated from certain code checking tools like iwyu (include what you use)."
Therefore, removed the "#include <PreCompiled.h>" from sources, also
there is no need for the "#ifdef _PreComp_" anymore
* Sketcher: Scale: Reorder operations and delete original modified constraints to ensure validity
* Sketcher: replace boolean parameters for deletion with enum and expose solver override on some deletion functions in the python API
* Use correct flag in ::delGeometry
* Set default value of false to noSolve
* Sketcher: autoscale: use deleteAllGeometry
* Sketcher: Scale: revert to checking constraints for geoId validity and handle horizontal&vertical
Use PyArg_ParseTuple's support of optional arguments than doing it with several calls of PyArg_ParseTuple
with different arguments.
This is error-prone, leads to convoluted code logic and may even fail because once the error indicator is set
PyArg_ParseTuple may unexpectedly fail.
* expose detectDegeneratedGeometries to Python
* expose removeDegeneratedGeometries to Python
* expose delConstraintsToExternal to Python
* expose evaluateConstraints to Python
* expose validateConstraints to Python
If endpoint-to-endpoint tangent constraint exists between the connecting points
of the curves to be joined, also apply C1 continuity (i.e. a knot multiplicity
of degree-1).
Presumably due to an copy/paste error, carbonCopy used to verify the
referenced object via `isExternalAllowed` (just like addExternal).
Now using `isCarbonCopyAllowed`, the resulting error message is the
expected one for wrong objects, not a generic one after the operation
failed.
The part behind the column represents the function name itself, not an
error message. So previously, an argument error looked like this:
("Give an object" is not the method name)
```
>>> obj.carbonCopy()
Traceback (most recent call last):
File "<input>", line 1, in <module>
TypeError: Give an object() takes at least 1 argument (0 given)
>>> obj.carbonCopy(123)
Traceback (most recent call last):
File "<input>", line 1, in <module>
TypeError: Give an object() argument 1 must be str, not int
```
While the format string also supports a text for the complete error message
(using a semicolon instead), I decided against this: Pythons standard text
is more precise than this:
(the type error here is not "Give an object")
```
>>> obj.carbonCopy()
Traceback (most recent call last):
File "<input>", line 1, in <module>
TypeError: Give an object
>>> obj.carbonCopy(123)
Traceback (most recent call last):
File "<input>", line 1, in <module>
TypeError: Give an object
```
=======================================================
- Better handling for exceptions originating in Python addConstraint.
- Refactor to reuse code for handling of exceptions
Algorithm to join b-splines:
The code simple concatenates the knots, poles, weights, and knot multiplicities
together, removing data on the connection point of the second curve. Some
further study is needed to see if/when it will give an exact/good connection.
Icon courtesy @bitacovir.
* Missing reference in range-for with non trivial type [-Wclazy-range-loop-reference]
* Unused QString [-Wclazy-unused-non-trivial-variable]
* Missing emit keyword on signal call [-Wclazy-incorrect-emit]
* Don't call QList::operator[]() on temporary [-Wclazy-detaching-temporary]
* Use multi-arg instead [-Wclazy-qstring-arg]
* Maybe you meant to call ViewProvider2DObjectGrid::onChanged() instead [-Wclazy-skipped-base-method]
===================================================
This commit is an independent refactor of the identifications used at Sketcher level.
It introduces a new type "GeoElementId" as a combination of GeoId and PointPos.
It moves the Undefined GeoId, previous Constraint::GeoUndef to GeoEnum, together with all
other fixed values of GeoIds.
=============================================
This commit is directed to external functionality of the split() function.
1. getAppliedConstraints renamed to getConstraintIndices
This is just for clarity being a general function
2. SwapInvolvedGeometry functionality moved to Constraint class
Why?
i. Because it is a specific operation on a constraint, it must not be
a public function, as it does not define interface of the Sketch.
ii. It could be a lambda or a private utility function, but them it would not be reusable.
iii. It could be part of a helper class, but then, it is would be less reusable.
3. renaming of the flag passed to transferConstraints function