[Gmsh] issue concerning the boolean difference of two volumes?

Nicolae Cindea nicolae.cindea at uca.fr
Wed May 30 12:08:30 CEST 2018


Dear all,

I think there is an issue concerning the difference (or the 
intersection) of two volumes. The following code:

// here starts the code
SetFactory("OpenCASCADE");

L = 0.5;   // cylinder length [0, L]
l = 1.00;  // triangle edge
r = 0.050; // radius of the sphere

h = l * Sqrt(3) / 2;

Sphere(2) = { 0, 0, 0, r };

Point(101) = {      h / 3, 0, -l / 2 };
Point(102) = {      h / 3, 0,  l / 2 };
Point(103) = { -2 * h / 3, 0,  0     };

Line(201) = { 102, 103 };
Line(202) = { 103, 101 };
Line(203) = { 101, 102 };

Line Loop(204) = {201, 202, 203};

Surface(3) = { 204 };

Translate { -0.108320, 0, -0.062538 } { Surface{3};}
out[] = Extrude { 0, L, 0 }{ Surface{3}; };


BooleanDifference(8) = { Volume{3}; Delete; }{ Volume{2}; Delete; 
};
// here ends the code


gives the following error "Error   : Intersection operation cannot 
be performed". Nevertheless, replacing the line
Translate { -0.108320, 0, -0.062538 } { Surface{3};}
by
Translate { -0.108320, 0, -0.062537 } { Surface{3};}
the error message disappears and everything work as supposed.

Can somebody reproduce this comportment? Since the above .geo file 
is generated from another language I'm searching a workaround to 
avoid the problematic situations.

Thank you.

Regards,
Nicolae.

PS: my gmsh -info

Version          : 3.0.6
License          : GNU General Public License
Build OS         : Linux64
Build date       : 20171105
Build host       : gmsh.info
Build options    : 64Bit Ann Bamg Bfgs Blas(Generic) Blossom C++11 
Chaco DIntegration Dlopen Fltk Gmm Jpeg(Fltk) Kbipack 
Lapack(Generic) LinuxJoystick MathEx Med Mesh Metis Mmg3d Mpeg 
Netgen ONELAB ONELABMetamodel OpenCASCADE OpenGL OptHom PETSc 
Parser Plugins Png(Fltk) Post SLEPc Solver Taucs TetGen/BR 
Tetgen1.5 Voro3D Zlib
FLTK version     : 1.3.4
PETSc version    : 3.7.5 (complex arithmtic)
OCC version      : 7.1.0
MED version      : 3.2.0
Packaged by      : gitlab-runner
Web site         : http://gmsh.info
Mailing list     : gmsh at onelab.info



More information about the gmsh mailing list