How do I use ShapeFixStd?

Hello all,

I have some parts that are made with boolean operations and the boolean operation produces the wrong shape (e.g. faces are missing, etc...). In an attempt to fix this I am trying to adjust tolerances within the part as follows (where all shapes are TopoDS_Shape's):

BRepAlgoAPI_Fuse fuser( tempShape, nextShape );

if ( fuser.IsDone() ) {

shape = fuser.Shape();

ShapeFixStd_Shape sfs( shape );

sfs.SetPrecision( 2.0e-6 );

sfs.SetMaxTolerance( 2.0e-5 );



First of all, my fix to the boolean operation doesn't work (am I doing the wrong thing here or perhaps using the wrong values?). Secondly, the problem actually gets worse because now the code enters an infinite loop when it operates on some parts so I suspect that I am not using the ShapeFixStd_Shape object correctly. Can anyone see what I am doing wrong?

Thanks for your help,

-- Shaun Bloom

Andrey Betenev's picture

Hello Shaun,

Unfortunately, ShapeFixStd_Shape is not intended and does not fix all the possible problems with shapes, but only some specific types of errors. For instance, it surely will not fix missing face if it has been lost by some operations.

If you are trying to use ShapeFixStd_Shape to do some specific task (like update of tolerances), and encounter some problems, you can try to modify some parameters of fixing. For instance, you can yse methods like FixSameParameterMode() to force or to forbid specific fixes. Use methods like FixWireTool() to get access to lowest-level tools and manage their parameters.

Best Regards,