diff --git a/src/BRepMesh/BRepMesh_ExtrusionRangeSplitter.cxx b/src/BRepMesh/BRepMesh_ExtrusionRangeSplitter.cxx new file mode 100644 index 0000000000..e83693654a --- /dev/null +++ b/src/BRepMesh/BRepMesh_ExtrusionRangeSplitter.cxx @@ -0,0 +1,45 @@ +// Created on: 2022-09-07 +// Copyright (c) 2022 OPEN CASCADE SAS +// Created by: Oleg AGASHIN +// +// This file is part of Open CASCADE Technology software library. +// +// This library is free software; you can redistribute it and/or modify it under +// the terms of the GNU Lesser General Public License version 2.1 as published +// by the Free Software Foundation, with special exception defined in the file +// OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT +// distribution for complete text of the license and disclaimer of any warranty. +// +// Alternatively, this file may be used under the terms of Open CASCADE +// commercial license or contractual agreement. + +#include <BRepMesh_ExtrusionRangeSplitter.hxx> + +//======================================================================= +// Function: getUndefinedIntervalNb +// Purpose : +//======================================================================= +Standard_Integer BRepMesh_ExtrusionRangeSplitter::getUndefinedIntervalNb( + const Handle(Adaptor3d_Surface)& theSurface, + const Standard_Boolean /*isU*/, + const GeomAbs_Shape theContinuity) const +{ + // Here we need just a regular grid along dimension with no + // geometrical data regarding intervals like extrusion surface. + const Handle(Adaptor3d_Curve) aCurve = theSurface->BasisCurve(); + Standard_Integer aIntervalsNb = aCurve->NbIntervals(theContinuity); + if (aIntervalsNb == 1) + { + const GeomAbs_CurveType aCurveType = aCurve->GetType(); + const Standard_Boolean isBSplineCurve = + aCurveType == GeomAbs_BezierCurve || + aCurveType == GeomAbs_BSplineCurve; + + if (isBSplineCurve) + { + aIntervalsNb = aCurve->NbPoles() - 1; + } + } + + return aIntervalsNb; +} diff --git a/src/BRepMesh/BRepMesh_ExtrusionRangeSplitter.hxx b/src/BRepMesh/BRepMesh_ExtrusionRangeSplitter.hxx new file mode 100644 index 0000000000..c1fda20d0a --- /dev/null +++ b/src/BRepMesh/BRepMesh_ExtrusionRangeSplitter.hxx @@ -0,0 +1,45 @@ +// Created on: 2022-09-07 +// Copyright (c) 2022 OPEN CASCADE SAS +// Created by: Oleg AGASHIN +// +// This file is part of Open CASCADE Technology software library. +// +// This library is free software; you can redistribute it and/or modify it under +// the terms of the GNU Lesser General Public License version 2.1 as published +// by the Free Software Foundation, with special exception defined in the file +// OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT +// distribution for complete text of the license and disclaimer of any warranty. +// +// Alternatively, this file may be used under the terms of Open CASCADE +// commercial license or contractual agreement. + +#ifndef _BRepMesh_ExtrusionRangeSplitter_HeaderFile +#define _BRepMesh_ExtrusionRangeSplitter_HeaderFile + +#include <BRepMesh_NURBSRangeSplitter.hxx> + +//! Auxiliary class analysing extrusion surface in order to generate internal nodes. +class BRepMesh_ExtrusionRangeSplitter : public BRepMesh_NURBSRangeSplitter +{ +public: + + //! Constructor. + BRepMesh_ExtrusionRangeSplitter() + { + } + + //! Destructor. + virtual ~BRepMesh_ExtrusionRangeSplitter() + { + } + +protected: + + //! Returns number of intervals computed using available geometrical parameters. + Standard_EXPORT virtual Standard_Integer getUndefinedIntervalNb( + const Handle(Adaptor3d_Surface)& theSurface, + const Standard_Boolean isU, + const GeomAbs_Shape theContinuity) const Standard_OVERRIDE; +}; + +#endif diff --git a/src/BRepMesh/BRepMesh_MeshAlgoFactory.cxx b/src/BRepMesh/BRepMesh_MeshAlgoFactory.cxx index 00fd9f9556..ce7cb6fba9 100644 --- a/src/BRepMesh/BRepMesh_MeshAlgoFactory.cxx +++ b/src/BRepMesh/BRepMesh_MeshAlgoFactory.cxx @@ -21,6 +21,8 @@ #include <BRepMesh_DelaunayBaseMeshAlgo.hxx> #include <BRepMesh_DelaunayDeflectionControlMeshAlgo.hxx> #include <BRepMesh_BoundaryParamsRangeSplitter.hxx> +#include <BRepMesh_ExtrusionRangeSplitter.hxx> +#include <BRepMesh_UndefinedRangeSplitter.hxx> IMPLEMENT_STANDARD_RTTIEXT(BRepMesh_MeshAlgoFactory, IMeshTools_MeshAlgoFactory) @@ -98,7 +100,18 @@ Handle(IMeshTools_MeshAlgo) BRepMesh_MeshAlgoFactory::GetAlgo( return new DeflectionControlMeshAlgo<BRepMesh_BoundaryParamsRangeSplitter>::Type; break; - default: + case GeomAbs_SurfaceOfExtrusion: + return new DeflectionControlMeshAlgo<BRepMesh_ExtrusionRangeSplitter>::Type; + break; + + case GeomAbs_BezierSurface: + case GeomAbs_BSplineSurface: return new DeflectionControlMeshAlgo<BRepMesh_NURBSRangeSplitter>::Type; + break; + + case GeomAbs_OffsetSurface: + case GeomAbs_OtherSurface: + default: + return new DeflectionControlMeshAlgo<BRepMesh_UndefinedRangeSplitter>::Type; } } diff --git a/src/BRepMesh/BRepMesh_NURBSRangeSplitter.cxx b/src/BRepMesh/BRepMesh_NURBSRangeSplitter.cxx index 7b0bdb67ad..186eca8059 100644 --- a/src/BRepMesh/BRepMesh_NURBSRangeSplitter.cxx +++ b/src/BRepMesh/BRepMesh_NURBSRangeSplitter.cxx @@ -392,27 +392,73 @@ Handle(IMeshData::ListOfPnt2d) BRepMesh_NURBSRangeSplitter::GenerateSurfaceNodes return aNodes; } +//======================================================================= +// Function: getUndefinedIntervalNb +// Purpose : +//======================================================================= +Standard_Integer BRepMesh_NURBSRangeSplitter::getUndefinedIntervalNb( + const Handle(Adaptor3d_Surface)& theSurface, + const Standard_Boolean isU, + const GeomAbs_Shape /*theContinuity*/) const +{ + return (isU ? theSurface->NbUPoles() : theSurface->NbVPoles()) - 1; +} + +//======================================================================= +// Function: getUndefinedInterval +// Purpose : +//======================================================================= +void BRepMesh_NURBSRangeSplitter::getUndefinedInterval( + const Handle(Adaptor3d_Surface)& theSurface, + const Standard_Boolean isU, + const GeomAbs_Shape theContinuity, + const std::pair<Standard_Real, Standard_Real>& theRange, + TColStd_Array1OfReal& theIntervals) const +{ + Standard_Integer aIntervalsNb = isU ? + theSurface->NbUIntervals(theContinuity) : + theSurface->NbVIntervals(theContinuity); + + if (aIntervalsNb == 1) + { + aIntervalsNb = getUndefinedIntervalNb(theSurface, isU, theContinuity); + if (aIntervalsNb > 1) + { + theIntervals = TColStd_Array1OfReal(1, aIntervalsNb - 1); + const Standard_Real aDiff = (theRange.second - theRange.first) / aIntervalsNb; + for (Standard_Integer i = theIntervals.Lower(); i <= theIntervals.Upper(); ++i) + { + theIntervals.SetValue(i, theRange.first + i * aDiff); + } + } + } + + if (theIntervals.IsEmpty()) + { + theIntervals = TColStd_Array1OfReal(1, aIntervalsNb + 1); + if (isU) + { + theSurface->UIntervals(theIntervals, theContinuity); + } + else + { + theSurface->VIntervals(theIntervals, theContinuity); + } + } +} + //======================================================================= // Function: initParameters // Purpose : //======================================================================= Standard_Boolean BRepMesh_NURBSRangeSplitter::initParameters() const { + const GeomAbs_Shape aContinuity = GeomAbs_CN; const Handle(BRepAdaptor_Surface)& aSurface = GetSurface(); - const GeomAbs_Shape aContinuity = GeomAbs_CN; - const std::pair<Standard_Integer, Standard_Integer> aIntervalsNb( - aSurface->NbUIntervals(aContinuity), - aSurface->NbVIntervals(aContinuity) - ); - - TColStd_Array1OfReal aIntervals[2] = { - TColStd_Array1OfReal(1, aIntervalsNb.first + 1), - TColStd_Array1OfReal(1, aIntervalsNb.second + 1) - }; - - aSurface->UIntervals(aIntervals[0], aContinuity); - aSurface->VIntervals(aIntervals[1], aContinuity); + TColStd_Array1OfReal aIntervals[2]; + getUndefinedInterval(aSurface, Standard_True, aContinuity, GetRangeU(), aIntervals[0]); + getUndefinedInterval(aSurface, Standard_False, aContinuity, GetRangeV(), aIntervals[1]); const Standard_Boolean isSplitIntervals = toSplitIntervals (aSurface->Surface().Surface(), aIntervals); diff --git a/src/BRepMesh/BRepMesh_NURBSRangeSplitter.hxx b/src/BRepMesh/BRepMesh_NURBSRangeSplitter.hxx index 9dfc40973b..525b44a4f3 100644 --- a/src/BRepMesh/BRepMesh_NURBSRangeSplitter.hxx +++ b/src/BRepMesh/BRepMesh_NURBSRangeSplitter.hxx @@ -49,7 +49,21 @@ protected: //! Initializes U and V parameters lists using CN continuity intervals. Standard_EXPORT virtual Standard_Boolean initParameters() const; + //! Returns number of intervals computed using available geometrical parameters. + Standard_EXPORT virtual Standard_Integer getUndefinedIntervalNb( + const Handle(Adaptor3d_Surface)& theSurface, + const Standard_Boolean isU, + const GeomAbs_Shape theContinuity) const; + private: + //! Tries to compute intervals even for cases with no intervals + //! at all using available geometrical parameters. + void getUndefinedInterval( + const Handle(Adaptor3d_Surface)& theSurface, + const Standard_Boolean isU, + const GeomAbs_Shape theContinuity, + const std::pair<Standard_Real, Standard_Real>& theRange, + TColStd_Array1OfReal& theIntervals) const; //! Computes parameters of filter and applies it to the source parameters. Handle(IMeshData::SequenceOfReal) computeGrainAndFilterParameters( diff --git a/src/BRepMesh/BRepMesh_UndefinedRangeSplitter.cxx b/src/BRepMesh/BRepMesh_UndefinedRangeSplitter.cxx new file mode 100644 index 0000000000..4e0c8ab249 --- /dev/null +++ b/src/BRepMesh/BRepMesh_UndefinedRangeSplitter.cxx @@ -0,0 +1,28 @@ +// Created on: 2022-09-07 +// Copyright (c) 2022 OPEN CASCADE SAS +// Created by: Oleg AGASHIN +// +// This file is part of Open CASCADE Technology software library. +// +// This library is free software; you can redistribute it and/or modify it under +// the terms of the GNU Lesser General Public License version 2.1 as published +// by the Free Software Foundation, with special exception defined in the file +// OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT +// distribution for complete text of the license and disclaimer of any warranty. +// +// Alternatively, this file may be used under the terms of Open CASCADE +// commercial license or contractual agreement. + +#include <BRepMesh_UndefinedRangeSplitter.hxx> + +//======================================================================= +// Function: getUndefinedIntervalNb +// Purpose : +//======================================================================= +Standard_Integer BRepMesh_UndefinedRangeSplitter::getUndefinedIntervalNb( + const Handle(Adaptor3d_Surface)& /*theSurface*/, + const Standard_Boolean /*isU*/, + const GeomAbs_Shape /*theContinuity*/) const +{ + return 1; +} diff --git a/src/BRepMesh/BRepMesh_UndefinedRangeSplitter.hxx b/src/BRepMesh/BRepMesh_UndefinedRangeSplitter.hxx new file mode 100644 index 0000000000..2ca7ec01fb --- /dev/null +++ b/src/BRepMesh/BRepMesh_UndefinedRangeSplitter.hxx @@ -0,0 +1,46 @@ +// Created on: 2022-09-07 +// Copyright (c) 2022 OPEN CASCADE SAS +// Created by: Oleg AGASHIN +// +// This file is part of Open CASCADE Technology software library. +// +// This library is free software; you can redistribute it and/or modify it under +// the terms of the GNU Lesser General Public License version 2.1 as published +// by the Free Software Foundation, with special exception defined in the file +// OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT +// distribution for complete text of the license and disclaimer of any warranty. +// +// Alternatively, this file may be used under the terms of Open CASCADE +// commercial license or contractual agreement. + +#ifndef _BRepMesh_UndefinedRangeSplitter_HeaderFile +#define _BRepMesh_UndefinedRangeSplitter_HeaderFile + +#include <BRepMesh_NURBSRangeSplitter.hxx> + +//! Auxiliary class provides safe value for surfaces that looks like NURBS +//! but has no poles or other characteristics. +class BRepMesh_UndefinedRangeSplitter : public BRepMesh_NURBSRangeSplitter +{ +public: + + //! Constructor. + BRepMesh_UndefinedRangeSplitter() + { + } + + //! Destructor. + virtual ~BRepMesh_UndefinedRangeSplitter() + { + } + +protected: + + //! Returns number of intervals computed using available geometrical parameters. + Standard_EXPORT virtual Standard_Integer getUndefinedIntervalNb( + const Handle(Adaptor3d_Surface)& theSurface, + const Standard_Boolean isU, + const GeomAbs_Shape theContinuity) const Standard_OVERRIDE; +}; + +#endif diff --git a/src/BRepMesh/FILES b/src/BRepMesh/FILES index d1d2fa3511..07fbe7e0dd 100755 --- a/src/BRepMesh/FILES +++ b/src/BRepMesh/FILES @@ -40,6 +40,8 @@ BRepMesh_EdgeDiscret.hxx BRepMesh_EdgeParameterProvider.hxx BRepMesh_EdgeTessellationExtractor.cxx BRepMesh_EdgeTessellationExtractor.hxx +BRepMesh_ExtrusionRangeSplitter.cxx +BRepMesh_ExtrusionRangeSplitter.hxx BRepMesh_FaceChecker.cxx BRepMesh_FaceChecker.hxx BRepMesh_FaceDiscret.cxx @@ -80,6 +82,8 @@ BRepMesh_SphereRangeSplitter.hxx BRepMesh_TorusRangeSplitter.cxx BRepMesh_TorusRangeSplitter.hxx BRepMesh_Triangle.hxx +BRepMesh_UndefinedRangeSplitter.cxx +BRepMesh_UndefinedRangeSplitter.hxx BRepMesh_UVParamRangeSplitter.hxx BRepMesh_Vertex.hxx BRepMesh_VertexInspector.hxx diff --git a/tests/bugs/iges/buc60820_1 b/tests/bugs/iges/buc60820_1 index ff82704d2c..9abdd7c07c 100755 --- a/tests/bugs/iges/buc60820_1 +++ b/tests/bugs/iges/buc60820_1 @@ -12,5 +12,5 @@ tclean result incmesh result 0.1 triangles result -checktrinfo result -tri 638 -nod 564 +checktrinfo result -tri 736 -nod 613 checkview -display result -2d -path ${imagedir}/${test_image}.png diff --git a/tests/bugs/iges/buc60820_2 b/tests/bugs/iges/buc60820_2 index 2ceebe03c0..06cfcf9687 100755 --- a/tests/bugs/iges/buc60820_2 +++ b/tests/bugs/iges/buc60820_2 @@ -13,6 +13,6 @@ vdisplay result vsetdispmode result 1 vfit -checktrinfo result -tri 200 -nod 215 +checktrinfo result -tri 202 -nod 216 checkview -display result -2d -path ${imagedir}/${test_image}.png diff --git a/tests/bugs/iges/buc60823 b/tests/bugs/iges/buc60823 index e80b533a86..70902ee48c 100755 --- a/tests/bugs/iges/buc60823 +++ b/tests/bugs/iges/buc60823 @@ -14,6 +14,6 @@ vdisplay result vsetdispmode result 1 vfit -checktrinfo result -tri 2722 -nod 2618 +checktrinfo result -tri 3496 -nod 3005 checkview -display result -2d -path ${imagedir}/${test_image}.png diff --git a/tests/bugs/iges/bug306 b/tests/bugs/iges/bug306 index 0e844344e3..a772296c97 100755 --- a/tests/bugs/iges/bug306 +++ b/tests/bugs/iges/bug306 @@ -20,7 +20,7 @@ vsetdispmode result 1 vdisplay result vfit -checktrinfo result -tri 5812 -nod 5809 +checktrinfo result -tri 6014 -nod 5910 checkmaxtol result -ref 0.92213088179312575 checknbshapes result -shell 1 diff --git a/tests/bugs/mesh/bug23631 b/tests/bugs/mesh/bug23631 index 2c2e7bda24..d90bc34066 100644 --- a/tests/bugs/mesh/bug23631 +++ b/tests/bugs/mesh/bug23631 @@ -13,7 +13,7 @@ restore [locate_data_file OCC396_f2903.brep] result incmesh result 0.01 triangles result -checktrinfo result -tri 57 -nod 59 +checktrinfo result -tri 75 -nod 68 vinit vdisplay result diff --git a/tests/bugs/mesh/bug25287 b/tests/bugs/mesh/bug25287 index 80336f81b3..2905c18057 100644 --- a/tests/bugs/mesh/bug25287 +++ b/tests/bugs/mesh/bug25287 @@ -11,7 +11,7 @@ renamevar a_1 result incmesh result 0.0001 -a 30 -force_face_def -parallel -checktrinfo result -tri 12512 -nod 8519 -defl 0.00031502118964205414 -tol_abs_defl 1e-6 +checktrinfo result -tri 14494 -nod 9510 -defl 0.00031502118964205414 -tol_abs_defl 1e-6 vinit vsetdispmode 1 diff --git a/tests/bugs/mesh/bug27845 b/tests/bugs/mesh/bug27845 index ce91dc3ea4..6287701923 100644 --- a/tests/bugs/mesh/bug27845 +++ b/tests/bugs/mesh/bug27845 @@ -14,7 +14,7 @@ vdisplay result vfit checkview -screenshot -3d -path ${imagedir}/${test_image}.png -checktrinfo result -tri 3006 -nod 4360 -defl 3.0544822246414993 -tol_abs_defl 1e-6 +checktrinfo result -tri 3828 -nod 4771 -defl 3.0544822246414993 -tol_abs_defl 1e-6 set log [tricheck result] if { [llength $log] != 0 } { diff --git a/tests/bugs/mesh/bug29149 b/tests/bugs/mesh/bug29149 index dacd0d686c..1581ca660e 100644 --- a/tests/bugs/mesh/bug29149 +++ b/tests/bugs/mesh/bug29149 @@ -7,7 +7,7 @@ restore [locate_data_file bug29149.brep] result tclean result incmesh result 0.1 -checktrinfo result -tri 7998 -nod 4931 -defl 1.9852316024615062 -tol_abs_defl 1e-6 +checktrinfo result -tri 8972 -nod 5418 -defl 1.4639409344792007 -tol_abs_defl 1e-6 # Reduce shape tolerance in order to hard check of mesh quality settolerance result 1.0e-7 diff --git a/tests/bugs/mesh/bug29641 b/tests/bugs/mesh/bug29641 new file mode 100644 index 0000000000..f6c75ad069 --- /dev/null +++ b/tests/bugs/mesh/bug29641 @@ -0,0 +1,20 @@ +puts "========" +puts "0029641: Mesher produce 'bad' result for extruded spline with given deviation coefficient" +puts "========" +puts "" + +restore [locate_data_file bug29641.brep] result +tclean result + +vinit +vdefaults -devCoeff 0.0001 + +vsetdispmode 1 +vdisplay result +vtop +vrotate -0.1 0.1 1 0 0 0 +vfit + +checktrinfo result -tri 29040 -nod 15358 + +checkview -screenshot -3d -path ${imagedir}/${test_image}.png diff --git a/tests/bugs/mesh/bug30008_1 b/tests/bugs/mesh/bug30008_1 index 16804a4c3d..034531a702 100644 --- a/tests/bugs/mesh/bug30008_1 +++ b/tests/bugs/mesh/bug30008_1 @@ -12,6 +12,6 @@ vdisplay result vviewparams -scale 8.46292 -proj 0.653203 -0.644806 0.396926 -up -0.0109833 0.51609 0.856464 -at 347.559 1026.89 219.262 -eye 2080.75 -684.022 1272.45 tricheck result -checktrinfo result -tri 6978 -nod 4890 -defl 8.4394056682382157 -tol_abs_defl 1e-6 +checktrinfo result -tri 6996 -nod 4899 -defl 8.4394056682382157 -tol_abs_defl 1e-6 checkview -screenshot -3d -path ${imagedir}/${test_image}.png diff --git a/tests/bugs/mesh/bug30167 b/tests/bugs/mesh/bug30167 index 74edff3f44..70932914c2 100644 --- a/tests/bugs/mesh/bug30167 +++ b/tests/bugs/mesh/bug30167 @@ -12,6 +12,6 @@ vdisplay result vfit tricheck result -checktrinfo result -tri 3424 -nod 1801 -max_defl 0.55846824898476011 -tol_abs_defl 1.0e-6 +checktrinfo result -tri 2954 -nod 1566 -max_defl 0.66166700094601016 -tol_abs_defl 1.0e-6 checkview -screenshot -3d -path ${imagedir}/${test_image}.png diff --git a/tests/bugs/mesh/bug31251 b/tests/bugs/mesh/bug31251 index 923d621ba8..d1af096e35 100644 --- a/tests/bugs/mesh/bug31251 +++ b/tests/bugs/mesh/bug31251 @@ -15,7 +15,7 @@ vdefaults -autoTriang 0 tclean result incmesh result 0.004 -a 14 -checktrinfo result -tri 70556 -nod 39944 -defl 0.24607185555570676 -tol_abs_defl 1e-6 +checktrinfo result -tri 72522 -nod 40927 -defl 0.24607185555570676 -tol_abs_defl 1e-6 vdisplay result -redisplay vfit @@ -23,7 +23,7 @@ checkview -screenshot -3d -path ${imagedir}/${test_image}_default.png tclean result incmesh result 0.004 -a 14 -force_face_def -checktrinfo result -tri 292556 -nod 150944 -defl 0.16388671063364907 -tol_abs_defl 1e-6 +checktrinfo result -tri 288022 -nod 148677 -defl 0.16388671063364907 -tol_abs_defl 1e-6 vdisplay result -redisplay vfit diff --git a/tests/bugs/mesh/bug32241 b/tests/bugs/mesh/bug32241 new file mode 100644 index 0000000000..9eab9b1b25 --- /dev/null +++ b/tests/bugs/mesh/bug32241 @@ -0,0 +1,31 @@ +puts "========" +puts "0032241: Mesh - wrong shading display of thrusections" +puts "========" +puts "" + +pload MODELING VISUALIZATION + +circle c0 0 0 0 0 0 1 30 +circle c1 0 0 0 0 0 1 30 +rotate c1 2000 0 0 0 1 0 15 +circle c2 0 0 0 0 0 1 30 +rotate c2 2000 0 0 0 1 0 30 +circle c3 0 0 0 0 0 1 30 +rotate c3 2000 0 0 0 1 0 45 +circle c4 0 0 0 0 0 1 30 +rotate c4 2000 0 0 0 1 0 60 +mkedge e0 c0 +mkedge e1 c1 +mkedge e2 c2 +mkedge e3 c3 +mkedge e4 c4 +wire w0 e0 +wire w1 e1 +wire w2 e2 +wire w3 e3 +wire w4 e4 +thrusections result issolid w0 w1 w2 w3 w4 + +checkview -display result -3d -path ${imagedir}/${test_image}.png + +checktrinfo result -tri 2744 -nod 1420 diff --git a/tests/bugs/mesh/bug32422 b/tests/bugs/mesh/bug32422 new file mode 100644 index 0000000000..c6657451cd --- /dev/null +++ b/tests/bugs/mesh/bug32422 @@ -0,0 +1,32 @@ +puts "========" +puts "0032422: Mesh - Weird rendering" +puts "========" +puts "" + +pload MODELING VISUALIZATION + +pbsplinecurve sp1 3 9 0 2 73.198335334976 1 109.22594821708 1 168.29694729401 1 244.58155163942 1 307.53411471698 1 344.2978168401 1 379.98768527731 1 399.75469301329 2 77.34874687409 77.303696496535 0 1 -37.404350826922 66.469283013615 0 1 -38.129049645989 51.427809605917 0 1 45.003598352348 23.760586819334 0 1 -76.009618710498 -14.499612221562 0 1 44.396611605217 -43.851734118626 0 1 119.71153838454 27.656796734959 0 1 38.244406969565 24.98300747794 0 1 68.787902964874 60.998473938995 0 1 +mkedge eg1 sp1 +wire wr1 eg1 +mkplane fc1 wr1 +prism result fc1 0 0 100 +checkshape result + +vinit +vdisplay -dispMode 1 result +vfit + +checktrinfo result -tri 1286 -nod 863 + +explode result F +tessellate r result_1 50 50 + +vdisplay r -dispMode 1 +vaspects r -material STONE -color GREEN +vlocation r -location 0 0 -100 +vleft +vfit + +checktrinfo r -tri 5000 -nod 2601 + +checkview -screenshot -3d -path ${imagedir}/${test_image}.png diff --git a/tests/bugs/modalg_2/bug264_0 b/tests/bugs/modalg_2/bug264_0 index 3377959ff7..8816be638a 100755 --- a/tests/bugs/modalg_2/bug264_0 +++ b/tests/bugs/modalg_2/bug264_0 @@ -15,6 +15,6 @@ vclear isos result 0 triangles result -checktrinfo result -tri 10 -nod 12 +checktrinfo result -tri 14 -nod 14 checkprops result -s 1.3135 checkview -display result -3d -path ${imagedir}/${test_image}.png diff --git a/tests/bugs/modalg_2/bug292 b/tests/bugs/modalg_2/bug292 index 2060e1a3d2..dbb567ff41 100755 --- a/tests/bugs/modalg_2/bug292 +++ b/tests/bugs/modalg_2/bug292 @@ -19,6 +19,6 @@ vsetdispmode result 1 isos result 0 triangles result -checktrinfo result -tri 10 -nod 12 +checktrinfo result -tri 14 -nod 14 checkprops result -s 1.3135 checkview -display result -3d -path ${imagedir}/${test_image}.png diff --git a/tests/bugs/modalg_2/bug358 b/tests/bugs/modalg_2/bug358 index 620f147091..dc4d9f4d19 100755 --- a/tests/bugs/modalg_2/bug358 +++ b/tests/bugs/modalg_2/bug358 @@ -6,6 +6,14 @@ puts "========================" puts "The helical pipe is not shaded in AISViewer" ##### +if { [regexp {Windows} [dversion]] } { + set tri_n 19922 + set nod_n 10395 +} else { + set tri_n 19882 + set nod_n 10375 +} + restore [locate_data_file OCC358a.brep] f checkshape f @@ -19,7 +27,7 @@ vdisplay result vfit vsetdispmode result 1 -checktrinfo result -tri 21654 -nod 11261 +checktrinfo result -tri $tri_n -nod $nod_n checkprops result -s 24861.2 checkshape result checkview -display result -2d -path ${imagedir}/${test_image}.png diff --git a/tests/bugs/moddata_1/bug15519 b/tests/bugs/moddata_1/bug15519 index 4474ff3231..d7ade0deef 100755 --- a/tests/bugs/moddata_1/bug15519 +++ b/tests/bugs/moddata_1/bug15519 @@ -14,5 +14,5 @@ tclean result set Deflection 1. catch {incmesh result ${Deflection} } -checktrinfo result -tri 52956 -nod 46525 -defl 1.2592398118022043 -tol_rel_defl 0.001 -tol_rel_tri 0.001 -tol_rel_nod 0.001 +checktrinfo result -tri 59881 -nod 49987 -defl 1.6213275001104823 -tol_rel_defl 0.001 -tol_rel_tri 0.001 -tol_rel_nod 0.001 checkview -display result -2d -path ${imagedir}/${test_image}.png diff --git a/tests/bugs/moddata_1/bug22759 b/tests/bugs/moddata_1/bug22759 index e4f4976193..e3d701b477 100755 --- a/tests/bugs/moddata_1/bug22759 +++ b/tests/bugs/moddata_1/bug22759 @@ -19,7 +19,7 @@ tclean result set Deflection 0.001 incmesh result ${Deflection} -checktrinfo result -tri 375392 -nod 190670 -defl 0.080199363667810539 -tol_rel_defl 0.001 -tol_rel_tri 0.001 -tol_rel_nod 0.001 +checktrinfo result -tri 326712 -nod 166330 -defl 0.080199363667810539 -tol_rel_defl 0.001 -tol_rel_tri 0.001 -tol_rel_nod 0.001 vinit vdisplay result diff --git a/tests/bugs/moddata_2/bug428 b/tests/bugs/moddata_2/bug428 index 559d0ddb6f..db0bba7e45 100755 --- a/tests/bugs/moddata_2/bug428 +++ b/tests/bugs/moddata_2/bug428 @@ -19,5 +19,5 @@ isos result 0 triangles result fit -checktrinfo result -tri 7863 -nod 6342 +checktrinfo result -tri 7769 -nod 6295 checkview -screenshot -2d -path ${imagedir}/${test_image}_axo.png diff --git a/tests/de_mesh/shape_write_stl/A11 b/tests/de_mesh/shape_write_stl/A11 index 0761581555..3cfd7b57ed 100644 --- a/tests/de_mesh/shape_write_stl/A11 +++ b/tests/de_mesh/shape_write_stl/A11 @@ -9,7 +9,7 @@ writestl m $imagedir/${casename} readstl res $imagedir/${casename} file delete $imagedir/${casename} -checktrinfo res -tri 58 -nod 31 +checktrinfo res -tri 60 -nod 32 # Visual check checkview -display res -2d -path ${imagedir}/${test_image}.png diff --git a/tests/de_mesh/shape_write_stl/A4 b/tests/de_mesh/shape_write_stl/A4 index 80520051a3..706db284cd 100644 --- a/tests/de_mesh/shape_write_stl/A4 +++ b/tests/de_mesh/shape_write_stl/A4 @@ -9,7 +9,7 @@ writestl m $imagedir/${casename} readstl res $imagedir/${casename} file delete $imagedir/${casename} -checktrinfo res -tri 106 -nod 55 +checktrinfo res -tri 110 -nod 57 # Visual check checkview -display res -2d -path ${imagedir}/${test_image}.png diff --git a/tests/hlr/poly_hlr/C12 b/tests/hlr/poly_hlr/C12 index 3495b2dafc..69baa1a86d 100644 --- a/tests/hlr/poly_hlr/C12 +++ b/tests/hlr/poly_hlr/C12 @@ -1,5 +1,5 @@ set viewname "vright" -set length 514.884 +set length 516.649 testreadstep [locate_data_file bug27341_Adapter_Zylinder_2_CAD.stp] a COMPUTE_HLR $viewname $algotype diff --git a/tests/hlr/poly_hlr/C14 b/tests/hlr/poly_hlr/C14 index 5fde7169f6..7d32bbf757 100644 --- a/tests/hlr/poly_hlr/C14 +++ b/tests/hlr/poly_hlr/C14 @@ -1,7 +1,5 @@ -puts "TODO OCC30286 ALL: Error : The length of result shape is 5499.*, expected 5934.34" - set viewname "vright" -set length 5934.34 +set length 5502.06 testreadstep [locate_data_file bug27341_Assembly_BILZ_WFL2_1_CAD.stp] a COMPUTE_HLR $viewname $algotype diff --git a/tests/hlr/poly_hlr/C15 b/tests/hlr/poly_hlr/C15 index 08111c4f08..526f80eca3 100644 --- a/tests/hlr/poly_hlr/C15 +++ b/tests/hlr/poly_hlr/C15 @@ -1,5 +1,5 @@ set viewname "vright" -set length 5117.25 +set length 5102.18 testreadstep [locate_data_file bug27341_Assembly_GMS_Kurz_CAD.stp] a COMPUTE_HLR $viewname $algotype diff --git a/tests/hlr/poly_hlr/C16 b/tests/hlr/poly_hlr/C16 index aed240802e..4c2ecbe5c2 100644 --- a/tests/hlr/poly_hlr/C16 +++ b/tests/hlr/poly_hlr/C16 @@ -1,7 +1,5 @@ -puts "TODO OCC30286 ALL: Error : The length of result shape is 1664.\\d+, expected 1664.48" - set viewname "vright" -set length 1664.48 +set length 1662.85 testreadstep [locate_data_file bug27341_CCS_Adapter_CAD.stp] a COMPUTE_HLR $viewname $algotype diff --git a/tests/hlr/poly_hlr/C17 b/tests/hlr/poly_hlr/C17 index 028db8b5d3..bca493e4e6 100644 --- a/tests/hlr/poly_hlr/C17 +++ b/tests/hlr/poly_hlr/C17 @@ -1,5 +1,5 @@ set viewname "vright" -set length 2234.38 +set length 2239.23 testreadstep [locate_data_file bug27341_CCT_PMK_32_L_o_CAD.stp] a COMPUTE_HLR $viewname $algotype diff --git a/tests/hlr/poly_hlr/C3 b/tests/hlr/poly_hlr/C3 index 9c0397e884..6efe35f15c 100644 --- a/tests/hlr/poly_hlr/C3 +++ b/tests/hlr/poly_hlr/C3 @@ -1,5 +1,5 @@ set viewname "vright" -set length 3060.33 +set length 3059.05 testreadstep [locate_data_file bug27341_570-DWLNL-40-08-L_131LANG_16VERSATZ_DIN.stp] a COMPUTE_HLR $viewname $algotype diff --git a/tests/hlr/poly_hlr/C7 b/tests/hlr/poly_hlr/C7 index 74ed18c563..471a9cd4ef 100644 --- a/tests/hlr/poly_hlr/C7 +++ b/tests/hlr/poly_hlr/C7 @@ -1,5 +1,5 @@ set viewname "vright" -set length 2257 +set length 2261.22 testreadstep [locate_data_file bug27341_AIF_Grundhalter_GR1_CAD.stp] a COMPUTE_HLR $viewname $algotype diff --git a/tests/hlr/poly_hlr/bug23625_1 b/tests/hlr/poly_hlr/bug23625_1 index 9484d87381..49d3709ec7 100644 --- a/tests/hlr/poly_hlr/bug23625_1 +++ b/tests/hlr/poly_hlr/bug23625_1 @@ -6,7 +6,7 @@ puts "" puts "REQUIRED All: Meshing statuses: SelfIntersectingWire Failure" set viewname "vfront" -set length 28388 +set length 26881.1 restore [locate_data_file bug23625_a1.brep] a diff --git a/tests/hlr/poly_hlr/bug23625_2 b/tests/hlr/poly_hlr/bug23625_2 index 10b31c6352..af647e97e0 100644 --- a/tests/hlr/poly_hlr/bug23625_2 +++ b/tests/hlr/poly_hlr/bug23625_2 @@ -4,7 +4,7 @@ puts "============" puts "" set viewname "vfront" -set length 29113.3 +set length 27461.9 restore [locate_data_file bug23625_a2.brep] a COMPUTE_HLR $viewname $algotype diff --git a/tests/hlr/poly_hlr/bug23625_3 b/tests/hlr/poly_hlr/bug23625_3 index 264015f5c8..904e40f261 100644 --- a/tests/hlr/poly_hlr/bug23625_3 +++ b/tests/hlr/poly_hlr/bug23625_3 @@ -4,7 +4,7 @@ puts "============" puts "" set viewname "vtop" -set length 19604.4 +set length 19259.1 restore [locate_data_file bug23625_a3.brep] a COMPUTE_HLR $viewname $algotype diff --git a/tests/hlr/poly_hlr/bug27719_102 b/tests/hlr/poly_hlr/bug27719_102 index 6c3dd212bc..05492298d2 100644 --- a/tests/hlr/poly_hlr/bug27719_102 +++ b/tests/hlr/poly_hlr/bug27719_102 @@ -4,7 +4,7 @@ puts "=====================================" puts "" set viewname "vtop" -set length 5.7955 +set length 5.79554 restore [locate_data_file bug27719_Extruded.brep] a COMPUTE_HLR $viewname $algotype diff --git a/tests/hlr/poly_hlr/bug27719_103 b/tests/hlr/poly_hlr/bug27719_103 index 1487c3285f..03581f9274 100644 --- a/tests/hlr/poly_hlr/bug27719_103 +++ b/tests/hlr/poly_hlr/bug27719_103 @@ -4,7 +4,7 @@ puts "=====================================" puts "" set viewname "vbottom" -set length 6.14978 +set length 6.14989 restore [locate_data_file bug27719_Extruded.brep] a COMPUTE_HLR $viewname $algotype diff --git a/tests/hlr/poly_hlr/bug27719_104 b/tests/hlr/poly_hlr/bug27719_104 index 20d2811270..23f60bcc58 100644 --- a/tests/hlr/poly_hlr/bug27719_104 +++ b/tests/hlr/poly_hlr/bug27719_104 @@ -4,7 +4,7 @@ puts "=====================================" puts "" set viewname "vfront" -set length 7.4551 +set length 7.45513 restore [locate_data_file bug27719_Extruded.brep] a COMPUTE_HLR $viewname $algotype diff --git a/tests/hlr/poly_hlr/bug27719_105 b/tests/hlr/poly_hlr/bug27719_105 index ffdd518e82..81fe405518 100644 --- a/tests/hlr/poly_hlr/bug27719_105 +++ b/tests/hlr/poly_hlr/bug27719_105 @@ -4,7 +4,7 @@ puts "=====================================" puts "" set viewname "vback" -set length 7.48367 +set length 7.48374 restore [locate_data_file bug27719_Extruded.brep] a COMPUTE_HLR $viewname $algotype diff --git a/tests/mesh/data/advanced/B8 b/tests/mesh/data/advanced/B8 index 62f5350c5d..87bf1b5e3c 100755 --- a/tests/mesh/data/advanced/B8 +++ b/tests/mesh/data/advanced/B8 @@ -2,5 +2,5 @@ set TheFileName OCC357.brep if { [string compare $command "shading"] == 0 } { #set bug_area "OCC22687" set max_rel_tol_diff 0.25 - set rel_tol 1.7957583466671934 + set rel_tol 1.299910771524823 } diff --git a/tests/mesh/data/standard/L2 b/tests/mesh/data/standard/L2 index ac3c960853..6973536383 100755 --- a/tests/mesh/data/standard/L2 +++ b/tests/mesh/data/standard/L2 @@ -1,5 +1,5 @@ set TheFileName shading_101.brep if { [string compare $command "shading"] != 0 } { set max_rel_tol_diff 0.1 - set rel_tol 1.2162834127672983 + set rel_tol 0.3408446823303861 } diff --git a/tests/mesh/data/standard/M8 b/tests/mesh/data/standard/M8 index 76e189fee3..bbf534ac91 100755 --- a/tests/mesh/data/standard/M8 +++ b/tests/mesh/data/standard/M8 @@ -3,7 +3,7 @@ set max_rel_tol_diff 1 if { [string compare $command "shading"] == 0 } { set rel_tol 0.241 } else { - set rel_tol 6.376860334255998 + set rel_tol 3.2394842919345677 } #set bug_freenodes "M8" #set nbfreenodes(All) 1 diff --git a/tests/mesh/data/standard/Q3 b/tests/mesh/data/standard/Q3 index e8a44d2e65..ad0d842065 100755 --- a/tests/mesh/data/standard/Q3 +++ b/tests/mesh/data/standard/Q3 @@ -1,5 +1,5 @@ set TheFileName shading_147.brep if { [string compare $command "shading"] == 0 } { - set rel_tol 0.8791879462861206 + set rel_tol 0.8369721827353692 set max_rel_tol_diff 0.001 } diff --git a/tests/mesh/data/standard/U2 b/tests/mesh/data/standard/U2 index f5c48950be..9f1f17bc81 100755 --- a/tests/mesh/data/standard/U2 +++ b/tests/mesh/data/standard/U2 @@ -1,9 +1,9 @@ set TheFileName shading_wrongshape_004.brep ###set bug_area "OCC22687" if { [string compare $command "shading"] == 0 } { - set rel_tol 0.06073194250400039 + set rel_tol 0.07204699336483454 } else { - set rel_tol 0.003702162749171707 + set rel_tol 0.008767384551980804 } set max_rel_tol_diff 0.001 ###set bug_withouttri "OCC22687" diff --git a/tests/mesh/data/standard/W6 b/tests/mesh/data/standard/W6 index 44e267dd7e..c74273990c 100755 --- a/tests/mesh/data/standard/W6 +++ b/tests/mesh/data/standard/W6 @@ -1,6 +1,6 @@ set TheFileName shading_wrongshape_026.brep if { [string compare $command "shading"] == 0 } { - set rel_tol 0.06893312870606805 + set rel_tol 0.08526389274308782 } else { set rel_tol 0.0020125629706199506 } diff --git a/tests/mesh/data/standard/W7 b/tests/mesh/data/standard/W7 index e6df883e0a..d7130aea93 100755 --- a/tests/mesh/data/standard/W7 +++ b/tests/mesh/data/standard/W7 @@ -7,5 +7,5 @@ if { [string compare $command "shading"] != 0 } { set rel_tol 0.19838215623500813 } else { set max_rel_tol_diff 0.01 - set rel_tol 0.12561722204279838 + set rel_tol 0.18116134043436827 } diff --git a/tests/mesh/data/standard/X1 b/tests/mesh/data/standard/X1 index 2c66fdf882..cca36dd09f 100755 --- a/tests/mesh/data/standard/X1 +++ b/tests/mesh/data/standard/X1 @@ -6,8 +6,8 @@ set TheFileName shading_wrongshape_030.brep set bug_cross "OCC22687" set nbcross(All) 4 if { [string compare $command "shading"] == 0 } { - set rel_tol 0.5456843734442471 + set rel_tol 0.5225697108844659 } else { - set rel_tol 0.1783852555846471 + set rel_tol 0.1856053577754922 } set max_rel_tol_diff 0.001 diff --git a/tests/perf/mesh/bug26965 b/tests/perf/mesh/bug26965 index 6adc45da7c..8eda1a2b86 100644 --- a/tests/perf/mesh/bug26965 +++ b/tests/perf/mesh/bug26965 @@ -16,4 +16,4 @@ dchrono h vfit checkview -screenshot -3d -path ${imagedir}/${test_image}.png -checktrinfo a -tri 14764 -nod 7587 -defl 0.29573935005082458 -tol_abs_defl 1e-6 +checktrinfo a -tri 15564 -nod 7987 -defl 0.25696012112765304 -tol_abs_defl 1e-6 diff --git a/tests/v3d/bugs/bug288_5 b/tests/v3d/bugs/bug288_5 index 0486edd2bc..729d25add8 100644 --- a/tests/v3d/bugs/bug288_5 +++ b/tests/v3d/bugs/bug288_5 @@ -14,5 +14,5 @@ isos result 0 triangles result vfit -checktrinfo result -tri 8048 -nod 8247 +checktrinfo result -tri 8130 -nod 8288 vdump $imagedir/${casename}.png