1
0
mirror of https://git.dev.opencascade.org/repos/occt.git synced 2025-08-04 13:13:25 +03:00

0031251: Add a new meshing parameter to enforce face linear deflection

Parameter has been renamed to ForceFaceDeflection. Added test case.

New parameter -force_face_def has been added to incmesh command.
This commit is contained in:
razmyslovich
2019-12-17 21:17:17 +03:00
committed by bugmaster
parent bdd09cfaf4
commit 0da2ecac41
5 changed files with 53 additions and 11 deletions

View File

@@ -145,18 +145,22 @@ void BRepMesh_Deflection::ComputeDeflection (
}
Standard_Real aFaceDeflection = 0.0;
if (theDFace->WiresNb () > 0)
if (!theParameters.ForceFaceDeflection)
{
for (Standard_Integer aWireIt = 0; aWireIt < theDFace->WiresNb(); ++aWireIt)
if (theDFace->WiresNb () > 0)
{
aFaceDeflection += theDFace->GetWire(aWireIt)->GetDeflection();
for (Standard_Integer aWireIt = 0; aWireIt < theDFace->WiresNb (); ++aWireIt)
{
aFaceDeflection += theDFace->GetWire (aWireIt)->GetDeflection ();
}
aFaceDeflection /= theDFace->WiresNb ();
}
aFaceDeflection /= theDFace->WiresNb ();
aFaceDeflection = Max (2. * BRepMesh_ShapeTool::MaxFaceTolerance (
theDFace->GetFace ()), aFaceDeflection);
}
aFaceDeflection = Max (aDeflection, aFaceDeflection);
aFaceDeflection = Max(aDeflection, aFaceDeflection);
theDFace->SetDeflection (Max(2.* BRepMesh_ShapeTool::MaxFaceTolerance(
theDFace->GetFace()), aFaceDeflection));
theDFace->SetDeflection (aFaceDeflection);
}

View File

@@ -72,7 +72,7 @@ Standard_Real BRepMesh_ShapeTool::MaxFaceTolerance(const TopoDS_Face& theFace)
Standard_Real aMaxTolerance = BRep_Tool::Tolerance(theFace);
Standard_Real aTolerance = Max(
MaxTolerance<TopAbs_EDGE, EdgeTolerance >(theFace),
MaxTolerance<TopAbs_EDGE, EdgeTolerance >(theFace),
MaxTolerance<TopAbs_VERTEX, VertexTolerance>(theFace));
return Max(aMaxTolerance, aTolerance);