1
0
mirror of https://git.dev.opencascade.org/repos/occt.git synced 2025-08-29 14:00:49 +03:00

0030780: [Regression to 7.3.0] BRepMesh fails triangulating one face of the shape

Added new parameter KeepSmallEdges to IMeshTools_Parameters allowing to compute min size for each edge locally, depending on the length of particular edge.
Parameter -smalledges now available for incmesh command.
This commit is contained in:
oan
2019-06-24 19:03:45 +03:00
committed by apn
parent 62810a3c51
commit 3c1b70842d
4 changed files with 43 additions and 10 deletions

View File

@@ -26,6 +26,7 @@
#include <Adaptor3d_HCurveOnSurface.hxx>
#include <Adaptor2d_HCurve2d.hxx>
#include <Standard_Failure.hxx>
#include <GCPnts_AbscissaPoint.hxx>
//=======================================================================
//function : Constructor
@@ -79,21 +80,28 @@ void BRepMesh_CurveTessellator::init()
aPreciseLinDef *= 0.5;
}
aPreciseLinDef = Max(aPreciseLinDef, Precision::Confusion());
aPreciseAngDef = Max(aPreciseAngDef, Precision::Angular());
aPreciseLinDef = Max (aPreciseLinDef, Precision::Confusion());
aPreciseAngDef = Max (aPreciseAngDef, Precision::Angular());
Standard_Real aMinSize = myParameters.MinSize;
if (myParameters.AdjustMinSize)
{
aMinSize = Min (aMinSize, myParameters.RelMinSize() * GCPnts_AbscissaPoint::Length (
myCurve, myCurve.FirstParameter(), myCurve.LastParameter(), aPreciseLinDef));
}
mySquareEdgeDef = aPreciseLinDef * aPreciseLinDef;
mySquareMinSize = Max(mySquareEdgeDef, myParameters.MinSize * myParameters.MinSize);
mySquareMinSize = Max (mySquareEdgeDef, aMinSize * aMinSize);
myEdgeSqTol = BRep_Tool::Tolerance(myEdge);
myEdgeSqTol = BRep_Tool::Tolerance (myEdge);
myEdgeSqTol *= myEdgeSqTol;
const Standard_Integer aMinPntNb = (myCurve.GetType() == GeomAbs_Circle) ? 4 : 2; //OCC287
myDiscretTool.Initialize(myCurve,
myCurve.FirstParameter(), myCurve.LastParameter(),
aPreciseAngDef, aPreciseLinDef, aMinPntNb,
Precision::PConfusion(), myParameters.MinSize);
myDiscretTool.Initialize (myCurve,
myCurve.FirstParameter(), myCurve.LastParameter(),
aPreciseAngDef, aPreciseLinDef, aMinPntNb,
Precision::PConfusion(), aMinSize);
if (myCurve.IsCurveOnSurface())
{