PAL13411: EDF285: Error while importing ellipses.py. Fix regresion of Boolean operations on case of non-3d arguments.

This commit is contained in:
jfa 2006-09-07 08:59:04 +00:00
parent c54dba1b72
commit d8af99d938
2 changed files with 45 additions and 20 deletions

View File

@ -134,8 +134,20 @@ Standard_Integer GEOMImpl_BooleanDriver::Execute(TFunction_Logbook& log) const
}
}
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
@ -169,8 +181,20 @@ Standard_Integer GEOMImpl_BooleanDriver::Execute(TFunction_Logbook& log) const
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

View File

@ -155,26 +155,32 @@ Standard_Integer GEOMImpl_ShapeDriver::Execute(TFunction_Logbook& log) const
}
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) {
Standard_NullObject::Raise
("Shape for face construction is null or not a 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 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();
@ -192,11 +198,6 @@ Standard_Integer GEOMImpl_ShapeDriver::Execute(TFunction_Logbook& log) const
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()) {