0020731: EDF 1302 GEOM: Fillet 1D anomaly

This commit is contained in:
dmv 2010-03-11 08:56:03 +00:00
parent 1159b0e00e
commit b6bb3a882a

View File

@ -103,48 +103,26 @@ Standard_Integer GEOMImpl_ShapeDriver::Execute(TFunction_Logbook& log) const
if (aType == WIRE_EDGES) {
Handle(TColStd_HSequenceOfTransient) aShapes = aCI.GetShapes();
unsigned int ind, nbshapes = aShapes->Length();
TopoDS_Wire aWire;
B.MakeWire(aWire);
BRepBuilderAPI_MakeWire MW;
bool isMWDone = true;
// add edges
for (ind = 1; ind <= nbshapes; ind++) {
for (uint ind = 1; ind <= aShapes->Length(); ind++) {
Handle(GEOM_Function) aRefShape = Handle(GEOM_Function)::DownCast(aShapes->Value(ind));
TopoDS_Shape aShape_i = aRefShape->GetValue();
if (aShape_i.IsNull()) {
Standard_NullObject::Raise("Shape for wire construction is null");
}
if (aShape_i.ShapeType() == TopAbs_EDGE) {
B.Add(aWire, TopoDS::Edge(aShape_i));
MW.Add(TopoDS::Edge(aShape_i));
if (!MW.IsDone()) {
// check status after each edge/wire addition, because the final status
// can be OK even in case, when some edges/wires was not accepted.
isMWDone = false;
}
} else if (aShape_i.ShapeType() == TopAbs_WIRE) {
if (aShape_i.ShapeType() == TopAbs_EDGE || aShape_i.ShapeType() == TopAbs_WIRE) {
TopExp_Explorer exp (aShape_i, TopAbs_EDGE);
for (; exp.More(); exp.Next()) {
for (; exp.More(); exp.Next())
B.Add(aWire, TopoDS::Edge(exp.Current()));
MW.Add(TopoDS::Edge(exp.Current()));
if (!MW.IsDone()) {
// check status after each edge/wire addition, because the final status
// can be OK even in case, when some edges/wires was not accepted.
isMWDone = false;
}
}
} else {
Standard_TypeMismatch::Raise
("Shape for wire construction is neither an edge nor a wire");
}
}
if (isMWDone) {
aShape = MW;
} else {
// fix edges order
Handle(ShapeFix_Wire) aFW = new ShapeFix_Wire;
aFW->Load(aWire);
@ -154,8 +132,6 @@ Standard_Integer GEOMImpl_ShapeDriver::Execute(TFunction_Logbook& log) const
Standard_ConstructionError::Raise("Wire construction failed: several loops detected");
} else if (aFW->StatusReorder(ShapeExtend_FAIL)) {
Standard_ConstructionError::Raise("Wire construction failed");
//} else if (aFW->StatusReorder(ShapeExtend_DONE2)) {
// Standard_ConstructionError::Raise("Wire construction failed: some gaps detected");
} else {
}
@ -186,10 +162,8 @@ Standard_Integer GEOMImpl_ShapeDriver::Execute(TFunction_Logbook& log) const
Standard_ConstructionError::Raise("Wire construction failed: cannot fix 3d gaps");
}
}
aShape = aFW->WireAPIMake();
}
}
else if (aType == FACE_WIRE) {
Handle(GEOM_Function) aRefBase = aCI.GetBase();
TopoDS_Shape aShapeBase = aRefBase->GetValue();