mirror of
https://git.dev.opencascade.org/repos/occt.git
synced 2025-04-05 18:16:23 +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:
parent
bdd09cfaf4
commit
0da2ecac41
@ -145,18 +145,22 @@ void BRepMesh_Deflection::ComputeDeflection (
|
|||||||
}
|
}
|
||||||
|
|
||||||
Standard_Real aFaceDeflection = 0.0;
|
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 (aFaceDeflection);
|
||||||
|
|
||||||
theDFace->SetDeflection (Max(2.* BRepMesh_ShapeTool::MaxFaceTolerance(
|
|
||||||
theDFace->GetFace()), aFaceDeflection));
|
|
||||||
}
|
}
|
||||||
|
@ -72,7 +72,7 @@ Standard_Real BRepMesh_ShapeTool::MaxFaceTolerance(const TopoDS_Face& theFace)
|
|||||||
Standard_Real aMaxTolerance = BRep_Tool::Tolerance(theFace);
|
Standard_Real aMaxTolerance = BRep_Tool::Tolerance(theFace);
|
||||||
|
|
||||||
Standard_Real aTolerance = Max(
|
Standard_Real aTolerance = Max(
|
||||||
MaxTolerance<TopAbs_EDGE, EdgeTolerance >(theFace),
|
MaxTolerance<TopAbs_EDGE, EdgeTolerance >(theFace),
|
||||||
MaxTolerance<TopAbs_VERTEX, VertexTolerance>(theFace));
|
MaxTolerance<TopAbs_VERTEX, VertexTolerance>(theFace));
|
||||||
|
|
||||||
return Max(aMaxTolerance, aTolerance);
|
return Max(aMaxTolerance, aTolerance);
|
||||||
|
@ -34,7 +34,8 @@ struct IMeshTools_Parameters {
|
|||||||
InternalVerticesMode (Standard_True),
|
InternalVerticesMode (Standard_True),
|
||||||
ControlSurfaceDeflection (Standard_True),
|
ControlSurfaceDeflection (Standard_True),
|
||||||
CleanModel (Standard_True),
|
CleanModel (Standard_True),
|
||||||
AdjustMinSize (Standard_False)
|
AdjustMinSize (Standard_False),
|
||||||
|
ForceFaceDeflection (Standard_False)
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -83,6 +84,10 @@ struct IMeshTools_Parameters {
|
|||||||
//! Enables/disables local adjustment of min size depending on edge size.
|
//! Enables/disables local adjustment of min size depending on edge size.
|
||||||
//! Disabled by default.
|
//! Disabled by default.
|
||||||
Standard_Boolean AdjustMinSize;
|
Standard_Boolean AdjustMinSize;
|
||||||
|
|
||||||
|
//! Enables/disables usage of shape tolerances for computing face deflection.
|
||||||
|
//! Disabled by default.
|
||||||
|
Standard_Boolean ForceFaceDeflection;
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
@ -88,7 +88,8 @@ options:\n\
|
|||||||
-surf_def_off disables control of deflection of mesh from real\n\
|
-surf_def_off disables control of deflection of mesh from real\n\
|
||||||
surface (enabled by default)\n\
|
surface (enabled by default)\n\
|
||||||
-parallel enables parallel execution (switched off by default)\n\
|
-parallel enables parallel execution (switched off by default)\n\
|
||||||
-adjust_min enables local adjustment of min size depending on edge size (switched off by default)\n";
|
-adjust_min enables local adjustment of min size depending on edge size (switched off by default)\n\
|
||||||
|
-force_face_def disables usage of shape tolerances for computing face deflection (switched off by default). \n";
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -123,6 +124,8 @@ options:\n\
|
|||||||
aMeshParams.ControlSurfaceDeflection = Standard_False;
|
aMeshParams.ControlSurfaceDeflection = Standard_False;
|
||||||
else if (aOpt == "-adjust_min")
|
else if (aOpt == "-adjust_min")
|
||||||
aMeshParams.AdjustMinSize = Standard_True;
|
aMeshParams.AdjustMinSize = Standard_True;
|
||||||
|
else if (aOpt == "-force_face_def")
|
||||||
|
aMeshParams.ForceFaceDeflection = Standard_True;
|
||||||
else if (i < nbarg)
|
else if (i < nbarg)
|
||||||
{
|
{
|
||||||
Standard_Real aVal = Draw::Atof(argv[i++]);
|
Standard_Real aVal = Draw::Atof(argv[i++]);
|
||||||
|
30
tests/bugs/mesh/bug31251
Normal file
30
tests/bugs/mesh/bug31251
Normal file
@ -0,0 +1,30 @@
|
|||||||
|
puts "======="
|
||||||
|
puts "0031251: Mesh - Add a parameter for IncrementalMesh to ignore face tolerance for face deflection"
|
||||||
|
puts "======="
|
||||||
|
puts ""
|
||||||
|
|
||||||
|
pload XDE
|
||||||
|
|
||||||
|
stepread [locate_data_file bug31251_Albatros_d2_elisa_a.STEP] a *
|
||||||
|
renamevar a_1 result
|
||||||
|
|
||||||
|
vinit
|
||||||
|
vtop
|
||||||
|
vsetdispmode 1
|
||||||
|
vdefaults -autoTriang 0
|
||||||
|
|
||||||
|
tclean result
|
||||||
|
incmesh result 0.004 -a 14
|
||||||
|
checktrinfo result -tri 70560 -nod 39946 -defl 0.22962869401103247
|
||||||
|
|
||||||
|
vdisplay result -redisplay
|
||||||
|
vfit
|
||||||
|
checkview -screenshot -3d -path ${imagedir}/${test_image}_default.png
|
||||||
|
|
||||||
|
tclean result
|
||||||
|
incmesh result 0.004 -a 14 -force_face_def
|
||||||
|
checktrinfo result -tri 292560 -nod 150946 -defl 0.04579460790575135
|
||||||
|
|
||||||
|
vdisplay result -redisplay
|
||||||
|
vfit
|
||||||
|
checkview -screenshot -3d -path ${imagedir}/${test_image}_tightfit.png
|
Loading…
x
Reference in New Issue
Block a user