  The Casimir force due to a scalar field on a piston in a cylinder of radius
$r$ with a spherical cap of radius $R>r$ is computed numerically in the
world-line approach. A geometrical subtraction scheme gives the finite
interaction energy that determines the Casimir force. The spectral function of
convex domains is obtained from a probability measure on convex surfaces that
is induced by the Wiener measure on Brownian bridges the convex surfaces are
the hulls of. The vacuum force on the piston by a scalar field satisfying
Dirichlet boundary conditions is attractive in these geometries, but the
strength and short-distance behavior of the force depends crucially on the
shape of the piston casing. For a cylindrical casing with a hemispherical head,
the force for $a/R\sim 0$ does not depend on the dimension of the casing and
numerically approaches $\sim - 0.00326(4)\hbar c/a^2$. Semiclassically this
asymptotic force is due to short, closed and non-periodic trajectories that
reflect once off the piston near its periphery. The semiclassical estimate
$-\hbar c/(96\pi a^2)(1+2\sqrt{R^2-r^2}/a)$ for the force when $a/r\ll r/R\leq
1$ reproduces the numerical results within statistical errors.
