Meshing with BRepMesh_IncrementalMesh - what controls accuracy?
I am loading shapes from STE files, and meshing them with BRepMesh_IncrementalMesh
I am using BRepMesh_FastDiscret to set the parameters of
//Set the meshing parameters
m_MeshParams.Deflection = 1e-5; //This one is important. Higher values are quicker but less accurate. Use 1e-3 for fast preview, 1e-5 or smaller for accurracy
m_MeshParams.Angle = 0.5;
m_MeshParams.Relative = Standard_True;
m_MeshParams.InParallel = Standard_True;
//aMeshParams.MinSize = aMinSize; //?? default is Standard_True
//aMeshParams.InternalVerticesMode = isIntVertices; //!!jw?? default is Standard_True
//aMeshParams.ControlSurfaceDeflection = isControlSurDef; //?? default is Standard_True
m_MeshParams.AdaptiveMin = Standard_True;
const TopoDS_Shape& aShape = .... // comes in from STEP load
BRepMesh_IncrementalMesh m(aShape, meshParams);
This works, but it isn't giving resulats as acurate as I'd hoped.
For instance, when getting normals of the meshes produced, some of them I expect to be exactly aligned to the carninal axes, eg (0,0,1), but instead get them slightly off,
e.g (1e-7, 1e-6, 1.00001)
I am comparing these numbers to the results I get from EWDraw http://www.eastwindsoft.com/index_en.htm
EWDraw is an Active X control that sits on top of OpenCascade - I can't use it in this project we don't support Active X.
But I have for comparrison an exisitng setup using EWDraw to load and examine STEP files.
I have tried playing with the BRepMesh_FastDiscret paramaters.
Deflection seems to make the biggest difference, making it smaller gives more accurate results, at the expense of speed.
However, it still is not as accurate as I'd hoped.
Can anyone advise on fine tuning the BRepMesh_FastDiscret parameters?
Or are there any alternatives to BRepMesh_IncrementalMesh?
Any help appreciated!