+ fixes #0001547: add Part Spiral to the selectable list of profiles for a Part Loft
This commit is contained in:
@@ -35,6 +35,7 @@
|
||||
# include <BRepOffsetAPI_MakePipeShell.hxx>
|
||||
# include <ShapeAnalysis.hxx>
|
||||
# include <TopTools_ListIteratorOfListOfShape.hxx>
|
||||
# include <TopoDS_Iterator.hxx>
|
||||
# include <TopExp_Explorer.hxx>
|
||||
# include <TopoDS.hxx>
|
||||
# include <Precision.hxx>
|
||||
@@ -240,9 +241,20 @@ App::DocumentObjectExecReturn *Loft::execute(void)
|
||||
for (it = shapes.begin(); it != shapes.end(); ++it) {
|
||||
if (!(*it)->isDerivedFrom(Part::Feature::getClassTypeId()))
|
||||
return new App::DocumentObjectExecReturn("Linked object is not a shape.");
|
||||
const TopoDS_Shape& shape = static_cast<Part::Feature*>(*it)->Shape.getValue();
|
||||
TopoDS_Shape shape = static_cast<Part::Feature*>(*it)->Shape.getValue();
|
||||
if (shape.IsNull())
|
||||
return new App::DocumentObjectExecReturn("Linked shape is invalid.");
|
||||
|
||||
// Extract first element of a compound
|
||||
if (shape.ShapeType() == TopAbs_COMPOUND) {
|
||||
TopoDS_Iterator it(shape);
|
||||
for (; it.More(); it.Next()) {
|
||||
if (!it.Value().IsNull()) {
|
||||
shape = it.Value();
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
if (shape.ShapeType() == TopAbs_FACE) {
|
||||
TopoDS_Wire faceouterWire = ShapeAnalysis::OuterWire(TopoDS::Face(shape));
|
||||
profiles.Append(faceouterWire);
|
||||
@@ -355,9 +367,20 @@ App::DocumentObjectExecReturn *Sweep::execute(void)
|
||||
for (it = shapes.begin(); it != shapes.end(); ++it) {
|
||||
if (!(*it)->isDerivedFrom(Part::Feature::getClassTypeId()))
|
||||
return new App::DocumentObjectExecReturn("Linked object is not a shape.");
|
||||
const TopoDS_Shape& shape = static_cast<Part::Feature*>(*it)->Shape.getValue();
|
||||
TopoDS_Shape shape = static_cast<Part::Feature*>(*it)->Shape.getValue();
|
||||
if (shape.IsNull())
|
||||
return new App::DocumentObjectExecReturn("Linked shape is invalid.");
|
||||
|
||||
// Extract first element of a compound
|
||||
if (shape.ShapeType() == TopAbs_COMPOUND) {
|
||||
TopoDS_Iterator it(shape);
|
||||
for (; it.More(); it.Next()) {
|
||||
if (!it.Value().IsNull()) {
|
||||
shape = it.Value();
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
// There is a weird behaviour of BRepOffsetAPI_MakePipeShell when trying to add the wire as is.
|
||||
// If we re-create the wire then everything works fine.
|
||||
// http://forum.freecadweb.org/viewtopic.php?f=10&t=2673&sid=fbcd2ff4589f0b2f79ed899b0b990648#p20268
|
||||
|
||||
Reference in New Issue
Block a user