1
0
mirror of https://git.dev.opencascade.org/repos/occt.git synced 2025-04-10 18:51:21 +03:00

0028573: Get rid of the old Boolean Operations in QA commands

The QA commands have been modified to use new Boolean operations instead of old.
This commit is contained in:
emv 2017-03-20 12:09:36 +03:00 committed by bugmaster
parent f1b2eddc0f
commit 431d0f181e
22 changed files with 368 additions and 1236 deletions

View File

@ -33,7 +33,6 @@
#include <BRepPrimAPI_MakeRevol.hxx> #include <BRepPrimAPI_MakeRevol.hxx>
#include <BRepAlgoAPI_Fuse.hxx> #include <BRepAlgoAPI_Fuse.hxx>
#include <BRepAlgo_Fuse.hxx>
#include <GProp_GProps.hxx> #include <GProp_GProps.hxx>
#include <BRepGProp.hxx> #include <BRepGProp.hxx>
@ -49,23 +48,14 @@
#include <Geom_TrimmedCurve.hxx> #include <Geom_TrimmedCurve.hxx>
#include <Geom_BSplineSurface.hxx> #include <Geom_BSplineSurface.hxx>
#include <ShapeUpgrade_UnifySameDomain.hxx>
static Standard_Integer OCC426 (Draw_Interpretor& di, Standard_Integer argc, const char ** argv) static Standard_Integer OCC426 (Draw_Interpretor& di, Standard_Integer argc, const char ** argv)
{ {
if(argc < 7 || argc > 8) { if(argc != 8) {
di << "Usage : " << argv[0] << " shape1 shape2 shape3 shape4 shape5 shape6 [BRepAlgoAPI/BRepAlgo = 1/0]\n"; di << "Usage : " << argv[0] << " shape1 shape2 shape3 shape4 shape5 shape6 shape7\n";
return 1; return 1;
} }
Standard_Boolean IsBRepAlgoAPI = Standard_True;
if (argc == 8) {
Standard_Integer IsB = Draw::Atoi(argv[7]);
if (IsB != 1) {
IsBRepAlgoAPI = Standard_False;
#if ! defined(BRepAlgo_def01)
// di << "Error: There is not BRepAlgo_Fuse class\n";
// return 1;
#endif
}
}
BRepBuilderAPI_MakePolygon W1; BRepBuilderAPI_MakePolygon W1;
W1.Add(gp_Pnt(10, 0, 0)); W1.Add(gp_Pnt(10, 0, 0));
@ -117,29 +107,26 @@ static Standard_Integer OCC426 (Draw_Interpretor& di, Standard_Integer argc, con
Standard_Real angle3 = 360 * (M_PI / 180.0); Standard_Real angle3 = 360 * (M_PI / 180.0);
TopoDS_Shape rs3 = BRepPrimAPI_MakeRevol(F3, A3, angle3); TopoDS_Shape rs3 = BRepPrimAPI_MakeRevol(F3, A3, angle3);
TopoDS_Shape fuse32, fuse321; di << "fuse32 = BRepAlgoAPI_Fuse(rs3, rs2)\n";
if (IsBRepAlgoAPI) { di << "fuse321 = BRepAlgoAPI_Fuse(fuse32, rs1)\n";
di << "fuse32 = BRepAlgoAPI_Fuse(rs3, rs2)\n"; TopoDS_Shape fuse32 = BRepAlgoAPI_Fuse(rs3, rs2).Shape();
di << "fuse321 = BRepAlgoAPI_Fuse(fuse32, rs1)\n"; TopoDS_Shape fuse321 = BRepAlgoAPI_Fuse(fuse32, rs1).Shape();
fuse32 = BRepAlgoAPI_Fuse(rs3, rs2);
fuse321 = BRepAlgoAPI_Fuse(fuse32, rs1);
} else {
di << "fuse32 = BRepAlgo_Fuse(rs3, rs2)\n";
di << "fuse321 = BRepAlgo_Fuse(fuse32, rs1)\n";
fuse32 = BRepAlgo_Fuse(rs3, rs2);
fuse321 = BRepAlgo_Fuse(rs1, fuse32);
}
//Give the mass claculation of the shpae "fuse321" // unify the faces of the Fuse result
ShapeUpgrade_UnifySameDomain anUnify(fuse321, Standard_True, Standard_True, Standard_True);
anUnify.Build();
const TopoDS_Shape& aFuseUnif = anUnify.Shape();
//Give the mass claculation of the shpae "aFuseUnif"
GProp_GProps G; GProp_GProps G;
BRepGProp::VolumeProperties(fuse321, G); BRepGProp::VolumeProperties(aFuseUnif, G);
di<<" \n"; di<<" \n";
di<<"Mass: "<<G.Mass()<<"\n\n"; di<<"Mass: "<<G.Mass()<<"\n\n";
di << "Trianglating Faces .....\n"; di << "Trianglating Faces .....\n";
TopExp_Explorer ExpFace; TopExp_Explorer ExpFace;
for (ExpFace.Init (fuse321,TopAbs_FACE); ExpFace.More(); ExpFace.Next()) for (ExpFace.Init (aFuseUnif,TopAbs_FACE); ExpFace.More(); ExpFace.Next())
{ {
TopoDS_Face TopologicalFace = TopoDS::Face (ExpFace.Current()); TopoDS_Face TopologicalFace = TopoDS::Face (ExpFace.Current());
TopologicalFace.Orientation (TopAbs_FORWARD) ; TopologicalFace.Orientation (TopAbs_FORWARD) ;
@ -156,10 +143,10 @@ static Standard_Integer OCC426 (Draw_Interpretor& di, Standard_Integer argc, con
di<<"Triangulation of all Faces Completed. \n\n"; di<<"Triangulation of all Faces Completed. \n\n";
TopTools_IndexedDataMapOfShapeListOfShape edgemap; TopTools_IndexedDataMapOfShapeListOfShape edgemap;
TopExp::MapShapesAndAncestors(fuse321, TopAbs_EDGE, TopAbs_SOLID, edgemap); TopExp::MapShapesAndAncestors(aFuseUnif, TopAbs_EDGE, TopAbs_SOLID, edgemap);
di << "No. of Edges: " << edgemap.Extent() << "\n"; di << "No. of Edges: " << edgemap.Extent() << "\n";
ChFi3d_FilletShape FShape = ChFi3d_Rational; ChFi3d_FilletShape FShape = ChFi3d_Rational;
BRepFilletAPI_MakeFillet blend(fuse321,FShape); BRepFilletAPI_MakeFillet blend(aFuseUnif,FShape);
di << "Adding Edges ..... \n"; di << "Adding Edges ..... \n";
for(int i = 1; i <= edgemap.Extent(); i++) for(int i = 1; i <= edgemap.Extent(); i++)
{ {
@ -178,6 +165,7 @@ static Standard_Integer OCC426 (Draw_Interpretor& di, Standard_Integer argc, con
DBRep::Set ( argv[4], rs3 ); DBRep::Set ( argv[4], rs3 );
DBRep::Set ( argv[5], fuse32 ); DBRep::Set ( argv[5], fuse32 );
DBRep::Set ( argv[6], fuse321 ); DBRep::Set ( argv[6], fuse321 );
DBRep::Set ( argv[7], aFuseUnif );
return 0; return 0;
} }
@ -446,32 +434,16 @@ Standard_Integer performTriangulation (TopoDS_Shape aShape, Draw_Interpretor& di
#include <BRepPrimAPI_MakeCylinder.hxx> #include <BRepPrimAPI_MakeCylinder.hxx>
#include <BRepPrimAPI_MakeCone.hxx> #include <BRepPrimAPI_MakeCone.hxx>
#include <BRepAlgoAPI_Cut.hxx> #include <BRepAlgoAPI_Cut.hxx>
#include <BRepAlgo_Cut.hxx>
//======================================================================= //=======================================================================
//function : OCC822_1 //function : OCC822_1
//purpose : //purpose :
//======================================================================= //=======================================================================
static Standard_Integer OCC822_1 (Draw_Interpretor& di, Standard_Integer argc, const char ** argv) { static Standard_Integer OCC822_1 (Draw_Interpretor& di, Standard_Integer argc, const char ** argv) {
if(argc < 4 || argc > 5) { if(argc != 4) {
di << "Usage : " << argv[0] << " name1 name2 result [BRepAlgoAPI/BRepAlgo = 1/0]\n"; di << "Usage : " << argv[0] << " name1 name2 result\n";
return 1; return 1;
} }
Standard_Boolean IsBRepAlgoAPI = Standard_True;
if (argc == 5) {
Standard_Integer IsB = Draw::Atoi(argv[4]);
if (IsB != 1) {
IsBRepAlgoAPI = Standard_False;
#if ! defined(BRepAlgo_def01)
// di << "Error: There is not BRepAlgo_Fuse class\n";
// return 1;
#endif
#if ! defined(BRepAlgo_def02)
// di << "Error: There is not BRepAlgo_Cut class\n";
// return 1;
#endif
}
}
int index = 1; int index = 1;
@ -495,69 +467,50 @@ static Standard_Integer OCC822_1 (Draw_Interpretor& di, Standard_Integer argc, c
di << "All primitives created..... Creating Boolean\n"; di << "All primitives created..... Creating Boolean\n";
TopoDS_Shape theIn, theOut, theRes;
try try
{ {
OCC_CATCH_SIGNALS OCC_CATCH_SIGNALS
if (IsBRepAlgoAPI) {
di << "theIn = BRepAlgoAPI_Fuse(cylIn, conIn)\n";
di << "theOut = BRepAlgoAPI_Fuse(cylOut, conOut)\n";
di << "theRes = BRepAlgoAPI_Cut(theOut, theIn)\n";
theIn = BRepAlgoAPI_Fuse(cylIn, conIn);
theOut = BRepAlgoAPI_Fuse(cylOut, conOut);
theRes = BRepAlgoAPI_Cut(theOut, theIn);
} else {
di << "theIn = BRepAlgo_Fuse(cylIn, conIn)\n";
di << "theOut = BRepAlgo_Fuse(cylOut, conOut)\n";
theIn = BRepAlgo_Fuse(cylIn, conIn);
theOut = BRepAlgo_Fuse(cylOut, conOut);
di << "theRes = BRepAlgo_Cut(theOut, theIn)\n";
theRes = BRepAlgo_Cut(theOut, theIn);
}
if (index < argc) DBRep::Set(argv[index++], theIn); di << "theIn = BRepAlgoAPI_Fuse(cylIn, conIn)\n";
if (index < argc) DBRep::Set(argv[index++], theOut); di << "theOut = BRepAlgoAPI_Fuse(cylOut, conOut)\n";
if (index < argc) DBRep::Set(argv[index++], theRes); di << "theRes = BRepAlgoAPI_Cut(theOut, theIn)\n";
di << "Booleans Created ! Triangulating !\n"; TopoDS_Shape theIn = BRepAlgoAPI_Fuse(cylIn, conIn).Shape();
TopoDS_Shape theOut = BRepAlgoAPI_Fuse(cylOut, conOut).Shape();
TopoDS_Shape theRes = BRepAlgoAPI_Cut(theOut, theIn).Shape();
performTriangulation(theRes, di); if (index < argc) DBRep::Set(argv[index++], theIn);
} if (index < argc) DBRep::Set(argv[index++], theOut);
if (index < argc) DBRep::Set(argv[index++], theRes);
di << "Booleans Created ! Triangulating !\n";
performTriangulation(theRes, di);
}
catch ( Standard_Failure ) catch ( Standard_Failure )
{ {
di<<"*********************************************************\n"; di << "*********************************************************\n";
di<<"***** ******\n"; di << "***** ******\n";
di<<"***** Standard_Failure : Exception in Shoe Function *****\n"; di << "***** Standard_Failure : Exception in Shoe Function *****\n";
di<<"***** ******\n"; di << "***** ******\n";
di<<"*********************************************************\n"; di << "*********************************************************\n";
return 1; return 1;
} }
return 0; return 0;
} }
#include <BRepPrimAPI_MakeBox.hxx> #include <BRepPrimAPI_MakeBox.hxx>
#include <BRepPrimAPI_MakeSphere.hxx> #include <BRepPrimAPI_MakeSphere.hxx>
//======================================================================= //=======================================================================
// OCC822_2 // OCC822_2
//======================================================================= //=======================================================================
static Standard_Integer OCC822_2 (Draw_Interpretor& di,Standard_Integer argc, const char ** argv) static Standard_Integer OCC822_2 (Draw_Interpretor& di,Standard_Integer argc, const char ** argv)
{ {
if(argc < 4 || argc > 5) { if(argc != 4) {
di << "Usage : " << argv[0] << " name1 name2 result [BRepAlgoAPI/BRepAlgo = 1/0]\n"; di << "Usage : " << argv[0] << " name1 name2 result\n";
return 1; return 1;
} }
Standard_Boolean IsBRepAlgoAPI = Standard_True;
if (argc == 5) {
Standard_Integer IsB = Draw::Atoi(argv[4]);
if (IsB != 1) {
IsBRepAlgoAPI = Standard_False;
#if ! defined(BRepAlgo_def01)
// di << "Error: There is not BRepAlgo_Fuse class\n";
// return 1;
#endif
}
}
int index = 1; int index = 1;
@ -575,31 +528,27 @@ static Standard_Integer OCC822_2 (Draw_Interpretor& di,Standard_Integer argc, co
di << "All primitives created..... Creating Cut Objects\n"; di << "All primitives created..... Creating Cut Objects\n";
TopoDS_Shape fuse;
try try
{ {
OCC_CATCH_SIGNALS OCC_CATCH_SIGNALS
if (IsBRepAlgoAPI) {
di << "fuse = BRepAlgoAPI_Fuse(box, sph)\n";
fuse = BRepAlgoAPI_Fuse(box, sph);
} else {
di << "fuse = BRepAlgo_Fuse(box, sph)\n";
fuse = BRepAlgo_Fuse(box, sph);
}
if (index < argc) DBRep::Set(argv[index++], fuse);
di << "Object Created ! Now Triangulating !" ;
performTriangulation(fuse, di); di << "fuse = BRepAlgoAPI_Fuse(box, sph)\n";
} TopoDS_Shape fuse = BRepAlgoAPI_Fuse(box, sph).Shape();
if (index < argc) DBRep::Set(argv[index++], fuse);
di << "Object Created ! Now Triangulating !";
performTriangulation(fuse, di);
}
catch ( Standard_Failure ) catch ( Standard_Failure )
{ {
di<<"*********************************************************\n"; di << "*********************************************************\n";
di<<"***** ******\n"; di << "***** ******\n";
di<<"***** Standard_Failure : Exception in HSP Function ******\n"; di << "***** Standard_Failure : Exception in HSP Function ******\n";
di<<"***** ******\n"; di << "***** ******\n";
di<<"*********************************************************\n"; di << "*********************************************************\n";
return 1; return 1;
} }
return 0; return 0;
} }
@ -610,21 +559,11 @@ static Standard_Integer OCC822_2 (Draw_Interpretor& di,Standard_Integer argc, co
static Standard_Integer OCC823 (Draw_Interpretor& di,Standard_Integer argc, const char ** argv) static Standard_Integer OCC823 (Draw_Interpretor& di,Standard_Integer argc, const char ** argv)
{ {
if(argc < 4 || argc > 5) { if(argc != 4) {
di << "Usage : " << argv[0] << " name1 name2 result [BRepAlgoAPI/BRepAlgo = 1/0]\n"; di << "Usage : " << argv[0] << " name1 name2 result\n";
return 1; return 1;
} }
Standard_Boolean IsBRepAlgoAPI = Standard_True;
if (argc == 5) {
Standard_Integer IsB = Draw::Atoi(argv[4]);
if (IsB != 1) {
IsBRepAlgoAPI = Standard_False;
#if ! defined(BRepAlgo_def01)
// di << "Error: There is not BRepAlgo_Fuse class\n";
// return 1;
#endif
}
}
int index = 1; int index = 1;
Standard_Real size = 0.001; Standard_Real size = 0.001;
@ -644,31 +583,27 @@ static Standard_Integer OCC823 (Draw_Interpretor& di,Standard_Integer argc, cons
di << "All primitives created..... Creating Boolean\n"; di << "All primitives created..... Creating Boolean\n";
TopoDS_Shape fuse;
try try
{ {
OCC_CATCH_SIGNALS OCC_CATCH_SIGNALS
if (IsBRepAlgoAPI) {
di << "fuse = BRepAlgoAPI_Fuse(cyl2, cyl1)\n";
fuse = BRepAlgoAPI_Fuse(cyl2, cyl1);
} else {
di << "fuse = BRepAlgo_Fuse(cyl2, cyl1)\n";
fuse = BRepAlgo_Fuse(cyl2, cyl1);
}
if (index < argc) DBRep::Set(argv[index++], fuse);
di << "Fuse Created ! Triangulating !\n";
performTriangulation(fuse, di); di << "fuse = BRepAlgoAPI_Fuse(cyl2, cyl1)\n";
} TopoDS_Shape fuse = BRepAlgoAPI_Fuse(cyl2, cyl1).Shape();
catch ( Standard_Failure )
{ if (index < argc) DBRep::Set(argv[index++], fuse);
di<<"*********************************************************\n"; di << "Fuse Created ! Triangulating !\n";
di<<"***** ******\n";
di<<"***** Standard_Failure : Exception in TEE Function ******\n"; performTriangulation(fuse, di);
di<<"***** ******\n"; }
di<<"*********************************************************\n"; catch (Standard_Failure)
return 1; {
} di << "*********************************************************\n";
di << "***** ******\n";
di << "***** Standard_Failure : Exception in TEE Function ******\n";
di << "***** ******\n";
di << "*********************************************************\n";
return 1;
}
return 0; return 0;
} }
@ -678,21 +613,11 @@ static Standard_Integer OCC823 (Draw_Interpretor& di,Standard_Integer argc, cons
static Standard_Integer OCC824 (Draw_Interpretor& di,Standard_Integer argc, const char ** argv) static Standard_Integer OCC824 (Draw_Interpretor& di,Standard_Integer argc, const char ** argv)
{ {
if(argc < 4 || argc > 5) { if(argc != 4) {
di << "Usage : " << argv[0] << " name1 name2 result [BRepAlgoAPI/BRepAlgo = 1/0]\n"; di << "Usage : " << argv[0] << " name1 name2 result\n";
return 1; return 1;
} }
Standard_Boolean IsBRepAlgoAPI = Standard_True;
if (argc == 5) {
Standard_Integer IsB = Draw::Atoi(argv[4]);
if (IsB != 1) {
IsBRepAlgoAPI = Standard_False;
#if ! defined(BRepAlgo_def01)
// di << "Error: There is not BRepAlgo_Fuse class\n";
// return 1;
#endif
}
}
int index = 1; int index = 1;
gp_Pnt P1(100, 0, 0); gp_Pnt P1(100, 0, 0);
@ -708,31 +633,27 @@ static Standard_Integer OCC824 (Draw_Interpretor& di,Standard_Integer argc, cons
di << "All primitives created..... Creating Boolean\n"; di << "All primitives created..... Creating Boolean\n";
TopoDS_Shape fuse;
try try
{ {
OCC_CATCH_SIGNALS OCC_CATCH_SIGNALS
if (IsBRepAlgoAPI) {
di << "fuse = BRepAlgoAPI_Fuse(cyl, sph)\n";
fuse = BRepAlgoAPI_Fuse(cyl, sph);
} else {
di << "fuse = BRepAlgo_Fuse(cyl, sph)\n";
fuse = BRepAlgo_Fuse(cyl, sph);
}
di << "Fuse Created ! Triangulating !\n";
if (index < argc) DBRep::Set(argv[index++], fuse);
performTriangulation(fuse, di); di << "fuse = BRepAlgoAPI_Fuse(cyl, sph)\n";
} TopoDS_Shape fuse = BRepAlgoAPI_Fuse(cyl, sph).Shape();
catch ( Standard_Failure )
{ di << "Fuse Created ! Triangulating !\n";
di<<"*********************************************************\n"; if (index < argc) DBRep::Set(argv[index++], fuse);
di<<"***** ******\n";
di<<"***** Standard_Failure : Exception in YOU Function ******\n"; performTriangulation(fuse, di);
di<<"***** ******\n"; }
di<<"*********************************************************\n"; catch (Standard_Failure)
return 1; {
} di << "*********************************************************\n";
di << "***** ******\n";
di << "***** Standard_Failure : Exception in YOU Function ******\n";
di << "***** ******\n";
di << "*********************************************************\n";
return 1;
}
return 0; return 0;
} }
@ -747,21 +668,11 @@ static Standard_Integer OCC824 (Draw_Interpretor& di,Standard_Integer argc, cons
static Standard_Integer OCC825 (Draw_Interpretor& di,Standard_Integer argc, const char ** argv) static Standard_Integer OCC825 (Draw_Interpretor& di,Standard_Integer argc, const char ** argv)
{ {
if(argc < 6 || argc > 7) { if(argc != 6) {
di << "Usage : " << argv[0] << " name1 name2 name3 result1 result2 [BRepAlgoAPI/BRepAlgo = 1/0]\n"; di << "Usage : " << argv[0] << " name1 name2 name3 result1 result2\n";
return 1; return 1;
} }
Standard_Boolean IsBRepAlgoAPI = Standard_True;
if (argc == 7) {
Standard_Integer IsB = Draw::Atoi(argv[6]);
if (IsB != 1) {
IsBRepAlgoAPI = Standard_False;
#if ! defined(BRepAlgo_def02)
// di << "Error: There is not BRepAlgo_Cut class\n";
// return 1;
#endif
}
}
int index = 1; int index = 1;
Standard_Real size = 50; Standard_Real size = 50;
@ -792,57 +703,50 @@ static Standard_Integer OCC825 (Draw_Interpretor& di,Standard_Integer argc, cons
di << "All primitives created..... Creating Cut Objects\n"; di << "All primitives created..... Creating Cut Objects\n";
TopoDS_Shape cut1, cut2;
try try
{ {
OCC_CATCH_SIGNALS OCC_CATCH_SIGNALS
if (IsBRepAlgoAPI) {
di << "cut1 = BRepAlgoAPI_Cut(sph1, hsp)\n";
cut1 = BRepAlgoAPI_Cut(sph1, hsp);
} else {
di << "cut1 = BRepAlgo_Cut(sph1, hsp)\n";
cut1 = BRepAlgo_Cut(sph1, hsp);
}
if (index < argc) DBRep::Set(argv[index++], cut1);
di << "CUT 1 Created ! " ;
if (IsBRepAlgoAPI) { di << "cut1 = BRepAlgoAPI_Cut(sph1, hsp)\n";
di << "cut2 = BRepAlgoAPI_Cut(sph2, hsp)\n"; TopoDS_Shape cut1 = BRepAlgoAPI_Cut(sph1, hsp).Shape();
cut2 = BRepAlgoAPI_Cut(sph2, hsp);
} else {
di << "cut2 = BRepAlgo_Cut(sph2, hsp)\n";
cut2 = BRepAlgo_Cut(sph2, hsp);
}
if (index < argc) DBRep::Set(argv[index++], cut2);
di << "CUT 2 Created !\n\n";
GProp_GProps G; if (index < argc) DBRep::Set(argv[index++], cut1);
BRepGProp::VolumeProperties(cut1, G); di << "CUT 1 Created ! " ;
di<<"CUT 1 Mass = "<<G.Mass()<< "\n\n";
BRepGProp::VolumeProperties(cut2, G);
di<<"CUT 2 Mass = "<<G.Mass()<< "\n\n";
di << "Trianglating Faces of CUT 1 .....\n";
performTriangulation(cut1, di);
di << "Trianglating Faces of CUT 2 .....\n"; di << "cut2 = BRepAlgoAPI_Cut(sph2, hsp)\n";
performTriangulation(cut2, di); TopoDS_Shape cut2 = BRepAlgoAPI_Cut(sph2, hsp).Shape();
}
catch ( Standard_Failure )
{
di<<"*********************************************************\n";
di<<"***** ******\n";
di<<"***** Standard_Failure : Exception in HSP Function ******\n";
di<<"***** ******\n";
di<<"*********************************************************\n";
return 1;
}
di<<"*************************************************************\n"; if (index < argc) DBRep::Set(argv[index++], cut2);
di<<" CUT 1 and CUT 2 gives entirely different results during\n"; di << "CUT 2 Created !\n\n";
di<<" mass computation and face triangulation, eventhough the\n";
di<<" two spheres are located more or less at the same position.\n"; GProp_GProps G;
di<<"*************************************************************\n"; BRepGProp::VolumeProperties(cut1, G);
di << "CUT 1 Mass = " << G.Mass() << "\n\n";
BRepGProp::VolumeProperties(cut2, G);
di << "CUT 2 Mass = " << G.Mass() << "\n\n";
di << "Trianglating Faces of CUT 1 .....\n";
performTriangulation(cut1, di);
di << "Trianglating Faces of CUT 2 .....\n";
performTriangulation(cut2, di);
}
catch (Standard_Failure)
{
di << "*********************************************************\n";
di << "***** ******\n";
di << "***** Standard_Failure : Exception in HSP Function ******\n";
di << "***** ******\n";
di << "*********************************************************\n";
return 1;
}
di << "*************************************************************\n";
di << " CUT 1 and CUT 2 gives entirely different results during\n";
di << " mass computation and face triangulation, eventhough the\n";
di << " two spheres are located more or less at the same position.\n";
di << "*************************************************************\n";
return 0; return 0;
} }
@ -853,21 +757,11 @@ static Standard_Integer OCC825 (Draw_Interpretor& di,Standard_Integer argc, cons
static Standard_Integer OCC826 (Draw_Interpretor& di,Standard_Integer argc, const char ** argv) static Standard_Integer OCC826 (Draw_Interpretor& di,Standard_Integer argc, const char ** argv)
{ {
if(argc < 4 || argc > 5) { if(argc != 4) {
di << "Usage : " << argv[0] << " name1 name2 result [BRepAlgoAPI/BRepAlgo = 1/0]\n"; di << "Usage : " << argv[0] << " name1 name2 result\n";
return 1; return 1;
} }
Standard_Boolean IsBRepAlgoAPI = Standard_True;
if (argc == 5) {
Standard_Integer IsB = Draw::Atoi(argv[4]);
if (IsB != 1) {
IsBRepAlgoAPI = Standard_False;
#if ! defined(BRepAlgo_def01)
// di << "Error: There is not BRepAlgo_Fuse class\n";
// return 1;
#endif
}
}
int index = 1; int index = 1;
Standard_Real x1 = 181.82808; Standard_Real x1 = 181.82808;
@ -898,30 +792,26 @@ static Standard_Integer OCC826 (Draw_Interpretor& di,Standard_Integer argc, cons
di << "All primitives created..... Creating Boolean\n"; di << "All primitives created..... Creating Boolean\n";
TopoDS_Shape fuse;
try try
{ {
OCC_CATCH_SIGNALS OCC_CATCH_SIGNALS
if (IsBRepAlgoAPI) {
di << "fuse = BRepAlgoAPI_Fuse(rev, sph)\n"; di << "fuse = BRepAlgoAPI_Fuse(rev, sph)\n";
fuse = BRepAlgoAPI_Fuse(rev, sph); TopoDS_Shape fuse = BRepAlgoAPI_Fuse(rev, sph).Shape();
} else {
di << "fuse = BRepAlgo_Fuse(rev, sph)\n"; if (index < argc) DBRep::Set(argv[index++], fuse);
fuse = BRepAlgo_Fuse(rev, sph); di << "Fuse Created ! Triangulating !\n";
} performTriangulation(fuse, di);
if (index < argc) DBRep::Set(argv[index++], fuse); }
di << "Fuse Created ! Triangulating !\n"; catch (Standard_Failure)
performTriangulation(fuse, di); {
} di << "*********************************************************\n";
catch ( Standard_Failure ) di << "***** ******\n";
{ di << "***** Standard_Failure : Exception in SPH Function ******\n";
di<<"*********************************************************\n"; di << "***** ******\n";
di<<"***** ******\n"; di << "*********************************************************\n";
di<<"***** Standard_Failure : Exception in SPH Function ******\n"; return 1;
di<<"***** ******\n"; }
di<<"*********************************************************\n";
return 1;
}
return 0; return 0;
} }
@ -932,21 +822,11 @@ static Standard_Integer OCC826 (Draw_Interpretor& di,Standard_Integer argc, cons
static Standard_Integer OCC827 (Draw_Interpretor& di,Standard_Integer argc, const char ** argv) static Standard_Integer OCC827 (Draw_Interpretor& di,Standard_Integer argc, const char ** argv)
{ {
if(argc < 6 || argc > 7) { if(argc != 6) {
di << "Usage : " << argv[0] << " name1 name2 name3 result1 result2 [BRepAlgoAPI/BRepAlgo = 1/0]\n"; di << "Usage : " << argv[0] << " name1 name2 name3 result1 result2\n";
return 1; return 1;
} }
Standard_Boolean IsBRepAlgoAPI = Standard_True;
if (argc == 7) {
Standard_Integer IsB = Draw::Atoi(argv[6]);
if (IsB != 1) {
IsBRepAlgoAPI = Standard_False;
#if ! defined(BRepAlgo_def01)
// di << "Error: There is not BRepAlgo_Fuse class\n";
// return 1;
#endif
}
}
int index = 1; int index = 1;
BRepBuilderAPI_MakePolygon W1; BRepBuilderAPI_MakePolygon W1;
@ -984,40 +864,33 @@ static Standard_Integer OCC827 (Draw_Interpretor& di,Standard_Integer argc, cons
di << "All primitives created..... Creating Boolean\n"; di << "All primitives created..... Creating Boolean\n";
TopoDS_Shape fuse1, fuse2;
try try
{ {
OCC_CATCH_SIGNALS OCC_CATCH_SIGNALS
if (IsBRepAlgoAPI) {
di << "Fuse1 = BRepAlgoAPI_Fuse(tor1, rev)\n";
fuse1 = BRepAlgoAPI_Fuse(tor1, rev);
} else {
di << "Fuse1 = BRepAlgo_Fuse(tor1, rev)\n";
fuse1 = BRepAlgo_Fuse(tor1, rev);
}
if (index < argc) DBRep::Set(argv[index++], fuse1);
di << "Fuse1 Created ! Creating Fuse 2\n";
if (IsBRepAlgoAPI) {
di << "Fuse2 = BRepAlgoAPI_Fuse(tor2, fuse1)\n";
fuse2 = BRepAlgoAPI_Fuse(tor2, fuse1);
} else {
di << "Fuse2 = BRepAlgo_Fuse(tor2, fuse1)\n";
fuse2 = BRepAlgo_Fuse(tor2, fuse1);
}
if (index < argc) DBRep::Set(argv[index++], fuse2);
di << "Fuse2 Created ! Triangulating !\n";
performTriangulation(fuse2, di); di << "Fuse1 = BRepAlgoAPI_Fuse(tor1, rev)\n";
} TopoDS_Shape fuse1 = BRepAlgoAPI_Fuse(tor1, rev).Shape();
catch ( Standard_Failure )
{ if (index < argc) DBRep::Set(argv[index++], fuse1);
di<<"*********************************************************\n"; di << "Fuse1 Created ! Creating Fuse 2\n";
di<<"***** ******\n";
di<<"***** Standard_Failure : Exception in REV Function ******\n"; di << "Fuse2 = BRepAlgoAPI_Fuse(tor2, fuse1)\n";
di<<"***** ******\n"; TopoDS_Shape fuse2 = BRepAlgoAPI_Fuse(tor2, fuse1).Shape();
di<<"*********************************************************\n";
return 1; if (index < argc) DBRep::Set(argv[index++], fuse2);
} di << "Fuse2 Created ! Triangulating !\n";
performTriangulation(fuse2, di);
}
catch (Standard_Failure)
{
di << "*********************************************************\n";
di << "***** ******\n";
di << "***** Standard_Failure : Exception in REV Function ******\n";
di << "***** ******\n";
di << "*********************************************************\n";
return 1;
}
return 0; return 0;
} }
@ -1164,18 +1037,18 @@ static Standard_Integer OCC828 (Draw_Interpretor& di,Standard_Integer argc, cons
void QABugs::Commands_10(Draw_Interpretor& theCommands) { void QABugs::Commands_10(Draw_Interpretor& theCommands) {
const char *group = "QABugs"; const char *group = "QABugs";
theCommands.Add ("OCC426", "OCC426 shape1 shape2 shape3 shape4 shape5 shape6 [BRepAlgoAPI/BRepAlgo = 1/0]", __FILE__, OCC426, group); theCommands.Add ("OCC426", "OCC426 shape1 shape2 shape3 shape4 shape5 shape6 shape7", __FILE__, OCC426, group);
theCommands.Add("isperiodic", "Use : isperiodic surfaceOfRevolution", __FILE__, isPeriodic, group); theCommands.Add("isperiodic", "Use : isperiodic surfaceOfRevolution", __FILE__, isPeriodic, group);
theCommands.Add("OCC486", "Use : OCC486 surf x y z du dv ", __FILE__, OCC486, group); theCommands.Add("OCC486", "Use : OCC486 surf x y z du dv ", __FILE__, OCC486, group);
theCommands.Add("OCC712", "OCC712 draftAngle slabThick", __FILE__, OCC712, group); theCommands.Add("OCC712", "OCC712 draftAngle slabThick", __FILE__, OCC712, group);
theCommands.Add("OCC822_1", "OCC822_1 name1 name2 result [BRepAlgoAPI/BRepAlgo = 1/0]", __FILE__,OCC822_1, group); theCommands.Add("OCC822_1", "OCC822_1 name1 name2 result", __FILE__,OCC822_1, group);
theCommands.Add("OCC822_2", "OCC822_2 name1 name2 result [BRepAlgoAPI/BRepAlgo = 1/0]", __FILE__,OCC822_2, group); theCommands.Add("OCC822_2", "OCC822_2 name1 name2 result", __FILE__,OCC822_2, group);
theCommands.Add("OCC823", "OCC823 name1 name2 result [BRepAlgoAPI/BRepAlgo = 1/0]", __FILE__,OCC823, group); theCommands.Add("OCC823", "OCC823 name1 name2 result", __FILE__,OCC823, group);
theCommands.Add("OCC824", "OCC824 name1 name2 result [BRepAlgoAPI/BRepAlgo = 1/0]", __FILE__,OCC824, group); theCommands.Add("OCC824", "OCC824 name1 name2 result", __FILE__,OCC824, group);
theCommands.Add("OCC825", "OCC825 name1 name2 name3 name4 name5 [BRepAlgoAPI/BRepAlgo = 1/0]", __FILE__,OCC825, group); theCommands.Add("OCC825", "OCC825 name1 name2 name3 name4 name5", __FILE__,OCC825, group);
theCommands.Add("OCC826", "OCC826 name1 name2 result [BRepAlgoAPI/BRepAlgo = 1/0]", __FILE__,OCC826, group); theCommands.Add("OCC826", "OCC826 name1 name2 result", __FILE__,OCC826, group);
theCommands.Add("OCC827", "OCC827 name1 name2 name3 result1 result2 [BRepAlgoAPI/BRepAlgo = 1/0]", __FILE__,OCC827, group); theCommands.Add("OCC827", "OCC827 name1 name2 name3 result1 result2", __FILE__,OCC827, group);
theCommands.Add("OCC828", "OCC828 redius shape result ", __FILE__,OCC828, group); theCommands.Add("OCC828", "OCC828 redius shape result ", __FILE__,OCC828, group);
return; return;

View File

@ -596,7 +596,6 @@ Standard_Integer OCC165(Draw_Interpretor& di ,
} }
#include<BRepAlgoAPI_Cut.hxx> #include<BRepAlgoAPI_Cut.hxx>
#include<BRepAlgo_Cut.hxx>
#include<BRepPrimAPI_MakeHalfSpace.hxx> #include<BRepPrimAPI_MakeHalfSpace.hxx>
#include<Geom_CartesianPoint.hxx> #include<Geom_CartesianPoint.hxx>
@ -609,71 +608,55 @@ Standard_Integer OCC165(Draw_Interpretor& di ,
static Standard_Integer OCC297 (Draw_Interpretor& di,Standard_Integer /*argc*/, const char ** argv ) static Standard_Integer OCC297 (Draw_Interpretor& di,Standard_Integer /*argc*/, const char ** argv )
{ {
Handle(AIS_InteractiveContext) myAISContext = ViewerTest::GetAISContext(); Handle(AIS_InteractiveContext) myAISContext = ViewerTest::GetAISContext();
if(myAISContext.IsNull()) { if (myAISContext.IsNull()) {
di << "use 'vinit' command before " << argv[0] << "\n"; di << "use 'vinit' command before " << argv[0] << "\n";
return -1; return -1;
} }
gp_Pnt pt1_(250., 250., 0.);
gp_Pnt pt2_(-250., 250., 0.);
gp_Pnt pt3_(-250., -250., 0.);
gp_Pnt pt4_(250., -250., 0.);
BRepBuilderAPI_MakeEdge edg1_(pt1_, pt2_);
BRepBuilderAPI_MakeEdge edg2_(pt2_, pt3_);
BRepBuilderAPI_MakeEdge edg3_(pt3_, pt4_);
BRepBuilderAPI_MakeEdge edg4_(pt4_, pt1_);
BRepBuilderAPI_MakeWire wire_(edg1_, edg2_, edg3_, edg4_);
BRepBuilderAPI_MakeFace face_(wire_);
TopoDS_Face sh_ = face_.Face();
gp_Pnt pt1_(250.,250.,0.); int up = 1;
gp_Pnt pt2_(-250.,250.,0.);
gp_Pnt pt3_(-250.,-250.,0.);
gp_Pnt pt4_(250.,-250.,0.);
BRepBuilderAPI_MakeEdge edg1_(pt1_, pt2_);
BRepBuilderAPI_MakeEdge edg2_(pt2_, pt3_);
BRepBuilderAPI_MakeEdge edg3_(pt3_, pt4_);
BRepBuilderAPI_MakeEdge edg4_(pt4_, pt1_);
BRepBuilderAPI_MakeWire wire_(edg1_, edg2_, edg3_, edg4_); gp_Pnt g_pnt;
BRepBuilderAPI_MakeFace face_(wire_); if (up)
TopoDS_Face sh_ = face_.Face(); g_pnt = gp_Pnt(0, 0, -100);
else
g_pnt = gp_Pnt(0, 0, 100);
int up = 1; myAISContext->EraseAll(Standard_False);
Handle(Geom_CartesianPoint) GEOMPoint = new Geom_CartesianPoint(g_pnt);
Handle(AIS_Point) AISPoint = new AIS_Point(GEOMPoint);
myAISContext->Display(AISPoint, Standard_True);
gp_Pnt g_pnt; BRepPrimAPI_MakeHalfSpace half_(sh_, g_pnt);
if(up) TopoDS_Solid sol1_ = half_.Solid();
g_pnt = gp_Pnt(0,0,-100);
else
g_pnt = gp_Pnt(0,0,100);
myAISContext->EraseAll(Standard_False); DBRep::Set("Face", sol1_);
Handle(Geom_CartesianPoint) GEOMPoint = new Geom_CartesianPoint(g_pnt);
Handle(AIS_Point) AISPoint = new AIS_Point(GEOMPoint);
myAISContext->Display (AISPoint, Standard_True);
BRepPrimAPI_MakeHalfSpace half_(sh_, g_pnt); gp_Ax1 ax1_(gp_Pnt(0., 0., -100.), gp_Dir(0., 0., 1.));
TopoDS_Solid sol1_ = half_.Solid();
// Handle(AIS_Shape) AISHalf = new AIS_Shape(sol1_);
// AISHalf->SetColor(Quantity_NOC_GREEN);
// myAISContext->Display(AISHalf);
DBRep::Set("Face",sol1_); Standard_Real x = 0., y = 0., z = -80.;
gp_Ax1 ax1_(gp_Pnt(0., 0., -100.), gp_Dir(0., 0., 1.)); BRepPrimAPI_MakeBox box(gp_Pnt(x, y, z), gp_Pnt(x + 150, y + 200, z + 200));
Standard_Real x=0., y=0., z=-80.; DBRep::Set("Box", box.Shape());
BRepPrimAPI_MakeBox box(gp_Pnt(x,y,z),gp_Pnt(x+150,y+200,z+200));
// Handle(AIS_Shape) AISBox = new AIS_Shape(box);
// AISBox->SetColor(Quantity_NOC_BLUE1);
// myAISContext->Display(AISBox);
DBRep::Set("Box",box.Shape());
// BRepAlgoAPI_Cut cut( sol1_, box.Shape() );
// //BRepAlgoAPI_Cut cut( box.Shape(), sol1_ );
// TopoDS_Shape sh1_ = cut.Shape();
// Handle(AIS_Shape) AISCut = new AIS_Shape(sh1_);
// AISCut->SetColor(Quantity_NOC_RED);
// myAISContext->Display(AISCut);
// DBRep::Set("Cut",sh1_);
return 0; return 0;
} }
#include<GProp_GProps.hxx> #include<GProp_GProps.hxx>
#include<BRepGProp.hxx> #include<BRepGProp.hxx>
@ -944,26 +927,13 @@ static Standard_Integer OCC310bug (Draw_Interpretor& di, Standard_Integer nb, co
#include <BRepAlgoAPI_Fuse.hxx> #include <BRepAlgoAPI_Fuse.hxx>
#include <BRepAlgoAPI_Common.hxx> #include <BRepAlgoAPI_Common.hxx>
#include <BRepAlgo_Fuse.hxx>
#include <BRepAlgo_Common.hxx>
static Standard_Integer OCC277bug (Draw_Interpretor& di, Standard_Integer nb, const char ** a) static Standard_Integer OCC277bug (Draw_Interpretor& di, Standard_Integer nb, const char ** a)
{ {
//if (nb != 1) { if(nb != 1) {
// cout << "Usage: " << a[0] << endl; di << "Usage : " << a[0] << "\n";
// return 1;
//}
if(nb < 1 || nb > 2) {
di << "Usage : " << a[0] << " [BRepAlgoAPI/BRepAlgo = 1/0]\n";
return 1; return 1;
} }
Standard_Boolean IsBRepAlgoAPI = Standard_True;
if (nb == 2) {
Standard_Integer IsB = Draw::Atoi(a[1]);
if (IsB != 1) {
IsBRepAlgoAPI = Standard_False;
}
}
BRepPrimAPI_MakeBox box1( 100, 100, 100 ); BRepPrimAPI_MakeBox box1( 100, 100, 100 );
BRepPrimAPI_MakeBox box2( gp_Pnt( 50, 50,50 ), 200, 200, 200 ); BRepPrimAPI_MakeBox box2( gp_Pnt( 50, 50,50 ), 200, 200, 200 );
@ -971,25 +941,11 @@ static Standard_Integer OCC277bug (Draw_Interpretor& di, Standard_Integer nb, co
TopoDS_Shape shape1 = box1.Shape(); TopoDS_Shape shape1 = box1.Shape();
TopoDS_Shape shape2 = box2.Shape(); TopoDS_Shape shape2 = box2.Shape();
//#if ! defined(BRepAlgoAPI_def01)
// TopoDS_Shape fuse = BRepAlgoAPI_Fuse( shape1, shape2 );
// TopoDS_Shape comm = BRepAlgoAPI_Common( shape1, shape2 );
//#else
// TopoDS_Shape fuse = BRepAlgo_Fuse( shape1, shape2 );
// TopoDS_Shape comm = BRepAlgo_Common( shape1, shape2 );
//#endif
TopoDS_Shape fuse,comm; TopoDS_Shape fuse,comm;
if (IsBRepAlgoAPI) { di << "fuse = BRepAlgoAPI_Fuse( shape1, shape2 )\n";
di << "fuse = BRepAlgoAPI_Fuse( shape1, shape2 )\n"; di << "comm = BRepAlgoAPI_Common( shape1, shape2 )\n";
di << "comm = BRepAlgoAPI_Common( shape1, shape2 )\n"; fuse = BRepAlgoAPI_Fuse(shape1, shape2).Shape();
fuse = BRepAlgoAPI_Fuse( shape1, shape2 ); comm = BRepAlgoAPI_Common(shape1, shape2).Shape();
comm = BRepAlgoAPI_Common( shape1, shape2 );
} else {
di << "fuse = BRepAlgo_Fuse( shape1, shape2 )\n";
fuse = BRepAlgo_Fuse( shape1, shape2 );
di << "comm = BRepAlgo_Common( shape1, shape2 )\n";
comm = BRepAlgo_Common( shape1, shape2 );
}
return 0; return 0;
} }
@ -1444,35 +1400,16 @@ static Standard_Integer OCC525(Draw_Interpretor& di, Standard_Integer /*argc*/,
#include <gce_MakeTranslation.hxx> #include <gce_MakeTranslation.hxx>
#include <BRepBuilderAPI_Transform.hxx> #include <BRepBuilderAPI_Transform.hxx>
#include <BRepPrimAPI_MakeWedge.hxx> #include <BRepPrimAPI_MakeWedge.hxx>
#include <BRepAlgoAPI_Fuse.hxx>
#include <BRepAlgoAPI_Cut.hxx>
#include <BRepAlgo_Fuse.hxx>
#include <BRepAlgo_Cut.hxx>
//======================================================================= //=======================================================================
//function : OCC578 //function : OCC578
//purpose : //purpose :
//======================================================================= //=======================================================================
static Standard_Integer OCC578 (Draw_Interpretor& di, Standard_Integer argc, const char ** argv) static Standard_Integer OCC578 (Draw_Interpretor& di, Standard_Integer argc, const char ** argv)
{ {
//if (argc!=4) { if(argc != 4) {
// di<<"Usage : " << argv[0] << " shape1 shape2 shape3\n"; di << "Usage : " << argv[0] << " shape1 shape2 shape3\n";
// return 1;
//}
if(argc < 4 || argc > 5) {
di << "Usage : " << argv[0] << " shape1 shape2 shape3 [BRepAlgoAPI/BRepAlgo = 1/0]\n";
return 1; return 1;
} }
Standard_Boolean IsBRepAlgoAPI = Standard_True;
if (argc == 5) {
Standard_Integer IsB = Draw::Atoi(argv[4]);
if (IsB != 1) {
IsBRepAlgoAPI = Standard_False;
// di << "Error: There is not BRepAlgo_Fuse class\n";
// return 1;
// di << "Error: There is not BRepAlgo_Cut class\n";
// return 1;
}
}
gp_Pnt P0(0,0,0.0); gp_Pnt P0(0,0,0.0);
double xperiod = 1.0; double xperiod = 1.0;
@ -1537,35 +1474,12 @@ static Standard_Integer OCC578 (Draw_Interpretor& di, Standard_Integer argc, con
// combine wedges // combine wedges
//#if ! defined(BRepAlgoAPI_def01) di << "wedge_common = BRepAlgoAPI_Fuse(wedge1a , wedge2a)\n";
// TopoDS_Shape wedge_common = BRepAlgoAPI_Fuse(wedge1a , wedge2a); TopoDS_Shape wedge_common = BRepAlgoAPI_Fuse(wedge1a , wedge2a).Shape();
//#else
// TopoDS_Shape wedge_common = BRepAlgo_Fuse(wedge1a , wedge2a);
//#endif
TopoDS_Shape wedge_common;
if (IsBRepAlgoAPI) {
di << "wedge_common = BRepAlgoAPI_Fuse(wedge1a , wedge2a)\n";
wedge_common = BRepAlgoAPI_Fuse(wedge1a , wedge2a);
} else {
di << "wedge_common = BRepAlgo_Fuse(wedge1a , wedge2a)\n";
wedge_common = BRepAlgo_Fuse(wedge1a , wedge2a);
}
// remove wedge area from substrate
//#if ! defined(BRepAlgoAPI_def01)
// TopoDS_Shape sub_etch1 = BRepAlgoAPI_Cut(substrate, wedge_common);
//#else
// TopoDS_Shape sub_etch1 = BRepAlgo_Cut(substrate, wedge_common);
//#endif
TopoDS_Shape sub_etch1;
if (IsBRepAlgoAPI) {
di << "sub_etch1 = BRepAlgoAPI_Cut(substrate, wedge_common)\n";
sub_etch1 = BRepAlgoAPI_Cut(substrate, wedge_common);
} else {
di << "sub_etch1 = BRepAlgo_Cut(substrate, wedge_common)\n";
sub_etch1 = BRepAlgo_Cut(substrate, wedge_common);
}
di << "sub_etch1 = BRepAlgoAPI_Cut(substrate, wedge_common)\n";
TopoDS_Shape sub_etch1 = BRepAlgoAPI_Cut(substrate, wedge_common).Shape();
if (sub_etch1.IsNull()) { if (sub_etch1.IsNull()) {
di<<" Null shape3 is not allowed\n"; di<<" Null shape3 is not allowed\n";
return 1; return 1;
@ -2047,31 +1961,16 @@ static Standard_Integer OCC1034_AISSelectionMode (Draw_Interpretor& di,
return 1; return 1;
} }
#include<BRepAlgoAPI_Cut.hxx>
#include<BRepAlgo_Cut.hxx>
//======================================================================= //=======================================================================
//function : OCC1487 //function : OCC1487
//purpose : //purpose :
//======================================================================= //=======================================================================
static Standard_Integer OCC1487 (Draw_Interpretor& di, Standard_Integer argc, const char ** argv) static Standard_Integer OCC1487 (Draw_Interpretor& di, Standard_Integer argc, const char ** argv)
{ {
//if(argc != 5) { if(argc != 5) {
// cerr << "Usage : " << argv[0] << " CylinderVariant(=1/2) cylinder1 cylinder2 cutshape" << endl; di << "Usage : " << argv[0] << " CylinderVariant(=1/2) cylinder1 cylinder2 cutshape\n";
// return -1;
//}
if(argc < 5 || argc > 6) {
di << "Usage : " << argv[0] << " CylinderVariant(=1/2) cylinder1 cylinder2 cutshape [BRepAlgoAPI/BRepAlgo = 1/0]\n";
return 1; return 1;
} }
Standard_Boolean IsBRepAlgoAPI = Standard_True;
if (argc == 6) {
Standard_Integer IsB = Draw::Atoi(argv[5]);
if (IsB != 1) {
IsBRepAlgoAPI = Standard_False;
// di << "Error: There is not BRepAlgo_Cut class\n";
// return 1;
}
}
Standard_Integer CaseNumber = Draw::Atoi(argv[1]); Standard_Integer CaseNumber = Draw::Atoi(argv[1]);
@ -2093,18 +1992,8 @@ static Standard_Integer OCC1487 (Draw_Interpretor& di, Standard_Integer argc, co
BRepPrimAPI_MakeCylinder o_mc2 (myAx2_mc2, 5, 150); BRepPrimAPI_MakeCylinder o_mc2 (myAx2_mc2, 5, 150);
cyl2 = o_mc2.Shape(); cyl2 = o_mc2.Shape();
//#if ! defined(BRepAlgoAPI_def01) di << "o_cut_shape = BRepAlgoAPI_Cut (o_mc1.Solid (), o_mc2.Solid ())\n";
// o_cut_shape = BRepAlgoAPI_Cut (o_mc1.Solid (), o_mc2.Solid ()); o_cut_shape = BRepAlgoAPI_Cut (o_mc1.Solid (), o_mc2.Solid ()).Shape();
//#else
// o_cut_shape = BRepAlgo_Cut (o_mc1.Solid (), o_mc2.Solid ());
//#endif
if (IsBRepAlgoAPI) {
di << "o_cut_shape = BRepAlgoAPI_Cut (o_mc1.Solid (), o_mc2.Solid ())\n";
o_cut_shape = BRepAlgoAPI_Cut (o_mc1.Solid (), o_mc2.Solid ());
} else {
di << "o_cut_shape = BRepAlgo_Cut (o_mc1.Solid (), o_mc2.Solid ())\n";
o_cut_shape = BRepAlgo_Cut (o_mc1.Solid (), o_mc2.Solid ());
}
} else { } else {
//BRepPrimAPI_MakeCylinder o_mc2 (gp_Ax2 (gp_Pnt(978.34936, -50.0, 127.5),gp_Dir(sin(M_PI/3), 0.0, 0.5)), 5, 150); //BRepPrimAPI_MakeCylinder o_mc2 (gp_Ax2 (gp_Pnt(978.34936, -50.0, 127.5),gp_Dir(sin(M_PI/3), 0.0, 0.5)), 5, 150);
gp_Dir myDir_mc2(sin(M_PI/3), 0.0, 0.5); gp_Dir myDir_mc2(sin(M_PI/3), 0.0, 0.5);
@ -2113,18 +2002,8 @@ static Standard_Integer OCC1487 (Draw_Interpretor& di, Standard_Integer argc, co
BRepPrimAPI_MakeCylinder o_mc2 (myAx2_mc2, 5, 150); BRepPrimAPI_MakeCylinder o_mc2 (myAx2_mc2, 5, 150);
cyl2 = o_mc2.Shape(); cyl2 = o_mc2.Shape();
//#if ! defined(BRepAlgoAPI_def01) di << "o_cut_shape = BRepAlgoAPI_Cut (o_mc1.Solid (), o_mc2.Solid ())\n";
// o_cut_shape = BRepAlgoAPI_Cut (o_mc1.Solid (), o_mc2.Solid ()); o_cut_shape = BRepAlgoAPI_Cut (o_mc1.Solid (), o_mc2.Solid ()).Shape();
//#else
// o_cut_shape = BRepAlgo_Cut (o_mc1.Solid (), o_mc2.Solid ());
//#endif
if (IsBRepAlgoAPI) {
di << "o_cut_shape = BRepAlgoAPI_Cut (o_mc1.Solid (), o_mc2.Solid ())\n";
o_cut_shape = BRepAlgoAPI_Cut (o_mc1.Solid (), o_mc2.Solid ());
} else {
di << "o_cut_shape = BRepAlgo_Cut (o_mc1.Solid (), o_mc2.Solid ())\n";
o_cut_shape = BRepAlgo_Cut (o_mc1.Solid (), o_mc2.Solid ());
}
} }
DBRep::Set(argv[2],cyl1); DBRep::Set(argv[2],cyl1);
@ -4983,7 +4862,7 @@ void QABugs::Commands_11(Draw_Interpretor& theCommands) {
theCommands.Add("OCC310","OCC310", __FILE__, OCC310bug, group); theCommands.Add("OCC310","OCC310", __FILE__, OCC310bug, group);
//theCommands.Add("OCC277","OCC277", __FILE__, OCC277bug, group); //theCommands.Add("OCC277","OCC277", __FILE__, OCC277bug, group);
theCommands.Add("OCC277","OCC277 [BRepAlgoAPI/BRepAlgo = 1/0]", __FILE__, OCC277bug, group); theCommands.Add("OCC277","OCC277", __FILE__, OCC277bug, group);
theCommands.Add("OCC333","OCC333 edge1 edge2 [toler domaindist]; Check overlapping edges", __FILE__, OCC333bug, group); theCommands.Add("OCC333","OCC333 edge1 edge2 [toler domaindist]; Check overlapping edges", __FILE__, OCC333bug, group);
@ -4997,7 +4876,7 @@ void QABugs::Commands_11(Draw_Interpretor& theCommands) {
theCommands.Add("OCC524", "OCC524 LowerVector UpperVector InitialValueVector LowerRowMatrix UpperRowMatrix LowerColMatrix UpperColMatrix InitialValueMatrix", __FILE__, OCC524, group); theCommands.Add("OCC524", "OCC524 LowerVector UpperVector InitialValueVector LowerRowMatrix UpperRowMatrix LowerColMatrix UpperColMatrix InitialValueMatrix", __FILE__, OCC524, group);
theCommands.Add("OCC525", "OCC525", __FILE__, OCC525, group); theCommands.Add("OCC525", "OCC525", __FILE__, OCC525, group);
//theCommands.Add("OCC578", "OCC578 shape1 shape2 shape3", __FILE__, OCC578, group); //theCommands.Add("OCC578", "OCC578 shape1 shape2 shape3", __FILE__, OCC578, group);
theCommands.Add("OCC578", "OCC578 shape1 shape2 shape3 [BRepAlgoAPI/BRepAlgo = 1/0]", __FILE__, OCC578, group); theCommands.Add("OCC578", "OCC578 shape1 shape2 shape3", __FILE__, OCC578, group);
theCommands.Add("OCC669", "OCC669 GUID", __FILE__, OCC669, group); theCommands.Add("OCC669", "OCC669 GUID", __FILE__, OCC669, group);
theCommands.Add("OCC738_ShapeRef", "OCC738_ShapeRef", __FILE__, OCC738_ShapeRef, group); theCommands.Add("OCC738_ShapeRef", "OCC738_ShapeRef", __FILE__, OCC738_ShapeRef, group);
theCommands.Add("OCC738_Assembly", "OCC738_Assembly", __FILE__, OCC738_Assembly, group); theCommands.Add("OCC738_Assembly", "OCC738_Assembly", __FILE__, OCC738_Assembly, group);
@ -5016,7 +4895,7 @@ void QABugs::Commands_11(Draw_Interpretor& theCommands) {
theCommands.Add ("OCC1034_AISSelectionMode", "OCC1034_AISSelectionMode (DOC, entry, [selectionmode])", __FILE__, OCC1034_AISSelectionMode, group); theCommands.Add ("OCC1034_AISSelectionMode", "OCC1034_AISSelectionMode (DOC, entry, [selectionmode])", __FILE__, OCC1034_AISSelectionMode, group);
//theCommands.Add("OCC1487", "OCC1487 CylinderVariant(=1/2) cylinder1 cylinder2 cutshape", __FILE__, OCC1487, group); //theCommands.Add("OCC1487", "OCC1487 CylinderVariant(=1/2) cylinder1 cylinder2 cutshape", __FILE__, OCC1487, group);
theCommands.Add("OCC1487", "OCC1487 CylinderVariant(=1/2) cylinder1 cylinder2 cutshape [BRepAlgoAPI/BRepAlgo = 1/0]", __FILE__, OCC1487, group); theCommands.Add("OCC1487", "OCC1487 CylinderVariant(=1/2) cylinder1 cylinder2 cutshape", __FILE__, OCC1487, group);
theCommands.Add("OCC1077", "OCC1077 result", __FILE__, OCC1077, group); theCommands.Add("OCC1077", "OCC1077 result", __FILE__, OCC1077, group);
theCommands.Add("OCC5739", "OCC5739 name shape step", __FILE__, OCC5739_UniAbs, group); theCommands.Add("OCC5739", "OCC5739 name shape step", __FILE__, OCC5739_UniAbs, group);

View File

@ -388,10 +388,6 @@ static Standard_Integer OCC332bug (Draw_Interpretor& di, Standard_Integer argc,
#include <TopExp.hxx> #include <TopExp.hxx>
#include <BRepOffsetAPI_Sewing.hxx> #include <BRepOffsetAPI_Sewing.hxx>
#include <BRepAlgoAPI_Fuse.hxx> #include <BRepAlgoAPI_Fuse.hxx>
///////#else
///////#include <BRepAlgo_Fuse.hxx>
///////#include <BRepAlgoAPI_Fuse.hxx>
#include <BRepAlgo_Fuse.hxx>
//======================================================================= //=======================================================================
//function : OCC544 //function : OCC544
@ -399,21 +395,10 @@ static Standard_Integer OCC332bug (Draw_Interpretor& di, Standard_Integer argc,
//======================================================================= //=======================================================================
static Standard_Integer OCC544 (Draw_Interpretor& di, Standard_Integer argc, const char** argv) static Standard_Integer OCC544 (Draw_Interpretor& di, Standard_Integer argc, const char** argv)
{ {
if(argc > 7) { if(argc > 6) {
di << "Usage : " << argv[0] << " [[[[[wT [[[[d1 [[[d2 [[R [length [BRepAlgoAPI/BRepAlgo = 1/0]]]]]]\n"; di << "Usage : " << argv[0] << " [[[[[wT [[[[d1 [[[d2 [[R [length]]]]]\n";
return 1; return 1;
} }
Standard_Boolean IsBRepAlgoAPI = Standard_True;
if (argc == 7) {
Standard_Integer IsB = Draw::Atoi(argv[6]);
if (IsB != 1) {
IsBRepAlgoAPI = Standard_False;
#if ! defined(BRepAlgo_def01)
// di << "Error: There is not BRepAlgo_Fuse class\n";
// return 1;
#endif
}
}
// Used to Display Geometry or Topolgy // Used to Display Geometry or Topolgy
char name[255]; char name[255];
@ -681,29 +666,18 @@ static Standard_Integer OCC544 (Draw_Interpretor& di, Standard_Integer argc, con
wallSolid = TopoDS::Solid(getSol.Current()); wallSolid = TopoDS::Solid(getSol.Current());
TopoDS_Solid test_solid; TopoDS_Solid test_solid;
while (getSol.More()) while (getSol.More())
{ {
di << "Next solid found in compound\n"; di << "Next solid found in compound\n";
getSol.Next(); getSol.Next();
test_solid = TopoDS::Solid(getSol.Current()); test_solid = TopoDS::Solid(getSol.Current());
//////#if ! defined(BRepAlgoAPI_def01)
////// BRepAlgoAPI_Fuse fuser(test_solid, wallSolid); di << "BRepAlgoAPI_Fuse fuser(test_solid, wallSolid)\n";
//////#else BRepAlgoAPI_Fuse fuser(test_solid, wallSolid);
////// BRepAlgo_Fuse fuser(test_solid, wallSolid); TopExp_Explorer aExpS(fuser.Shape(), TopAbs_SOLID);
//////#endif if (aExpS.More()) {
////// fuser.Build(); wallSolid = TopoDS::Solid(aExpS.Current());
if (IsBRepAlgoAPI) { }
di << "BRepAlgoAPI_Fuse fuser(test_solid, wallSolid)\n"; }
BRepAlgoAPI_Fuse fuser(test_solid, wallSolid);
fuser.Build();
wallSolid = TopoDS::Solid(fuser.Shape());
} else {
di << "BRepAlgo_Fuse fuser(test_solid, wallSolid)\n";
BRepAlgo_Fuse fuser(test_solid, wallSolid);
fuser.Build();
wallSolid = TopoDS::Solid(fuser.Shape());
}
////// wallSolid = TopoDS::Solid(fuser.Shape());
}
} else { } else {
// Let's see if we can extract shells instead of solids. // Let's see if we can extract shells instead of solids.
TopExp_Explorer getShel; TopExp_Explorer getShel;
@ -794,41 +768,15 @@ static Standard_Integer OCC544 (Draw_Interpretor& di, Standard_Integer argc, con
#include <BRepBuilderAPI_Copy.hxx> #include <BRepBuilderAPI_Copy.hxx>
#include <BRepAlgoAPI_Cut.hxx> #include <BRepAlgoAPI_Cut.hxx>
#include <BRepAlgoAPI_Common.hxx> #include <BRepAlgoAPI_Common.hxx>
//////////#else
//////////#include <BRepAlgo_Cut.hxx>
//////////#include <BRepAlgo_Common.hxx>
//////////#include <BRepAlgoAPI_Cut.hxx>
//////////#include <BRepAlgoAPI_Common.hxx>
#include <BRepAlgo_Cut.hxx>
#include <BRepAlgo_Common.hxx>
#include <Precision.hxx> #include <Precision.hxx>
static Standard_Integer OCC817 (Draw_Interpretor& di, Standard_Integer argc, const char** argv) static Standard_Integer OCC817 (Draw_Interpretor& di, Standard_Integer argc, const char** argv)
{ {
//////////if(argc != 3) { if(argc != 3) {
////////// cout << "Usage : " << argv[0] << " result mesh_delta" << endl; di << "Usage : " << argv[0] << " result mesh_delta\n";
////////// return 1;
//////////}
if(argc < 3 || argc > 4) {
di << "Usage : " << argv[0] << " result mesh_delta [BRepAlgoAPI/BRepAlgo = 1/0]\n";
return 1; return 1;
} }
Standard_Boolean IsBRepAlgoAPI = Standard_True;
if (argc == 4) {
Standard_Integer IsB = Draw::Atoi(argv[3]);
if (IsB != 1) {
IsBRepAlgoAPI = Standard_False;
#if ! defined(BRepAlgo_def02)
// di << "Error: There is not BRepAlgo_Cut class\n";
// return 1;
#endif
#if ! defined(BRepAlgo_def03)
// di << "Error: There is not BRepAlgo_Common class\n";
// return 1;
#endif
}
}
Standard_Real delt = 5.0*Precision::Confusion(); Standard_Real delt = 5.0*Precision::Confusion();
Standard_Real mesh_delt = Draw::Atof(argv[2]); Standard_Real mesh_delt = Draw::Atof(argv[2]);
if (mesh_delt <= 0.0) if (mesh_delt <= 0.0)
@ -846,38 +794,14 @@ static Standard_Integer OCC817 (Draw_Interpretor& di, Standard_Integer argc, con
TopoDS_Solid internalSolid = BRepPrimAPI_MakeBox(P, 10.0, 10.0, 10.0).Solid(); TopoDS_Solid internalSolid = BRepPrimAPI_MakeBox(P, 10.0, 10.0, 10.0).Solid();
// Cut inner from outer // Cut inner from outer
//////////#if ! defined(BRepAlgoAPI_def01) di << "BRepAlgoAPI_Cut cut( fullSolid, internalSolid )\n";
////////// BRepAlgoAPI_Cut cut( fullSolid, internalSolid ); BRepAlgoAPI_Cut cut(fullSolid, internalSolid);
//////////#else if (!cut.IsDone())
////////// BRepAlgo_Cut cut( fullSolid, internalSolid ); {
//////////#endif di << "Error: Could not cut volumes\n";
////////// TopoDS_Shape cut_shape = cut.Shape(); return -1;
////////// if ( !cut.IsDone() )
////////// {
////////// cout << "Error: Could not cut volumes" << endl;
////////// return -1;
////////// }
TopoDS_Shape cut_shape;
if (IsBRepAlgoAPI) {
di << "BRepAlgoAPI_Cut cut( fullSolid, internalSolid )\n";
BRepAlgoAPI_Cut cut( fullSolid, internalSolid );
cut_shape = cut.Shape();
if ( !cut.IsDone() )
{
di << "Error: Could not cut volumes\n";
return -1;
}
} else {
di << "BRepAlgo_Cut cut( fullSolid, internalSolid )\n";
BRepAlgo_Cut cut( fullSolid, internalSolid );
cut_shape = cut.Shape();
if ( !cut.IsDone() )
{
di << "Error: Could not cut volumes\n";
return -1;
}
} }
const TopoDS_Shape& cut_shape = cut.Shape();
// see if we have a solid // see if we have a solid
Standard_Integer found_solid = 0; Standard_Integer found_solid = 0;
@ -979,37 +903,14 @@ static Standard_Integer OCC817 (Draw_Interpretor& di, Standard_Integer argc, con
TopoDS_Shape copySolid = BRepBuilderAPI_Copy(cutSolid).Shape(); TopoDS_Shape copySolid = BRepBuilderAPI_Copy(cutSolid).Shape();
// perform common // perform common
//////////#if ! defined(BRepAlgoAPI_def01) di << "BRepAlgoAPI_Common common(copySolid/*cutSolid*/, SubvolumeSolid(l))\n";
////////// BRepAlgoAPI_Common common(copySolid/*cutSolid*/, SubvolumeSolid(l)); BRepAlgoAPI_Common common(copySolid/*cutSolid*/, SubvolumeSolid(l));
//////////#else if (!common.IsDone())
////////// BRepAlgo_Common common(copySolid/*cutSolid*/, SubvolumeSolid(l)); {
//////////#endif di << "Error: could not construct a common solid " << l << "\n";
////////// if (!common.IsDone()) return 1;
////////// {
////////// cout << "Error: could not construct a common solid " << l << endl;
////////// return 1;
////////// }
TopoDS_Shape aCommonShape;
if (IsBRepAlgoAPI) {
di << "BRepAlgoAPI_Common common(copySolid/*cutSolid*/, SubvolumeSolid(l))\n";
BRepAlgoAPI_Common common(copySolid/*cutSolid*/, SubvolumeSolid(l));
if (!common.IsDone())
{
di << "Error: could not construct a common solid " << l << "\n";
return 1;
}
aCommonShape = common.Shape();
} else {
di << "BRepAlgo_Common common(copySolid/*cutSolid*/, SubvolumeSolid(l))\n";
BRepAlgo_Common common(copySolid/*cutSolid*/, SubvolumeSolid(l));
if (!common.IsDone())
{
di << "Error: could not construct a common solid " << l << "\n";
return 1;
}
aCommonShape = common.Shape();
} }
const TopoDS_Shape& aCommonShape = common.Shape();
// see if we have a solid // see if we have a solid
found_solid = 0; found_solid = 0;
@ -1055,9 +956,9 @@ void QABugs::Commands_13(Draw_Interpretor& theCommands) {
theCommands.Add ("OCC332", "OCC332 [wall_thickness [dia1 [dia2 [length [major_radius]]]]]", __FILE__, OCC332bug, group); theCommands.Add ("OCC332", "OCC332 [wall_thickness [dia1 [dia2 [length [major_radius]]]]]", __FILE__, OCC332bug, group);
//////theCommands.Add("OCC544", "OCC544 [[[[[wT [[[[d1 [[[d2 [[R [length]]]]]", __FILE__, OCC544, group); //////theCommands.Add("OCC544", "OCC544 [[[[[wT [[[[d1 [[[d2 [[R [length]]]]]", __FILE__, OCC544, group);
theCommands.Add("OCC544", "OCC544 [[[[[wT [[[[d1 [[[d2 [[R [length [BRepAlgoAPI/BRepAlgo = 1/0]]]]]]", __FILE__, OCC544, group); theCommands.Add("OCC544", "OCC544 [[[[[wT [[[[d1 [[[d2 [[R [length ]]]]]", __FILE__, OCC544, group);
//////theCommands.Add("OCC817", "OCC817 result mesh_delta", __FILE__, OCC817, group); //////theCommands.Add("OCC817", "OCC817 result mesh_delta", __FILE__, OCC817, group);
theCommands.Add("OCC817", "OCC817 result mesh_delta [BRepAlgoAPI/BRepAlgo = 1/0]", __FILE__, OCC817, group); theCommands.Add("OCC817", "OCC817 result mesh_delta ", __FILE__, OCC817, group);
return; return;
} }

View File

@ -1399,7 +1399,6 @@ static Standard_Integer OCCN1 (Draw_Interpretor& di, Standard_Integer argc, cons
#include <BRepPrimAPI_MakeCylinder.hxx> #include <BRepPrimAPI_MakeCylinder.hxx>
#include <BRepPrimAPI_MakeSphere.hxx> #include <BRepPrimAPI_MakeSphere.hxx>
#include <BRepAlgoAPI_Section.hxx> #include <BRepAlgoAPI_Section.hxx>
#include <BRepAlgo_Section.hxx>
//======================================================================= //=======================================================================
//function : OCCN2 //function : OCCN2
//purpose : BOOLEAN OPERATION //purpose : BOOLEAN OPERATION
@ -1407,18 +1406,9 @@ static Standard_Integer OCCN1 (Draw_Interpretor& di, Standard_Integer argc, cons
static Standard_Integer OCCN2 (Draw_Interpretor& di, Standard_Integer argc, const char ** argv) static Standard_Integer OCCN2 (Draw_Interpretor& di, Standard_Integer argc, const char ** argv)
{ {
if (argc > 2) { if (argc > 2) {
di << "Usage : " << argv[0] << " [BRepAlgoAPI/BRepAlgo = 1/0]\n"; di << "Usage : " << argv[0] << "\n";
return 1; return 1;
} }
Standard_Boolean IsBRepAlgoAPI = Standard_True;
if (argc == 2) {
Standard_Integer IsB = Draw::Atoi(argv[1]);
if (IsB != 1) {
IsBRepAlgoAPI = Standard_False;
#if ! defined(BRepAlgo_def04)
#endif
}
}
Handle(AIS_InteractiveContext) aContext = ViewerTest::GetAISContext(); Handle(AIS_InteractiveContext) aContext = ViewerTest::GetAISContext();
if(aContext.IsNull()) if(aContext.IsNull())
@ -1433,27 +1423,12 @@ static Standard_Integer OCCN2 (Draw_Interpretor& di, Standard_Integer argc, cons
BRepPrimAPI_MakeSphere sphere(gp_Pnt(60,0,100),50); BRepPrimAPI_MakeSphere sphere(gp_Pnt(60,0,100),50);
TopoDS_Shape sphere_sh = sphere.Shape(); TopoDS_Shape sphere_sh = sphere.Shape();
//BRepAlgoAPI_Section section(cylinder_sh, sphere_sh); di << "BRepAlgoAPI_Section section(cylinder_sh, sphere_sh)\n";
//TopoDS_Shape shape = section.Shape(); BRepAlgoAPI_Section section(cylinder_sh, sphere_sh);
if (!section.IsDone()){
TopoDS_Shape shape; di << "Error performing intersection: not done.\n";
if (IsBRepAlgoAPI) {
di << "BRepAlgoAPI_Section section(cylinder_sh, sphere_sh)\n";
BRepAlgoAPI_Section section(cylinder_sh, sphere_sh);
section.Build();
if(!section.IsDone()){
di << "Error performing intersection: not done.\n";
}
shape = section.Shape();
} else {
di << "BRepAlgo_Section section(cylinder_sh, sphere_sh)\n";
BRepAlgo_Section section(cylinder_sh, sphere_sh);
section.Build();
if(!section.IsDone()){
di << "Error performing intersection: not done.\n";
}
shape = section.Shape();
} }
const TopoDS_Shape& shape = section.Shape();
DBRep::Set("OCCN2_cylinder",cylinder_sh); DBRep::Set("OCCN2_cylinder",cylinder_sh);
DBRep::Set("OCCN2_sphere",sphere_sh); DBRep::Set("OCCN2_sphere",sphere_sh);

View File

@ -18,7 +18,7 @@
#include <AIS_InteractiveContext.hxx> #include <AIS_InteractiveContext.hxx>
#include <AIS_LocalContext.hxx> #include <AIS_LocalContext.hxx>
#include <AIS_TexturedShape.hxx> #include <AIS_TexturedShape.hxx>
#include <BRepAlgo_Cut.hxx> #include <BRepAlgoAPI_Cut.hxx>
#include <BRepOffsetAPI_MakePipe.hxx> #include <BRepOffsetAPI_MakePipe.hxx>
#include <BRepPrimAPI_MakeBox.hxx> #include <BRepPrimAPI_MakeBox.hxx>
#include <BRepPrimAPI_MakeSphere.hxx> #include <BRepPrimAPI_MakeSphere.hxx>
@ -125,7 +125,7 @@ static Standard_Integer OCC23237 (Draw_Interpretor& di, Standard_Integer /*argc*
// do some operation that will take considerable time compared with time of starting / stopping timers // do some operation that will take considerable time compared with time of starting / stopping timers
BRepPrimAPI_MakeBox aBox (10., 10., 10.); BRepPrimAPI_MakeBox aBox (10., 10., 10.);
BRepPrimAPI_MakeSphere aSphere (10.); BRepPrimAPI_MakeSphere aSphere (10.);
BRepAlgo_Cut aCutter (aBox.Shape(), aSphere.Shape()); BRepAlgoAPI_Cut aCutter (aBox.Shape(), aSphere.Shape());
aTM.Stop(); aTM.Stop();
aPM.Stop(); aPM.Stop();

View File

@ -32,7 +32,6 @@
#include <gp_Pln.hxx> #include <gp_Pln.hxx>
#include <BRep_Tool.hxx> #include <BRep_Tool.hxx>
#include <BRepAlgoAPI_Section.hxx> #include <BRepAlgoAPI_Section.hxx>
#include <BRepAlgo_Section.hxx>
#include <BRepMesh_IncrementalMesh.hxx> #include <BRepMesh_IncrementalMesh.hxx>
#include <Precision.hxx> #include <Precision.hxx>
#include <Standard_ErrorHandler.hxx> #include <Standard_ErrorHandler.hxx>
@ -49,23 +48,11 @@ static Standard_Integer OCC527(Draw_Interpretor& di, Standard_Integer argc, cons
{ {
OCC_CATCH_SIGNALS OCC_CATCH_SIGNALS
// 1. Verify amount of arguments of the command // 1. Verify amount of arguments of the command
//if (argc < 2) { di << "OCC527 FAULTY. Use : OCC527 shape "; return 0;} if (argc != 2) {
if (argc < 2 || argc > 3) { di << "Usage : " << argv[0] << "OCC527 shape\n";
di << "Usage : " << argv[0] << " shape [BRepAlgoAPI/BRepAlgo = 1/0]\n";
return 1; return 1;
} }
Standard_Boolean IsBRepAlgoAPI = Standard_True;
if (argc == 3) {
Standard_Integer IsB = Draw::Atoi(argv[2]);
if (IsB != 1) {
IsBRepAlgoAPI = Standard_False;
//#if ! defined(BRepAlgo_def04)
// di << "Error: There is not BRepAlgo_Section class\n";
// return 1;
//#endif
}
}
// 2. Get selected shape // 2. Get selected shape
TopoDS_Shape aShape = DBRep::Get(argv[1]); TopoDS_Shape aShape = DBRep::Get(argv[1]);
if(aShape.IsNull()) { di << "OCC527 FAULTY. Entry shape is NULL"; return 0;} if(aShape.IsNull()) { di << "OCC527 FAULTY. Entry shape is NULL"; return 0;}
@ -97,62 +84,34 @@ static Standard_Integer OCC527(Draw_Interpretor& di, Standard_Integer argc, cons
// Build current section // Build current section
gp_Pln pl(0,0,1,-zcur); gp_Pln pl(0,0,1,-zcur);
//#if ! defined(BRepAlgoAPI_def01)
// BRepAlgoAPI_Section aSection(aFace,pl,Standard_False); //
//#else di << "BRepAlgoAPI_Section aSection(aFace,pl,Standard_False)\n";
// BRepAlgo_Section aSection(aFace,pl,Standard_False); BRepAlgoAPI_Section aSection(aFace, pl, Standard_False);
//#endif aSection.Approximation(Standard_True);
// aSection.Approximation(Standard_True); aSection.Build();
// aSection.Build(); Standard_Boolean IsDone = aSection.IsDone();
// // If section was built meassure distance between vertexes and plane of the one. Max distance is stored.
// if (aSection.IsDone())
Standard_Boolean IsDone;
TopoDS_Shape aResult;
if (IsBRepAlgoAPI) {
di << "BRepAlgoAPI_Section aSection(aFace,pl,Standard_False)\n";
BRepAlgoAPI_Section aSection(aFace,pl,Standard_False);
aSection.Approximation(Standard_True);
aSection.Build();
IsDone = aSection.IsDone();
aResult = aSection.Shape();
} else {
di << "BRepAlgo_Section aSection(aFace,pl,Standard_False)\n";
BRepAlgo_Section aSection(aFace,pl,Standard_False);
aSection.Approximation(Standard_True);
aSection.Build();
IsDone = aSection.IsDone();
aResult = aSection.Shape();
}
if (IsDone) if (IsDone)
{ {
// TopoDS_Shape aResult = aSection.Shape(); const TopoDS_Shape& aResult = aSection.Shape();
if (!aResult.IsNull()) if (!aResult.IsNull())
{ {
double lmaxdist = 0.0; double lmaxdist = 0.0;
TopExp_Explorer aExp2; TopExp_Explorer aExp2;
for (aExp2.Init(aResult,TopAbs_VERTEX); aExp2.More(); aExp2.Next()) for (aExp2.Init(aResult, TopAbs_VERTEX); aExp2.More(); aExp2.Next())
{ {
TopoDS_Vertex aV = TopoDS::Vertex(aExp2.Current()); TopoDS_Vertex aV = TopoDS::Vertex(aExp2.Current());
Standard_Real toler = BRep_Tool::Tolerance(aV); Standard_Real toler = BRep_Tool::Tolerance(aV);
double dist = pl.Distance(BRep_Tool::Pnt(aV)); double dist = pl.Distance(BRep_Tool::Pnt(aV));
if (dist > lmaxdist) lmaxdist = dist; if (dist > lmaxdist) lmaxdist = dist;
// If section was built check distance beetwen vertexes and plane of the one // If section was built check distance beetwen vertexes and plane of the one
str[0] =0; str[0] = 0;
// if (wasBuilt) if (dist > toler)
// { Sprintf(str, "Dist=%f, Toler=%f, Param=%f FAULTY\n", dist, toler, gzmax);
// if(gmaxdist > Precision::Confusion()) else
// Sprintf(str,"Dist=%f, Param=%f FAULTY\n",gmaxdist,gzmax); Sprintf(str, "Dist=%f, Toler=%f, Param=%f\n", dist, toler, gzmax);
// else di << str;
// Sprintf(str,"Dist=%f, Param=%f\n",gmaxdist,gzmax);
if(dist > toler)
Sprintf(str,"Dist=%f, Toler=%f, Param=%f FAULTY\n",dist,toler,gzmax);
else
Sprintf(str,"Dist=%f, Toler=%f, Param=%f\n",dist,toler,gzmax);
// }
// else Sprintf(str,"No result\n");
di << str;
} }
if (lmaxdist > gmaxdist) if (lmaxdist > gmaxdist)
{ {
@ -195,8 +154,7 @@ static Standard_Integer OCC1048 (Draw_Interpretor& di, Standard_Integer argc, co
void QABugs::Commands_2(Draw_Interpretor& theCommands) { void QABugs::Commands_2(Draw_Interpretor& theCommands) {
const char *group = "QABugs"; const char *group = "QABugs";
//theCommands.Add("OCC527", "OCC527 shape", __FILE__, OCC527, group); theCommands.Add("OCC527", "OCC527 shape", __FILE__, OCC527, group);
theCommands.Add("OCC527", "OCC527 shape [BRepAlgoAPI/BRepAlgo = 1/0]", __FILE__, OCC527, group); theCommands.Add("OCC1048", "OCC1048 shape", __FILE__, OCC1048, group);
theCommands.Add("OCC1048", "OCC1048 shape", __FILE__, OCC1048, group);
return; return;
} }

View File

@ -323,7 +323,6 @@ static Standard_Integer BUC60574(Draw_Interpretor& di, Standard_Integer /*n*/, c
#include <BRepPrimAPI_MakeSphere.hxx> #include <BRepPrimAPI_MakeSphere.hxx>
#include <BRepAlgoAPI_Fuse.hxx> #include <BRepAlgoAPI_Fuse.hxx>
#include <BRepAlgo_Fuse.hxx>
#include <V3d_View.hxx> #include <V3d_View.hxx>
#include <gce_MakePln.hxx> #include <gce_MakePln.hxx>
@ -732,21 +731,10 @@ static int BUC60825(Draw_Interpretor& di, Standard_Integer argc, const char ** a
static int OCC10006(Draw_Interpretor& di, Standard_Integer argc, const char ** argv) static int OCC10006(Draw_Interpretor& di, Standard_Integer argc, const char ** argv)
{ {
if(argc > 2) { if(argc != 1) {
di << "Usage : " << argv[0] << " [BRepAlgoAPI/BRepAlgo = 1/0]\n"; di << "Usage : " << argv[0] << "\n";
return 1; return 1;
} }
Standard_Boolean IsBRepAlgoAPI = Standard_True;
if (argc == 2) {
Standard_Integer IsB = Draw::Atoi(argv[1]);
if (IsB != 1) {
IsBRepAlgoAPI = Standard_False;
#if ! defined(BRepAlgo_def01)
// di << "Error: There is not BRepAlgo_Fuse class\n";
// return 1;
#endif
}
}
double bottompoints1[12] = { 10, -10, 0, 100, -10, 0, 100, -100, 0, 10, -100, 0}; double bottompoints1[12] = { 10, -10, 0, 100, -10, 0, 100, -100, 0, 10, -100, 0};
double toppoints1[12] = { 0, 0, 10, 100, 0, 10, 100, -100, 10, 0, -100, 10}; double toppoints1[12] = { 0, 0, 10, 100, 0, 10, 100, -100, 10, 0, -100, 10};
@ -785,22 +773,10 @@ static int OCC10006(Draw_Interpretor& di, Standard_Integer argc, const char ** a
DBRep::Set("TS1",loft1.Shape()); DBRep::Set("TS1",loft1.Shape());
DBRep::Set("TS2",loft2.Shape()); DBRep::Set("TS2",loft2.Shape());
//#if ! defined(BRepAlgoAPI_def01) di << "BRepAlgoAPI_Fuse result(loft1.Shape(), loft2.Shape())\n";
// BRepAlgoAPI_Fuse result(loft1.Shape(), loft2.Shape()); BRepAlgoAPI_Fuse result(loft1.Shape(), loft2.Shape());
//#else DBRep::Set("F", result.Shape());
// BRepAlgo_Fuse result(loft1.Shape(), loft2.Shape());
//#endif
if (IsBRepAlgoAPI) {
di << "BRepAlgoAPI_Fuse result(loft1.Shape(), loft2.Shape())\n";
BRepAlgoAPI_Fuse result(loft1.Shape(), loft2.Shape());
DBRep::Set("F",result.Shape());
} else {
di << "BRepAlgo_Fuse result(loft1.Shape(), loft2.Shape())\n";
BRepAlgo_Fuse result(loft1.Shape(), loft2.Shape());
DBRep::Set("F",result.Shape());
}
// DBRep::Set("F",result.Shape());
return 0; return 0;
} }
@ -945,21 +921,10 @@ static Standard_Integer BUC60773 (Draw_Interpretor& /*di*/, Standard_Integer /*n
static int TestCMD(Draw_Interpretor& di, Standard_Integer argc, const char ** argv) static int TestCMD(Draw_Interpretor& di, Standard_Integer argc, const char ** argv)
{ {
if(argc > 2) { if(argc != 1) {
di << "Usage : " << argv[0] << " [BRepAlgoAPI/BRepAlgo = 1/0]\n"; di << "Usage : " << argv[0] << "\n";
return 1; return 1;
} }
Standard_Boolean IsBRepAlgoAPI = Standard_True;
if (argc == 2) {
Standard_Integer IsB = Draw::Atoi(argv[1]);
if (IsB != 1) {
IsBRepAlgoAPI = Standard_False;
#if ! defined(BRepAlgo_def01)
// di << "Error: There is not BRepAlgo_Fuse class\n";
// return 1;
#endif
}
}
//Cylindre 36.085182 20.0 8.431413 88.04671 20.0 38.931416 10.0 //Cylindre 36.085182 20.0 8.431413 88.04671 20.0 38.931416 10.0
@ -1000,34 +965,15 @@ static int TestCMD(Draw_Interpretor& di, Standard_Integer argc, const char ** ar
TopoDS_Shape SCon = cone.Shape(); TopoDS_Shape SCon = cone.Shape();
DBRep::Set("con", SCon); DBRep::Set("con", SCon);
//#if ! defined(BRepAlgoAPI_def01) di << "BRepAlgoAPI_Fuse SFuse(SCyl, SCon)\n";
// BRepAlgoAPI_Fuse SFuse(SCyl, SCon); BRepAlgoAPI_Fuse SFuse(SCyl, SCon);
//#else if (!SFuse.IsDone()) {
// BRepAlgo_Fuse SFuse(SCyl, SCon); di << "Error: Boolean fuse operation failed !\n";
//#endif }
// else {
// if(! SFuse.IsDone() ) const TopoDS_Shape& fuse = SFuse.Shape();
// cout<<"Error: Boolean fuse operation failed !"<<endl; DBRep::Set("fus", fuse);
//
// TopoDS_Shape fuse = SFuse.Shape();
TopoDS_Shape fuse;
if (IsBRepAlgoAPI) {
di << "BRepAlgoAPI_Fuse SFuse(SCyl, SCon)\n";
BRepAlgoAPI_Fuse SFuse(SCyl, SCon);
if(! SFuse.IsDone() )
di<<"Error: Boolean fuse operation failed !\n";
fuse = SFuse.Shape();
} else {
di << "BRepAlgo_Fuse SFuse(SCyl, SCon)\n";
BRepAlgo_Fuse SFuse(SCyl, SCon);
if(! SFuse.IsDone() )
di<<"Error: Boolean fuse operation failed !\n";
fuse = SFuse.Shape();
} }
DBRep::Set("fus", fuse);
return 0; return 0;
} }
@ -1125,21 +1071,10 @@ static Standard_Integer statface (Draw_Interpretor& di,Standard_Integer /*argc*/
static Standard_Integer BUC60841(Draw_Interpretor& di, Standard_Integer argc, const char ** argv ) static Standard_Integer BUC60841(Draw_Interpretor& di, Standard_Integer argc, const char ** argv )
{ {
if(argc > 2) { if(argc != 1) {
di << "Usage : " << argv[0] << " [BRepAlgoAPI/BRepAlgo = 1/0]\n"; di << "Usage : " << argv[0] << "\n";
return 1; return 1;
} }
Standard_Boolean IsBRepAlgoAPI = Standard_True;
if (argc == 2) {
Standard_Integer IsB = Draw::Atoi(argv[1]);
if (IsB != 1) {
IsBRepAlgoAPI = Standard_False;
#if ! defined(BRepAlgo_def01)
// di << "Error: There is not BRepAlgo_Fuse class\n";
// return 1;
#endif
}
}
gp_Ax2 Ax2 = gp_Ax2(gp_Pnt(0, 621, 78), gp_Dir(0, 1,0)); gp_Ax2 Ax2 = gp_Ax2(gp_Pnt(0, 621, 78), gp_Dir(0, 1,0));
BRepPrimAPI_MakeCylinder cyl(Ax2, 260, 150); BRepPrimAPI_MakeCylinder cyl(Ax2, 260, 150);
@ -1156,52 +1091,21 @@ static Standard_Integer BUC60841(Draw_Interpretor& di, Standard_Integer argc, co
TopoDS_Shape sh2 = trans1.Shape(); TopoDS_Shape sh2 = trans1.Shape();
DBRep::Set("sh2",sh2); DBRep::Set("sh2",sh2);
//#if ! defined(BRepAlgoAPI_def01) di << "BRepAlgoAPI_Fuse fuse1(sh1, sh2)\n";
// BRepAlgoAPI_Fuse fuse1(sh1, sh2); BRepAlgoAPI_Fuse fuse1(sh1, sh2);
//#else TopoDS_Shape fsh1 = fuse1.Shape();
// BRepAlgo_Fuse fuse1(sh1, sh2);
//#endif
//
// TopoDS_Shape fsh1 = fuse1.Shape();
TopoDS_Shape fsh1;
if (IsBRepAlgoAPI) {
di << "BRepAlgoAPI_Fuse fuse1(sh1, sh2)\n";
BRepAlgoAPI_Fuse fuse1(sh1, sh2);
fsh1 = fuse1.Shape();
} else {
di << "BRepAlgo_Fuse fuse1(sh1, sh2)\n";
BRepAlgo_Fuse fuse1(sh1, sh2);
fsh1 = fuse1.Shape();
}
DBRep::Set("fsh1",fsh1); DBRep::Set("fsh1",fsh1);
BRepBuilderAPI_Transform trans2(fsh1, trsf2); BRepBuilderAPI_Transform trans2(fsh1, trsf2);
TopoDS_Shape sh3 = trans2.Shape(); TopoDS_Shape sh3 = trans2.Shape();
DBRep::Set("sh3",sh3); DBRep::Set("sh3",sh3);
//#if ! defined(BRepAlgoAPI_def01) di << "BRepAlgoAPI_Fuse fuse2(fsh1,sh3)\n";
// BRepAlgoAPI_Fuse fuse2(fsh1,sh3); BRepAlgoAPI_Fuse fuse2(fsh1, sh3);
//#else const TopoDS_Shape& fsh2 = fuse2.Shape();
// BRepAlgo_Fuse fuse2(fsh1,sh3);
//#endif
//
// TopoDS_Shape fsh2 = fuse2.Shape();
TopoDS_Shape fsh2;
if (IsBRepAlgoAPI) {
di << "BRepAlgoAPI_Fuse fuse2(fsh1,sh3)\n";
BRepAlgoAPI_Fuse fuse2(fsh1,sh3);
fsh2 = fuse2.Shape();
} else {
di << "BRepAlgo_Fuse fuse2(fsh1,sh3)\n";
BRepAlgo_Fuse fuse2(fsh1,sh3);
fsh2 = fuse2.Shape();
}
DBRep::Set("fsh2",fsh2); DBRep::Set("fsh2",fsh2);
Handle(AIS_Shape) aisp1 = new AIS_Shape(fsh2); Handle(AIS_Shape) aisp1 = new AIS_Shape(fsh2);
// aContext->Display(aisp1);
return 0; return 0;
} }
@ -1596,27 +1500,11 @@ static Standard_Integer BUC60921 (Draw_Interpretor& di,
static Standard_Integer BUC60951_(Draw_Interpretor& di, Standard_Integer argc, const char ** a) static Standard_Integer BUC60951_(Draw_Interpretor& di, Standard_Integer argc, const char ** a)
{ {
//if(argc!=2) if (argc != 2) {
// { di << "Usage : " << a[0] << " file.igs\n";
// cerr << "Usage : " << a[0] << " file.igs" << endl;
// return -1;
// }
if(argc < 2 || argc > 3) {
di << "Usage : " << a[0] << " [BRepAlgoAPI/BRepAlgo = 1/0]\n";
return 1; return 1;
} }
Standard_Boolean IsBRepAlgoAPI = Standard_True;
if (argc == 3) {
Standard_Integer IsB = Draw::Atoi(a[2]);
if (IsB != 1) {
IsBRepAlgoAPI = Standard_False;
#if ! defined(BRepAlgo_def01)
// di << "Error: There is not BRepAlgo_Fuse class\n";
// return 1;
#endif
}
}
Handle(AIS_InteractiveContext) myContext = ViewerTest::GetAISContext(); Handle(AIS_InteractiveContext) myContext = ViewerTest::GetAISContext();
if(myContext.IsNull()) { if(myContext.IsNull()) {
@ -1649,23 +1537,9 @@ static Standard_Integer BUC60951_(Draw_Interpretor& di, Standard_Integer argc, c
BRepPrimAPI_MakeCylinder cyl(anAx2, 50, 300); BRepPrimAPI_MakeCylinder cyl(anAx2, 50, 300);
TopoDS_Shape sh = cyl.Shape(); TopoDS_Shape sh = cyl.Shape();
//#if ! defined(BRepAlgoAPI_def01) di << "BRepAlgoAPI_Fuse fuse(sol, sh)\n";
// BRepAlgoAPI_Fuse fuse(sol, sh); BRepAlgoAPI_Fuse fuse(sol, sh);
//#else sh = fuse.Shape();
// BRepAlgo_Fuse fuse(sol, sh);
//#endif
//
// sh = fuse.Shape();
if (IsBRepAlgoAPI) {
di << "BRepAlgoAPI_Fuse fuse(sol, sh)\n";
BRepAlgoAPI_Fuse fuse(sol, sh);
sh = fuse.Shape();
} else {
di << "BRepAlgo_Fuse fuse(sol, sh)\n";
BRepAlgo_Fuse fuse(sol, sh);
sh = fuse.Shape();
}
Handle(AIS_Shape) res = new AIS_Shape(sh); Handle(AIS_Shape) res = new AIS_Shape(sh);
myContext->Display (res, Standard_True); myContext->Display (res, Standard_True);
@ -1694,7 +1568,7 @@ void QABugs::Commands_3(Draw_Interpretor& theCommands) {
theCommands.Add("BUC60825","BUC60825",__FILE__,BUC60825,group); theCommands.Add("BUC60825","BUC60825",__FILE__,BUC60825,group);
theCommands.Add("OCC10006","OCC10006 [BRepAlgoAPI/BRepAlgo = 1/0]",__FILE__,OCC10006,group); theCommands.Add("OCC10006","OCC10006",__FILE__,OCC10006,group);
theCommands.Add("BUC60856","BUC60856",__FILE__,BUC60856,group); theCommands.Add("BUC60856","BUC60856",__FILE__,BUC60856,group);
@ -1705,11 +1579,11 @@ void QABugs::Commands_3(Draw_Interpretor& theCommands) {
theCommands.Add("BUC60876","BUC60876 shape",__FILE__,BUC60876_,group); theCommands.Add("BUC60876","BUC60876 shape",__FILE__,BUC60876_,group);
theCommands.Add("BUC60773","BUC60773",__FILE__,BUC60773,group); theCommands.Add("BUC60773","BUC60773",__FILE__,BUC60773,group);
theCommands.Add("TestCMD","TestCMD [BRepAlgoAPI/BRepAlgo = 1/0]",__FILE__,TestCMD,group); theCommands.Add("TestCMD","TestCMD",__FILE__,TestCMD,group);
theCommands.Add("statface","statface face",__FILE__,statface,group); theCommands.Add("statface","statface face",__FILE__,statface,group);
theCommands.Add("BUC60841","BUC60841 [BRepAlgoAPI/BRepAlgo = 1/0]",__FILE__,BUC60841,group); theCommands.Add("BUC60841","BUC60841",__FILE__,BUC60841,group);
theCommands.Add("BUC60874","BUC60874",__FILE__,BUC60874,group); theCommands.Add("BUC60874","BUC60874",__FILE__,BUC60874,group);
@ -1726,6 +1600,6 @@ void QABugs::Commands_3(Draw_Interpretor& theCommands) {
theCommands.Add("AISWidth","AISWidth (DOC,entry,[width])",__FILE__,AISWidth,group); theCommands.Add("AISWidth","AISWidth (DOC,entry,[width])",__FILE__,AISWidth,group);
theCommands.Add("BUC60921","BUC60921 Doc label brep_file",__FILE__,BUC60921,group); theCommands.Add("BUC60921","BUC60921 Doc label brep_file",__FILE__,BUC60921,group);
theCommands.Add("BUC60951","BUC60951 file.igs [BRepAlgoAPI/BRepAlgo = 1/0]",__FILE__,BUC60951_, group ); theCommands.Add("BUC60951","BUC60951 file.igs",__FILE__,BUC60951_, group );
} }

View File

@ -1,8 +1,6 @@
if { ![checkplatform -windows] } { puts "TODO OCC24156 MacOS: \\*\\* Exception \\*\\*.*"
puts "TODO ?OCC12345 MacOS: \\*\\* Exception" puts "TODO OCC24156 MacOS: An exception was caught"
puts "TODO ?OCC12345 MacOS: An exception was caught" puts "TODO OCC24156 MacOS: TEST INCOMPLETE"
puts "TODO ?OCC12345 MacOS: TEST INCOMPLETE"
}
pload QAcommands pload QAcommands
@ -15,10 +13,8 @@ puts "========"
############################################################################# #############################################################################
## BRepFilletAPI_MakeFillet presents a bug on fillet computation (build()) ## BRepFilletAPI_MakeFillet presents a bug on fillet computation (build())
############################################################################# #############################################################################
## (old topology)
#############################################################################
OCC426 result rs1 rs2 rs3 fuse32 fuse321 0 OCC426 result rs1 rs2 rs3 fuse32 fuse321 fuseUnif
checkshape rs1 checkshape rs1
checkshape rs2 checkshape rs2
@ -29,4 +25,3 @@ checkshape fuse321
checkprops result -s 7507.61 checkprops result -s 7507.61
checkshape result checkshape result
checkview -display result -2d -path ${imagedir}/${test_image}.png checkview -display result -2d -path ${imagedir}/${test_image}.png

View File

@ -1,29 +0,0 @@
puts "TODO OCC24156 MacOS: \\*\\* Exception \\*\\*.*"
puts "TODO OCC24156 MacOS: An exception was caught"
puts "TODO OCC24156 MacOS: TEST INCOMPLETE"
puts "TODO OCC25920 ALL: Faulty shapes in variables faulty_1 to faulty_"
puts "TODO OCC25920 ALL: Error : The area of result shape is"
pload QAcommands
puts "========"
puts "OCC426"
puts "OCC50"
puts "========"
#############################################################################
## The result of fuse operation is invalid
#############################################################################
## BRepFilletAPI_MakeFillet presents a bug on fillet computation (build())
#############################################################################
OCC426 result rs1 rs2 rs3 fuse32 fuse321
checkshape rs1
checkshape rs2
checkshape rs3
checkshape fuse32
checkshape fuse321
checkprops result -s 7507.61
checkshape result
checkview -display result -3d -path ${imagedir}/${test_image}.png

View File

@ -7,10 +7,8 @@ puts ""
##################################### #####################################
## BRepMesh_IncrementalMesh fails on some faces ## BRepMesh_IncrementalMesh fails on some faces
##################################### #####################################
## (old topology)
#####################################
if {[ catch { set info_result [OCC822_1 a1 a2 result 0] } ] } { if {[ catch { set info_result [OCC822_1 a1 a2 result] } ] } {
puts "Faulty OCC822" puts "Faulty OCC822"
} else { } else {
if { [regexp {FAILED} $info_result] } { if { [regexp {FAILED} $info_result] } {

View File

@ -10,7 +10,7 @@ puts ""
## (old topology) ## (old topology)
##################################### #####################################
if { [ catch { set info_result [OCC822_2 a1 a2 result 0] } ] } { if { [ catch { set info_result [OCC822_2 a1 a2 result] } ] } {
puts "Faulty OCC822" puts "Faulty OCC822"
} else { } else {
if { [regexp {FAILED} $info_result] } { if { [regexp {FAILED} $info_result] } {

View File

@ -7,8 +7,6 @@ puts ""
############################### ###############################
## BRepAlgoAPI_Fuse fails on two cylinders ## BRepAlgoAPI_Fuse fails on two cylinders
############################### ###############################
## (old topology)
#####################################
if { [ catch { set info_result [OCC823 a1 a2 result] } ] } { if { [ catch { set info_result [OCC823 a1 a2 result] } ] } {
puts "Faulty OCC823" puts "Faulty OCC823"

View File

@ -1,31 +0,0 @@
pload QAcommands
puts "============"
puts "OCC823"
puts "============"
puts ""
################################
## BRepAlgoAPI_Fuse fails on two cylinders
################################
##
## Note: test for old topology
##
################################
if { [ catch { set info_result [OCC823 a1 a2 a3] } ] } {
puts "Faulty : exception was caught"
} else {
checkshape a1
checkshape a2
bfuse result a1 a2
set ExplodeList [explode result]
if {[llength ${ExplodeList}] < 1} {
puts "Faulty : Resulting shape is empty COMPOUND"
}
}
checkprops result -s 23189.5
checkshape result
checkview -display result -2d -path ${imagedir}/${test_image}.png

View File

@ -7,10 +7,8 @@ puts ""
#################################### ####################################
## BRepAlgoAPI_Fuse fails on cylinder and sphere ## BRepAlgoAPI_Fuse fails on cylinder and sphere
#################################### ####################################
## (old topology)
#####################################
if { [ catch { set info_result [OCC824 a1 a2 result 0] } ] } { if { [ catch { set info_result [OCC824 a1 a2 result] } ] } {
puts "Faulty OCC824" puts "Faulty OCC824"
} else { } else {
if { [regexp {FAILED} $info_result] } { if { [regexp {FAILED} $info_result] } {

View File

@ -1,31 +0,0 @@
pload QAcommands
puts "======="
puts "OCC824"
puts "======="
puts ""
####################################
## BRepAlgoAPI_Fuse fails on cylinder and sphere
####################################
##
## Note: test for old topology
##
################################
if { [ catch { set info_result [OCC824 a1 a2 a3] } ] } {
puts "Faulty : exception was catch"
} else {
checkshape a1
checkshape a2
bfuse result a1 a2
set ExplodeList [explode result]
if {[llength ${ExplodeList}] < 1} {
puts "Faulty : Resulting shape is empty COMPOUND"
}
}
checkprops result -s 16336.3
checkshape result
checkview -display result -2d -path ${imagedir}/${test_image}.png

View File

@ -1,5 +1,4 @@
puts "TODO OCC25915 ALL: Faulty OCC825" puts "TODO OCC25915 ALL: Faulty OCC825"
puts "TODO OCC25915 ALL: Error : The command is not valid. The area is"
puts "TODO OCC25915 ALL: Faulty shapes in variables faulty_1 to faulty_" puts "TODO OCC25915 ALL: Faulty shapes in variables faulty_1 to faulty_"
pload QAcommands pload QAcommands
@ -14,7 +13,7 @@ puts ""
## (old topology) ## (old topology)
##################################### #####################################
if { [ catch { set info_result [OCC825 a1 a2 a3 res1 res2 0] } ] } { if { [ catch { set info_result [OCC825 a1 a2 a3 res1 res2] } ] } {
puts "Faulty OCC825" puts "Faulty OCC825"
} else { } else {
if { [regexp {FAILED} $info_result] } { if { [regexp {FAILED} $info_result] } {
@ -30,13 +29,17 @@ if { [ catch { set info_result [OCC825 a1 a2 a3 res1 res2 0] } ] } {
if {[llength ${ExplodeList}] < 1} { if {[llength ${ExplodeList}] < 1} {
puts "Faulty OCC825" puts "Faulty OCC825"
} }
checkshape res1
checkshape res1
checkprops res1 -s 5890.42
checknbshapes res1 -face 2 -shell 1 -solid 1 -compsolid 0 -compound 1 -shape 15 checknbshapes res1 -face 2 -shell 1 -solid 1 -compsolid 0 -compound 1 -shape 15
renamevar res2 result renamevar res2 result
} }
checkprops result -s 0
checkshape result checkshape result
checkprops result -s 5890.42
checkview -display result -2d -path ${imagedir}/${test_image}.png checkview -display result -2d -path ${imagedir}/${test_image}.png

View File

@ -1,28 +0,0 @@
pload QAcommands
puts "======="
puts "OCC825"
puts "======="
puts ""
######################################
## BRepAlgoAPI_Cut fails on sphere and b-spline face
######################################
##
## Note: test for old topology
##
################################
if { [ catch { set info_result [OCC825 a1 a2 a3 a4 a5] } ] } {
puts "Faulty : an exception was caught"
} else {
bcut result a2 a1
set ExplodeList [explode result]
if {[llength ${ExplodeList}] < 1} {
puts "Faulty : Resulting shape is empty COMPOUND"
}
}
checkprops result -s 5890.46
checkshape result
checkview -display result -2d -path ${imagedir}/${test_image}.png

View File

@ -1,30 +0,0 @@
puts "TODO OCC25915 ALL: Faulty shapes in variables faulty_1 to faulty_"
pload QAcommands
puts "========"
puts "OCC825"
puts "========"
puts ""
######################################
## BRepAlgoAPI_Cut fails on sphere and b-spline face
######################################
##
## Note: test for old topology
##
################################
if { [ catch { set info_result [OCC825 a1 a2 a3 a4 a5] } ] } {
puts "Faulty : an exception was caught"
} else {
bcut result a3 a1
set ExplodeList [explode result]
if {[llength ${ExplodeList}] < 1} {
puts "Faulty : Resulting shape is empty COMPOUND"
}
}
checkprops result -s 5890.48
checkshape result
checkview -display result -2d -path ${imagedir}/${test_image}.png

View File

@ -1,37 +0,0 @@
pload QAcommands
puts "============"
puts "OCC826"
puts "============"
puts ""
###################################
## BRepAlgoAPI_Fuse fails on revolved and sphere
###################################
## Now this test uses BOPAlgo.
## Intersection of cylinder and sphere. At that,
## the intersection line goes near to the pole
## of the sphere (near, but not through).
## Walking-line has a point in the seam of
## the sphere and neighbour point. Both sections of the
## sphere (through every of these points and parallel to
## equatorial plane) are circles with small radii. As result,
## in 2D-space U-coordinates of these points are too different
## (may be even ~60 degrees) in spite of its neighbourhood.
#####################################
if { [ catch { set result [OCC826 a1 a2 a3] } ] } {
puts "Faulty : an exception was caught"
} else {
checkshape a1
checkshape a2
bfuse result a1 a2
set ExplodeList [explode result]
if {[llength ${ExplodeList}] < 1} {
puts "Faulty : Resulting shape is empty COMPOUND"
}
}
checkprops result -s 272935
checkshape result
checkview -display result -2d -path ${imagedir}/${test_image}.png

View File

@ -1,47 +0,0 @@
puts "TODO #23910 ALL: Faulty OCC827"
puts "TODO #23910 ALL: Faulty shapes in variables faulty_1 to faulty_"
pload QAcommands
puts "========"
puts "OCC827"
puts "========"
puts ""
###################################
## BRepAlgoAPI_Fuse fails on cylinder and torus
###################################
## (old topology)
#####################################
#
# a1 - Cylinder
# a2 - Torus1
# a3 - Torus1
# res1 - Fuse(Torus1 & Cylinder)
# res2 - Fuse(Torus2 & res1)
#
if { [ catch { set info_result [OCC827 a1 a2 a3 res1 res2 0] } ] } {
puts "Faulty OCC827"
} else {
if { [regexp {FAILED} $info_result] } {
puts "Faulty OCC827"
}
checkshape a1
checkshape a2
checkshape a3
checkshape res1
set ExplodeList [explode res1]
if {[llength ${ExplodeList}] < 1} {
puts "Faulty OCC827"
}
set ExplodeList [explode res2]
if {[llength ${ExplodeList}] < 1} {
puts "Faulty OCC827"
}
renamevar res2 result
}
checkprops result -s 7046.01
checkshape result
checkview -display result -2d -path ${imagedir}/${test_image}.png

View File

@ -1,43 +0,0 @@
pload QAcommands
puts "======="
puts "OCC827"
puts "======="
puts ""
####################################
## BRepAlgoAPI_Fuse fails on cylinder and torus
####################################
#
# a1 - Cylinder
# a2 - Torus1
# a3 - Torus1
# res1 - Fuse(Torus1 & Cylinder)
# res2 - Fuse(Torus2 & res1)
#
if { [ catch { set info_result [OCC827 a1 a2 a3 a4 a5] } ] } {
puts "Faulty OCC827"
} else {
checkshape a1
checkshape a2
checkshape a3
bop a1 a2
bopfuse res1
checkshape res1
set ExplodeList [explode res1]
if {[llength ${ExplodeList}] < 1} {
puts "Faulty OCC827 : Resulting shape is empty COMPOUND"
}
bop res1 a3
bopfuse result
set ExplodeList [explode result]
if {[llength ${ExplodeList}] < 1} {
puts "Faulty OCC827 : Resulting shape is empty COMPOUND"
}
}
checkprops result -s 11847.7
checkshape result
checkview -display result -2d -path ${imagedir}/${test_image}.png

View File

@ -1,44 +0,0 @@
pload QAcommands
puts "======="
puts "OCC827"
puts "======="
puts ""
####################################
## BRepAlgoAPI_Fuse fails on cylinder and torus
####################################
#
# a1 - Cylinder
# a2 - Torus1
# a3 - Torus1
# res1 - Fuse(Torus1 & Cylinder)
# res2 - Fuse(Torus2 & res1)
#
if { [ catch { set info_result [OCC827 a1 a2 a3 a4 a5] } ] } {
puts "Faulty OCC827"
} else {
checkshape a1
checkshape a2
checkshape a3
bop a2 a1
bopfuse res1
checkshape res1
set ExplodeList [explode res1]
if {[llength ${ExplodeList}] < 1} {
puts "Faulty OCC827 : Resulting shape is empty COMPOUND"
}
bop a3 res1
bopfuse result
set ExplodeList [explode result]
if {[llength ${ExplodeList}] < 1} {
puts "Faulty OCC827 : Resulting shape is empty COMPOUND"
}
}
checkprops result -s 11847.7
checkshape result
checkview -display result -2d -path ${imagedir}/${test_image}.png