Sphere with two holes
A = (2, 0, 0)
B = (0, 2, 0)
r = Slider(1,4, 0.1, 1, 180, false, true, false, false)
A' = r/abs(A) * A
B' = r/abs(B) * B
dmax = Slider(0.1, 2, 0.01, 1, 180, false, true, false, false)
SetValue(dmax, 0.8)
ind(d) = If(d<dmax, 1)
inX(ϕ, θ) = r * sin(ϕ) * cos(θ)
inY(ϕ, θ) = r * sin(ϕ) * sin(θ)
inZ(ϕ, θ) = r * cos(ϕ)
cosA = (x * x(A') + y * y(A') + z * z(A')) / r^2
cosB = (x * x(B') + y * y(B') + z * z(B')) / r^2
surf = Surface(ind(cosA(inX(ϕ, θ), inY(ϕ, θ), inZ(ϕ, θ))) ind(cosB(inX(ϕ, θ), inY(ϕ, θ), inZ(ϕ, θ))) inX(ϕ, θ), inY(ϕ, θ), inZ(ϕ, θ), ϕ, 0, π, θ, 0, 2π)