Fix broken RuledSurface feature

This commit is contained in:
wmayer 2012-04-13 17:50:28 +02:00
parent b5505d00cf
commit 39f18cfe69

View File

@ -76,23 +76,29 @@ App::DocumentObjectExecReturn *RuledSurface::execute(void)
TopoDS_Shape curve1; TopoDS_Shape curve1;
const Part::TopoShape& shape1 = static_cast<Part::Feature*>(c1)->Shape.getValue(); const Part::TopoShape& shape1 = static_cast<Part::Feature*>(c1)->Shape.getValue();
if (!shape1._Shape.IsNull()) { if (!shape1._Shape.IsNull()) {
if (!element1[0].empty()) {
curve1 = shape1.getSubShape(element1[0].c_str());
}
else {
if (shape1._Shape.ShapeType() == TopAbs_EDGE) if (shape1._Shape.ShapeType() == TopAbs_EDGE)
curve1 = shape1._Shape; curve1 = shape1._Shape;
else if (shape1._Shape.ShapeType() == TopAbs_WIRE) else if (shape1._Shape.ShapeType() == TopAbs_WIRE)
curve1 = shape1._Shape; curve1 = shape1._Shape;
else }
curve1 = shape1.getSubShape(element1[0].c_str());
} }
TopoDS_Shape curve2; TopoDS_Shape curve2;
const Part::TopoShape& shape2 = static_cast<Part::Feature*>(c2)->Shape.getValue(); const Part::TopoShape& shape2 = static_cast<Part::Feature*>(c2)->Shape.getValue();
if (!shape2._Shape.IsNull()) { if (!shape2._Shape.IsNull()) {
if (!element2[0].empty()) {
curve2 = shape2.getSubShape(element2[0].c_str());
}
else {
if (shape2._Shape.ShapeType() == TopAbs_EDGE) if (shape2._Shape.ShapeType() == TopAbs_EDGE)
curve2 = shape2._Shape; curve2 = shape2._Shape;
else if (shape2._Shape.ShapeType() == TopAbs_WIRE) else if (shape2._Shape.ShapeType() == TopAbs_WIRE)
curve2 = shape2._Shape; curve2 = shape2._Shape;
else }
curve2 = shape2.getSubShape(element2[0].c_str());
} }
if (curve1.IsNull() || curve2.IsNull()) if (curve1.IsNull() || curve2.IsNull())