[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)
This commit is contained in:
Ajinkya Dahale
2024-06-27 00:22:49 +05:30
parent bf4eed0921
commit 30e95ee86a
3 changed files with 368 additions and 581 deletions

File diff suppressed because it is too large Load Diff

View File

@@ -410,7 +410,8 @@ public:
/// the constraint that will replace the given one (which is to be deleted). NOTE: Currently
/// assuming all constraints on the end points of the old curve have been transferred or
/// destroyed
void deriveConstraintsForPieces(const int oldId,
/// Returns whether or not new constraint(s) was/were added.
bool deriveConstraintsForPieces(const int oldId,
const std::vector<int> newIds,
const Constraint* con,
std::vector<Constraint*>& newConstraints);
@@ -455,6 +456,7 @@ public:
double perpscale = 1.0);
int removeAxesAlignment(const std::vector<int>& geoIdList);
static bool isClosedCurve(const Part::Geometry* geo);
static bool hasInternalGeometry(const Part::Geometry* geo);
/// Exposes all internal geometry of an object supporting internal geometry
/*!