Shap3d47.dat, 47th 'shape' file for CPO3D
Square hole in a sphere, by users equation.
For information on the option for users equations, see users equations.
Developed from shap3d39, square hole in circular disc..
The sphere has a radius of R, and so z = sqrt(R^2 - x^2 - y^2), always.
The equations, say g1(x,y,z), for the inner square edge are
x = s, y = s*tan(phi), where phi = 0 to pi/4.
The equations, say g2(x,y,z), for the outer circular edge are
x = r*cos(phi), y = r*sin(phi).
In the usual fashion we can combine these by using the general equation
g(x,y,z) = (1 - f)*g1 + f*g2,
where f goes from 0 to 1.
This reproduces g1 when f = 0, and g2 when f = 1.
Here s = 0.25, r = 0.75, R = 1 and 3 symmetry planes are used.
The equation for z looks complicated, but is essentially sqrt(R^2 - x^2 - y^2).
The '+1.e10' avoids sqrt(0).
Simulting a rectangular slot in a sphere is clearly possible, but more compicated.
The data, as they appear in the data file, are:
f 0 1 name of variable number 1 and its limits
phi 0 0.785398 name of variable number 2 and its limits
r 0.75 name of parameter number 1 and its fixed value
s 0.25 name of parameter number 2 and its fixed value
R 1 name of parameter number 3 and its fixed value
0 name of parameter number 4 and its fixed value
1 1 numbers of 2 applied voltages (can be same)
6 8 numbers of subdivisions of variables 1 and 2
(The program has corrected the less accurate value that was entered for pi/4.)