From a98108292579258c97bcba7b322d5665068c1323 Mon Sep 17 00:00:00 2001 From: emv Date: Mon, 5 Feb 2018 15:10:32 +0300 Subject: [PATCH] 0029484: Avoid inheritance of the BRepAlgoAPI_Check from BRepBuilderAPI_MakeShape Inherit BRepAlgoAPI_Check class from BOPAlgo_Options instead of BRepAlgoAPI_Algo, as the latter is too excessive for checking purposes. Implementation of the Draw command "bopapicheck" for testing the BRepAlgoAPI_Check algorithm. --- src/BOPTest/BOPTest_CheckCommands.cxx | 129 ++++++++++++++++ src/BRepAlgoAPI/BRepAlgoAPI_Check.cxx | 179 ++++++---------------- src/BRepAlgoAPI/BRepAlgoAPI_Check.hxx | 208 +++++++++++++++----------- tests/bugs/modalg_7/bug29484 | 90 +++++++++++ 4 files changed, 389 insertions(+), 217 deletions(-) create mode 100644 tests/bugs/modalg_7/bug29484 diff --git a/src/BOPTest/BOPTest_CheckCommands.cxx b/src/BOPTest/BOPTest_CheckCommands.cxx index 8e3c1bcbf2..9b5c3054c5 100644 --- a/src/BOPTest/BOPTest_CheckCommands.cxx +++ b/src/BOPTest/BOPTest_CheckCommands.cxx @@ -22,6 +22,7 @@ #include #include #include +#include #include #include #include @@ -50,6 +51,7 @@ static // static Standard_Integer bopcheck (Draw_Interpretor&, Standard_Integer, const char** ); static Standard_Integer bopargcheck(Draw_Interpretor&, Standard_Integer, const char** ); +static Standard_Integer bopapicheck(Draw_Interpretor&, Standard_Integer, const char** ); static Standard_Integer xdistef(Draw_Interpretor&, Standard_Integer, const char** ); static Standard_Integer checkcurveonsurf (Draw_Interpretor&, Standard_Integer, const char**); @@ -79,6 +81,16 @@ void BOPTest::CheckCommands(Draw_Interpretor& theCommands) theCommands.Add("checkcurveonsurf", "use checkcurveonsurf shape", __FILE__, checkcurveonsurf, g); + theCommands.Add("bopapicheck", + "Checks the validity of shape/pair of shapes.\n" + "\t\tUsage: bopapicheck s1 [s2] [-op common/fuse/cut/tuc] [-se] [-si]\n" + "\t\tOptions:\n" + "\t\ts1, s2 - shapes for checking;\n" + "\t\t-op - specifies the type of Boolean operation, for which the validity of shapes should be checked;" + " Should be followed by the operation;\n" + "\t\t-se - disables the check of the shapes on small edges;\n" + "\t\t-si - disables the check of the shapes on self-interference.\n", + __FILE__, bopapicheck, g); } //======================================================================= //class : BOPTest_Interf @@ -909,6 +921,123 @@ Standard_Integer bopargcheck (Draw_Interpretor& di, return 0; } +//======================================================================= +//function : bopapicheck +//purpose : +//======================================================================= +Standard_Integer bopapicheck(Draw_Interpretor& di, + Standard_Integer n, + const char** a) +{ + if (n < 2) + { + di.PrintHelp(a[0]); + return 1; + } + + TopoDS_Shape aS1 = DBRep::Get(a[1]); + TopoDS_Shape aS2; + if (n > 2) + { + // Try to get the second shape + aS2 = DBRep::Get(a[2]); + } + + BOPAlgo_Operation anOp = BOPAlgo_UNKNOWN; + Standard_Boolean bTestSE = Standard_True; + Standard_Boolean bTestSI = Standard_True; + + for (Standard_Integer i = aS2.IsNull() ? 2 : 3; i < n; ++i) + { + if (!strcmp(a[i], "-op")) + { + // Get the operation type + ++i; + if (!strcmp(a[i], "common")) + anOp = BOPAlgo_COMMON; + else if (!strcmp(a[i], "fuse")) + anOp = BOPAlgo_FUSE; + else if (!strcmp(a[i], "cut")) + anOp = BOPAlgo_CUT; + else if (!strcmp(a[i], "tuc")) + anOp = BOPAlgo_CUT21; + else if (!strcmp(a[i], "section")) + anOp = BOPAlgo_SECTION; + } + else if (!strcmp(a[i], "-se")) + { + bTestSE = Standard_False; + } + else if (!strcmp(a[i], "-si")) + { + bTestSI = Standard_False; + } + else + { + di << "Invalid key: " << a[i] << ". Skipped.\n"; + } + } + + BRepAlgoAPI_Check aChecker(aS1, aS2, anOp, bTestSE, bTestSI); + if (aChecker.IsValid()) + { + if (aS2.IsNull()) + di << "The shape seems to be valid\n"; + else + di << "The shapes seem to be valid\n"; + return 0; + } + + // Shapes seem to be invalid. + // Analyze the invalidity. + + Standard_Boolean isInv1 = Standard_False, isInv2 = Standard_False; + Standard_Boolean isBadOp = Standard_False; + BOPAlgo_ListIteratorOfListOfCheckResult itF(aChecker.Result()); + for (; itF.More(); itF.Next()) + { + const BOPAlgo_CheckResult& aFaulty = itF.Value(); + if (aFaulty.GetCheckStatus() == BOPAlgo_BadType) + { + isBadOp = Standard_True; + } + else + { + if (!isInv1) + { + isInv1 = !aFaulty.GetShape1().IsNull(); + } + if (!isInv2) + { + isInv2 = !aFaulty.GetShape2().IsNull(); + } + } + + if (isInv1 && isInv2 && isBadOp) + break; + } + + if (isInv1) + { + if (aS2.IsNull()) + di << "The shape is invalid\n"; + else + di << "The first shape is invalid\n"; + } + if (isInv2) + { + di << "The second shape is invalid\n"; + } + if (isBadOp) + { + if (aS2.IsNull()) + di << "The shape is empty\n"; + else + di << "The shapes are not valid for Boolean operation\n"; + } + return 0; +} + //======================================================================= //function : xdistef //purpose : diff --git a/src/BRepAlgoAPI/BRepAlgoAPI_Check.cxx b/src/BRepAlgoAPI/BRepAlgoAPI_Check.cxx index 35eb8c8ae0..2df37e105e 100644 --- a/src/BRepAlgoAPI/BRepAlgoAPI_Check.cxx +++ b/src/BRepAlgoAPI/BRepAlgoAPI_Check.cxx @@ -14,20 +14,21 @@ // commercial license or contractual agreement. -#include #include + +#include #include -#include //======================================================================= //function : BRepAlgoAPI_Check //purpose : //======================================================================= BRepAlgoAPI_Check::BRepAlgoAPI_Check() -: - BRepAlgoAPI_Algo(), - myAnalyzer(NULL), - myFuzzyValue(0.) +: + BOPAlgo_Options(), + myTestSE(Standard_True), + myTestSI(Standard_True), + myOperation(BOPAlgo_UNKNOWN) { } @@ -38,11 +39,13 @@ BRepAlgoAPI_Check::BRepAlgoAPI_Check() BRepAlgoAPI_Check::BRepAlgoAPI_Check(const TopoDS_Shape& theS, const Standard_Boolean bTestSE, const Standard_Boolean bTestSI) -: BRepAlgoAPI_Algo(), - myFuzzyValue(0.) +: + BOPAlgo_Options(), + myS1(theS), + myTestSE(bTestSE), + myTestSI(bTestSI), + myOperation(BOPAlgo_UNKNOWN) { - Init(theS, TopoDS_Shape(), BOPAlgo_UNKNOWN, bTestSE, bTestSI); - // Perform(); } @@ -55,11 +58,14 @@ BRepAlgoAPI_Check::BRepAlgoAPI_Check(const TopoDS_Shape& theS1, const BOPAlgo_Operation theOp, const Standard_Boolean bTestSE, const Standard_Boolean bTestSI) -: BRepAlgoAPI_Algo(), - myFuzzyValue(0.) +: + BOPAlgo_Options(), + myS1(theS1), + myS2(theS2), + myTestSE(bTestSE), + myTestSI(bTestSI), + myOperation(theOp) { - Init(theS1, theS2, theOp, bTestSE, bTestSI); - // Perform(); } @@ -69,97 +75,6 @@ BRepAlgoAPI_Check::BRepAlgoAPI_Check(const TopoDS_Shape& theS1, //======================================================================= BRepAlgoAPI_Check::~BRepAlgoAPI_Check() { - if(myAnalyzer){ - delete myAnalyzer; - myAnalyzer=NULL; - } - myResult.Clear(); -} - -//======================================================================= -//function : SetFuzzyValue -//purpose : -//======================================================================= -void BRepAlgoAPI_Check::SetFuzzyValue(const Standard_Real theFuzz) -{ - myFuzzyValue = (theFuzz < 0.) ? 0. : theFuzz; -} -//======================================================================= -//function : FuzzyValue -//purpose : -//======================================================================= -Standard_Real BRepAlgoAPI_Check::FuzzyValue() const -{ - return myFuzzyValue; -} - -//======================================================================= -//function : SetData -//purpose : -//======================================================================= -void BRepAlgoAPI_Check::SetData(const TopoDS_Shape& theS, - const Standard_Boolean bTestSE, - const Standard_Boolean bTestSI) -{ - Init(theS, TopoDS_Shape(), BOPAlgo_UNKNOWN, bTestSE, bTestSI); -} - -//======================================================================= -//function : SetData -//purpose : -//======================================================================= -void BRepAlgoAPI_Check::SetData(const TopoDS_Shape& theS1, - const TopoDS_Shape& theS2, - const BOPAlgo_Operation theOp, - const Standard_Boolean bTestSE, - const Standard_Boolean bTestSI) -{ - Init(theS1, theS2, theOp, bTestSE, bTestSI); -} -//======================================================================= -//function : Init -//purpose : -//======================================================================= -void BRepAlgoAPI_Check::Init(const TopoDS_Shape& theS1, - const TopoDS_Shape& theS2, - const BOPAlgo_Operation theOp, - const Standard_Boolean bTestSE, - const Standard_Boolean bTestSI) -{ - myResult.Clear(); - myS1 = theS1; - myS2 = theS2; - // - myAnalyzer = new BOPAlgo_ArgumentAnalyzer(); - // - myAnalyzer->SetShape1(myS1); - myAnalyzer->SetShape2(myS2); - myAnalyzer->OperationType() = theOp; - myAnalyzer->ArgumentTypeMode() = Standard_True; - myAnalyzer->SmallEdgeMode() = bTestSE; - myAnalyzer->SelfInterMode() = bTestSI; - // - myAnalyzer->SetRunParallel(myRunParallel); - myAnalyzer->SetProgressIndicator(myProgressIndicator); - myAnalyzer->SetFuzzyValue(myFuzzyValue); -} - -//======================================================================= -//function : Result -//purpose : -//======================================================================= -const BOPAlgo_ListOfCheckResult& BRepAlgoAPI_Check::Result() -{ - return myResult; -} - -//======================================================================= -//function : IsValid -//purpose : -//======================================================================= -Standard_Boolean BRepAlgoAPI_Check::IsValid() -{ - return myResult.IsEmpty(); } //======================================================================= @@ -168,38 +83,40 @@ Standard_Boolean BRepAlgoAPI_Check::IsValid() //======================================================================= void BRepAlgoAPI_Check::Perform() { - Standard_Boolean isS1, isS2; - //incompatibility of shape types, small edges and self-interference - myAnalyzer->Perform(); - if (myAnalyzer->HasFaulty()) { - myResult = myAnalyzer->GetCheckResult(); - } + // Check the incompatibility of shapes types, small edges and self-interference + BOPAlgo_ArgumentAnalyzer anAnalyzer; + // Set the shapes and options for the check + anAnalyzer.SetShape1(myS1); + anAnalyzer.SetShape2(myS2); + anAnalyzer.OperationType() = myOperation; + anAnalyzer.ArgumentTypeMode() = Standard_True; + anAnalyzer.SmallEdgeMode() = myTestSE; + anAnalyzer.SelfInterMode() = myTestSI; + // Set options from BOPAlgo_Options + anAnalyzer.SetRunParallel(myRunParallel); + anAnalyzer.SetProgressIndicator(myProgressIndicator); + anAnalyzer.SetFuzzyValue(myFuzzyValue); + // Perform the check + anAnalyzer.Perform(); + // Get the results + myFaultyShapes = anAnalyzer.GetCheckResult(); - //topological validity - isS1 = !myS1.IsNull(); - isS2 = !myS2.IsNull(); - if (isS1) { - BRepCheck_Analyzer anS1(myS1); - isS1 = anS1.IsValid(); - } else { - isS1 = Standard_True; - } - // - if (isS2) { - BRepCheck_Analyzer anS2(myS2); - isS2 = anS2.IsValid(); - } else { - isS2 = Standard_True; - } - if (!isS1 || !isS2) { + // Check the topological validity of the shapes + Standard_Boolean isValidS1 = !myS1.IsNull() ? + BRepCheck_Analyzer(myS1).IsValid() : Standard_True; + + Standard_Boolean isValidS2 = !myS2.IsNull() ? + BRepCheck_Analyzer(myS2).IsValid() : Standard_True; + + if (!isValidS1 || !isValidS2) { BOPAlgo_CheckResult aRes; aRes.SetCheckStatus(BOPAlgo_NotValid); - if (!isS1) { + if (!isValidS1) { aRes.SetShape1(myS1); } - if (!isS1) { + if (!isValidS2) { aRes.SetShape2(myS2); } - myResult.Append(aRes); + myFaultyShapes.Append(aRes); } } diff --git a/src/BRepAlgoAPI/BRepAlgoAPI_Check.hxx b/src/BRepAlgoAPI/BRepAlgoAPI_Check.hxx index 62724dea54..e3ded7899c 100644 --- a/src/BRepAlgoAPI/BRepAlgoAPI_Check.hxx +++ b/src/BRepAlgoAPI/BRepAlgoAPI_Check.hxx @@ -20,121 +20,157 @@ #include #include -#include -#include #include -#include -#include -#include #include -class TopoDS_Shape; +#include +#include +#include +#include - -//! The class Check provides a diagnostic tool for checking -//! single shape or couple of shapes. -//! Single shape is checking on topological validity, small edges -//! and self-interference. For couple of shapes added check -//! on validity for boolean operation of given type. +//! The class Check provides a diagnostic tool for checking the validity +//! of the single shape or couple of shapes. +//! The shapes are checked on: +//! - Topological validity; +//! - Small edges; +//! - Self-interference; +//! - Validity for Boolean operation of certain type (for couple of shapes only). //! //! The class provides two ways of checking shape(-s) //! 1. Constructors //! BRepAlgoAPI_Check aCh(theS); -//! Standard_Boolean bV=aCh.IsValid(); +//! Standard_Boolean isValid = aCh.IsValid(); //! 2. Methods SetData and Perform //! BRepAlgoAPI_Check aCh; //! aCh.SetData(theS1, theS2, BOPAlgo_FUSE, Standard_False); //! aCh.Perform(); -//! Standard_Boolean bV=aCh.IsValid(); -class BRepAlgoAPI_Check : public BRepAlgoAPI_Algo +//! Standard_Boolean isValid = aCh.IsValid(); +//! +class BRepAlgoAPI_Check : public BOPAlgo_Options { public: DEFINE_STANDARD_ALLOC - + +public: //! @name Constructors + //! Empty constructor. Standard_EXPORT BRepAlgoAPI_Check(); -Standard_EXPORT virtual ~BRepAlgoAPI_Check(); - + Standard_EXPORT virtual ~BRepAlgoAPI_Check(); + //! Constructor for checking single shape. - //! It calls methods - //! Init(theS, TopoDS_Shape(), BOPAlgo_UNKNOWN, bTestSE, bTestSI) - //! and Perform(). - //! Params: - //! theS - the shape that should be checked; - //! bTestSE - flag that specifies whether check on small edges - //! should be performed; by default it is set to TRUE; - //! bTestSI - flag that specifies whether check on self-interference - //! should be performed; by default it is set to TRUE; - Standard_EXPORT BRepAlgoAPI_Check(const TopoDS_Shape& theS, const Standard_Boolean bTestSE = Standard_True, const Standard_Boolean bTestSI = Standard_True); - - //! Constructor for couple of shapes. - //! It calls methods - //! Init(theS1, theS2, theOp, bTestSE, bTestSI) and Perform(). - //! Params: - //! theS1, theS2 - the initial shapes. - //! theOp - the type of Boolean Operation; - //! if it is not defined (set to UNKNOWN) for each shape - //! performed check as for single shape. - //! bTestSE - flag that specifies whether check on small edges - //! should be performed; by default it is set to TRUE; - //! bTestSI - flag that specifies whether check on self-interference - //! should be performed; by default it is set to TRUE; - Standard_EXPORT BRepAlgoAPI_Check(const TopoDS_Shape& theS1, const TopoDS_Shape& theS2, const BOPAlgo_Operation theOp = BOPAlgo_UNKNOWN, const Standard_Boolean bTestSE = Standard_True, const Standard_Boolean bTestSI = Standard_True); - - //! Sets data for check by Init method. - //! The method provides alternative way for checking single shape. - Standard_EXPORT void SetData (const TopoDS_Shape& theS, const Standard_Boolean bTestSE = Standard_True, const Standard_Boolean bTestSI = Standard_True); - - //! Sets data for check by Init method. - //! The method provides alternative way for checking couple of shapes. - Standard_EXPORT void SetData (const TopoDS_Shape& theS1, const TopoDS_Shape& theS2, const BOPAlgo_Operation theOp = BOPAlgo_UNKNOWN, const Standard_Boolean bTestSE = Standard_True, const Standard_Boolean bTestSI = Standard_True); - + //! + //! @param theS [in] - the shape to check; + //! @param bTestSE [in] - flag which specifies whether to check the shape + //! on small edges or not; by default it is set to TRUE; + //! @param bTestSI [in] - flag which specifies whether to check the shape + //! on self-interference or not; by default it is set to TRUE; + Standard_EXPORT BRepAlgoAPI_Check(const TopoDS_Shape& theS, + const Standard_Boolean bTestSE = Standard_True, + const Standard_Boolean bTestSI = Standard_True); + + //! Constructor for checking the couple of shapes. + //! Additionally to the validity checks of each given shape, + //! the types of the given shapes will be checked on validity + //! for Boolean operation of given type. + //! + //! @param theS1 [in] - the first shape to check; + //! @param theS2 [in] - the second shape to check; + //! @param theOp [in] - the type of Boolean Operation for which the validity + //! of given shapes should be checked. + //! @param bTestSE [in] - flag which specifies whether to check the shape + //! on small edges or not; by default it is set to TRUE; + //! @param bTestSI [in] - flag which specifies whether to check the shape + //! on self-interference or not; by default it is set to TRUE; + Standard_EXPORT BRepAlgoAPI_Check(const TopoDS_Shape& theS1, + const TopoDS_Shape& theS2, + const BOPAlgo_Operation theOp = BOPAlgo_UNKNOWN, + const Standard_Boolean bTestSE = Standard_True, + const Standard_Boolean bTestSI = Standard_True); + + +public: //! @name Initializing the algorithm + + //! Initializes the algorithm with single shape. + //! + //! @param theS [in] - the shape to check; + //! @param bTestSE [in] - flag which specifies whether to check the shape + //! on small edges or not; by default it is set to TRUE; + //! @param bTestSI [in] - flag which specifies whether to check the shape + //! on self-interference or not; by default it is set to TRUE; + void SetData(const TopoDS_Shape& theS, + const Standard_Boolean bTestSE = Standard_True, + const Standard_Boolean bTestSI = Standard_True) + { + myS1 = theS; + myS2 = TopoDS_Shape(); + myTestSE = bTestSE; + myTestSI = bTestSI; + myFaultyShapes.Clear(); + } + + //! Initializes the algorithm with couple of shapes. + //! Additionally to the validity checks of each given shape, + //! the types of the given shapes will be checked on validity + //! for Boolean operation of given type. + //! + //! @param theS1 [in] - the first shape to check; + //! @param theS2 [in] - the second shape to check; + //! @param theOp [in] - the type of Boolean Operation for which the validity + //! of given shapes should be checked. + //! @param bTestSE [in] - flag which specifies whether to check the shape + //! on small edges or not; by default it is set to TRUE; + //! @param bTestSI [in] - flag which specifies whether to check the shape + //! on self-interference or not; by default it is set to TRUE; + void SetData(const TopoDS_Shape& theS1, + const TopoDS_Shape& theS2, + const BOPAlgo_Operation theOp = BOPAlgo_UNKNOWN, + const Standard_Boolean bTestSE = Standard_True, + const Standard_Boolean bTestSI = Standard_True) + { + myS1 = theS1; + myS2 = theS2; + myOperation = theOp; + myTestSE = bTestSE; + myTestSI = bTestSI; + myFaultyShapes.Clear(); + } + + +public: //! @name Performing the operation + //! Performs the check. Standard_EXPORT void Perform(); - + + +public: //! @name Getting the results. + //! Shows whether shape(s) valid or not. - Standard_EXPORT Standard_Boolean IsValid(); - + Standard_Boolean IsValid() + { + return myFaultyShapes.IsEmpty(); + } + //! Returns faulty shapes. - Standard_EXPORT const BOPAlgo_ListOfCheckResult& Result(); - - //! Sets the additional tolerance - Standard_EXPORT void SetFuzzyValue (const Standard_Real theFuzz); - - //! Returns the additional tolerance - Standard_EXPORT Standard_Real FuzzyValue() const; - - - - -protected: - - - //! Initialyzes data. - Standard_EXPORT void Init (const TopoDS_Shape& theS1, const TopoDS_Shape& theS2, const BOPAlgo_Operation theOp, const Standard_Boolean bTestSE, const Standard_Boolean bTestSI); - - - TopoDS_Shape myS1; - TopoDS_Shape myS2; - BOPAlgo_PArgumentAnalyzer myAnalyzer; - BOPAlgo_ListOfCheckResult myResult; - Standard_Real myFuzzyValue; - - -private: + const BOPAlgo_ListOfCheckResult& Result() + { + return myFaultyShapes; + } +protected: //! @name Fields + // Inputs + TopoDS_Shape myS1; //!< The first shape + TopoDS_Shape myS2; //!< The second shape + Standard_Boolean myTestSE; //!< Flag defining whether to look for small edges in the given shapes or not + Standard_Boolean myTestSI; //!< Flag defining whether to check the input edges on self-interference or not + BOPAlgo_Operation myOperation; //!< Type of Boolean operation for which the validity of input shapes should be checked + // Results + BOPAlgo_ListOfCheckResult myFaultyShapes; //!< Found faulty shapes }; - - - - - - #endif // _BRepAlgoAPI_Check_HeaderFile diff --git a/tests/bugs/modalg_7/bug29484 b/tests/bugs/modalg_7/bug29484 new file mode 100644 index 0000000000..bc15dd7109 --- /dev/null +++ b/tests/bugs/modalg_7/bug29484 @@ -0,0 +1,90 @@ +puts "========" +puts "OCC29484" +puts "========" +puts "" +################################################# +# Avoid inheritance of the BRepAlgoAPI_Check from BRepBuilderAPI_MakeShape +################################################# + +puts "check simple box" + +box b1 2 2 2 +if {![regexp "The shape seems to be valid" [bopapicheck b1]]} { + puts "Error: The simple box is considered as invalid by BRepAlgoAPI_Check" +} + +puts "add another box" + +box b2 1 1 1 2 2 2 +compound b1 b2 c + +puts "check si compound" + +if {![regexp "The shape is invalid" [bopapicheck c]]} { + puts "Error: Self-intersection is not detected" +} + +if {![regexp "The shape seems to be valid" [bopapicheck c -si]]} { + puts "Error: Check on self-intersection is still enabled" +} + + +puts "increase tolerance of the vertices of the box to test Small edges detection" + +foreach v [explode b1 v] {settolerance $v 5.} + +if {![regexp "The shape is invalid" [bopapicheck b1 -si]]} { + puts "Error: Small edges are not detected" +} + +if {![regexp "The shape seems to be valid" [bopapicheck c -si -se]]} { + puts "Error: Check on small edges is still enabled" +} + +puts "b1 - invalid, b2 - ok" + +if {![regexp "The first shape is invalid" [bopapicheck b1 b2]]} { + puts "Error: The check is invalid" +} + +if {![regexp "The second shape is invalid" [bopapicheck b2 b1]]} { + puts "Error: The check is invalid" +} + + +puts "test types" + +if {![regexp "The shapes seem to be valid" [bopapicheck b1 b2 -op fuse -se -si]]} { + puts "Error: The check on types is invalid" +} + +puts "check empty shape" +compound c + +if {![regexp "The shape is empty" [bopapicheck c]]} { + puts "Error: Empty shape is not detected" +} + +if {![regexp "The shapes are not valid for Boolean operation" [bopapicheck b2 c]]} { + puts "Error: Empty shape is not detected" +} + + +puts "check vertex/solid BOPs" +vertex v 1 1 1 + +if {![regexp "The shapes seem to be valid" [bopapicheck b2 v -op common]]} { + puts "Error: The check on types is invalid" +} + +if {![regexp "The shapes are not valid for Boolean operation" [bopapicheck b2 v -op fuse]]} { + puts "Error: The check on types is invalid" +} + +if {![regexp "The shapes are not valid for Boolean operation" [bopapicheck b2 v -op cut]]} { + puts "Error: The check on types is invalid" +} + +if {![regexp "The shapes seem to be valid" [bopapicheck b2 v -op tuc]]} { + puts "Error: The check on types is invalid" +}