Issues regarding msh3 and the Sphere function


I am trying to create surface meshes, and more specifically, I am trying to use the Sphere function. Unfortunately, I get the error message : The Identifier Sphere does not exist.
I am very new to FreeFem++ and I don’t really understand where the error could come from. Here’s my code for reference.

My code:

// For 3D meshing tools
load "msh3" 
load "tetgen"
load "medit"

// Parameters start:
// For the sphere:
real Radius = 400.;
real SphMesh = 1; // size of the mesh
int SphLabel = 1;
real SphCentreX = 0., SphCentreY = 0., SphCentreZ = 0.;
int SphOrientation = -1; // orientation of the surface (1 for extern).

// For the first object (that has a potential V_0):
int[int] Obj1Nseg = [100, 2000, 20]; // number of segments in each direction (x, y, z)
real [int, int] Obj1Bounds = [[-10, 10],[-100, 100],[-1, 1]];
int [int, int] Obj1Labels = [[2,3],[4,5],[6,7]];
int Obj1Orientation = 1;

// For the second object:
// Parameters end.

// Build surface meshes for different objects
// I can't use underscores in variable names.
meshS Thair = Sphere(Radius, SphMesh, SphLabel,
    SphCentreX, SphCentreY, SphCentreZ, SphOrientation);
meshS ThObj1 = SurfaceHex(Obj1Nseg, Obj1Bounds, Obj1Labels, Obj1Orientation); 

// Add them so that we have the total surface meshes
meshS Thsystem = Thair + ThObj1 // + Thobj2...

I don’t know if maybe I’m not using the Sphere function correctly. I don’t understand clearly how the Sphere function should be used. Indeed, by reading the doc, at page 148, there’s an example of a call to the Sphere function. However, on page 150, the function should include the position of the centre.

The issue might also come from the installation process of FreeFem++ because I tried running the following example but it wouldn’t show the same output: I would only see the “Aluminium Plate” image (at line 32) and it would be a white mesh on a black background.

I already tried uninstalling and reinstalling FreeFem++ from the Github (version 4.9 .exe) to no avail.

Thank you for your time, and any advice is welcome ! :slight_smile: