OpenCASCADE error when creating mesh with circular hole with GUI
I make a simple 2D rectangular mesh with a circular hole in it using the GUI (4.12.2). I get an OpenCASCADE error when I try to make the surface plane. This is because the OpenCASCADE engine is added when adding the circle. The error is: "unknown OpenCASCADE curve with tag 4. Could not add curve loop". The generated code is below.
When I move the OpenCASCADE line to the start of the script, remove the curve loop lines and recreate the curve loops, they get the correct ID and I can mesh the geometry.
//+
Point(1) = {0, 0, 0, 1.0};
//+
Point(2) = {1, 0, 0, 1.0};
//+
Point(3) = {1, 1, 0, 1.0};
//+
Point(4) = {0, 1, 0, 1.0};
//+
Line(1) = {1, 2};
//+
Line(2) = {2, 3};
//+
Line(3) = {3, 4};
//+
Line(4) = {4, 1};
//+
SetFactory("OpenCASCADE");
Circle(5) = {0.5, 0.5, 0, 0.1, 0, 2*Pi};
//+
Curve Loop(1) = {4, 1, 2, 3};
//+
Curve Loop(1) = {5};
//+
Plane Surface(1) = {1};
Edited by nijso beishuizen