diff --git a/src/generate.cpp b/src/generate.cpp index 00ec3708..62f35fa2 100644 --- a/src/generate.cpp +++ b/src/generate.cpp @@ -275,8 +275,8 @@ void SolveSpaceUI::GenerateAll(Generate type, bool andFindFree, bool genForBBox) // and then regenerate the mesh based on the solved stuff. if(genForBBox) { SolveGroupAndReport(g->h, andFindFree); - } else { g->GenerateLoops(); + } else { g->GenerateShellAndMesh(); g->clean = true; } diff --git a/src/group.cpp b/src/group.cpp index 70b6af17..ca811d8f 100644 --- a/src/group.cpp +++ b/src/group.cpp @@ -782,6 +782,12 @@ void Group::MakeExtrusionTopBottomFaces(IdList *el, hEntity pt) Group *src = SK.GetGroup(opA); Vector n = src->polyLoops.normal; + // When there is no loop normal (e.g. if the loop is broken), use normal of workplane + // as fallback, to avoid breaking constraints depending on the faces. + if(n.Equals(Vector::From(0.0, 0.0, 0.0)) && src->type == Group::Type::DRAWING_WORKPLANE) { + n = SK.GetEntity(src->h.entity(0))->Normal()->NormalN(); + } + Entity en = {}; en.type = Entity::Type::FACE_NORMAL_PT; en.group = h;