]> OCCT Git - occt-copy.git/commitdiff
0025656: Specification of semantic of Closed flag of an edge
authorazv <azv@opencascade.com>
Tue, 30 Dec 2014 04:37:51 +0000 (07:37 +0300)
committerbugmaster <bugmaster@opencascade.com>
Thu, 22 Jan 2015 14:37:32 +0000 (17:37 +0300)
1. Using of the "Closed" flag was unified:
  a) this flag is applicable for TopoDS_Wire and TopoDS_Shell only, because these entities may hedge an area in 2D space or a volume in 3D space correspondingly;
  b) other types of TopoDS shapes are passing over this flag;
  c) changing of this flag should be controlled by high-level algorithms (not BRep_Builder).
2. Implemented verification of the closedness of edges. An edge is closed if and only if its first and last vertices are the same.
3. Test cases were changed according to new behavior.

43 files changed:
src/BRep/BRep_Builder.cxx
src/BRep/BRep_Tool.cdl
src/BRep/BRep_Tool.cxx
src/BRepAlgo/BRepAlgo_Loop.cxx
src/BRepFeat/BRepFeat_MakeCylindricalHole.cxx
src/BRepFill/BRepFill.cxx
src/BRepFill/BRepFill_Evolved.cxx
src/BRepFill/BRepFill_Filling.cxx
src/BRepFill/BRepFill_Generator.cxx
src/BRepFill/BRepFill_NSections.cxx
src/BRepFill/BRepFill_OffsetWire.cxx
src/BRepFill/BRepFill_Pipe.cxx
src/BRepFill/BRepFill_Section.cxx
src/BRepFill/BRepFill_ShapeLaw.cxx
src/BRepLib/BRepLib.cxx
src/BRepLib/BRepLib_MakeWire.cxx
src/BRepLib/BRepLib_MakeWire_1.cxx
src/BRepOffset/BRepOffset_Offset.cxx
src/BRepOffsetAPI/BRepOffsetAPI_ThruSections.cxx
src/BRepPrim/BRepPrim_Builder.cxx
src/BRepPrimAPI/BRepPrimAPI_MakeOneAxis.cxx
src/BRepPrimAPI/BRepPrimAPI_MakeWedge.cxx
src/BRepProj/BRepProj_Projection.cxx
src/BRepSweep/BRepSweep_NumLinearRegularSweep.cxx
src/BRepSweep/BRepSweep_Rotation.cxx
src/BRepTools/BRepTools_ReShape.cxx
src/ChFi3d/ChFi3d_Builder_1.cxx
src/IGESToBRep/IGESToBRep_BRepEntity.cxx
src/LocOpe/LocOpe_SplitShape.cxx
src/ShapeBuild/ShapeBuild_ReShape.cxx
src/ShapeFix/ShapeFix_Edge.cxx
src/ShapeFix/ShapeFix_Solid.cxx
src/ShapeProcess/ShapeProcess_ShapeContext.cxx
src/ShapeUpgrade/ShapeUpgrade_FaceDivideArea.cxx
src/TopOpeBRepBuild/TopOpeBRepBuild_Builder1.cxx
src/TopOpeBRepBuild/TopOpeBRepBuild_Builder1_1.cxx
src/TopOpeBRepBuild/TopOpeBRepBuild_Builder1_2.cxx
src/TopOpeBRepBuild/TopOpeBRepBuild_FaceBuilder.cxx
src/TopOpeBRepBuild/TopOpeBRepBuild_makeedges.cxx
src/TopoDS/TopoDS_TShape.cdl
tests/bugs/moddata_3/bug25202_1
tests/bugs/moddata_3/bug25202_3
tests/bugs/moddata_3/bug25202_4

index c556d6a3bbdc07d68d692097ab96c4eb9ec9c521..b30c72fe47bd8fc92625b8e8389cf6fe437bd082 100644 (file)
@@ -563,7 +563,6 @@ void  BRep_Builder::MakeEdge(TopoDS_Edge& E) const
   {
     TopoDS_LockedShape::Raise("BRep_Builder::MakeEdge");
   }
-  TE->Closed(Standard_False);
   MakeShape(E,TE);
 }
 
@@ -586,7 +585,6 @@ void  BRep_Builder::UpdateEdge(const TopoDS_Edge& E,
   const TopLoc_Location l = L.Predivided(E.Location());
 
   UpdateCurves(TE->ChangeCurves(),C,l);
-  if (!C.IsNull()) TE->Closed(C->IsClosed());
 
   TE->UpdateTolerance(Tol);
   TE->Modified(Standard_True);
@@ -665,8 +663,6 @@ void  BRep_Builder::UpdateEdge(const TopoDS_Edge& E,
   const TopLoc_Location l = L.Predivided(E.Location());
 
   UpdateCurves(TE->ChangeCurves(),C1,C2,S,l);
-  if (!C1.IsNull() && !C2.IsNull()) 
-    TE->Closed(C1->IsClosed() && C2->IsClosed());
 
   TE->UpdateTolerance(Tol);
   TE->Modified(Standard_True);
@@ -695,9 +691,7 @@ void  BRep_Builder::UpdateEdge(const TopoDS_Edge& E,
   const TopLoc_Location l = L.Predivided(E.Location());
 
   UpdateCurves(TE->ChangeCurves(),C1,C2,S,l,Pf,Pl);
-  if (!C1.IsNull() && !C2.IsNull()) 
-    TE->Closed(C1->IsClosed() && C2->IsClosed());
-  
+
   TE->UpdateTolerance(Tol);
   TE->Modified(Standard_True);
 }
@@ -768,14 +762,14 @@ void  BRep_Builder::UpdateEdge(const TopoDS_Edge& E,
   while (itcr.More())
   {
     if (itcr.Value()->IsPolygonOnTriangulation(T,l))
-       {
+    {
       // cr is used to keep a reference on the curve representation
       // this avoid deleting it as its content may be referenced by T
       cr = itcr.Value();
       lcr.Remove(itcr);
       isModified = Standard_True;
       break;
-       }
+    }
     itcr.Next();
   }
 
@@ -1093,23 +1087,8 @@ void  BRep_Builder::Range(const TopoDS_Edge&  E,
   
   while (itcr.More()) {
     GC = Handle(BRep_GCurve)::DownCast(itcr.Value());
-    if (!GC.IsNull()) {
-      if (!Only3d || GC->IsCurve3D())
-       GC->SetRange(First,Last);
-      if (GC->IsCurve3D()) {
-        // Set the closedness flag to the correct value.
-        Handle(Geom_Curve) C = GC->Curve3D();
-        
-        //fixing a bug PRO18577 to avoid infinite values of First and Last 
-        if ( !C.IsNull() && 
-            !Precision::IsNegativeInfinite(First) && 
-            !Precision::IsPositiveInfinite(Last) )   {
-          Standard_Boolean closed = 
-            C->Value(First).IsEqual(C->Value(Last),BRep_Tool::Tolerance(E));
-          TE->Closed(closed);
-        }
-      }
-    }
+    if (!GC.IsNull() && (!Only3d || GC->IsCurve3D()))
+      GC->SetRange(First,Last);
     itcr.Next();
   }
   
@@ -1141,20 +1120,10 @@ void  BRep_Builder::Range(const TopoDS_Edge& E,
 
   while (itcr.More()) {
     GC = Handle(BRep_GCurve)::DownCast(itcr.Value());
-    if (!GC.IsNull()) {
-      if (GC->IsCurveOnSurface(S,l)) {
-        GC->SetRange(First,Last);
-
-        // Set the closedness flag to the correct value.
-        Handle(Geom2d_Curve) PC = GC->PCurve();
-        gp_Pnt2d P1 = PC->Value(First);
-        gp_Pnt2d P2 = PC->Value(Last);
-        gp_Pnt   PP1 = S->Value(P1.X(),P1.Y());
-        gp_Pnt   PP2 = S->Value(P2.X(),P2.Y());
-        Standard_Boolean closed = PP1.IsEqual(PP2,BRep_Tool::Tolerance(E));
-        TE->Closed(closed);
-        break;
-      }
+    if (!GC.IsNull() && GC->IsCurveOnSurface(S,l))
+    {
+      GC->SetRange(First,Last);
+      break;
     }
     itcr.Next();
   }
index 84c6c8170476288bd40dbb1eb788bc91aee64a22..0db0bb0c3d9a36672a2d59a5926781467346a6b0 100644 (file)
@@ -49,14 +49,15 @@ is
 
     -----------------------------------------------------------
     -----------------------------------------------------------
-    --                         Solid                         -- 
+    --                         Shape                         -- 
     -----------------------------------------------------------
     -----------------------------------------------------------
     IsClosed (myclass; S : Shape from TopoDS) returns Boolean from Standard;
-       ---Purpose: If S is Solid or Shell, returns True if it has no free boundaries (edges).
-               --          If S is Wire, returns True if it has no free ends (vertices).
-               --          (Internal and External sub-shepes are ignored in this check.)
-               --          For other shape types returns S.Closed().
+    ---Purpose: If S is Shell, returns True if it has no free boundaries (edges).
+    --          If S is Wire, returns True if it has no free ends (vertices).
+    --          (Internal and External sub-shepes are ignored in these checks)
+    --          If S is Edge, returns True if its vertices are the same.
+    --          For other shape types returns S.Closed().
        
     -----------------------------------------------------------
     -----------------------------------------------------------
index 930c7dc417f05a6134fe47ce00e374e4d8476c2c..800f1df4037273a93cf2faa6ad45ca98d90663c9 100644 (file)
@@ -1455,7 +1455,7 @@ gp_Pnt2d  BRep_Tool::Parameters(const TopoDS_Vertex& V,
 //=======================================================================
 Standard_Boolean BRep_Tool::IsClosed (const TopoDS_Shape& theShape)
 {
-  if (theShape.ShapeType() == TopAbs_SHELL || theShape.ShapeType() == TopAbs_SOLID)
+  if (theShape.ShapeType() == TopAbs_SHELL)
   {
     NCollection_Map<TopoDS_Shape, TopTools_ShapeMapHasher> aMap (101, new NCollection_IncAllocator);
     TopExp_Explorer exp (theShape.Oriented(TopAbs_FORWARD), TopAbs_EDGE);
@@ -1487,6 +1487,12 @@ Standard_Boolean BRep_Tool::IsClosed (const TopoDS_Shape& theShape)
     }
     return hasBound && aMap.IsEmpty();
   }
+  else if (theShape.ShapeType() == TopAbs_EDGE)
+  {
+    TopoDS_Vertex aVFirst, aVLast;
+    TopExp::Vertices(TopoDS::Edge(theShape), aVFirst, aVLast);
+    return !aVFirst.IsNull() && aVFirst.IsSame(aVLast);
+  }
   return theShape.Closed();
 }
 
index 64bec4b01bcf308b3c782cf4f2aa0a757e8a4d94..e8cc8c642134351686974bc3ca817e0fbb66a561 100644 (file)
@@ -826,7 +826,7 @@ void BRepAlgo_Loop::CutEdge (const TopoDS_Edge&          E,
        {
          gp_Pnt2d pf, pl;
          BRep_Tool::UVPoints( EE, myFace, pf, pl );
-         if (pf.Distance(pl) <= Tol && !EE.Closed())
+         if (pf.Distance(pl) <= Tol && !BRep_Tool::IsClosed(EE))
            NE.Remove(it);
          else
            it.Next();
index 7e0b90f837de3e4812714c76eb06a5dd9663ac79..5ef838e04e21046ee8e224666384f10ede65a8cb 100644 (file)
@@ -92,7 +92,6 @@ void BRepFeat_MakeCylindricalHole::Perform(const Standard_Real Radius)
   TopoDS_Solid theTool;
   B.MakeSolid(theTool);
   B.Add(theTool,theCylinder.Shell());
-  theTool.Closed(Standard_True);
 
   myTopFace = theCylinder.TopFace();
   myBotFace = theCylinder.BottomFace();
@@ -193,7 +192,6 @@ void BRepFeat_MakeCylindricalHole::PerformThruNext(const Standard_Real Radius,
   TopoDS_Solid theTool;
   B.MakeSolid(theTool);
   B.Add(theTool,theCylinder.Shell());
-  theTool.Closed(Standard_True);
 
   myTopFace = theCylinder.TopFace();
   myBotFace = theCylinder.BottomFace();
@@ -344,7 +342,6 @@ void BRepFeat_MakeCylindricalHole::PerformUntilEnd(const Standard_Real Radius,
   TopoDS_Solid theTool;
   B.MakeSolid(theTool);
   B.Add(theTool,theCylinder.Shell());
-  theTool.Closed(Standard_True);
 
   myTopFace = theCylinder.TopFace();
   myBotFace = theCylinder.BottomFace();
@@ -474,7 +471,6 @@ void BRepFeat_MakeCylindricalHole::Perform(const Standard_Real Radius,
   TopoDS_Solid theTool;
   B.MakeSolid(theTool);
   B.Add(theTool,theCylinder.Shell());
-  theTool.Closed(Standard_True);
 
   myTopFace = theCylinder.TopFace();
   myBotFace = theCylinder.BottomFace();
@@ -603,7 +599,6 @@ void BRepFeat_MakeCylindricalHole::PerformBlind(const Standard_Real Radius,
   TopoDS_Solid theTool;
   B.MakeSolid(theTool);
   B.Add(theTool,theCylinder.Shell());
-  theTool.Closed(Standard_True);
 
   myTopFace = theCylinder.TopFace();
   myBotFace.Nullify();
index 1b1361ac899ccf27672e74f9176de0a5b9bd196c..8eb19fc677b6c455c8d2bc037e485b0dc3260302 100644 (file)
@@ -304,7 +304,6 @@ TopoDS_Face BRepFill::Face(const TopoDS_Edge& Edge1,
   TopoDS_Edge Edge3, Edge4;
 
   Iso = Surf->UIso(f1);
-//  Tol = Max(BT.Tolerance(V1f), BT.Tolerance(V2f));
   Tol = Max(BRep_Tool::Tolerance(V1f), BRep_Tool::Tolerance(V2f));
   if (Iso->Value(f2).Distance(Iso->Value(l2)) > Tol) {
     B.MakeEdge(Edge3,Iso,Precision::Confusion());
@@ -324,7 +323,6 @@ TopoDS_Face BRepFill::Face(const TopoDS_Edge& Edge1,
   }
   else {
     Iso = Surf->UIso(l1);
-//    Tol = Max(BT.Tolerance(V1l), BT.Tolerance(V2l));
     Tol = Max(BRep_Tool::Tolerance(V1l), BRep_Tool::Tolerance(V2l));
     if (Iso->Value(l2).Distance(Iso->Value(f2)) > Tol) {
       B.MakeEdge(Edge4,Iso,Precision::Confusion());
@@ -436,7 +434,8 @@ TopoDS_Shell BRepFill::Shell(const TopoDS_Wire& Wire1,
     Edge1 = TopoDS::Edge(ex1.Current());
     Edge2 = TopoDS::Edge(ex2.Current());
 
-    Standard_Boolean Periodic = Edge1.Closed() && Edge2.Closed();
+    Standard_Boolean Periodic =
+      BRep_Tool::IsClosed(Edge1) && BRep_Tool::IsClosed(Edge2);
     
     ex1.Next();
     ex2.Next();
index d23cd97bd61dc7d4f2b11f7b0839792626cef1d8..642fbca5d4ffa3e3c42c32e02455bfe7ee431661 100644 (file)
@@ -3218,7 +3218,7 @@ void CutEdge (const TopoDS_Edge& E,
   CT2d = new Geom2d_TrimmedCurve(C2d,f,l);
 
   if (CT2d->BasisCurve()->IsKind(STANDARD_TYPE(Geom2d_Circle)) &&
-      E.Closed()) {
+      BRep_Tool::IsClosed(E)) {
     //---------------------------
     // Cut closed circle.
     //---------------------------
index 4e0bd81a5ad5196ba7517a204c3c490cad3af9da..56e108abc193442f84880c8fd57bd620d6cc7334 100644 (file)
@@ -681,7 +681,7 @@ void BRepFill_Filling::Build()
     Handle(Geom2d_Curve) aCurveOnPlate = CurvesOnPlate->Value(i);
 
     TopoDS_Edge NewEdge = TopoDS::Edge(anEdge.EmptyCopied());
-    NewEdge.Closed(anEdge.Closed());
+
     TopoDS_Vertex V1, V2;
     TopExp::Vertices(anEdge, V1, V2, Standard_True); //with orientation
     BB.UpdateVertex(V1, dmax);
index 989cd8be54f0736908313388c59bfa6d67b7c65b..3f7a83869fa296d5edc3346152db7a7879515dc5 100644 (file)
@@ -620,8 +620,8 @@ void BRepFill_Generator::Perform()
        Edge2 = TopoDS::Edge(ex2.Current());
       }
 
-      Standard_Boolean Periodic
-       = (Edge1.Closed() || degen1) && (Edge2.Closed() || degen2);
+      Standard_Boolean Periodic = (BRep_Tool::IsClosed(Edge1) || degen1) &&
+                                  (BRep_Tool::IsClosed(Edge2) || degen2);
       // ATTENTION : a non-punctual wire should not 
       //             contain a punctual edge
       if (!wPoint1) ex1.Next();
@@ -648,13 +648,7 @@ void BRepFill_Generator::Perform()
          Vf_toMap = V1f;
          Vl_toMap = V1l;
        }
-      
-      if(Periodic) {
-       Standard_Boolean E1IsReallyClosed = BRepTools::Compare(V1f,V1l);
-       Standard_Boolean E2IsReallyClosed = BRepTools::Compare(V2f,V2l);
-       Periodic 
-         = (E1IsReallyClosed || degen1) && (E2IsReallyClosed || degen2);
-      }
+
       // processing of KPart
       Standard_Integer IType = DetectKPart(Edge1,Edge2);
       if (IType==0) {
index cbdeab57bd8ffa953a1211f9278b75ef4743fbdf..81431a2f501050079d274333a3da2196a1a8fca3 100644 (file)
@@ -573,7 +573,7 @@ void BRepFill_NSections::Init(const TColStd_SequenceOfReal & P,
            Last = aux;
            C =  CBis;
          } 
-         if ((ii>1) || (!E.Closed()) ) { // Cut C
+         if ((ii>1) || (!BRep_Tool::IsClosed(E)) ) { // Cut C
            Handle(Geom_TrimmedCurve) TC = 
              new (Geom_TrimmedCurve) (C,First, Last);
            C  = TC;
index efd39b4f0dd54f4b09c22a4eea829a41a6d16695..ee341093f597b7439354680df3d5c30969b012d0 100644 (file)
@@ -251,9 +251,7 @@ static Standard_Boolean KPartCircle
     C = Ct->BasisCurve();
   }
 
-  TopoDS_Vertex V1,V2;
-  TopExp::Vertices(E,V1,V2);
-  if ((C->IsKind(STANDARD_TYPE(Geom_Circle)) && V1.IsSame(V2)) || //closed circle
+  if ((C->IsKind(STANDARD_TYPE(Geom_Circle)) && BRep_Tool::IsClosed(E)) || //closed circle
       IsOpenResult)
   {
     Standard_Real anOffset = myOffset;
index 4c27561a7db5c268e008e02f5190302a4e8f418e..3f17c637110f7f47ee9d79ab71694cca95b5af26 100644 (file)
@@ -556,18 +556,18 @@ TopoDS_Shape BRepFill_Pipe::MakeShape(const TopoDS_Shape& S,
       B.MakeShell(TopoDS::Shell(result));
       B.MakeWire(W);
       B.Add(W, S);
-      W.Closed(S.Closed());
+      W.Closed(BRep_Tool::IsClosed(S));
       TheS = W;
       if (!FirstShape.IsNull()) {
        B.MakeWire(W);
        B.Add(W, FirstShape);
-       W.Closed(FirstShape.Closed());
+       W.Closed(BRep_Tool::IsClosed(FirstShape));
        TheFirst = W;
       }
       if (!LastShape.IsNull()) {
        B.MakeWire(W);
        B.Add(W, LastShape);
-       W.Closed(LastShape.Closed());
+       W.Closed(BRep_Tool::IsClosed(LastShape));
        TheLast = W;
       }
       result.Closed (BRep_Tool::IsClosed (result));
index 6f00f35ca922fb9a8d195ca83d6ce2152927a9c9..070eb2d8e90e351ec5475eed1548c19eab55e9f2 100644 (file)
@@ -46,7 +46,6 @@ BRepFill_Section::BRepFill_Section(const TopoDS_Shape& Profile,
       BB.Add( DegEdge, aVertex.Oriented(TopAbs_FORWARD) );
       BB.Add( DegEdge, aVertex.Oriented(TopAbs_REVERSED) );
       BB.Degenerated( DegEdge, Standard_True );
-      DegEdge.Closed( Standard_True );
       
       BB.MakeWire( wire );
       BB.Add( wire, DegEdge );
index 096688580c700af7affc8f08e4d1ddad6a8f05a1..a48f1784bce3aff420ac464507f0cc3e4d52dcad 100644 (file)
@@ -149,23 +149,12 @@ void BRepFill_ShapeLaw::Init(const Standard_Boolean Build)
            C = CBis;
          }
 
-         Standard_Boolean IsReallyClosed = E.Closed();
-         //IFV - some checking when closed flag is wrong
-         if(IsReallyClosed) {
-           TopoDS_Vertex V1, V2;
-           TopExp::Vertices(E, V1, V2);
-           if(V1.IsNull() || V2.IsNull()) {
-             IsReallyClosed = Standard_False;
-           }
-           else {
-             IsReallyClosed = V1.IsSame(V2);
-           }
-         }
-          if (IsReallyClosed &&
+          Standard_Boolean IsClosed = BRep_Tool::IsClosed(E);
+          if (IsClosed &&
               Abs(C->FirstParameter() - First) > Precision::PConfusion())
-            IsReallyClosed = Standard_False; //trimmed curve differs
+            IsClosed = Standard_False; //trimmed curve differs
 
-         if ((ii>1) || !IsReallyClosed ) { // Trim C
+         if ((ii>1) || !IsClosed ) { // Trim C
            Handle(Geom_TrimmedCurve) TC = new Geom_TrimmedCurve(C,First, Last);
            C = TC;
          }
index 1ff393d4040a3c684e807ca6609419ad1de08ab5..3b72a6ff6b3db7def9f58f3ea69588b5b79fbd9d 100644 (file)
@@ -361,15 +361,9 @@ Standard_Boolean  BRepLib::BuildCurve3d(const TopoDS_Edge& AnEdge,
     Standard_Real First, Last;
 
     BRep_Builder B;
-    Standard_Boolean is_closed ;
-    is_closed = AnEdge.Closed() ;
-
     B.UpdateEdge(AnEdge,C3d,LocalLoc,0.0e0);
     BRep_Tool::Range(AnEdge, S, LC, First, Last);
     B.Range(AnEdge, First, Last); //Do not forget 3D range.(PRO6412)
-    TopoDS_Edge E = AnEdge ;
-    E.Closed(is_closed) ;
-
   }
   else {
     //
@@ -430,14 +424,10 @@ Standard_Boolean  BRepLib::BuildCurve3d(const TopoDS_Edge& AnEdge,
       max_deviation = Max( tolerance, Tolerance );
       if (NewCurvePtr.IsNull())
         return Standard_False;
-      Standard_Boolean is_closed ;
-      is_closed = AnEdge.Closed() ;
       B.UpdateEdge(TopoDS::Edge(AnEdge),
         NewCurvePtr,
         L[0],
         max_deviation) ;
-      TopoDS_Edge  E = AnEdge ;
-      E.Closed(is_closed) ;
       if (jj == 1 ) {
         //
         // if there is only one curve on surface attached to the edge
index 3e4a82d70c83356b5d4cd591cf069487c3ac08f9..c0de4f9b7fa70e4af33c55cc16ad90a0e901acf7 100644 (file)
@@ -279,7 +279,6 @@ void  BRepLib_MakeWire::Add(const TopoDS_Edge& E)
        // copy the edge
        TopoDS_Shape Dummy = EE.EmptyCopied();
        myEdge = TopoDS::Edge(Dummy);
-       myEdge.Closed(EE.Closed());
        
        for (it.Initialize(EE); it.More(); it.Next()) {
 
index 8bafda8e4e384f775ae70bf8d03e82b6d91df060..35a595b73ba77c680736653d7c8a10b86e92e89e 100644 (file)
@@ -97,7 +97,6 @@ void  BRepLib_MakeWire::Add(const TopTools_ListOfShape& L)
          TopoDS_Edge newEd=TopoDS::Edge(aLocalShape);
 //       TopoDS_Edge newEd=TopoDS::Edge(curEd.EmptyCopied());
          BB.Transfert(curEd, newEd);
-         newEd.Closed(curEd.Closed());
          TopTools_ListIteratorOfListOfShape itV(nlist);
          for (; itV.More(); itV.Next()) {
            BB.Add(newEd, itV.Value());
index e3eda2d5c3b2b4751775ced573bd77c69f01105e..7e734e0555b68a722ac45d3a0b84f3974a3418ab 100644 (file)
@@ -179,43 +179,6 @@ static void UpdateEdge (const TopoDS_Edge& E,
   B.UpdateEdge(E,NC1,NC2,F,Tol);
 }
 
-//=======================================================================
-//function : Range3d
-//purpose  : Set the range only on the 3d curve 
-//           waitint that BRep_Builder does it !!
-//=======================================================================
-
-static void Range3d (const TopoDS_Edge&  E, 
-                    const Standard_Real First, 
-                    const Standard_Real Last) 
-{
-  //  set the range to all the representations
-  const Handle(BRep_TEdge)& TE = *((Handle(BRep_TEdge)*) &E.TShape());
-  
-  BRep_ListOfCurveRepresentation& lcr = TE->ChangeCurves();
-  BRep_ListIteratorOfListOfCurveRepresentation itcr(lcr);
-  Handle(BRep_GCurve) GC;
-  
-  while (itcr.More()) {
-    GC = Handle(BRep_GCurve)::DownCast(itcr.Value());
-    if (!GC.IsNull()) {
-      if (GC->IsCurve3D()) {
-       GC->SetRange(First,Last);
-       // Set the closedness flag to the correct value.
-       Handle(Geom_Curve) C = GC->Curve3D();
-       if ( !C.IsNull() ) {
-         Standard_Boolean closed = 
-           C->Value(First).IsEqual(C->Value(Last),BRep_Tool::Tolerance(E));
-         TE->Closed(closed);
-       }
-      }
-    }
-    itcr.Next();
-  }
-
-  TE->Modified(Standard_True);
-}
-
 
 //=======================================================================
 //function : ComputeCurve3d
@@ -1165,12 +1128,11 @@ void BRepOffset_Offset::Init(const TopoDS_Edge&     Path,
 
   // mise a same range de la nouvelle pcurve.
   if ( !C1is3D && !C1Denerated)
-  myBuilder.SameRange    (Edge1,Standard_False);
-  if ( !C1is3D && !C1Denerated) 
-    Range3d(Edge1,U1,U2);
-  myBuilder.Range       (Edge1,myFace,U1,U2); 
-    Range3d(Edge1,U1,U2);
-  myBuilder.Range       (Edge1,myFace,U1,U2);
+  {
+    myBuilder.SameRange    (Edge1,Standard_False);
+    myBuilder.Range(Edge1,U1,U2, Standard_True);
+  }
+  myBuilder.Range(Edge1,myFace,U1,U2);
   BRepLib::SameRange(Edge1);
   
   // mise a sameparameter pour les KPart
@@ -1206,7 +1168,8 @@ void BRepOffset_Offset::Init(const TopoDS_Edge&     Path,
 
   // mise a same range de la nouvelle pcurve.
   myBuilder.SameRange    (Edge2,Standard_False);
-  if ( !C2is3D && !C2Denerated) Range3d(Edge2,U1,U2);
+  if ( !C2is3D && !C2Denerated)
+    myBuilder.Range(Edge2, U1, U2, Standard_True);
   myBuilder.Range(Edge2,myFace,U1,U2);
   BRepLib::SameRange(Edge2);
   
index be62e61abad83accc54820154156e341f23f3fd6..db5178fca00fe2b273064d7abe88f502957cf8df 100644 (file)
@@ -317,7 +317,6 @@ void BRepOffsetAPI_ThruSections::AddVertex(const TopoDS_Vertex& aVertex)
   BB.Add( DegEdge, aVertex.Oriented(TopAbs_FORWARD) );
   BB.Add( DegEdge, aVertex.Oriented(TopAbs_REVERSED) );
   BB.Degenerated( DegEdge, Standard_True );
-  DegEdge.Closed( Standard_True );
 
   TopoDS_Wire DegWire;
   BB.MakeWire( DegWire );
index beab8514db2b952c2819aff804bed19682a678d9..aa2eb0a8abd0306ef36445b9480b5c457c8eb166 100644 (file)
@@ -210,7 +210,6 @@ void BRepPrim_Builder::AddEdgeVertex (TopoDS_Edge& E,
   VV.Orientation(TopAbs_REVERSED);
   myBuilder.Add(E,VV);
   myBuilder.Range(E,P1,P2);
-  E.Closed(Standard_True);
 }
 
 //=======================================================================
@@ -280,6 +279,7 @@ void  BRepPrim_Builder::CompleteEdge(TopoDS_Edge& E)const
 
 void  BRepPrim_Builder::CompleteWire(TopoDS_Wire& W)const 
 {
+  W.Closed(BRep_Tool::IsClosed(W));
   BRepTools::Update(W);
 }
 
@@ -302,5 +302,6 @@ void  BRepPrim_Builder::CompleteFace(TopoDS_Face& F)const
 
 void  BRepPrim_Builder::CompleteShell(TopoDS_Shell& S)const 
 {
+  S.Closed(BRep_Tool::IsClosed(S));
   BRepTools::Update(S);
 }
index 3a6e0c10200804642d2cbe63c107148dcd7921c0..6f97b32113c03de0cf45bc87141bc9f382a82bad 100644 (file)
@@ -52,7 +52,6 @@ void BRepPrimAPI_MakeOneAxis::Build()
   BRep_Builder B;
   B.MakeSolid(TopoDS::Solid(myShape));
   B.Add(myShape,((BRepPrim_OneAxis*) OneAxis())->Shell());
-  myShape.Closed(Standard_True);
   Done();
 }
 
index 34dc6decd955babd7442f4096f312d749b820f8e..65422dc73fa3cca05a9a74a2eb40644c8fd8dfbe 100644 (file)
@@ -119,7 +119,6 @@ void BRepPrimAPI_MakeWedge::Build()
   BRep_Builder B;
   B.MakeSolid(TopoDS::Solid(myShape));
   B.Add(myShape,myWedge.Shell());
-  myShape.Closed(Standard_True);
   Done();
 }
 
index 0edfa6bffd2f1d4f1095fce1c57847dbbe9bd898..c56a0e61f61374cf924795557cabae3502b170d6 100644 (file)
@@ -260,7 +260,7 @@ BRepProj_Projection::BRepProj_Projection (const TopoDS_Shape& Wire,
   BB.Add( DegEdge, aVertex.Oriented(TopAbs_FORWARD) );
   BB.Add( DegEdge, aVertex.Oriented(TopAbs_REVERSED) );
   BB.Degenerated( DegEdge, Standard_True );
-  DegEdge.Closed( Standard_True );
+
   TopoDS_Wire DegWire;
   BB.MakeWire( DegWire );
   BB.Add( DegWire, DegEdge );
index 21c5c3048958fec50288a2448ffcc3dc5d883e1b..7a9d71a1a909e33a697503c096960fb79d275b5f 100644 (file)
@@ -256,6 +256,7 @@ TopoDS_Shape BRepSweep_NumLinearRegularSweep::Shape (const TopoDS_Shape& aGenS,
                TopoDS_Shape wi;
                myBuilder.MakeWire(wi);
                myBuilder.Add(wi,newShape,Or);
+               wi.Closed(BRep_Tool::IsClosed(wi));
                WireSeq.Append(wi);
              }
              else{
@@ -328,6 +329,7 @@ TopoDS_Shape BRepSweep_NumLinearRegularSweep::Shape (const TopoDS_Shape& aGenS,
          }
        }
        else{
+         newWire.Closed(BRep_Tool::IsClosed(newWire));
          myBuilder.Add(myShapes(iGenS,iDirS),newWire);
        }
        myBuiltShapes(iGenS,iDirS) = Standard_True;
@@ -393,7 +395,10 @@ TopoDS_Shape BRepSweep_NumLinearRegularSweep::Shape (const TopoDS_Shape& aGenS,
     }
     myBuiltShapes(iGenS,iDirS) = Standard_True;
   }
-  myShapes(iGenS,iDirS).Closed (BRep_Tool::IsClosed (myShapes(iGenS,iDirS)));
+  // Change the "Closed" flag only for Wires and Shells
+  if (myShapes(iGenS, iDirS).ShapeType() == TopAbs_WIRE ||
+      myShapes(iGenS, iDirS).ShapeType() == TopAbs_SHELL)
+    myShapes(iGenS,iDirS).Closed (BRep_Tool::IsClosed (myShapes(iGenS,iDirS)));
   return myShapes(iGenS,iDirS);
 }
 
index 99dcfffa5675af953f2a1a42be92349284e63ae6..b0d01d3d4237b9743d209cd5fda47a21d941f077 100644 (file)
@@ -201,14 +201,7 @@ TopoDS_Shape  BRepSweep_Rotation::MakeEmptyDirectingEdge
     Handle(Geom_Circle) GC = new Geom_Circle(Axis,O.Distance(P));
     Standard_Real tol = BRep_Tool::Tolerance(TopoDS::Vertex(aGenV));
     myBuilder.Builder().MakeEdge(E, GC, tol);
-
-    gp_Pnt PLast = GC->Value(myAng);
-    if(PLast.SquareDistance(P) > tol*tol) E.Closed(Standard_False);
-
   }
-
-    
-
   return E;
 }
 
index 77fadbad9b7d640175ad59255a2e8116fc740194..3ca3db4e1c6da3543d1bb4c43bb6c8016f058457 100644 (file)
@@ -375,10 +375,7 @@ TopoDS_Shape BRepTools_ReShape::Apply (const TopoDS_Shape& shape,
     if ( (modif < 0 && buildmode < 2) || (modif == 0 && buildmode < 1) )
       return C;
     else
-    {
-      S.Closed (BRep_Tool::IsClosed (S));
       return S;
-    }
   }
 
   if (st == TopAbs_SHELL) {
@@ -542,17 +539,17 @@ TopoDS_Shape BRepTools_ReShape::Apply (const TopoDS_Shape& shape,
     //BRepTools_Edge sbe;
     CopyRanges ( TopoDS::Edge ( result ), TopoDS::Edge ( shape ),0,1 );
   }
-
-  if (st == TopAbs_FACE)  {
+  else if (st == TopAbs_FACE)  {
     TopoDS_Face face = TopoDS::Face ( shape );
     if( BRep_Tool::NaturalRestriction( face ) ) {
       BRep_Builder aB;
       aB.NaturalRestriction( TopoDS::Face (  result ), Standard_True );
     }
   }
+  else if (st == TopAbs_WIRE || st == TopAbs_SHELL)
+    result.Closed (BRep_Tool::IsClosed (result));
 
   result.Orientation(orien);
-  result.Closed (BRep_Tool::IsClosed (result));
   myStatus = locStatus;
   Replace ( shape, result );
 
index 376b1390a005225affc71a70150380fcf072adfa..378d078f66a738a86ac5dd942ad7fb42deb11609 100644 (file)
@@ -547,9 +547,7 @@ void ChFi3d_Builder::PerformExtremity (const Handle(ChFiDS_Spine)& Spine)
        Ec = TopoDS::Edge(It.Value());
        Standard_Boolean bonedge = !BRep_Tool::Degenerated(Ec);
        if(bonedge){
-         TopoDS_Vertex v1,v2;
-         TopExp::Vertices(Ec,v1,v2);
-         Standard_Boolean eclosed = v1.IsSame(v2);
+         Standard_Boolean eclosed = BRep_Tool::IsClosed(Ec);
          Standard_Integer nboc = 0;
          for(j = 0; j <= i && bonedge; j++){ 
            if(!eclosed) bonedge = !Ec.IsSame(E[j]); 
index 5b86bffd2bed7d4b658c165e080fee6534b67f62..1fe2ad4685eb3c910692a279cb935d2e852ac75d 100644 (file)
@@ -268,7 +268,7 @@ TopoDS_Shape IGESToBRep_BRepEntity::TransferEdge
            Standard_Real dist2f = p2.Distance ( pf );
            Standard_Real dist1l = p1.Distance ( pl );
            Standard_Real dist2l = p2.Distance ( pl );
-           if ( E.Closed() || dist1f + dist2l <= dist1l + dist2f ) {
+           if ( V1.IsSame(V2) || dist1f + dist2l <= dist1l + dist2f + Precision::Confusion() ) {
              //:77 if (BRepTools::Compare(V1, Vf)) //the part 'else' only if, in fact, edge should be reversed
              V1.Orientation(TopAbs_FORWARD);
              B.Add(E,V1);
index aac49a456a4b4cd44c5642adc164564baf6288fb..721792410a665fabe312f78e7f06078bde5f1e75 100644 (file)
@@ -1233,7 +1233,9 @@ Standard_Boolean LocOpe_SplitShape::Rebuild(const TopoDS_Shape& S)
         B.Add(result,itr.Value().Oriented(orient));
       }
     }
-    result.Closed (BRep_Tool::IsClosed(result));
+    // Assign "Closed" flag for Wires and Shells only
+    if (result.ShapeType() == TopAbs_WIRE || result.ShapeType() == TopAbs_SHELL)
+      result.Closed (BRep_Tool::IsClosed(result));
     myMap(S).Append(result);
   }
   else {
index a82f68297f6328630a02414f086c15e4e741f6ec..d874d5bc16b1d21b5412a8a3e45f30565e638ffa 100644 (file)
@@ -124,8 +124,9 @@ TopoDS_Shape ShapeBuild_ReShape::Apply (const TopoDS_Shape& shape,
     ShapeBuild_Edge sbe;
     sbe.CopyRanges ( TopoDS::Edge ( result ), TopoDS::Edge ( shape ));
   }
+  else if (st == TopAbs_WIRE || st == TopAbs_SHELL)
+    result.Closed (BRep_Tool::IsClosed (result));
   result.Orientation(orient);
-  result.Closed (BRep_Tool::IsClosed (result));
   myStatus = locStatus;
   Replace ( shape, result );
 
index 231a2057cb2fd33b398bb88ac7a5ff9b81098dee..a6e4b044de6b1f1d4fc2f14f0991ba5d49f8266f 100644 (file)
@@ -314,41 +314,6 @@ static Handle(Geom2d_Curve) TranslatePCurve (const Handle(Geom_Surface)& aSurf,
   return aC2d;
 }
 
-//=======================================================================
-//static : Range3d 
-//purpose  : contournement du Range de BRep_Builder pour ne pas affecter
-//           les ranges des pcurves.
-//=======================================================================
-
-static void Range3d (const TopoDS_Edge& E, 
-                    const Standard_Real First, const Standard_Real Last,
-                    const Standard_Real myPrecision) 
-{
-  //  set the range to all the representations
-  const Handle(BRep_TEdge)& TE = *((Handle(BRep_TEdge)*) &E.TShape());
-  
-  BRep_ListOfCurveRepresentation& lcr = TE->ChangeCurves();
-  BRep_ListIteratorOfListOfCurveRepresentation itcr(lcr);
-  Handle(BRep_GCurve) GC;
-  
-  while (itcr.More()) {
-    GC = Handle(BRep_GCurve)::DownCast(itcr.Value());
-    if (!GC.IsNull()) {
-      if (GC->IsCurve3D()) {
-       GC->SetRange(First,Last);
-       // Set the closedness flag to the correct value.
-       Handle(Geom_Curve) C = GC->Curve3D();
-       if ( !C.IsNull() ) {
-         Standard_Boolean closed = C->Value(First).IsEqual(C->Value(Last),myPrecision);
-         TE->Closed(closed);
-       }
-      }
-    }
-    itcr.Next();
-  }
-
-  TE->Modified(Standard_True);
-}
 //=======================================================================
 //function : SameRange (Temp)
 //purpose  : 
@@ -585,7 +550,7 @@ Standard_Boolean ShapeFix_Edge::FixAddPCurve (const TopoDS_Edge& edge,
       Standard_Real G3dCFirst = c3d->FirstParameter();
       Standard_Real G3dCLast  = c3d->LastParameter();
       B.UpdateEdge(edge, c3d, 0.);
-      Range3d(edge, G3dCFirst, G3dCLast, 0.);
+      B.Range(edge, G3dCFirst, G3dCLast, Standard_True);
     }
   }   // end try
   catch(Standard_Failure) {
index bbe3110d357a21871cbdbc3501f7c90ea8394aad..7d1486516101fc4809455d07b28b19b01370c965 100644 (file)
@@ -432,18 +432,16 @@ Standard_Boolean ShapeFix_Solid::Perform(const Handle(Message_ProgressIndicator)
     }
       
     if(isClosed || myCreateOpenSolidMode) {
-      if(BRep_Tool::IsClosed(tmpShape)) {
-        TopoDS_Iterator itersh(tmpShape);
-        TopoDS_Shell aShell;
-        if(itersh.More() && itersh.Value().ShapeType() == TopAbs_SHELL)
-          aShell = TopoDS::Shell(itersh.Value());
-        if(!aShell.IsNull()) {
-          TopoDS_Solid aSol = SolidFromShell(aShell);
-          if(ShapeExtend::DecodeStatus(myStatus,ShapeExtend_DONE2)) {
-            SendWarning (Message_Msg ("FixAdvSolid.FixOrientation.MSG20"));// Orientaion of shell was corrected.
-            Context()->Replace(tmpShape,aSol);
-            tmpShape = aSol;
-          }
+      TopoDS_Iterator itersh(tmpShape);
+      TopoDS_Shell aShell;
+      if(itersh.More() && itersh.Value().ShapeType() == TopAbs_SHELL)
+        aShell = TopoDS::Shell(itersh.Value());
+      if(!aShell.IsNull()) {
+        TopoDS_Solid aSol = SolidFromShell(aShell);
+        if(ShapeExtend::DecodeStatus(myStatus,ShapeExtend_DONE2)) {
+          SendWarning (Message_Msg ("FixAdvSolid.FixOrientation.MSG20"));// Orientaion of shell was corrected.
+          Context()->Replace(tmpShape,aSol);
+          tmpShape = aSol;
         }
       }
       mySolid  = TopoDS::Solid(tmpShape);
index 0fa6f719c270324a659f04ebdf7de4a9d59b0501..51007d2286224adf26971ef09f1d33e484f2c795 100644 (file)
@@ -212,7 +212,8 @@ static void RecModif (const TopoDS_Shape &S,
       }
       if ( modif )
       {
-        result.Closed (BRep_Tool::IsClosed (result));
+        if (result.ShapeType() == TopAbs_WIRE || result.ShapeType() == TopAbs_SHELL)
+          result.Closed (BRep_Tool::IsClosed (result));
         res = result;
       }
     }
index 12ea362a5cb12ff7b26ee1c5e3efdbaa54909057..1b9fb6c4be4c67b090263036ade9e71e281469e8 100644 (file)
@@ -97,7 +97,8 @@ ShapeUpgrade_FaceDivideArea::ShapeUpgrade_FaceDivideArea(const TopoDS_Face& F)
   }
   if(isModified)
   {
-    aCopyRes.Closed (BRep_Tool::IsClosed (aCopyRes));
+    if (aCopyRes.ShapeType() == TopAbs_WIRE || aCopyRes.ShapeType() == TopAbs_SHELL)
+      aCopyRes.Closed (BRep_Tool::IsClosed (aCopyRes));
     Context()->Replace(aResult,aCopyRes);
   }
   myStatus |= aStatus;  
index c2ddae9fdc2d5251d21b013e0628e3cf7cad750c..9f3698f2efae4bbd33bf59b10af618f58813970f 100644 (file)
@@ -1795,7 +1795,7 @@ Standard_Integer TopOpeBRepBuild_Builder1::IsSame2d (const TopTools_SequenceOfSh
   if (!(aBAS.IsUPeriodic() || aBAS.IsVPeriodic())) return 1;
 
   //we process here only fully closed edges (Vf == Vl)
-  if(!anEdgeObj.Closed() || !anEdgeTool.Closed())
+  if(!BRep_Tool::IsClosed(anEdgeObj) || !BRep_Tool::IsClosed(anEdgeTool))
     return 1;
   
   Standard_Real f = 0., l = 0., tolpc = 0. ,  
index bf0d357d4e0a45802e041f44a0b2d752b8264ed2..b4cb1b69d547e3a0f0aed7f6b32bff4b5f13e655 100644 (file)
@@ -553,8 +553,6 @@ void TopOpeBRepBuild_Builder1::Destroy()
          Vl = TopoDS::Vertex(myDataStructure->Shape(iref));
          Vl.Orientation(TopAbs_REVERSED);
        }
-       Standard_Boolean bitclosed = Vf.IsSame(Vl);
-       aNewEdge.Closed(bitclosed);
       
        myBuildTool.AddEdgeVertex (aNewEdge, Vf);
        myBuildTool.Parameter     (aNewEdge, Vf, ParF);
@@ -841,9 +839,6 @@ void TopOpeBRepBuild_Builder1::Destroy()
     // Make new edge from EdgeF
     TopoDS_Edge aNewEdge;
     myBuildTool.CopyEdge (EdgeF, aNewEdge);
-    
-    Standard_Boolean bitclosed = aV1.IsSame(aV2);
-    aNewEdge.Closed(bitclosed);
 
     myBuildTool.AddEdgeVertex (aNewEdge, aV1);
     myBuildTool.Parameter     (aNewEdge, aV1, aPar1);
index 6eb13c1a2eea133be983ac0adc00274874dc8c75..086b93b6d55f7ae948793ad91bff61c548f210b8 100644 (file)
@@ -152,7 +152,6 @@ Standard_Integer TopOpeBRepBuild_Builder1::CorrectResult2d(TopoDS_Shape& aResult
     aShell.Closed (BRep_Tool::IsClosed(aShell));
     BB.Add (aSolid, aShell);
   }
-  aSolid.Closed (BRep_Tool::IsClosed(aSolid));
   aResult=aSolid;
 
   //update section curves 
index c4d86d3494682b85ab8e5ba86c0e1da74b90b603..64d2070c670ec666933a244d137660d3e7509436 100644 (file)
@@ -145,7 +145,7 @@ Standard_Integer FUN_AnalyzemapVon1E(const TopTools_IndexedDataMapOfShapeShape&
   }
   else if (nV == 1) {
     const TopoDS_Shape& E = mapVon1E.FindFromIndex(1);
-    Standard_Boolean Eclosed = E.Closed();
+    Standard_Boolean Eclosed = BRep_Tool::IsClosed(E);
     Standard_Boolean dgE = BRep_Tool::Degenerated(TopoDS::Edge(E));
     if      (dgE)     res = ISVERTEX;
     else if (Eclosed) res = CLOSEDW;
@@ -319,7 +319,7 @@ void TopOpeBRepBuild_FaceBuilder::DetectUnclosedWire(TopTools_IndexedDataMapOfSh
             {
               const TopoDS_Edge &E = TopoDS::Edge (itE.Value());
               Standard_Integer I = myBlockBuilder.Element(E);
-              if (!E.Closed() && myBlockBuilder.ElementIsValid(I))
+              if (!BRep_Tool::IsClosed(E) && myBlockBuilder.ElementIsValid(I))
               {
                 TopoDS_Vertex Vf,Vl;
                 TopExp::Vertices (E, Vf, Vl);
index 58ad7d8474539c08bf0bb2b0f9a1fa0b9329cce9..2a963cc45e545d98b8c6228ae1750d11b3c38eea 100644 (file)
@@ -150,11 +150,6 @@ void TopOpeBRepBuild_Builder::GEDBUMakeEdges
     } // EDBUloop.InitVertex :  on vertices of new edge newEdge
     
     Standard_Boolean addedge = (nVF == 1 && nVR == 1);
-    Standard_Boolean bitclosed = Standard_False;
-    if (nVF == 1 && nVR == 1) {
-      bitclosed = VF.IsSame(VR);
-      newEdge.Closed(bitclosed);
-    }
     if (addedge) {
       if (tosplit) {
        TopTools_ListOfShape loe; Standard_Boolean ok = TopOpeBRepTool_TOOL::SplitE(TopoDS::Edge(newEdge),loe);
index b177a6b629c007215c24379dc08b75f817b353ae..391b16197faadca1d4412c830e0844c1b5018ef8 100644 (file)
@@ -34,7 +34,7 @@ deferred class TShape from TopoDS inherits TShared from MMgt
        --           - Modified   : Has been modified.
        --           - Checked    : Has been checked.
        --           - Orientable : Can be oriented.
-       --           - Closed     : Is closed.
+       --           - Closed     : Is closed (note that only Wires and Shells may be closed).
        --           - Infinite   : Is infinite.
        --           - Convex     : Is convex.
        --       
index 7acf0ece416b80f8ecab36793555a732d69fb40a..eaf623bc4a5847258d72d618d7b56c718e2f8094 100755 (executable)
@@ -24,7 +24,7 @@ explode b f
 OCC25202 result b 1 ff1 3 ff2
 
 set info [whatis result]
-if { [regexp {Closed} ${info}] } {
+if { [regexp {Closed} ${info}] != 1 } {
     puts "OK : value of IsClosed flag is correct"
 } else {
     puts "Error : value of IsClosed flag is not correct"
index ba1cc564abd86cf2d2bf434a48840fa1269659f3..13c6ad3d241af767e8380b43ed5ddfaa8c936a28 100755 (executable)
@@ -12,7 +12,7 @@ mkface ff pp
 prism result ff 0 0 20
 
 set info [whatis result]
-if { [regexp {Closed} ${info}] } {
+if { [regexp {Closed} ${info}] != 1 } {
     puts "OK : value of IsClosed flag is correct"
 } else {
     puts "Error : value of IsClosed flag is not correct"
index 84ff55105effeca1aa4b6e25f12483a5283f7726..25caf8894f963f3aed1c97b3b39b0eda75e0bd82 100755 (executable)
@@ -13,7 +13,7 @@ mkplane ff ww
 revol result ff 0 0 0 1 0 0 90
 
 set info [whatis result]
-if { [regexp {Closed} ${info}] } {
+if { [regexp {Closed} ${info}] != 1 } {
     puts "OK : value of IsClosed flag is correct"
 } else {
     puts "Error : value of IsClosed flag is not correct"