// commercial license or contractual agreement.
#include <BRep_Tool.hxx>
+#include <TopTools_MapOfShape.hxx>
+#include <Geom2d_Line.hxx>
+#include <TopExp_Explorer.hxx>
+#include <TopoDS.hxx>
+#include <Precision.hxx>
+#include <TopoDS_Edge.hxx>
//=======================================================================
//function : BRepGProp_Face
inline Standard_Boolean BRepGProp_Face::NaturalRestriction() const
{
- return BRep_Tool::NaturalRestriction(mySurface.Face());
+ const TopoDS_Face& aF = mySurface.Face();
+ TopoDS_Iterator anItW(aF);
+
+ TopLoc_Location aL;
+ Handle(Geom_Surface) aS = BRep_Tool::Surface(aF, aL);
+ Standard_Real aUm = 0.0, aUM = 0.0, aVm = 0.0, aVM = 0.0;
+ aS->Bounds(aUm, aUM, aVm, aVM);
+
+ if ((Precision::IsInfinite(aUm) || Precision::IsInfinite(aUM) ||
+ Precision::IsInfinite(aVm) || Precision::IsInfinite(aVM)) && anItW.More())
+ {
+ return Standard_False;
+ }
+
+ return BRep_Tool::NaturalRestriction(aF);
}
//=======================================================================
--- /dev/null
+puts "=========="
+puts "OCC26607"
+puts "=========="
+puts ""
+###########################################
+# Wrong value of area.
+###########################################
+
+box b1 10 10 10
+box b2 20 0 0 10 10 10
+explode b1 f
+explode b2 f
+explode b1_5
+explode b2_5
+
+mksurface s b1_5
+mkface fs s
+add b1_5_1 fs
+add b2_5_1 fs
+
+checkarea fs -200 1e-06 0.01
--- /dev/null
+puts "========"
+puts "OCC28585"
+puts "========"
+puts ""
+#################################################
+# Wrong value of area computation
+#################################################
+
+# The face in Steps To Reproduce is based on infinite planar surface.
+# If we convert this surface to trimmed planar surface then
+# the area of obtained face will be significantly different from source one.
+
+restore [locate_data_file bug28585_planarface.brep] result
+
+smallview
+donly result
+fit
+
+xwd ${imagedir}/${test_image}.png
+
+set square 253.417
\ No newline at end of file