OpenCASCADE changes arbitrarily position of point
The following code
SetFactory("OpenCASCADE");
Point(1)={0,0,2};
Point(2)={1,0,2};
Point(3)={0,1,2};
Point(4)={5.000000e-01,0,1.500000e+00};
Point(5)={0,5.000000e-01,2.500000e+00};
Point(6)={5.000000e-01,5.000000e-01,1.500000e+00};
Point(7)={5.000000e-01,0,1};
Point(8)={0,5.000000e-01,3};
Point(9)={5.000000e-01,5.000000e-01,1};
Bezier(1) = {1,7,2};
Bezier(2) = {3,8,1};
Bezier(3) = {2,9,3};
Curve Loop(1) = {1,3,2};
c[] = Point{1};
Printf("point 1: [%g, %g, %g]", c[0], c[1], c[2]);
Surface(1)={1};
c[] = Point{1};
Printf("point 1: [%g, %g, %g]", c[0], c[1], c[2]);
either segfaults or fails with the following
point 1: [0, 0, 2]
Error : OpenCASCADE exception Wire is not closed
Error : 'bug2.geo', line 19 : Could not add surface
point 1: [0.361803, 0.276393, 2]
Notice that the loop is indeed closed and that the coordinates of point 1 printed the second time are incorrect.
Notice that a small change makes the problem go away:
Point(1)={0.1,0,2};