The QA commands have been modified to use new Boolean operations instead of old.
#include <BRepPrimAPI_MakeRevol.hxx>
#include <BRepAlgoAPI_Fuse.hxx>
-#include <BRepAlgo_Fuse.hxx>
#include <GProp_GProps.hxx>
#include <BRepGProp.hxx>
#include <Geom_TrimmedCurve.hxx>
#include <Geom_BSplineSurface.hxx>
+#include <ShapeUpgrade_UnifySameDomain.hxx>
+
static Standard_Integer OCC426 (Draw_Interpretor& di, Standard_Integer argc, const char ** argv)
{
- if(argc < 7 || argc > 8) {
- di << "Usage : " << argv[0] << " shape1 shape2 shape3 shape4 shape5 shape6 [BRepAlgoAPI/BRepAlgo = 1/0]\n";
+ if(argc != 8) {
+ di << "Usage : " << argv[0] << " shape1 shape2 shape3 shape4 shape5 shape6 shape7\n";
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;
W1.Add(gp_Pnt(10, 0, 0));
Standard_Real angle3 = 360 * (M_PI / 180.0);
TopoDS_Shape rs3 = BRepPrimAPI_MakeRevol(F3, A3, angle3);
- TopoDS_Shape fuse32, fuse321;
- if (IsBRepAlgoAPI) {
- di << "fuse32 = BRepAlgoAPI_Fuse(rs3, rs2)\n";
- di << "fuse321 = BRepAlgoAPI_Fuse(fuse32, rs1)\n";
- 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);
- }
+ di << "fuse32 = BRepAlgoAPI_Fuse(rs3, rs2)\n";
+ di << "fuse321 = BRepAlgoAPI_Fuse(fuse32, rs1)\n";
+ TopoDS_Shape fuse32 = BRepAlgoAPI_Fuse(rs3, rs2).Shape();
+ TopoDS_Shape fuse321 = BRepAlgoAPI_Fuse(fuse32, rs1).Shape();
+
+ // 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 "fuse321"
+ //Give the mass claculation of the shpae "aFuseUnif"
GProp_GProps G;
- BRepGProp::VolumeProperties(fuse321, G);
+ BRepGProp::VolumeProperties(aFuseUnif, G);
di<<" \n";
di<<"Mass: "<<G.Mass()<<"\n\n";
di << "Trianglating Faces .....\n";
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());
TopologicalFace.Orientation (TopAbs_FORWARD) ;
di<<"Triangulation of all Faces Completed. \n\n";
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";
ChFi3d_FilletShape FShape = ChFi3d_Rational;
- BRepFilletAPI_MakeFillet blend(fuse321,FShape);
+ BRepFilletAPI_MakeFillet blend(aFuseUnif,FShape);
di << "Adding Edges ..... \n";
for(int i = 1; i <= edgemap.Extent(); i++)
{
DBRep::Set ( argv[4], rs3 );
DBRep::Set ( argv[5], fuse32 );
DBRep::Set ( argv[6], fuse321 );
+ DBRep::Set ( argv[7], aFuseUnif );
return 0;
}
#include <BRepPrimAPI_MakeCylinder.hxx>
#include <BRepPrimAPI_MakeCone.hxx>
#include <BRepAlgoAPI_Cut.hxx>
-#include <BRepAlgo_Cut.hxx>
//=======================================================================
//function : OCC822_1
//purpose :
//=======================================================================
static Standard_Integer OCC822_1 (Draw_Interpretor& di, Standard_Integer argc, const char ** argv) {
- if(argc < 4 || argc > 5) {
- di << "Usage : " << argv[0] << " name1 name2 result [BRepAlgoAPI/BRepAlgo = 1/0]\n";
+ if(argc != 4) {
+ di << "Usage : " << argv[0] << " name1 name2 result\n";
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;
di << "All primitives created..... Creating Boolean\n";
- TopoDS_Shape theIn, theOut, theRes;
try
- {
+ {
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);
- if (index < argc) DBRep::Set(argv[index++], theOut);
- if (index < argc) DBRep::Set(argv[index++], theRes);
- di << "Booleans Created ! Triangulating !\n";
+ di << "theIn = BRepAlgoAPI_Fuse(cylIn, conIn)\n";
+ di << "theOut = BRepAlgoAPI_Fuse(cylOut, conOut)\n";
+ di << "theRes = BRepAlgoAPI_Cut(theOut, theIn)\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 )
- {
- di<<"*********************************************************\n";
- di<<"***** ******\n";
- di<<"***** Standard_Failure : Exception in Shoe Function *****\n";
- di<<"***** ******\n";
- di<<"*********************************************************\n";
- return 1;
- }
+ {
+ di << "*********************************************************\n";
+ di << "***** ******\n";
+ di << "***** Standard_Failure : Exception in Shoe Function *****\n";
+ di << "***** ******\n";
+ di << "*********************************************************\n";
+ return 1;
+ }
return 0;
}
#include <BRepPrimAPI_MakeBox.hxx>
#include <BRepPrimAPI_MakeSphere.hxx>
+
//=======================================================================
// OCC822_2
//=======================================================================
static Standard_Integer OCC822_2 (Draw_Interpretor& di,Standard_Integer argc, const char ** argv)
{
- if(argc < 4 || argc > 5) {
- di << "Usage : " << argv[0] << " name1 name2 result [BRepAlgoAPI/BRepAlgo = 1/0]\n";
+ if(argc != 4) {
+ di << "Usage : " << argv[0] << " name1 name2 result\n";
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;
di << "All primitives created..... Creating Cut Objects\n";
- TopoDS_Shape fuse;
try
- {
+ {
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 )
- {
- di<<"*********************************************************\n";
- di<<"***** ******\n";
- di<<"***** Standard_Failure : Exception in HSP Function ******\n";
- di<<"***** ******\n";
- di<<"*********************************************************\n";
- return 1;
- }
+ {
+ di << "*********************************************************\n";
+ di << "***** ******\n";
+ di << "***** Standard_Failure : Exception in HSP Function ******\n";
+ di << "***** ******\n";
+ di << "*********************************************************\n";
+ return 1;
+ }
return 0;
}
static Standard_Integer OCC823 (Draw_Interpretor& di,Standard_Integer argc, const char ** argv)
{
- if(argc < 4 || argc > 5) {
- di << "Usage : " << argv[0] << " name1 name2 result [BRepAlgoAPI/BRepAlgo = 1/0]\n";
+ if(argc != 4) {
+ di << "Usage : " << argv[0] << " name1 name2 result\n";
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;
Standard_Real size = 0.001;
di << "All primitives created..... Creating Boolean\n";
- TopoDS_Shape fuse;
try
- {
+ {
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);
- }
- catch ( Standard_Failure )
- {
- di<<"*********************************************************\n";
- di<<"***** ******\n";
- di<<"***** Standard_Failure : Exception in TEE Function ******\n";
- di<<"***** ******\n";
- di<<"*********************************************************\n";
- return 1;
- }
+ di << "fuse = BRepAlgoAPI_Fuse(cyl2, cyl1)\n";
+ TopoDS_Shape fuse = BRepAlgoAPI_Fuse(cyl2, cyl1).Shape();
+
+ if (index < argc) DBRep::Set(argv[index++], fuse);
+ di << "Fuse Created ! Triangulating !\n";
+
+ performTriangulation(fuse, di);
+ }
+ catch (Standard_Failure)
+ {
+ di << "*********************************************************\n";
+ di << "***** ******\n";
+ di << "***** Standard_Failure : Exception in TEE Function ******\n";
+ di << "***** ******\n";
+ di << "*********************************************************\n";
+ return 1;
+ }
return 0;
}
static Standard_Integer OCC824 (Draw_Interpretor& di,Standard_Integer argc, const char ** argv)
{
- if(argc < 4 || argc > 5) {
- di << "Usage : " << argv[0] << " name1 name2 result [BRepAlgoAPI/BRepAlgo = 1/0]\n";
+ if(argc != 4) {
+ di << "Usage : " << argv[0] << " name1 name2 result\n";
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;
gp_Pnt P1(100, 0, 0);
di << "All primitives created..... Creating Boolean\n";
- TopoDS_Shape fuse;
try
- {
+ {
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);
- }
- catch ( Standard_Failure )
- {
- di<<"*********************************************************\n";
- di<<"***** ******\n";
- di<<"***** Standard_Failure : Exception in YOU Function ******\n";
- di<<"***** ******\n";
- di<<"*********************************************************\n";
- return 1;
- }
+ di << "fuse = BRepAlgoAPI_Fuse(cyl, sph)\n";
+ TopoDS_Shape fuse = BRepAlgoAPI_Fuse(cyl, sph).Shape();
+
+ di << "Fuse Created ! Triangulating !\n";
+ if (index < argc) DBRep::Set(argv[index++], fuse);
+
+ performTriangulation(fuse, di);
+ }
+ catch (Standard_Failure)
+ {
+ di << "*********************************************************\n";
+ di << "***** ******\n";
+ di << "***** Standard_Failure : Exception in YOU Function ******\n";
+ di << "***** ******\n";
+ di << "*********************************************************\n";
+ return 1;
+ }
return 0;
}
static Standard_Integer OCC825 (Draw_Interpretor& di,Standard_Integer argc, const char ** argv)
{
- if(argc < 6 || argc > 7) {
- di << "Usage : " << argv[0] << " name1 name2 name3 result1 result2 [BRepAlgoAPI/BRepAlgo = 1/0]\n";
+ if(argc != 6) {
+ di << "Usage : " << argv[0] << " name1 name2 name3 result1 result2\n";
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;
Standard_Real size = 50;
di << "All primitives created..... Creating Cut Objects\n";
- TopoDS_Shape cut1, cut2;
try
- {
+ {
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 << "cut2 = BRepAlgoAPI_Cut(sph2, hsp)\n";
- 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;
- 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 << "cut1 = BRepAlgoAPI_Cut(sph1, hsp)\n";
+ TopoDS_Shape cut1 = BRepAlgoAPI_Cut(sph1, hsp).Shape();
- di << "Trianglating Faces of CUT 1 .....\n";
- performTriangulation(cut1, di);
+ if (index < argc) DBRep::Set(argv[index++], cut1);
+ di << "CUT 1 Created ! " ;
- 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";
+ di << "cut2 = BRepAlgoAPI_Cut(sph2, hsp)\n";
+ TopoDS_Shape cut2 = BRepAlgoAPI_Cut(sph2, hsp).Shape();
+
+ if (index < argc) DBRep::Set(argv[index++], cut2);
+ di << "CUT 2 Created !\n\n";
+
+ GProp_GProps G;
+ 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;
}
static Standard_Integer OCC826 (Draw_Interpretor& di,Standard_Integer argc, const char ** argv)
{
- if(argc < 4 || argc > 5) {
- di << "Usage : " << argv[0] << " name1 name2 result [BRepAlgoAPI/BRepAlgo = 1/0]\n";
+ if(argc != 4) {
+ di << "Usage : " << argv[0] << " name1 name2 result\n";
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;
Standard_Real x1 = 181.82808;
di << "All primitives created..... Creating Boolean\n";
- TopoDS_Shape fuse;
try
- {
+ {
OCC_CATCH_SIGNALS
- if (IsBRepAlgoAPI) {
- di << "fuse = BRepAlgoAPI_Fuse(rev, sph)\n";
- fuse = BRepAlgoAPI_Fuse(rev, sph);
- } else {
- di << "fuse = BRepAlgo_Fuse(rev, sph)\n";
- fuse = BRepAlgo_Fuse(rev, sph);
- }
- if (index < argc) DBRep::Set(argv[index++], fuse);
- di << "Fuse Created ! Triangulating !\n";
- performTriangulation(fuse, di);
- }
- catch ( Standard_Failure )
- {
- di<<"*********************************************************\n";
- di<<"***** ******\n";
- di<<"***** Standard_Failure : Exception in SPH Function ******\n";
- di<<"***** ******\n";
- di<<"*********************************************************\n";
- return 1;
- }
+
+ di << "fuse = BRepAlgoAPI_Fuse(rev, sph)\n";
+ TopoDS_Shape fuse = BRepAlgoAPI_Fuse(rev, sph).Shape();
+
+ if (index < argc) DBRep::Set(argv[index++], fuse);
+ di << "Fuse Created ! Triangulating !\n";
+ performTriangulation(fuse, di);
+ }
+ catch (Standard_Failure)
+ {
+ di << "*********************************************************\n";
+ di << "***** ******\n";
+ di << "***** Standard_Failure : Exception in SPH Function ******\n";
+ di << "***** ******\n";
+ di << "*********************************************************\n";
+ return 1;
+ }
return 0;
}
static Standard_Integer OCC827 (Draw_Interpretor& di,Standard_Integer argc, const char ** argv)
{
- if(argc < 6 || argc > 7) {
- di << "Usage : " << argv[0] << " name1 name2 name3 result1 result2 [BRepAlgoAPI/BRepAlgo = 1/0]\n";
+ if(argc != 6) {
+ di << "Usage : " << argv[0] << " name1 name2 name3 result1 result2\n";
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;
BRepBuilderAPI_MakePolygon W1;
di << "All primitives created..... Creating Boolean\n";
- TopoDS_Shape fuse1, fuse2;
try
- {
+ {
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);
- }
- catch ( Standard_Failure )
- {
- di<<"*********************************************************\n";
- di<<"***** ******\n";
- di<<"***** Standard_Failure : Exception in REV Function ******\n";
- di<<"***** ******\n";
- di<<"*********************************************************\n";
- return 1;
- }
+ di << "Fuse1 = BRepAlgoAPI_Fuse(tor1, rev)\n";
+ TopoDS_Shape fuse1 = BRepAlgoAPI_Fuse(tor1, rev).Shape();
+
+ if (index < argc) DBRep::Set(argv[index++], fuse1);
+ di << "Fuse1 Created ! Creating Fuse 2\n";
+
+ di << "Fuse2 = BRepAlgoAPI_Fuse(tor2, fuse1)\n";
+ TopoDS_Shape fuse2 = BRepAlgoAPI_Fuse(tor2, fuse1).Shape();
+
+ 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;
}
void QABugs::Commands_10(Draw_Interpretor& theCommands) {
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("OCC486", "Use : OCC486 surf x y z du dv ", __FILE__, OCC486, 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_2", "OCC822_2 name1 name2 result [BRepAlgoAPI/BRepAlgo = 1/0]", __FILE__,OCC822_2, group);
- theCommands.Add("OCC823", "OCC823 name1 name2 result [BRepAlgoAPI/BRepAlgo = 1/0]", __FILE__,OCC823, group);
- theCommands.Add("OCC824", "OCC824 name1 name2 result [BRepAlgoAPI/BRepAlgo = 1/0]", __FILE__,OCC824, group);
- theCommands.Add("OCC825", "OCC825 name1 name2 name3 name4 name5 [BRepAlgoAPI/BRepAlgo = 1/0]", __FILE__,OCC825, group);
- theCommands.Add("OCC826", "OCC826 name1 name2 result [BRepAlgoAPI/BRepAlgo = 1/0]", __FILE__,OCC826, group);
- theCommands.Add("OCC827", "OCC827 name1 name2 name3 result1 result2 [BRepAlgoAPI/BRepAlgo = 1/0]", __FILE__,OCC827, group);
+ theCommands.Add("OCC822_1", "OCC822_1 name1 name2 result", __FILE__,OCC822_1, group);
+ theCommands.Add("OCC822_2", "OCC822_2 name1 name2 result", __FILE__,OCC822_2, group);
+ theCommands.Add("OCC823", "OCC823 name1 name2 result", __FILE__,OCC823, group);
+ theCommands.Add("OCC824", "OCC824 name1 name2 result", __FILE__,OCC824, group);
+ theCommands.Add("OCC825", "OCC825 name1 name2 name3 name4 name5", __FILE__,OCC825, group);
+ theCommands.Add("OCC826", "OCC826 name1 name2 result", __FILE__,OCC826, group);
+ theCommands.Add("OCC827", "OCC827 name1 name2 name3 result1 result2", __FILE__,OCC827, group);
theCommands.Add("OCC828", "OCC828 redius shape result ", __FILE__,OCC828, group);
return;
}
#include<BRepAlgoAPI_Cut.hxx>
-#include<BRepAlgo_Cut.hxx>
#include<BRepPrimAPI_MakeHalfSpace.hxx>
#include<Geom_CartesianPoint.hxx>
static Standard_Integer OCC297 (Draw_Interpretor& di,Standard_Integer /*argc*/, const char ** argv )
{
-
Handle(AIS_InteractiveContext) myAISContext = ViewerTest::GetAISContext();
- if(myAISContext.IsNull()) {
+ if (myAISContext.IsNull()) {
di << "use 'vinit' command before " << argv[0] << "\n";
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();
+
+ int up = 1;
+
+ gp_Pnt g_pnt;
+ if (up)
+ g_pnt = gp_Pnt(0, 0, -100);
+ else
+ g_pnt = gp_Pnt(0, 0, 100);
+ 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 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();
-
- int up = 1;
-
- gp_Pnt g_pnt;
- if(up)
- g_pnt = gp_Pnt(0,0,-100);
- else
- g_pnt = gp_Pnt(0,0,100);
-
- 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);
-
- BRepPrimAPI_MakeHalfSpace half_(sh_, g_pnt);
- 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_);
-
- gp_Ax1 ax1_(gp_Pnt(0., 0., -100.), gp_Dir(0., 0., 1.));
+ BRepPrimAPI_MakeHalfSpace half_(sh_, g_pnt);
+ TopoDS_Solid sol1_ = half_.Solid();
- Standard_Real x=0., y=0., z=-80.;
+ DBRep::Set("Face", sol1_);
- 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);
+ gp_Ax1 ax1_(gp_Pnt(0., 0., -100.), gp_Dir(0., 0., 1.));
- DBRep::Set("Box",box.Shape());
+ Standard_Real x = 0., y = 0., z = -80.;
-// 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);
+ BRepPrimAPI_MakeBox box(gp_Pnt(x, y, z), gp_Pnt(x + 150, y + 200, z + 200));
-// DBRep::Set("Cut",sh1_);
+ DBRep::Set("Box", box.Shape());
return 0;
}
+
#include<GProp_GProps.hxx>
#include<BRepGProp.hxx>
#include <BRepAlgoAPI_Fuse.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)
{
- //if (nb != 1) {
- // cout << "Usage: " << a[0] << endl;
- // return 1;
- //}
- if(nb < 1 || nb > 2) {
- di << "Usage : " << a[0] << " [BRepAlgoAPI/BRepAlgo = 1/0]\n";
+ if(nb != 1) {
+ di << "Usage : " << a[0] << "\n";
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 box2( gp_Pnt( 50, 50,50 ), 200, 200, 200 );
TopoDS_Shape shape1 = box1.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;
- if (IsBRepAlgoAPI) {
- di << "fuse = BRepAlgoAPI_Fuse( shape1, shape2 )\n";
- di << "comm = BRepAlgoAPI_Common( shape1, shape2 )\n";
- fuse = BRepAlgoAPI_Fuse( shape1, shape2 );
- 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 );
- }
+ di << "fuse = BRepAlgoAPI_Fuse( shape1, shape2 )\n";
+ di << "comm = BRepAlgoAPI_Common( shape1, shape2 )\n";
+ fuse = BRepAlgoAPI_Fuse(shape1, shape2).Shape();
+ comm = BRepAlgoAPI_Common(shape1, shape2).Shape();
return 0;
}
#include <gce_MakeTranslation.hxx>
#include <BRepBuilderAPI_Transform.hxx>
#include <BRepPrimAPI_MakeWedge.hxx>
-#include <BRepAlgoAPI_Fuse.hxx>
-#include <BRepAlgoAPI_Cut.hxx>
-#include <BRepAlgo_Fuse.hxx>
-#include <BRepAlgo_Cut.hxx>
//=======================================================================
//function : OCC578
//purpose :
//=======================================================================
static Standard_Integer OCC578 (Draw_Interpretor& di, Standard_Integer argc, const char ** argv)
{
- //if (argc!=4) {
- // 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";
+ if(argc != 4) {
+ di << "Usage : " << argv[0] << " shape1 shape2 shape3\n";
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);
double xperiod = 1.0;
// combine wedges
-//#if ! defined(BRepAlgoAPI_def01)
-// TopoDS_Shape wedge_common = BRepAlgoAPI_Fuse(wedge1a , wedge2a);
-//#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 << "wedge_common = BRepAlgoAPI_Fuse(wedge1a , wedge2a)\n";
+ TopoDS_Shape wedge_common = BRepAlgoAPI_Fuse(wedge1a , wedge2a).Shape();
+ di << "sub_etch1 = BRepAlgoAPI_Cut(substrate, wedge_common)\n";
+ TopoDS_Shape sub_etch1 = BRepAlgoAPI_Cut(substrate, wedge_common).Shape();
+
if (sub_etch1.IsNull()) {
di<<" Null shape3 is not allowed\n";
return 1;
return 1;
}
-#include<BRepAlgoAPI_Cut.hxx>
-#include<BRepAlgo_Cut.hxx>
//=======================================================================
//function : OCC1487
//purpose :
//=======================================================================
static Standard_Integer OCC1487 (Draw_Interpretor& di, Standard_Integer argc, const char ** argv)
{
- //if(argc != 5) {
- // cerr << "Usage : " << argv[0] << " CylinderVariant(=1/2) cylinder1 cylinder2 cutshape" << endl;
- // return -1;
- //}
- if(argc < 5 || argc > 6) {
- di << "Usage : " << argv[0] << " CylinderVariant(=1/2) cylinder1 cylinder2 cutshape [BRepAlgoAPI/BRepAlgo = 1/0]\n";
+ if(argc != 5) {
+ di << "Usage : " << argv[0] << " CylinderVariant(=1/2) cylinder1 cylinder2 cutshape\n";
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]);
BRepPrimAPI_MakeCylinder o_mc2 (myAx2_mc2, 5, 150);
cyl2 = o_mc2.Shape();
-//#if ! defined(BRepAlgoAPI_def01)
-// o_cut_shape = BRepAlgoAPI_Cut (o_mc1.Solid (), o_mc2.Solid ());
-//#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 ());
- }
+ di << "o_cut_shape = BRepAlgoAPI_Cut (o_mc1.Solid (), o_mc2.Solid ())\n";
+ o_cut_shape = BRepAlgoAPI_Cut (o_mc1.Solid (), o_mc2.Solid ()).Shape();
} 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);
gp_Dir myDir_mc2(sin(M_PI/3), 0.0, 0.5);
BRepPrimAPI_MakeCylinder o_mc2 (myAx2_mc2, 5, 150);
cyl2 = o_mc2.Shape();
-//#if ! defined(BRepAlgoAPI_def01)
-// o_cut_shape = BRepAlgoAPI_Cut (o_mc1.Solid (), o_mc2.Solid ());
-//#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 ());
- }
+ di << "o_cut_shape = BRepAlgoAPI_Cut (o_mc1.Solid (), o_mc2.Solid ())\n";
+ o_cut_shape = BRepAlgoAPI_Cut (o_mc1.Solid (), o_mc2.Solid ()).Shape();
}
DBRep::Set(argv[2],cyl1);
theCommands.Add("OCC310","OCC310", __FILE__, OCC310bug, 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("OCC524", "OCC524 LowerVector UpperVector InitialValueVector LowerRowMatrix UpperRowMatrix LowerColMatrix UpperColMatrix InitialValueMatrix", __FILE__, OCC524, 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 [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("OCC738_ShapeRef", "OCC738_ShapeRef", __FILE__, OCC738_ShapeRef, group);
theCommands.Add("OCC738_Assembly", "OCC738_Assembly", __FILE__, OCC738_Assembly, 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 [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("OCC5739", "OCC5739 name shape step", __FILE__, OCC5739_UniAbs, group);
#include <TopExp.hxx>
#include <BRepOffsetAPI_Sewing.hxx>
#include <BRepAlgoAPI_Fuse.hxx>
-///////#else
-///////#include <BRepAlgo_Fuse.hxx>
-///////#include <BRepAlgoAPI_Fuse.hxx>
-#include <BRepAlgo_Fuse.hxx>
//=======================================================================
//function : OCC544
//=======================================================================
static Standard_Integer OCC544 (Draw_Interpretor& di, Standard_Integer argc, const char** argv)
{
- if(argc > 7) {
- di << "Usage : " << argv[0] << " [[[[[wT [[[[d1 [[[d2 [[R [length [BRepAlgoAPI/BRepAlgo = 1/0]]]]]]\n";
+ if(argc > 6) {
+ di << "Usage : " << argv[0] << " [[[[[wT [[[[d1 [[[d2 [[R [length]]]]]\n";
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
char name[255];
wallSolid = TopoDS::Solid(getSol.Current());
TopoDS_Solid test_solid;
while (getSol.More())
- {
- di << "Next solid found in compound\n";
- getSol.Next();
- test_solid = TopoDS::Solid(getSol.Current());
-//////#if ! defined(BRepAlgoAPI_def01)
-////// BRepAlgoAPI_Fuse fuser(test_solid, wallSolid);
-//////#else
-////// BRepAlgo_Fuse fuser(test_solid, wallSolid);
-//////#endif
-////// fuser.Build();
- 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());
- }
+ {
+ di << "Next solid found in compound\n";
+ getSol.Next();
+ test_solid = TopoDS::Solid(getSol.Current());
+
+ di << "BRepAlgoAPI_Fuse fuser(test_solid, wallSolid)\n";
+ BRepAlgoAPI_Fuse fuser(test_solid, wallSolid);
+ TopExp_Explorer aExpS(fuser.Shape(), TopAbs_SOLID);
+ if (aExpS.More()) {
+ wallSolid = TopoDS::Solid(aExpS.Current());
+ }
+ }
} else {
// Let's see if we can extract shells instead of solids.
TopExp_Explorer getShel;
#include <BRepBuilderAPI_Copy.hxx>
#include <BRepAlgoAPI_Cut.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>
static Standard_Integer OCC817 (Draw_Interpretor& di, Standard_Integer argc, const char** argv)
{
- //////////if(argc != 3) {
- ////////// cout << "Usage : " << argv[0] << " result mesh_delta" << endl;
- ////////// return 1;
- //////////}
- if(argc < 3 || argc > 4) {
- di << "Usage : " << argv[0] << " result mesh_delta [BRepAlgoAPI/BRepAlgo = 1/0]\n";
+ if(argc != 3) {
+ di << "Usage : " << argv[0] << " result mesh_delta\n";
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 mesh_delt = Draw::Atof(argv[2]);
if (mesh_delt <= 0.0)
TopoDS_Solid internalSolid = BRepPrimAPI_MakeBox(P, 10.0, 10.0, 10.0).Solid();
// Cut inner from outer
-//////////#if ! defined(BRepAlgoAPI_def01)
-////////// BRepAlgoAPI_Cut cut( fullSolid, internalSolid );
-//////////#else
-////////// BRepAlgo_Cut cut( fullSolid, internalSolid );
-//////////#endif
-////////// TopoDS_Shape cut_shape = cut.Shape();
-////////// 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;
- }
+ di << "BRepAlgoAPI_Cut cut( fullSolid, internalSolid )\n";
+ BRepAlgoAPI_Cut cut(fullSolid, internalSolid);
+ 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
Standard_Integer found_solid = 0;
TopoDS_Shape copySolid = BRepBuilderAPI_Copy(cutSolid).Shape();
// perform common
-//////////#if ! defined(BRepAlgoAPI_def01)
-////////// BRepAlgoAPI_Common common(copySolid/*cutSolid*/, SubvolumeSolid(l));
-//////////#else
-////////// BRepAlgo_Common common(copySolid/*cutSolid*/, SubvolumeSolid(l));
-//////////#endif
-////////// if (!common.IsDone())
-////////// {
-////////// 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();
+ 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;
}
+ const TopoDS_Shape& aCommonShape = common.Shape();
// see if we have a solid
found_solid = 0;
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 [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 [BRepAlgoAPI/BRepAlgo = 1/0]", __FILE__, OCC817, group);
+ theCommands.Add("OCC817", "OCC817 result mesh_delta ", __FILE__, OCC817, group);
return;
}
#include <BRepPrimAPI_MakeCylinder.hxx>
#include <BRepPrimAPI_MakeSphere.hxx>
#include <BRepAlgoAPI_Section.hxx>
-#include <BRepAlgo_Section.hxx>
//=======================================================================
//function : OCCN2
//purpose : BOOLEAN OPERATION
static Standard_Integer OCCN2 (Draw_Interpretor& di, Standard_Integer argc, const char ** argv)
{
if (argc > 2) {
- di << "Usage : " << argv[0] << " [BRepAlgoAPI/BRepAlgo = 1/0]\n";
+ di << "Usage : " << argv[0] << "\n";
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();
if(aContext.IsNull())
BRepPrimAPI_MakeSphere sphere(gp_Pnt(60,0,100),50);
TopoDS_Shape sphere_sh = sphere.Shape();
- //BRepAlgoAPI_Section section(cylinder_sh, sphere_sh);
- //TopoDS_Shape shape = section.Shape();
-
- TopoDS_Shape shape;
- 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();
+ di << "BRepAlgoAPI_Section section(cylinder_sh, sphere_sh)\n";
+ BRepAlgoAPI_Section section(cylinder_sh, sphere_sh);
+ if (!section.IsDone()){
+ di << "Error performing intersection: not done.\n";
}
+ const TopoDS_Shape& shape = section.Shape();
DBRep::Set("OCCN2_cylinder",cylinder_sh);
DBRep::Set("OCCN2_sphere",sphere_sh);
#include <AIS_InteractiveContext.hxx>
#include <AIS_LocalContext.hxx>
#include <AIS_TexturedShape.hxx>
-#include <BRepAlgo_Cut.hxx>
+#include <BRepAlgoAPI_Cut.hxx>
#include <BRepOffsetAPI_MakePipe.hxx>
#include <BRepPrimAPI_MakeBox.hxx>
#include <BRepPrimAPI_MakeSphere.hxx>
// do some operation that will take considerable time compared with time of starting / stopping timers
BRepPrimAPI_MakeBox aBox (10., 10., 10.);
BRepPrimAPI_MakeSphere aSphere (10.);
- BRepAlgo_Cut aCutter (aBox.Shape(), aSphere.Shape());
+ BRepAlgoAPI_Cut aCutter (aBox.Shape(), aSphere.Shape());
aTM.Stop();
aPM.Stop();
#include <gp_Pln.hxx>
#include <BRep_Tool.hxx>
#include <BRepAlgoAPI_Section.hxx>
-#include <BRepAlgo_Section.hxx>
#include <BRepMesh_IncrementalMesh.hxx>
#include <Precision.hxx>
#include <Standard_ErrorHandler.hxx>
{
OCC_CATCH_SIGNALS
// 1. Verify amount of arguments of the command
- //if (argc < 2) { di << "OCC527 FAULTY. Use : OCC527 shape "; return 0;}
- if (argc < 2 || argc > 3) {
- di << "Usage : " << argv[0] << " shape [BRepAlgoAPI/BRepAlgo = 1/0]\n";
+ if (argc != 2) {
+ di << "Usage : " << argv[0] << "OCC527 shape\n";
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
TopoDS_Shape aShape = DBRep::Get(argv[1]);
if(aShape.IsNull()) { di << "OCC527 FAULTY. Entry shape is NULL"; return 0;}
// Build current section
gp_Pln pl(0,0,1,-zcur);
-//#if ! defined(BRepAlgoAPI_def01)
-// BRepAlgoAPI_Section aSection(aFace,pl,Standard_False);
-//#else
-// BRepAlgo_Section aSection(aFace,pl,Standard_False);
-//#endif
-// aSection.Approximation(Standard_True);
-// aSection.Build();
-// // 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();
- }
+
+ //
+ di << "BRepAlgoAPI_Section aSection(aFace,pl,Standard_False)\n";
+ BRepAlgoAPI_Section aSection(aFace, pl, Standard_False);
+ aSection.Approximation(Standard_True);
+ aSection.Build();
+ Standard_Boolean IsDone = aSection.IsDone();
if (IsDone)
- {
-// TopoDS_Shape aResult = aSection.Shape();
- if (!aResult.IsNull())
- {
+ {
+ const TopoDS_Shape& aResult = aSection.Shape();
+ if (!aResult.IsNull())
+ {
double lmaxdist = 0.0;
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());
Standard_Real toler = BRep_Tool::Tolerance(aV);
double dist = pl.Distance(BRep_Tool::Pnt(aV));
if (dist > lmaxdist) lmaxdist = dist;
- // If section was built check distance beetwen vertexes and plane of the one
- str[0] =0;
-// if (wasBuilt)
-// {
-// if(gmaxdist > Precision::Confusion())
-// Sprintf(str,"Dist=%f, Param=%f FAULTY\n",gmaxdist,gzmax);
-// else
-// 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 section was built check distance beetwen vertexes and plane of the one
+ str[0] = 0;
+ 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);
+ di << str;
}
if (lmaxdist > gmaxdist)
{
void QABugs::Commands_2(Draw_Interpretor& theCommands) {
const char *group = "QABugs";
- //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("OCC527", "OCC527 shape", __FILE__, OCC527, group);
+ theCommands.Add("OCC1048", "OCC1048 shape", __FILE__, OCC1048, group);
return;
}
#include <BRepPrimAPI_MakeSphere.hxx>
#include <BRepAlgoAPI_Fuse.hxx>
-#include <BRepAlgo_Fuse.hxx>
#include <V3d_View.hxx>
#include <gce_MakePln.hxx>
static int OCC10006(Draw_Interpretor& di, Standard_Integer argc, const char ** argv)
{
- if(argc > 2) {
- di << "Usage : " << argv[0] << " [BRepAlgoAPI/BRepAlgo = 1/0]\n";
+ if(argc != 1) {
+ di << "Usage : " << argv[0] << "\n";
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 toppoints1[12] = { 0, 0, 10, 100, 0, 10, 100, -100, 10, 0, -100, 10};
DBRep::Set("TS1",loft1.Shape());
DBRep::Set("TS2",loft2.Shape());
-//#if ! defined(BRepAlgoAPI_def01)
-// BRepAlgoAPI_Fuse result(loft1.Shape(), loft2.Shape());
-//#else
-// 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());
- }
+ di << "BRepAlgoAPI_Fuse result(loft1.Shape(), loft2.Shape())\n";
+ BRepAlgoAPI_Fuse result(loft1.Shape(), loft2.Shape());
+ DBRep::Set("F", result.Shape());
-// DBRep::Set("F",result.Shape());
return 0;
}
static int TestCMD(Draw_Interpretor& di, Standard_Integer argc, const char ** argv)
{
- if(argc > 2) {
- di << "Usage : " << argv[0] << " [BRepAlgoAPI/BRepAlgo = 1/0]\n";
+ if(argc != 1) {
+ di << "Usage : " << argv[0] << "\n";
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
TopoDS_Shape SCon = cone.Shape();
DBRep::Set("con", SCon);
-//#if ! defined(BRepAlgoAPI_def01)
-// BRepAlgoAPI_Fuse SFuse(SCyl, SCon);
-//#else
-// BRepAlgo_Fuse SFuse(SCyl, SCon);
-//#endif
-//
-// if(! SFuse.IsDone() )
-// cout<<"Error: Boolean fuse operation failed !"<<endl;
-//
-// 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();
+ di << "BRepAlgoAPI_Fuse SFuse(SCyl, SCon)\n";
+ BRepAlgoAPI_Fuse SFuse(SCyl, SCon);
+ if (!SFuse.IsDone()) {
+ di << "Error: Boolean fuse operation failed !\n";
+ }
+ else {
+ const TopoDS_Shape& fuse = SFuse.Shape();
+ DBRep::Set("fus", fuse);
}
-
- DBRep::Set("fus", fuse);
-
return 0;
}
static Standard_Integer BUC60841(Draw_Interpretor& di, Standard_Integer argc, const char ** argv )
{
- if(argc > 2) {
- di << "Usage : " << argv[0] << " [BRepAlgoAPI/BRepAlgo = 1/0]\n";
+ if(argc != 1) {
+ di << "Usage : " << argv[0] << "\n";
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));
BRepPrimAPI_MakeCylinder cyl(Ax2, 260, 150);
TopoDS_Shape sh2 = trans1.Shape();
DBRep::Set("sh2",sh2);
-//#if ! defined(BRepAlgoAPI_def01)
-// BRepAlgoAPI_Fuse fuse1(sh1, sh2);
-//#else
-// 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();
- }
-
+ di << "BRepAlgoAPI_Fuse fuse1(sh1, sh2)\n";
+ BRepAlgoAPI_Fuse fuse1(sh1, sh2);
+ TopoDS_Shape fsh1 = fuse1.Shape();
DBRep::Set("fsh1",fsh1);
+
BRepBuilderAPI_Transform trans2(fsh1, trsf2);
TopoDS_Shape sh3 = trans2.Shape();
DBRep::Set("sh3",sh3);
-//#if ! defined(BRepAlgoAPI_def01)
-// BRepAlgoAPI_Fuse fuse2(fsh1,sh3);
-//#else
-// 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();
- }
-
+ di << "BRepAlgoAPI_Fuse fuse2(fsh1,sh3)\n";
+ BRepAlgoAPI_Fuse fuse2(fsh1, sh3);
+ const TopoDS_Shape& fsh2 = fuse2.Shape();
DBRep::Set("fsh2",fsh2);
+
Handle(AIS_Shape) aisp1 = new AIS_Shape(fsh2);
-// aContext->Display(aisp1);
return 0;
}
static Standard_Integer BUC60951_(Draw_Interpretor& di, Standard_Integer argc, const char ** a)
{
- //if(argc!=2)
- // {
- // cerr << "Usage : " << a[0] << " file.igs" << endl;
- // return -1;
- // }
- if(argc < 2 || argc > 3) {
- di << "Usage : " << a[0] << " [BRepAlgoAPI/BRepAlgo = 1/0]\n";
+ if (argc != 2) {
+ di << "Usage : " << a[0] << " file.igs\n";
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();
if(myContext.IsNull()) {
BRepPrimAPI_MakeCylinder cyl(anAx2, 50, 300);
TopoDS_Shape sh = cyl.Shape();
-//#if ! defined(BRepAlgoAPI_def01)
-// BRepAlgoAPI_Fuse fuse(sol, sh);
-//#else
-// 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();
- }
+ di << "BRepAlgoAPI_Fuse fuse(sol, sh)\n";
+ BRepAlgoAPI_Fuse fuse(sol, sh);
+ sh = fuse.Shape();
Handle(AIS_Shape) res = new AIS_Shape(sh);
myContext->Display (res, Standard_True);
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("BUC60876","BUC60876 shape",__FILE__,BUC60876_,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("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("AISWidth","AISWidth (DOC,entry,[width])",__FILE__,AISWidth,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 );
}
-if { ![checkplatform -windows] } {
- puts "TODO ?OCC12345 MacOS: \\*\\* Exception"
- puts "TODO ?OCC12345 MacOS: An exception was caught"
- puts "TODO ?OCC12345 MacOS: TEST INCOMPLETE"
-}
+puts "TODO OCC24156 MacOS: \\*\\* Exception \\*\\*.*"
+puts "TODO OCC24156 MacOS: An exception was caught"
+puts "TODO OCC24156 MacOS: TEST INCOMPLETE"
pload QAcommands
#############################################################################
## 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 rs2
checkprops result -s 7507.61
checkshape result
checkview -display result -2d -path ${imagedir}/${test_image}.png
-
+++ /dev/null
-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
#####################################
## 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"
} else {
if { [regexp {FAILED} $info_result] } {
## (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"
} else {
if { [regexp {FAILED} $info_result] } {
###############################
## BRepAlgoAPI_Fuse fails on two cylinders
###############################
-## (old topology)
-#####################################
if { [ catch { set info_result [OCC823 a1 a2 result] } ] } {
puts "Faulty OCC823"
+++ /dev/null
-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
-
####################################
## 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"
} else {
if { [regexp {FAILED} $info_result] } {
+++ /dev/null
-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
-
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_"
pload QAcommands
## (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"
} else {
if { [regexp {FAILED} $info_result] } {
if {[llength ${ExplodeList}] < 1} {
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
renamevar res2 result
}
-checkprops result -s 0
checkshape result
+checkprops result -s 5890.42
+
checkview -display result -2d -path ${imagedir}/${test_image}.png
+
+
+++ /dev/null
-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
+++ /dev/null
-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
+++ /dev/null
-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
+++ /dev/null
-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
+++ /dev/null
-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
-
+++ /dev/null
-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
-