Tue, 07/09/2024 - 22:26
Forums:
Hi! I making triangliation of simple cylinder via BRepMesh_IncrementalMesh and IMeshTools_Parameters and i get this result on the cap of cylinder:
but this is very very bad mesh... I would like to get this result:
It's impossible?
P.S.: I remember exporting models to STL from different CADs, there was the same very bad mesh as in the first picture, so there is of course little chance that opencascade will make a good mesh...
Tue, 07/09/2024 - 23:03
Hello, I'm afraid that OCCT will not give you close result. IncMesh generated simple triangle entities. In your sample you have "fan triangle" entities.
For that result IncMesh needs to create a special vertex in some position. I'm afraid that functionality is not implemented. And will be not optiomal for "simple triangle" logic.
I'm not sure about "perfect" status of your sample. But looks like your mesh have some benefits in your scenarios.
But if you will generate mesh from OCCT, you will be free to post-process mesh with some external software.
Best regards, Dmitrii.
Wed, 07/10/2024 - 07:30
Thanks for reply!
bad news...
In fact, triangle strip and triangle fun are exotic rendering modes (especially fun) and no one has been using them for now. Real renders use indexed rendering, that is, you have a set of vertices and an index buffer, with which you "made" triangles, and with this approach it would be very simple to make a beautiful cylinder cap, it’s strange that this was not done in the open cascade, although I once again I repeat, a very long time ago I saw exports to STL even from very serious CAD systems such as Solidworks or Unigraphics, and their mesh quality is exactly the same as in opencascade (same bad caps:), apparently the algorithms are the same. But it’s okay, I will solve this problem somehow differently, thanks again for reply :)
P.S.:
This cannot be done efficiently without the internal topology of the Open Cascade shapes.
Wed, 07/10/2024 - 08:41
It would be nice to hear why do you consider circle triangulated like this as a 'bad' cap in the first place ;)? Does it produce visual artifacts? Does it deviates from required deflection parameters? Or this is just a visual perfection idea that circle triangulation would look 'nicer' in the other way?
BRepMesh
is designed to generate mesh for arbitrary surfaces and topologies, and there is nothing wrong in that it handles perfect circles in a generalized way. If circle is the only thing that borthers you in generated mesh - it shouldn't be that difficult to find such Faces in your shape and regenerate mesh like you want, while preserving a common mesh for more complex scenarios.Both meshes for a circle will work identically for visualization purposes. And other domains like FEM usually have different requirements of what to consider a 'good' or 'bad' mesh.
Wed, 07/10/2024 - 09:39
In order to increase performance, I shade my edges of 3d shape-models without any line-mesh, that is, procedurally and directly on the triangles, by painting one or several of its sides (with some thickness) or painting a small distance from vertices. In general, artifacts appear on a bad mesh, yes, and they can be eliminated, but by significantly complicating shaders and performance penalty.
Wed, 07/10/2024 - 13:02
Hey guys, does anyone know an external triangulator/mesher that is compatible with OpenCascade shapes, so that I can throw a OCCT face into it and get a high-quality mesh according to certain rules?
Mon, 07/15/2024 - 14:28
Ciao
have a look at the mmg platform @ https://www.mmgtools.org/
Use the coarse mesh of BRepMesh_IncrementalMesh (I mean coarse
since used only for the shaded view) as input for the library or for
mmg_03.exe. A typical resuls (for some meshing parameters) is
shown in the attached picture
Giovanni
Wed, 07/10/2024 - 21:57
Brep mesher of occt can be customized with your own 2D triangulator.
Thu, 07/11/2024 - 15:45
Can you provide me any link with information about how to do this? Examples?
Thu, 07/11/2024 - 16:41
The best way to know is to look at documentation.
https://dev.opencascade.org/doc/overview/html/occt_user_guides__mesh.htm...
It contains a code example: