From 7d5eaffa89210171fabf744f3d59b8379fcc34af Mon Sep 17 00:00:00 2001 From: phkahler <14852918+phkahler@users.noreply.github.com> Date: Sun, 19 Jun 2022 17:53:48 -0400 Subject: [PATCH] Add ability to select 3 faces --- src/describescreen.cpp | 20 ++++++++++++++++++++ src/draw.cpp | 4 ++-- 2 files changed, 22 insertions(+), 2 deletions(-) diff --git a/src/describescreen.cpp b/src/describescreen.cpp index db527493..021f2661 100644 --- a/src/describescreen.cpp +++ b/src/describescreen.cpp @@ -428,6 +428,26 @@ void TextWindow::DescribeSelection() { double d = (p1.Minus(p0)).Dot(n0); Printf(true, " distance = %Fi%s", SS.MmToString(d).c_str()); } + } else if(gs.n == 3 && gs.faces == 3) { + Printf(false, "%FtTHREE PLANE FACES"); + + Vector n0 = SK.GetEntity(gs.face[0])->FaceGetNormalNum(); + Printf(true, " planeA normal = " PT_AS_NUM, CO(n0)); + Vector p0 = SK.GetEntity(gs.face[0])->FaceGetPointNum(); + Printf(false, " planeA thru = " PT_AS_STR, COSTR(SK.GetEntity(gs.face[0]), p0)); + + Vector n1 = SK.GetEntity(gs.face[1])->FaceGetNormalNum(); + Printf(true, " planeB normal = " PT_AS_NUM, CO(n1)); + Vector p1 = SK.GetEntity(gs.face[1])->FaceGetPointNum(); + Printf(false, " planeB thru = " PT_AS_STR, COSTR(SK.GetEntity(gs.face[1]), p1)); + + Vector n2 = SK.GetEntity(gs.face[2])->FaceGetNormalNum(); + Printf(true, " planeC normal = " PT_AS_NUM, CO(n2)); + Vector p2 = SK.GetEntity(gs.face[2])->FaceGetPointNum(); + Printf(false, " planeB thru = " PT_AS_STR, COSTR(SK.GetEntity(gs.face[2]), p2)); + + // We should probably compute and show the intersection point if there is onw. + } else if(gs.n == 0 && gs.constraints == 1) { Constraint *c = SK.GetConstraint(gs.constraint[0]); const std::string &desc = c->DescriptionString().c_str(); diff --git a/src/draw.cpp b/src/draw.cpp index 3610f201..344c5d61 100644 --- a/src/draw.cpp +++ b/src/draw.cpp @@ -185,7 +185,7 @@ void GraphicsWindow::MakeSelected(Selection *stog) { if(stog->entity.v != 0 && SK.GetEntity(stog->entity)->IsFace()) { // In the interest of speed for the triangle drawing code, - // only two faces may be selected at a time. + // only three faces may be selected at a time. int c = 0; Selection *s; selection.ClearTags(); @@ -193,7 +193,7 @@ void GraphicsWindow::MakeSelected(Selection *stog) { hEntity he = s->entity; if(he.v != 0 && SK.GetEntity(he)->IsFace()) { c++; - if(c >= 2) s->tag = 1; + if(c >= 3) s->tag = 1; } } selection.RemoveTagged();