Part_Loft add ability to use a Facefor a profile

Part Loft internally uses either a vertices and/or wires as profiles.
If an edge is selected always was converted into a wire for MakeLoft.
This commit allows a face to be selected and then uses
ShapeAnalysis::OuterWire
to aquire a wire (from the outer edges of the face) to pass to MakeLoft.
This commit is contained in:
jmaustpc
2013-03-08 00:48:08 +11:00
committed by Yorik van Havre
parent 5fc802dfa1
commit 0a7a9d9cf2
2 changed files with 11 additions and 5 deletions

View File

@@ -29,6 +29,7 @@
# include <TopoDS_Shell.hxx>
# include <BRepBuilderAPI_MakeWire.hxx>
# include <BRepOffsetAPI_MakePipeShell.hxx>
# include <ShapeAnalysis.hxx>
# include <TopTools_ListIteratorOfListOfShape.hxx>
# include <TopExp_Explorer.hxx>
# include <Precision.hxx>
@@ -173,7 +174,11 @@ App::DocumentObjectExecReturn *Loft::execute(void)
const TopoDS_Shape& shape = static_cast<Part::Feature*>(*it)->Shape.getValue();
if (shape.IsNull())
return new App::DocumentObjectExecReturn("Linked shape is invalid.");
if (shape.ShapeType() == TopAbs_WIRE) {
if (shape.ShapeType() == TopAbs_FACE) {
TopoDS_Wire faceouterWire = ShapeAnalysis::OuterWire(TopoDS::Face(shape));
profiles.Append(faceouterWire);
}
else if (shape.ShapeType() == TopAbs_WIRE) {
profiles.Append(shape);
}
else if (shape.ShapeType() == TopAbs_EDGE) {