Skip to content

Commit

Permalink
Part: [skip ci] fix regression in ruled surface feature by applying p…
Browse files Browse the repository at this point in the history
…lacement of source object twice

See: https://forum.freecadweb.org/viewtopic.php?p=411934
  • Loading branch information
wwmayer committed Jun 27, 2020
1 parent 79e11ce commit 478823b
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/Mod/Part/App/PartFeatures.cpp
Expand Up @@ -84,20 +84,20 @@ App::DocumentObjectExecReturn* RuledSurface::getShape(const App::PropertyLinkSub
TopoDS_Shape& shape) const
{
App::DocumentObject* obj = link.getValue();
if(!obj)
if (!(obj && obj->getTypeId().isDerivedFrom(Part::Feature::getClassTypeId())))
return new App::DocumentObjectExecReturn("No shape linked.");

// if no explicit sub-shape is selected use the whole part
const std::vector<std::string>& element = link.getSubValues();
if (element.empty()) {
shape = Feature::getShape(obj);
shape = static_cast<Part::Feature*>(obj)->Shape.getValue();
return nullptr;
}
else if (element.size() != 1) {
return new App::DocumentObjectExecReturn("Not exactly one sub-shape linked.");
}

const Part::TopoShape& part = Feature::getTopoShape(obj);
const Part::TopoShape& part = static_cast<Part::Feature*>(obj)->Shape.getValue();
if (!part.getShape().IsNull()) {
if (!element[0].empty()) {
shape = part.getSubShape(element[0].c_str());
Expand Down

0 comments on commit 478823b

Please sign in to comment.