]> OCCT Git - occt-copy.git/commitdiff
0023303: Expression always true in ShapeFix_Face.cxx
authorPawel <pawel-kowalski@wp.pl>
Tue, 17 Jul 2012 12:43:45 +0000 (14:43 +0200)
committerPawel Kowalski <pawel-kowalski@wp.pl>
Fri, 20 Jul 2012 12:07:15 +0000 (16:07 +0400)
The two corrected if-clause conditions were always true.

In FixSmallAreaWire where the documentation says: "Detects wires with small area (that is less than 100*Precision::PConfusion(). Removes these wires if they are internal." and the bugfix conforms to this.

For 'NeedCheckSplitWire' option in the Perform method the same assumption is made although no documentation on this could be found.

src/ShapeFix/ShapeFix_Face.cxx

index 313300c10121b90e7f32bfb6d25c7d87faf2869f..70274608d7535fa8864de081cf9f2d6a6cf471df 100755 (executable)
@@ -588,7 +588,7 @@ Standard_Boolean ShapeFix_Face::Perform()
           B.Add (tmpFace,iter.Value());
           continue;
         }
-        if(iter.Value().Orientation() != TopAbs_FORWARD || 
+        if(iter.Value().Orientation() != TopAbs_FORWARD && 
            iter.Value().Orientation() != TopAbs_REVERSED) {
           B.Add (tmpFace,TopoDS::Wire(iter.Value()));
           continue;
@@ -1701,7 +1701,7 @@ Standard_Boolean ShapeFix_Face::FixSmallAreaWire()
   Standard_Real prec = ::Precision::PConfusion()*100;
   for (TopoDS_Iterator wi (myFace, Standard_False); wi.More(); wi.Next()) {
     if(wi.Value().ShapeType() != TopAbs_WIRE && 
-       (wi.Value().Orientation() != TopAbs_FORWARD || wi.Value().Orientation() != TopAbs_REVERSED))
+       (wi.Value().Orientation() != TopAbs_FORWARD && wi.Value().Orientation() != TopAbs_REVERSED))
         continue;
     TopoDS_Wire wire = TopoDS::Wire ( wi.Value() );
     Handle(ShapeAnalysis_Wire) saw = new ShapeAnalysis_Wire(wire,myFace,prec);