}
}
- if (isCompound)
- aShape = GEOMImpl_GlueDriver::GlueFaces(C, Precision::Confusion());
+ if (isCompound) {
+ TopTools_ListOfShape listShapeC;
+ AddSimpleShapes(C, listShapeC);
+ TopTools_ListIteratorOfListOfShape itSubC (listShapeC);
+ bool isOnlySolids = true;
+ for (; itSubC.More(); itSubC.Next()) {
+ TopoDS_Shape aValueC = itSubC.Value();
+ if (aValueC.ShapeType() != TopAbs_SOLID) isOnlySolids = false;
+ }
+ if (isOnlySolids)
+ aShape = GEOMImpl_GlueDriver::GlueFaces(C, Precision::Confusion());
+ else
+ aShape = C;
+ }
}
// perform CUT operation
aShape = aCut;
}
- if (isCompound)
- aShape = GEOMImpl_GlueDriver::GlueFaces(C, Precision::Confusion());
+ if (isCompound) {
+ TopTools_ListOfShape listShapeC;
+ AddSimpleShapes(C, listShapeC);
+ TopTools_ListIteratorOfListOfShape itSubC (listShapeC);
+ bool isOnlySolids = true;
+ for (; itSubC.More(); itSubC.Next()) {
+ TopoDS_Shape aValueC = itSubC.Value();
+ if (aValueC.ShapeType() != TopAbs_SOLID) isOnlySolids = false;
+ }
+ if (isOnlySolids)
+ aShape = GEOMImpl_GlueDriver::GlueFaces(C, Precision::Confusion());
+ else
+ aShape = C;
+ }
}
// perform FUSE operation
}
aShape = aFW->WireAPIMake();
}
-
}
else if (aType == FACE_WIRE) {
Handle(GEOM_Function) aRefBase = aCI.GetBase();
TopoDS_Shape aShapeBase = aRefBase->GetValue();
- if (aShapeBase.IsNull() || aShapeBase.ShapeType() != TopAbs_WIRE) {
+ if (aShapeBase.IsNull()) Standard_NullObject::Raise("Argument Shape is null");
+ TopoDS_Wire W;
+ if (aShapeBase.ShapeType() == TopAbs_WIRE) {
+ W = TopoDS::Wire(aShapeBase);
+ }
+ else if (aShapeBase.ShapeType() == TopAbs_EDGE && aShapeBase.Closed()) {
+ BRepBuilderAPI_MakeWire MW;
+ MW.Add(TopoDS::Edge(aShapeBase));
+ if (!MW.IsDone()) {
+ Standard_ConstructionError::Raise("Wire construction failed");
+ }
+ //W = TopoDS::Wire(aShapeBase);
+ W = MW;
+ }
+ else {
Standard_NullObject::Raise
- ("Shape for face construction is null or not a wire");
+ ("Shape for face construction is neither a wire nor a closed edge");
}
- TopoDS_Wire W = TopoDS::Wire(aShapeBase);
- //BRepBuilderAPI_MakeFace MF (W, aCI.GetIsPlanar());
- //if (!MF.IsDone()) {
- // Standard_ConstructionError::Raise("Face construction failed");
- //}
- //aShape = MF.Shape();
GEOMImpl_Block6Explorer::MakeFace(W, aCI.GetIsPlanar(), aShape);
if (aShape.IsNull()) {
Standard_ConstructionError::Raise("Face construction failed");
}
-
}
else if (aType == FACE_WIRES) {
Handle(TColStd_HSequenceOfTransient) aShapes = aCI.GetShapes();
TopoDS_Wire W = TopoDS::Wire(aWire);
// basic face
- //BRepBuilderAPI_MakeFace MF (W, aCI.GetIsPlanar());
- //if (!MF.IsDone()) {
- // Standard_ConstructionError::Raise("Face construction failed");
- //}
- //TopoDS_Shape FFace = MF.Shape();
TopoDS_Shape FFace;
GEOMImpl_Block6Explorer::MakeFace(W, aCI.GetIsPlanar(), FFace);
if (FFace.IsNull()) {