I would like to create a hollow or thick semi-torus, for this, I use the following commands:
SetFactory ("OpenCASCADE");
Torus (1) = {0,0,0, 170,30, Pi};
Torus (2) = {0,0,0, 170,20, Pi};
BooleanDifference (8) = {Volume {1}; Delete; } {Volume {2}; Delete; };
When I try to create the 3D mesh it gives the following error:
PLC Error: A segment and a facet intersect at point Info: (122,229,106,391, -9.48334). Info: Segment: [314,311] # -1 (0) Info: Facet: [7,54,60] # 1 Error: Invalid boundary mesh (segment-facet intersection) on surface 1, intersection (122.229,106.391, -9.48334) Error: No elements in volume 8
Why is this happening? How can it be fixed?.
There is no problem with your geometry definitions. Everything is legit.
However, in the GEO file, you are not specifying the desired element size for the mesh. And, in this particular case, GMSH fails to create a proper tetrahedral mesh with what it chooses as a default one.
The following will allow you to create a proper tetrahedral mesh on your hollow semi-torus:
Mesh.CharacteristicLengthMin = 5;
Mesh.CharacteristicLengthMax = 10;
SetFactory ("OpenCASCADE");
Torus (1) = {0,0,0, 170,30, Pi};
Torus (2) = {0,0,0, 170,20, Pi};
BooleanDifference (8) = {Volume {1}; Delete; } {Volume {2}; Delete; };
Here, I manually specified the min and max element size. My choice is arbitrary and is dictated mostly by getting a visually appealing mesh.
You can read more about various options of specifying mesh element size (and about the mesh element size itself) in the corresponding section of GMSH documentation.