Match Ruled Surface behavior to prior versions

This commit is contained in:
bgbsww
2024-09-18 21:44:02 -04:00
committed by Chris Hennes
parent 331c7ad59d
commit 99cdc19b50
2 changed files with 7 additions and 4 deletions

View File

@@ -126,9 +126,15 @@ App::DocumentObjectExecReturn* RuledSurface::execute()
std::vector<TopoShape> shapes;
std::array<App::PropertyLinkSub*, 2> 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.");

View File

@@ -2165,9 +2165,6 @@ TopoShape& TopoShape::makeElementRuledSurface(const std::vector<TopoShape>& 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;
}