From a3e43d97f61c133fd59ab26f779022d4823baa94 Mon Sep 17 00:00:00 2001 From: Ladislav Michl Date: Wed, 25 Jun 2025 13:51:57 +0200 Subject: [PATCH] PD: Fix loft between curved faces Fixes issue 19183 also reported in the forum: https://forum.freecad.org/viewtopic.php?p=806495 https://forum.freecad.org/viewtopic.php?t=88234 The actual reason for the failure is that the new code uses FaceMakerBullseye method which expects coplanar wires. The code was using FaceMakerCheese previously which changed in LinkStage with their commit 93ce3edfe7ff ("PD: use FaceMakerBullseye for feature Loft") and was imported here with TNP mitigations. As changing it back would cause different regressions, lets try different facemakers until one succeeds. Fixes: 301194a69682 ("Toponaming/Part: Fix all getBaseTopoShape calls...") Co-authored-by: Benjamin Nauck Co-authored-by: Werner Mayer --- src/Mod/PartDesign/App/FeatureLoft.cpp | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) diff --git a/src/Mod/PartDesign/App/FeatureLoft.cpp b/src/Mod/PartDesign/App/FeatureLoft.cpp index 25bd92c722..0d27b9c89f 100644 --- a/src/Mod/PartDesign/App/FeatureLoft.cpp +++ b/src/Mod/PartDesign/App/FeatureLoft.cpp @@ -213,7 +213,23 @@ App::DocumentObjectExecReturn *Loft::execute() std::vector backwires; for(auto& sectionWires : wiresections) backwires.push_back(sectionWires.back()); - back = TopoShape(0).makeElementFace(backwires); + const char *faceMaker[] = { + "Part::FaceMakerBullseye", + "Part::FaceMakerCheese", + "Part::FaceMakerSimple", + }; + for (size_t i = 0; i < std::size(faceMaker); i++) { + try { + back = TopoShape(0).makeElementFace(backwires, nullptr, faceMaker[i]); + break; + } + catch (...) { + if (i == std::size(faceMaker) - 1) { + throw; + } + continue; + } + } } if (!front.isNull() || !back.isNull()) {