From 3833dd0246f88e96c5d2a4d83b69b61c760e65ea Mon Sep 17 00:00:00 2001 From: phkahler <14852918+phkahler@users.noreply.github.com> Date: Mon, 2 Jan 2023 15:38:25 -0500 Subject: [PATCH] Allow point-on-face for up to 3 faces at once --- src/constraint.cpp | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/src/constraint.cpp b/src/constraint.cpp index 0a14f81..b9b0239 100644 --- a/src/constraint.cpp +++ b/src/constraint.cpp @@ -274,22 +274,29 @@ void Constraint::MenuConstrain(Command id) { c.type = Type::POINTS_COINCIDENT; c.ptA = gs.point[0]; c.ptB = gs.point[1]; + newcons.push_back(c); } else if(gs.points == 1 && gs.workplanes == 1 && gs.n == 2) { c.type = Type::PT_IN_PLANE; c.ptA = gs.point[0]; c.entityA = gs.entity[0]; + newcons.push_back(c); } else if(gs.points == 1 && gs.lineSegments == 1 && gs.n == 2) { c.type = Type::PT_ON_LINE; c.ptA = gs.point[0]; c.entityA = gs.entity[0]; + newcons.push_back(c); } else if(gs.points == 1 && gs.circlesOrArcs == 1 && gs.n == 2) { c.type = Type::PT_ON_CIRCLE; c.ptA = gs.point[0]; c.entityA = gs.entity[0]; - } else if(gs.points == 1 && gs.faces == 1 && gs.n == 2) { + newcons.push_back(c); + } else if(gs.points == 1 && gs.faces >= 1 && gs.n == gs.points+gs.faces) { c.type = Type::PT_ON_FACE; c.ptA = gs.point[0]; - c.entityA = gs.face[0]; + for (int k=0; k