Built-in entities in Booleans
In https://gitlab.onelab.info/gmsh/gmsh/blob/master/demos/boolean/simple4.geo, it is shown that built-in and OpenCascade entities can be used in Boolean operations. However, when I do
SetFactory("OpenCASCADE");
p0 = newp;
Point(p0) = {0.0, 0.0, 0.0, 0.1};
p1 = newp;
Point(p1) = {1.0, 0.0, 0.0, 0.1};
l0 = newl;
Line(l0) = {p0, p1};
ex1[] = Extrude {0.0,1.0,0.0} {Line{l0};};
bo1[] = BooleanUnion{Surface{ex1[]}; Delete;} {Surface{ex1[]}; Delete;};
I'm only getting
Error : Unknown OpenCASCADE entity of dimension 2 with tag 4
Error : 'u.geo', line 11 : Could not apply boolean operator
I suspect this is a bug for Extrude
entities; it works fine with others:
SetFactory("OpenCASCADE");
p0 = newp;
Point(p0) = {-0.5, -0.5, 0.0, 0.05};
p1 = newp;
Point(p1) = {-0.5, 0.5, 0.0, 0.05};
p2 = newp;
Point(p2) = {0.5, 0.5, 0.0, 0.05};
p3 = newp;
Point(p3) = {0.5, -0.5, 0.0, 0.05};
l0 = newl;
Line(l0) = {p0, p1};
l1 = newl;
Line(l1) = {p1, p2};
l2 = newl;
Line(l2) = {p2, p3};
l3 = newl;
Line(l3) = {p3, p0};
ll0 = newll;
Line Loop(ll0) = {l0, l1, l2, l3};
s0 = news;
Plane Surface(s0) = {ll0};
bo2[] = BooleanUnion{Surface {s0}; Delete;} {Surface {s0}; Delete;};
Edited by Nico Schlömer