1
0
mirror of https://git.dev.opencascade.org/repos/occt.git synced 2025-08-09 13:22:24 +03:00

0023748: Bad monitoring of intermediate results in offset commands

This commit is contained in:
nbv
2013-05-16 11:46:21 +04:00
parent ac29d56ac7
commit ab87e6fc2e
184 changed files with 2714 additions and 2170 deletions

View File

@@ -1489,22 +1489,23 @@ Standard_Integer mkoffset(Draw_Interpretor& di,
BRepOffsetAPI_MakeOffset Paral;
TopoDS_Shape Base = DBRep::Get(a[2],TopAbs_FACE);
if ( Base.IsNull()) {
if ( Base.IsNull())
{
Base = DBRep::Get(a[2]);
if (Base.IsNull()) return 1;
Paral.Init(GeomAbs_Arc);
TopExp_Explorer exp;
for (exp.Init(Base,TopAbs_WIRE); exp.More(); exp.Next()) {
for (exp.Init(Base,TopAbs_WIRE); exp.More(); exp.Next())
{
TopoDS_Wire aLocalShape = TopoDS::Wire(exp.Current());
Paral.AddWire(aLocalShape);
// Paral.AddWire(TopoDS::Wire(exp.Current()));
}
}
}
else {
else
{
Base.Orientation(TopAbs_FORWARD);
// Base = TopoDS::Face(Base.Oriented(TopAbs_FORWARD));
Paral.Init(TopoDS::Face(Base));
}
}
Standard_Real U, dU;
Standard_Integer Nb;
@@ -1512,24 +1513,31 @@ Standard_Integer mkoffset(Draw_Interpretor& di,
Nb = Draw::Atoi(a[3]);
Standard_Real Alt = 0.;
if ( n == 6) Alt = Draw::Atof(a[5]);
if ( n == 6)
Alt = Draw::Atof(a[5]);
Standard_Integer Compt = 1;
for ( Standard_Integer i = 1; i <= Nb; i++) {
for ( Standard_Integer i = 1; i <= Nb; i++)
{
U = i * dU;
Paral.Perform(U,Alt);
if ( !Paral.IsDone()) {
//cout << " Parali aux fraises" << endl;
di << " Parali aux fraises" << "\n";
}
else {
if ( !Paral.IsDone())
{
di << " Error: Offset is not done." << "\n";
return 1;
}
else
{
Sprintf(name,"%s_%d", a[1], Compt++);
char* temp = name; // portage WNT
DBRep::Set(temp,Paral.Shape());
}
}
}
return 0;
}
}
//=======================================================================
//function : pickface

View File

@@ -1025,18 +1025,28 @@ Standard_Integer offsetonface(Draw_Interpretor&, Standard_Integer n, const char*
//purpose :
//=======================================================================
Standard_Integer offsetperform(Draw_Interpretor&,
Standard_Integer n, const char** a)
{
if ( n < 2) return 1;
Standard_Integer offsetperform(Draw_Interpretor& theCommands,
Standard_Integer theNArg, const char** a)
{
if ( theNArg < 2) return 1;
if (theYaBouchon) TheOffset.MakeThickSolid ();
else TheOffset.MakeOffsetShape();
if (theYaBouchon)
TheOffset.MakeThickSolid ();
else
TheOffset.MakeOffsetShape();
if(TheOffset.IsDone())
{
DBRep::Set(a[1],TheOffset.Shape());
}
else
{
theCommands << "ERROR. offsetperform operation not done.";
return 1;
}
DBRep::Set(a[1],TheOffset.Shape());
return 0;
}
}
//=======================================================================