Limits on Deflection

Hello,

I could use some pointers on the internal workings of the deflection parameter (mainly in BRepMesh::Mesh) It seems that there is some point (different for each surface, natch) where greater values of deflection don't have any effect anymore. Looking at the source code, I couldn't quite figure out why. Anyone with more experience with this care to give me some hints how this works or give me clues how to force Mesh to produce coarser triangulations?

Any help would be much appreciated. Thanks, Chris Clason

Igor Feoktistov's picture

Hi,

the method BRepMesh::Mesh uses class IncrementalMesh to build mesh for shape. That class was designed to build mesh only for those parts of shape that have no yet triangulation at all or deflection is greater then new deflection. So, if you have built mesh with given deflection, this method doesn't build new mesh for shape if new deflection is greater then old. To build coarser triangulation you should first to delete old triangulation by method BRepTools::Clean(...).

Best regards, Igor

chris_clason's picture

Hello,

I did call BRepMesh::Clean() before creating the new triangulation; the problem is not that I can't update a triangulation, it is the fact that the deflection parameter fails to show any change in effect from a certain value on. So the mesh resulting from Mesh(Shape, 1.0) is the same as the one created by, say, Mesh(Shape, 10000.0) (calling Clean() between those two calls, of course.)

Thanks, Chris

Igor Feoktistov's picture

Chris,

it is difficult to say something about your problem without detailed information.

Really mesh is defined by two parameters - deflection and angle. If you have a look at BRepMesh_IncrementalMesh.cdl you can see that by default angle = 0.5 and this parameter is unreachable from BRepMesh::Mesh(...). In some cases angle doesn't permit to build too coarse mesh for cylinrical and toroidal surfaces.

For plane faces triangulation doesn't depend on deflection at all.

For BSpline and Bezier faces mesh can be independ on deflection for big deflections, because first coarse mesh is created on base of appropriate number of sample points, then new points are added if deflection of coarse mesh greater then given deflection. But never points are removed.

Best regards, Igor

chris_clason's picture

Thanks! That was exactly the information I was looking for. Do you see any way, given the functions available in OpenCASCADE, to force a coarser triangulation than deflection (and angle) allows, or am I on my own there?

Again, many thanks, Chris

Igor Feoktistov's picture

What I can only propose is try to use directly class BRepMesh_IncrementalMesh instead of BRepMesh::Mesh(...) and try to change parameter Ang. You can use also for building mesh class BRepMesh_Discret. It provides another algorithm of meshing and may be results will be more suitable for you. You can see how to use these classes in file MeshTest.cxx and MeshTest_DrawableMesh.cxx. (package MeshTest provides commands that are used in TPRESENTATION - some kind of test harness (Draw) for testing presentation and meshing algorithms)

Igor

Sylvain Lecluze's picture

Hello, i use BRepMesh with deflection. It provide, some time, degenereted triangulation or doesn't work with ellispoid for example. I'm interesting by another method, may be BRepMesh_Discret or BRepMesh_IncrementalMesh, but documentation doesn't exist ?, could you send me the documentation. Thanks. Sylvain (note, for the moment, i use cascade 2.1 NT)

Igor Feoktistov's picture

Hi,

there is no another documentation, only one that is on Open CASCADE. I am not sure, but probably problems with degenerate mesh in some cases are fixed in CASCADE 3.0. Method BRepMesh::Mesh() calls BRepMesh_IncrementalMesh, so try only BRepMesh_Discret.

Igor