betaFeedback

WorksComputer Science

Volume and Surface Area of two Orthogonal, Partially Intersecting Cylinders: A Generalization of the Steinmetz Solid

Abstract

The intersection of two orthogonal cylinders represents a classical problem in computational geometry with direct applications to engineering design, manufacturing, and numerical simulation. While analytical solutions exist for the fully intersecting case, the Steinmetz solid, partial intersections with arbitrary depth ratios require numerical methods or approximations. This work presents general integral expressions for both the intersection volume and surface area as explicit functions of the intersection depth. Accompanying these exact formulations are empirical approximation functions, which provide closed-form evaluations with relative errors below 15% across the full range of intersection depth. Validation against Quasi-Monte Carlo simulation confirms the accuracy of both the analytical and approximate solutions.

Two orthogonal, partially intersecting cylinders

Figure 6.

Introduction

The intersection of two cylinders is a classical problem in computational geometry with applications in engineering, manufacturing, and numerical simulation. Determining the volume and surface area of the intersection shape requires careful geometric analysis and integration techniques. Analytical solutions exist only for the fully intersecting case (Steinmetz solid), where both cylinders completely overlap; partial intersections with arbitrary depth ratios necessitate numerical methods or approximation schemes. This work derives general integral expressions for both the intersection volume and surface area as functions of the intersection depth parameter δ=H/D\delta= H/D, alongside practical empirical approximation functions that allow for rapid evaluation without numerical integration. The analytical results are validated through Quasi-Monte Carlo estimation, establishing the accuracy and applicability of the derived expressions.

Geometric Integration

Analytical Derivation of Intersection Volume

A Cartesian coordinate system is introduced with the XX and ZZ axes aligned parallel to the bottom and top cylinders, respectively. The YY axis is oriented in the vertical direction. The origin is placed in the center of the intersection shape. The intersection height, i.e., the extent of the intersection in YY direction, is denoted by HH.

As illustrated in Figure 2, cross-sections of the intersection shape in the XZXZ plane are rectangles with dimensions dd and ww. These dimensions depend solely on the vertical coordinate yy. Note that the intersection shape possesses an improper rotational symmetry: reflecting the geometry across the Y=0Y = 0 plane followed by a rotation of π/2\pi/2 maps the object onto itself. Consequently, the partial volumes and surface areas above and below the Y=0Y = 0 plane are identical.

Intersection of two cylinders with rectangular cross sections

Figure 2. At any given height, the intersection shape has a rectangular cross section. Its width and length are highlighted by the green and red lines.

Figure 3 illustrates how the width and depth depend on y∈[0,H/2]y \in[0,H/2]. The width and depth are given by:

Figure 3. Cross-sectional cuts illustrating the relation of width and height with the intersection volume. The origin of the coordinate system is placed in the center-of-mass of the intersection volume.

w(y)=D2−(2y−D+H)2w(y) = \sqrt{D^2 - (2y - D + H)^2}
d(y)=D2−(2y+D−H)2d(y) = \sqrt{D^2 - (2y + D - H)^2}

Defining the dimensionless width and depth as w′=w/Dw' = w/D and d′=d/Dd' = d/D, respectively, the expressions reduce to:

w′=1−(2y′−1+δ)2(1)w' = \sqrt{1 - (2y' - 1 + \delta)^2} \tag*{(1)}
d′=1−(2y′+1−δ)2(2)d' = \sqrt{1 - (2y' + 1 - \delta)^2} \tag*{(2)}

where y′=y/Dy' = y/D and δ=H/D\delta= H/D. The dimensionless volume, normalized by a cube of side length DD, is obtained by integrating the cross-sectional area w⋅dw \cdot d along the yy-axis:

VD3=2D3∫0H/2dy w d=2∫0δ/2dy′ w′ d′\frac{V}{D^3} = \frac{2}{D^3} \int_{0}^{H/2} dy\,w\,d = 2 \int_{0}^{\delta/2} dy'\,w'\,d'

Using equations (1), (2) in the integral above, and V′=V/D3V' = V/D^3, we arrive at:

V′(δ)=8∫0δ/2dy′y′4−Q1y′2+Q22,(3)V'(\delta) = 8 \int_{0}^{\delta/2} dy' \sqrt{y'^4 - Q_1 y'^2 + Q_2^2}, \tag*{(3)}

with Q1=1−δ+δ2/2Q_1 = 1 - \delta+ \delta^2/2 and Q2=δ/2−(δ/2)2Q_2 = \delta/2 - (\delta/2)^2. Equation (3) represents the general solution for the intersection volume. Numerical integration of this expression yields the values listed in Table 1 and the solid curve in Figure 5(left). Note that the volume function (3) is not point symmetric around the half-intersection depth.

δ\delta0.10.20.30.40.50.60.70.80.9
V′V'0.0150.0560.1200.1990.2900.3870.4810.5670.635
(V′−Vapprox′)/V′(%)(V'-V'_{\mathit{approx}})/V'(\%)-9.4-12.8-14.8-15.4-14.8-12.9-9.9-6.3-2.4
A′A'0.6121.1901.7322.2322.6883.0933.4403.7193.916
(A′−Aapprox′)/A′(%)(A'-A'_{\mathit{approx}})/A'(\%)-2.2-3.8-4.9-5.3-5.2-4.6-3.6-2.3-0.9

Table 1. Integral values of reduced volume and surface area, together with relative errors of the respective approximations.

Figure 5. Reduced (volume|surface area) against intersection depth, displaying the integral solution, its empirical approximations, and two Monte Carlo approximations with different number of sample points. Left: reduced volume, Right: reduced surface area.

Specifically, in the case of fully intersecting cylinders, the intersection volume integral is readily solved analytically, resulting in V′(1)=2/3V'(1)=2/3. The intersection volume of two fully intersecting cylinders of diameter DD equals two-thirds of the volume of a cube with side length DD. This result is also known as the volume of the Steinmetz solid.

The intersection volume (3) is excellently approximated through the empirical relation (4), as indicated by the dashed curve in Figure 5(left) and the relative errors in Table 1.

Vapprox′(δ)=13(1−cos⁡(δπ))(4)V'_{\mathrm{approx}}(\delta)=\frac{1}{3}\left(1-\cos(\delta\pi)\right) \tag*{(4)}

Analytical Derivation of Intersection Surface Area

A cylindrical coordinate system (r,ϕ,x)(r,\phi,x), aligned with the bottom cylinder, is defined. The surface of the intersection volume consists of two cylindrical shell sections: one belonging to the bottom cylinder and one to the top cylinder, see Figure 1 (PDF p. 2). Each cylindrical shell section possesses two planes of symmetry and can be decomposed into four congruent surfaces. The gray surface in Figure 4 (facing the reader) is a cylindrical shell section of the bottom cylinder and its surface area is one-eighth of the entire surface area. The area of this shell section is calculated as a surface integral in cylindrical coordinates at constant radius RR:

Intersection volumes for depth ratios from 0.1 to 1

Figure 1 (PDF p. 2). The intersection depth is measured by δ=H/D\delta= H/D, which is indicated above each volume. The intersection volume of fully-intersecting cylinders is called a Steinmetz solid (δ=1\delta= 1).

Figure 4. Intersecting cylinders, illustrating geometric features for calculating the gray shell sections. The cylindrical coordinate system is placed in the bottom cylinder. Left: δ≤1/2\delta\leq1/2, Right: δ>1/2\delta>1/2

A=8R∫0x~dr∫ϕ1ϕ2dϕA=8R\int_{0}^{\widetilde{x}}\mathrm{d}r\int_{\phi_1}^{\phi_2}\mathrm{d}\phi

Along the x-direction, the shell section extends from 0 to x~\widetilde{x} for δ≤1/2\delta\leq1/2, and from 0 to RR for δ>1/2\delta>1/2. At each position xx the shell section is spanned between the two azimuth angles ϕ1,ϕ2\phi_1,\phi_2. When δ≤1/2\delta\leq1/2, ϕ1=0\phi_1=0, and when δ>1/2\delta>1/2, the value of ϕ1\phi_1 depends on whether x≤x~x\leq\widetilde{x} or x>x~x>\widetilde{x}: ϕ1=0\phi_1=0, if x≤x~x\leq\widetilde{x} and ϕ1≠0\phi_1\ne0, if x>x~x>\widetilde{x}.

A=8R∫0x~dr dϕ2δ≤12(5)A=8R\int_{0}^{\widetilde{x}}\mathrm{d}r\,\mathrm{d}\phi_2 \qquad\delta\leq\frac{1}{2} \tag*{(5)}
A=8R(∫0x~dr dϕ2+∫x~Rdr dϕ2−ϕ1)δ>12,(6)A=8R\left(\int_{0}^{\widetilde{x}}\mathrm{d}r\,\mathrm{d}\phi_2+\int_{\widetilde{x}}^{R}\mathrm{d}r\,\mathrm{d}\phi_2-\phi_1\right) \qquad\delta>\frac{1}{2}, \tag*{(6)}

where the position x~\widetilde{x} is calculated as

x~=2RH−H2\widetilde{x}=\sqrt{2RH-H^2}

The local intersection depth is denoted by h(x)h(x). It is related to the position xx through R2=x2+(h+R−H)2R^2=x^2+(h+R-H)^2. For δ≤1/2\delta\le1/2, hh is related to ϕ2\phi_2 through cos⁡(ϕ2)=(R−h)/R\cos(\phi_2)=(R-h)/R, and when δ>1/2\delta> 1/2, cos⁡(π−ϕ2)=(h−R)/R\cos(\pi-\phi_2)=(h-R)/R. In either case, isolating ϕ2\phi_2 yields:

ϕ2=cos⁡−1(1−hR)=cos⁡−1(2−HR−1−x2R2)\phi_2=\cos^{-1}\left(1-\frac{h}{R}\right)=\cos^{-1}\left(2-\frac{H}{R}-\sqrt{1-\frac{x^2}{R^2}}\right)

Similarly, for δ>1/2\delta> 1/2 and x>x~x>\tilde{x}, the distance k(x)k(x) is the local gap between the intersection volume and the top-most position of the bottom cylinder, see Figure 4, right. kk and xx are related through R2=x2+(H−R−k)2R^2=x^2+(H-R-k)^2, and kk and ϕ1\phi_1 are related through cos⁡(ϕ2)=(R−k)/R\cos(\phi_2)=(R-k)/R. Combining these relations yields:

ϕ1=cos⁡−1(1−kR)=cos⁡−1(2−HR+1−x2R2)\phi_1=\cos^{-1}\left(1-\frac{k}{R}\right)=\cos^{-1}\left(2-\frac{H}{R}+\sqrt{1-\frac{x^2}{R^2}}\right)

Finally, substituting H/R=2δH/R=2\delta, x′=x/Rx'=x/R, A′=A/D2A'=A/D^2, Q=2−2δQ=2-2\delta, x~′=x~/R=2δ−δ2\tilde{x}'=\tilde{x}/R=2\sqrt{\delta-\delta^2} the integrals (5), (6) are written as:

A′=2∫0x~′dx′cos⁡−1(Q−1−x′2)(7)A'=2\int_{0}^{\tilde{x}'} dx'\cos^{-1}\left(Q-\sqrt{1-x'^2}\right) \tag*{(7)}
A′=2(∫01dx′cos⁡−1(Q−1−x′2)−∫x~′1dx′cos⁡−1(Q+1−x′2))(8)A'=2\left(\int_{0}^{1}dx'\cos^{-1}\left(Q-\sqrt{1-x'^2}\right)-\int_{\tilde{x}'}^{1}dx'\cos^{-1}\left(Q+\sqrt{1-x'^2}\right)\right) \tag*{(8)}

The integrals above describe the reduced surface area of the entire intersection shape. The integral can be solved analytically only for δ=0\delta=0 or δ=1\delta=1; otherwise, numerical integration is required. The resulting reduced surface area is plotted against the intersection depth in Figure 5(right) as a solid curve, and certain calculated integral values are found in Table 1.

When δ=1\delta=1, integral (8) can be reduced significantly, Q=0Q=0, x~′=0\tilde{x}'=0:

A′=2(∫01dx′cos⁡−1(−1−x′2)−∫01dx′cos⁡−1(1−x′2))=2(π−2∫01dx′cos⁡−1(1−x′2))=2(π−2[x′cos⁡−1(1−x′2)+1−x′2]01)=4\begin{aligned} A'&=2\left(\int_{0}^{1}dx'\cos^{-1}\left(-\sqrt{1-x'^2}\right)-\int_{0}^{1}dx'\cos^{-1}\left(\sqrt{1-x'^2}\right)\right)\\ &=2\left(\pi-2\int_{0}^{1}dx'\cos^{-1}\left(\sqrt{1-x'^2}\right)\right)\\ &=2\left(\pi-2\left[x'\cos^{-1}\left(\sqrt{1-x'^2}\right)+\sqrt{1-x'^2}\right]_{0}^{1}\right)\\ &=4 \end{aligned}

This solution is the surface area of the Steinmetz solid.

The surface area integrals (7), (8) can be excellently approximated with the empirical relation:

Aapprox′=4sin⁡(δπ2)(9)A'_{\mathit{approx}}=4\sin\left(\frac{\delta\pi}{2}\right) \tag*{(9)}

The resulting plot is shown as the dashed curve in Figure 5(right) and the approximation errors are listed in Table 1.

Quasi-Monte Carlo Estimation

In this section, a Quasi-Monte Carlo method to estimate the intersection volume and surface area of two arbitrary finite cylinders is described. The corresponding Python implementation is provided in the Appendix. All geometric parameters (endpoints of axes, radii) can be freely specified, allowing application to perpendicular, skew, or partially overlapping cylinders.

The core of the algorithm involves calculating the shortest Euclidean distance from sample points PiP_i to a cylinder axis defined by endpoints AA and BB:

APi→=Pi−A\overrightarrow{AP_i}=P_i-A
AB→=B−A\overrightarrow{AB}=B-A
ti=APi→⋅AB→∣AB→∣2t_i=\frac{\overrightarrow{AP_i}\cdot\overrightarrow{AB}}{\lvert\overrightarrow{AB}\rvert^2}
ti′=clip⁡(ti,0,1)t_i'=\operatorname{clip}(t_i,0,1)
Qi=A+ti′AB→Q_i=A+t_i'\overrightarrow{AB}
di=∥Pi−Qi∥d_i=\lVert P_i-Q_i\rVert

Here, QiQ_i is the point on the axis segment closest to PiP_i, while did_i is the orthogonal distance. The scalar ti′t_i' represents the relative position of the closest point on the axis segment ABAB to the point PiP_i, expressed as a fraction between 0 and 1 along the length of the segment. This is an established geometric method (Ericson [1]).

Samples are generated using a Sobol sequence, a low-discrepancy quasi-random generator.

Volume

For volume estimation, points are drawn in the interior using cylindrical coordinates, transformed back to Cartesian space via an orthogonal local basis (u\mathbf{u}, v\mathbf{v}, d\mathbf{d}), with d\mathbf{d} along the cylinder axis and u\mathbf{u}, v\mathbf{v} constructed orthogonal to d\mathbf{d} via cross products. Radial samples are drawn by taking the square root of uniformly distributed random numbers, which ensures that points are uniformly distributed across the circular cross-section.

The intersection volume estimate proceeds as follows:

  1. Generate nn samples within the first cylinder’s interior.

  2. For each sample, compute its orthogonal distance to the second cylinder’s axis.

  3. Mark the sample as “hit” if this distance is less than or equal to the second cylinder’s radius.

  4. The estimated intersection volume is

Vest=(hitsn)Vcyl 1V_{\mathrm{est}} = \left(\frac{\mathrm{hits}}{n}\right)V_{\mathrm{cyl\,1}}

where Vcyl 1=πr12L1V_{\mathrm{cyl\,1}} = \pi r_1^2 L_1.

Surface area

For surface area estimation, samples are instead mapped to the lateral surface using the same basis, with the angular and longitudinal coordinates spanning the full 2π2\pi and axis length, respectively.

For surface area estimation:

  1. Generate nn samples on the surface of each cylinder individually.

  2. For each sample, compute its distance from the axis of the other cylinder.

  3. For each cylinder, the proportion of its surface points found to lie inside the other cylinder is used to estimate the portion of the lateral surface that forms part of the intersection.

  4. The estimated intersection surface area is:

Aest=f1Acyl 1+f2Acyl 2A_{\mathrm{est}} = f_1 A_{\mathrm{cyl\,1}} + f_2 A_{\mathrm{cyl\,2}}

where f1,2f_{1,2} are the fractions of surface samples on each cylinder found to lie inside the other, and Acyl=2πrLA_{\mathrm{cyl}} = 2\pi rL.

Appendix: Monte Carlo implementation

import numpy as np
from scipy.stats import qmc


def point_to_segment_distance_vectorized(P, A, B):
    AP = P - A
    AB = B - A
    AB_dot = np.dot(AB, AB)
    t = np.einsum('ij,j->i', AP, AB) / AB_dot
    t = np.clip(t, 0, 1)
    closest = A + t[:, np.newaxis] * AB
    return np.linalg.norm(P - closest, axis=1)


def cylinder_surface_area(A, B, r):
    return 2 * np.pi * r * np.linalg.norm(B - A)


def sample_cylinder_surface(A, B, r, n_samples):
    axis = B - A
    length = np.linalg.norm(axis)
    direction = axis / length if length > 0 else np.array([0, 0, 1])

    # Create orthogonal basis
    if np.allclose(direction, [0, 0, 1]):
        u = np.array([1, 0, 0])
    else:
        u = np.cross(direction, [0, 0, 1])
        u /= np.linalg.norm(u)
    v = np.cross(direction, u)

    # Generate Sobol samples
    m = int(np.ceil(np.log2(n_samples)))
    sampler = qmc.Sobol(d=2, scramble=True)
    samples = sampler.random_base2(m=m)[:n_samples]

    # Convert samples to cylindrical coordinates
    theta = samples[:, 0] * 2 * np.pi
    z = samples[:, 1] * length

    # Convert to 3D coordinates with vectorized operations
    points = (
        A[:, None]
        + z[None, :] * direction[:, None]
        + r * np.cos(theta)[None, :] * u[:, None]
        + r * np.sin(theta)[None, :] * v[:, None]
    )
    return points.T


def sample_intersection_volume(A1, B1, r1, A2, B2, r2, n_samples=5_000_000):
    axis = B1 - A1
    length = np.linalg.norm(axis)
    direction = axis / length if length > 0 else np.array([0, 0, 1])
# Create orthogonal basis vectors for Cylinder 1’s coordinate system
if np.allclose(direction, [0, 0, 1]):
    u = np.array([1, 0, 0])
    v = np.array([0, 1, 0])
else:
    u = np.cross(direction, [0, 0, 1])
    u /= np.linalg.norm(u)
    v = np.cross(direction, u)

# Generate samples
sampler = qmc.Sobol(d=3, scramble=True)
samples = sampler.random_base2(m=int(np.log2(n_samples)))

# Convert to cylindrical coordinates with uniform volume distribution
radial = r1 * np.sqrt(samples[:, 0])  # Correct sqrt for uniform density
theta = 2 * np.pi * samples[:, 1]
z_local = length * samples[:, 2]

# Convert to 3D points in world coordinates
points = (
    A1[:, None] +
    z_local[None, :] * direction[:, None] +
    radial[None, :] * (np.cos(theta)[None, :] * u[:, None] +
                       np.sin(theta)[None, :] * v[:, None])).T
d2 = point_to_segment_distance_vectorized(points, A2, B2)
hit_ratio = np.mean(d2 <= r2)
cyl_volume = np.pi * r1 ** 2 * length

return hit_ratio * cyl_volume

def sample_intersection_surface_area(A1, B1, r1, A2, B2, r2, n_samples=5_000_000):
    # Sample both surfaces
    points1 = sample_cylinder_surface(A1, B1, r1, n_samples)
    points2 = sample_cylinder_surface(A2, B2, r2, n_samples)

    # Check containment using vectorized distances
    in_cyl2 = point_to_segment_distance_vectorized(points1, A2, B2) <= r2
    in_cyl1 = point_to_segment_distance_vectorized(points2, A1, B1) <= r1

    # Calculate estimated areas
    area1 = cylinder_surface_area(A1, B1, r1)
    area2 = cylinder_surface_area(A2, B2, r2)

    return (np.mean(in_cyl2) * area1) + (np.mean(in_cyl1) * area2)

References

  1. [1]Ericson, C., 2005. Real-Time Collision Detection. volume 1. Morgan Kaufmann.DOI

Paper details

vlnc:W_ydz9sq6k
Version
v1 · latest
Published
Fresh — added to the Hub within the last 30 days
Added
License
CC BY 4.0
Usage

views · 10

downloads · 0

A view counts once per browser per day, a download each time the PDF is requested.

  • Computer Science

Not recorded for this paper

View statement
Looking for related papers…
Contents