For all issues regarding the Forums use, please, refer to the Forum Rules.

Our Solutions

Need professional assistance?
Consider our:

Support Offerings


Need to speed up your development?
Have a look at our:

Samples & Tools


Need some functionality extending standard OCCT capabilities?
Check out our:

Adv. Components

Related pages

BRepBuilderAPI_MakeFace precision

Stephen Leary's picture

Is there any way to set the planar tolerance for BRepBuilderAPI_MakeFace()?

I would like to be able to alter the tolerance for what is considered on and off the plane?

BRepBuilderAPI::Precision(Standard_Real xx) does not seem to do the trick.


Pawel's picture

Hi Stephen,

maybe you could try ShapeFix_ShapeTolerance.


Stephen Leary's picture

Thanks Pawel,

I will try this. Its my (limited) understanding that ShapeFix_ShapeTolerance alters shape? Is this true?

For various reasons I am not allwoed to alter the data i simply want to treat it as a plane with a given tolerance.


Pawel's picture

Hi Stephen,

I guess changing the tolerance of a face might alter the whole shape.

Refer to Roman's blog here:

It might help.


Stephen Leary's picture

Thanks again,

That would be true only if you snapped vertices onto the face. Here i am refering to how cascade decides whether a shape is planar or not.

Provided all the vertices are within a tolerance distance of a plane i would not expect an error to be thrown. It may be true that as you add points the best fit plane is different.

Oracle 3D Validators manage to provide arbitrary tolerance for planes, I was looking for something similar.


Stephen Leary's picture

double myTolerance = 0.00001; // vary this
TopoDS_Vertex v1 = newVertex(0,0,0);
TopoDS_Vertex v2 = newVertex(0,1,0);
TopoDS_Vertex v3 = newVertex(1,1,0);
TopoDS_Vertex v4 = newVertex(1,1,0.0001);

TopoDS_Edge e1 = newEdge(v1,v2);
TopoDS_Edge e2 = newEdge(v2,v3);
TopoDS_Edge e3 = newEdge(v3,v4);
TopoDS_Edge e4 = newEdge(v4,v1);

BRepBuilderAPI_MakeWire mWire(e1,e2,e3,e4);

// create a tolerance object
ShapeFix_ShapeTolerance FTol;
// get the wide
TopoDS_Wire wire = mWire.Wire();
// set the tolerance for this shape.
FTol.SetTolerance(wire, myTolerance ,TopAbs_WIRE);

// make the face with this tolerance
BRepBuilderAPI_MakeFace mFace(wire);

if (mFace.IsDone())
cout }
cout cout cout }

Stephen Leary's picture

The example above (which i accidentally submitted) shows how to set the precision / tolerance for makeface or BRepBuilderAPI_MakeFace


Sharad Verma's picture

Setting Tolerance really worked for my case.

Thanks Stephen

Contact us

Attention: DO NOT use this form for all kind of request for the removal of your personal data. Please follow this link for such cases.