- if (aWire_i.IsNull() || aWire_i.ShapeType() != TopAbs_WIRE) {
- Standard_NullObject::Raise("Shape for face construction is null or not a wire");
- }
-
- FR.Add(TopoDS::Wire(aWire_i));
+ if (aWire_i.IsNull()) Standard_NullObject::Raise("Argument Shape is null");
+ TopoDS_Wire W_i;
+ if(aWire_i.ShapeType() == TopAbs_WIRE) {
+ W_i = TopoDS::Wire(aWire_i);
+ }
+ else if(aWire_i.ShapeType() == TopAbs_EDGE && aWire_i.Closed()) {
+ BRepBuilderAPI_MakeWire MW1;
+ MW1.Add(TopoDS::Edge(aWire_i));
+ if (!MW1.IsDone()) {
+ Standard_ConstructionError::Raise("Wire construction failed");
+ }
+ W_i = MW1;
+ }
+ else {
+ Standard_NullObject::Raise
+ ("Shape for face construction is neither a wire nor closed edges");
+ }
+ FR.Add(W_i);