[Sketcher] Use tangent at B-spline knot constraint

Also squashes:

[Sketcher] Make tangent-at-knot with just knot and line

[Sketcher] Disallow tangent at C0 knot

If passed on to planegcs can cause segmentation fault.

[Sketcher] (Re-)Support tangent at B-spline end-knots

New code had introduced problems for non-periodic spline end-points, and
periodic spline "end-points" were not supported anyway.

(here end-points mean star/end points)
This commit is contained in:
Ajinkya Dahale
2022-09-21 20:26:56 +05:30
committed by Chris Hennes
parent 56b19515b6
commit a609bce527
4 changed files with 94 additions and 8 deletions

View File

@@ -8492,7 +8492,7 @@ int SketchObject::port_reversedExternalArcs(bool justAnalyze)
/// false - fail (this indicates an error, or that a constraint locking isn't supported).
bool SketchObject::AutoLockTangencyAndPerpty(Constraint *cstr, bool bForce, bool bLock)
{
try{
try {
//assert ( cstr->Type == Tangent || cstr->Type == Perpendicular);
if(cstr->getValue() != 0.0 && ! bForce) /*tangency type already set. If not bForce - don't touch.*/
return true;
@@ -8536,7 +8536,8 @@ bool SketchObject::AutoLockTangencyAndPerpty(Constraint *cstr, bool bForce, bool
cstr->setValue(angleDesire + angleOffset); //external tangency. The angle stored is offset by Pi/2 so that a value of 0.0 is invalid and treated as "undecided".
}
}
} catch (Base::Exception& e){
}
catch (Base::Exception& e){
//failure to determine tangency type is not a big deal, so a warning.
Base::Console().Warning("Error in AutoLockTangency. %s \n", e.what());
return false;