6.9.x - Relative and Absolute Deflection Definitions Within BRepMesh_IncrementalMesh

I'm currently trying to get my head around the definitions in the documentation for relative and absolute deflection.

I understand that it's possible to define a value for deflection of x units and run the tessellation but what I'm more unclear of is the definition of 'relative' and do not find the documentation helpful. Is this a calculation of a new 'absolute' value and if so, how is this calculated?

Kirill Gavrilov's picture

Relative means being computed relative to bounding box.

Defining an "absolute" linear deflection value is the preferred way for working with meshing algorithms. This should be defined in exact units (mm / meters) based on prior knowledge of model origin. This is what normal OCCT-based application having well-defined purpose and usage scope normally do.

In case, when input model has unknown origin and triangulation is needed just to be able to see it, "relative" linear deflection value could be specified, computed as a fraction of bounding box of entire model or of displayed part. This is what Prs3d::GetDeflection() returns using a simple formula:

const Graphic3d_Vec3d aDiag = theBndMax - theBndMin;
return Max (aDiag.maxComp() * theDeviationCoefficient * 4.0, Precision::Confusion());

Note that computing relative deflection based on bounding box of entire model and only on specific subshape would produce different results - the latter may lead to over-detailed triangulation for small individual shapes. AIS_Shape by default computes deflection relative to bounding box of specific shape with Prs3d_Drawer::TypeOfDeflection()==Aspect_TOD_RELATIVE parameters - it is preferred using Aspect_TOD_ABSOLUTE mode instead and compute linear deflection for entire model.

There is also IMeshTools_Parameters::Relative flag asking BRepMesh_IncrementalMesh to compute linear deflection based on bounding box of it's sub-shapes. Cannot say, though, what it actually computes there.