From 465506670ceaa1f2004b7aa8d5979c9622b3d565 Mon Sep 17 00:00:00 2001 From: phkahler <14852918+phkahler@users.noreply.github.com> Date: Sun, 30 Jan 2022 15:06:13 -0500 Subject: [PATCH] Fix normal issue, when a workplane is created from a point and normal we were only storing the numeric normal so the plane (and subsequent extrusion) wouldn't follow if the sketch was on the face of a revolve. Now we store the handle to the defining normal it predef.entityB so it can update properly on regeneration. --- src/group.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/group.cpp b/src/group.cpp index 1cb1a1b8..174bab58 100644 --- a/src/group.cpp +++ b/src/group.cpp @@ -140,6 +140,7 @@ void Group::MenuGroup(Command id, Platform::Path linkFile) { } } else if(gs.anyNormals == 1 && gs.points == 1 && gs.n == 2) { g.subtype = Subtype::WORKPLANE_BY_POINT_NORMAL; + g.predef.entityB = gs.anyNormal[0]; g.predef.q = SK.GetEntity(gs.anyNormal[0])->NormalGetNum(); g.predef.origin = gs.point[0]; //} else if(gs.faces == 1 && gs.points == 1 && gs.n == 2) { @@ -455,9 +456,11 @@ void Group::Generate(IdList *entity, if(predef.negateU) u = u.ScaledBy(-1); if(predef.negateV) v = v.ScaledBy(-1); q = Quaternion::From(u, v); - } else if(subtype == Subtype::WORKPLANE_BY_POINT_ORTHO || subtype == Subtype::WORKPLANE_BY_POINT_NORMAL /*|| subtype == Subtype::WORKPLANE_BY_POINT_FACE*/) { + } else if(subtype == Subtype::WORKPLANE_BY_POINT_ORTHO) { // Already given, numerically. q = predef.q; + } else if(subtype == Subtype::WORKPLANE_BY_POINT_NORMAL) { + q = SK.GetEntity(predef.entityB)->NormalGetNum(); } else ssassert(false, "Unexpected workplane subtype"); Entity normal = {};