Allow faces to be profiles for a sweep & minor fix loft

Allow faces to be used as the profiles for a Part_Sweep
some minor fixes for Part_Loft
This commit is contained in:
jmaustpc
2013-03-10 04:28:38 +11:00
committed by Yorik van Havre
parent ea5f621dde
commit ad0bedcd56
3 changed files with 12 additions and 7 deletions

View File

@@ -189,7 +189,7 @@ App::DocumentObjectExecReturn *Loft::execute(void)
profiles.Append(shape);
}
else {
return new App::DocumentObjectExecReturn("Linked shape is not a vertex, edge nor wire.");
return new App::DocumentObjectExecReturn("Linked shape is not a vertex, edge, wire nor face.");
}
}
@@ -290,7 +290,11 @@ App::DocumentObjectExecReturn *Sweep::execute(void)
// 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.
// https://sourceforge.net/apps/phpbb/free-cad/viewtopic.php?f=10&t=2673&sid=fbcd2ff4589f0b2f79ed899b0b990648#p20268
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) {
BRepBuilderAPI_MakeWire mkWire(TopoDS::Wire(shape));
profiles.Append(mkWire.Wire());
}
@@ -302,7 +306,7 @@ App::DocumentObjectExecReturn *Sweep::execute(void)
profiles.Append(shape);
}
else {
return new App::DocumentObjectExecReturn("Linked shape is not a vertex, edge nor wire.");
return new App::DocumentObjectExecReturn("Linked shape is not a vertex, edge, wire nor face.");
}
}