Shape Tolerance

I have a question about tolerances of TopoDS_Shapes.
I'm using ShapeFix_Shape as follows

double myTolerance = 0.01;
ShapeFix_Shape Stol(aShape);
STol.SetMaxTolerance(myTolerance);
STol.Perform();
aShape = STol.Shape();

which works nicely in most cases, but I still have some crashes, so I though about setting min Tolernace as well, but when I tried it liked this

double myTolerance = 0.01;
ShapeFix_Shape Stol(aShape);
STol.SetMinTolerance(myTolerance);
STol.SetMaxTolerance(myTolerance);
STol.Perform();
aShape = STol.Shape();

it messed up stuff that worked perfectly before. Can I set MinTolerance with the same value as MaxTolerance, or would it have to a different value?

I understand it like this, which may be wrong:

value b is considered the same as value a, if
b - mintolerance is this correct? or would have to change the value for mintolerance to (-1)*myTolerance?

thanks a lot in advance if somebody can help me.

Dennis G.'s picture

Hello Christian,

your assumption (b - mintolerance < a < b + maxtolerance) is NOT correct. 'maxtolerance' defines the maximal tolerance in all directions, i.e. it defines a sphere with the radius 'maxtolerance' around each point which is treated.
That is, in your example: b - maxtolerance < a < b + maxtolerance.
Please take a look at Romans OCC-Blog http://opencascade.blogspot.com/2009/02/topology-and-geometry-in-open-ca...

I do not know about the function of SetMinTolerance(real) though. In my understanding every value smaller 'mintolerance' is automatically set to 'mintolerance' in order to avoid small number computations. By default it is set to the working precision, that is Precision::Confusion();

Regards,

Dennis