From 99cdc19b50a7a5cc8463109dfea7bbb0a9a511bb Mon Sep 17 00:00:00 2001 From: bgbsww Date: Wed, 18 Sep 2024 21:44:02 -0400 Subject: [PATCH] Match Ruled Surface behavior to prior versions --- src/Mod/Part/App/PartFeatures.cpp | 8 +++++++- src/Mod/Part/App/TopoShapeExpansion.cpp | 3 --- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/src/Mod/Part/App/PartFeatures.cpp b/src/Mod/Part/App/PartFeatures.cpp index 4e456f0e0f..f9e5643fcb 100644 --- a/src/Mod/Part/App/PartFeatures.cpp +++ b/src/Mod/Part/App/PartFeatures.cpp @@ -126,9 +126,15 @@ App::DocumentObjectExecReturn* RuledSurface::execute() std::vector shapes; std::array links = {&Curve1, &Curve2}; for (auto link : links) { + App::DocumentObject* obj = link->getValue(); + const Part::TopoShape part = Part::Feature::getTopoShape(obj); + if (part.isNull()) { + return new App::DocumentObjectExecReturn("No shape linked."); + } + // if no explicit sub-shape is selected use the whole part const auto& subs = link->getSubValues(); if (subs.empty()) { - shapes.push_back(getTopoShape(link->getValue())); + shapes.push_back(part); } else if (subs.size() != 1) { return new App::DocumentObjectExecReturn("Not exactly one sub-shape linked."); diff --git a/src/Mod/Part/App/TopoShapeExpansion.cpp b/src/Mod/Part/App/TopoShapeExpansion.cpp index 91eeb3ca97..81b96f6512 100644 --- a/src/Mod/Part/App/TopoShapeExpansion.cpp +++ b/src/Mod/Part/App/TopoShapeExpansion.cpp @@ -2165,9 +2165,6 @@ TopoShape& TopoShape::makeElementRuledSurface(const std::vector& shap } auto countOfWires = s.countSubShapes(TopAbs_WIRE); if (countOfWires > 1) { - FC_THROWM(Base::CADKernelError, "Input shape has more than one wire"); - } - if (countOfWires == 1) { curves[i++] = s.getSubTopoShape(TopAbs_WIRE, 1); continue; }