From bb8a3c8885cb48b752190e3d919fa66a4dfe0adf Mon Sep 17 00:00:00 2001 From: Ajinkya Dahale Date: Thu, 22 Dec 2022 14:47:55 +0530 Subject: [PATCH] [Sketcher] Disallow tangent at knot with non-line in GUI --- src/Mod/Sketcher/Gui/CommandConstraints.cpp | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/src/Mod/Sketcher/Gui/CommandConstraints.cpp b/src/Mod/Sketcher/Gui/CommandConstraints.cpp index 4e5e680b18..20e7cca390 100644 --- a/src/Mod/Sketcher/Gui/CommandConstraints.cpp +++ b/src/Mod/Sketcher/Gui/CommandConstraints.cpp @@ -4226,7 +4226,15 @@ void CmdSketcherConstrainTangent::activated(int iMsg) } if (isSimpleVertex(Obj, GeoId1, PosId1)) { - if (!isBsplineKnot(Obj, GeoId1)) { + if (isBsplineKnot(Obj, GeoId1)) { + const Part::Geometry *geom2 = Obj->getGeometry(GeoId2); + if (!geom2 || geom2->getTypeId() !=Part::GeomLineSegment::getClassTypeId()) { + QMessageBox::warning(Gui::getMainWindow(), QObject::tr("Wrong selection"), + QObject::tr("Tangent constraint at B-spline knot is only supported with lines!")); + return; + } + } + else { QMessageBox::warning(Gui::getMainWindow(), QObject::tr("Wrong selection"), QObject::tr("Cannot add a tangency constraint at an unconnected point!")); return;