Parameterize the two line segments by
Put and abbreviate , , , , and . Minimizing the Euclidean distance is equivalent to minimizing the convex quadratic function
over a closed square. For nonzero nonparallel segment directions, . An interior minimum must satisfy
whose unique solution is
Keep it as a candidate only if both parameters lie in .
Every remaining minimum lies on the boundary. Define . The four edge minima are the point-to-segment orthogonal projections
Evaluate at those four pairs and at the admissible interior pair, and return a pair with the smallest value. This solves closest points on two line segments completely: continuity guarantees a minimum, and every interior or boundary location has been tested. Do not independently clamp and : the mixed term couples them. For example, , , and give the line minimizer . Its independently clamped pair has squared distance , whereas the correct edge minimizer has squared distance .
Without general position, explicitly handle these configurations:
  • If either segment has zero length, solve a point-to-segment projection; if both do, return the two points. This avoids division by or .
  • If the directions are parallel, and the interior linear system is singular. The four edge projections still contain a minimum. Overlapping projected parameter intervals can yield a whole family of closest pairs.
  • Collinear segments may overlap, touch, or be disjoint. Overlap gives zero distance with many choices; disjoint intervals give their nearest endpoints.
  • Coplanar nonparallel segments can intersect, including endpoint contacts. The same candidate tests return zero distance if the line-intersection parameters lie in the square. Coincident endpoints and equal candidate distances need no arbitrary division or uniqueness assumption.
In floating-point arithmetic, almost-parallel directions require a condition-aware or higher-precision solve; they must not be declared exactly parallel solely because the computed determinant is small. The returned distance is , and the returned points are obtained by substitution into .
The degree- Bernstein basis is
For , every basis function is nonnegative, and the binomial theorem gives
Therefore is a convex combination of its control points. By the definition of their convex hull,
This includes the endpoints because and . It depends on the specified parameter interval: outside it the weights need not be nonnegative.
For , differentiating the basis and using the elementary binomial identities gives
where out-of-range basis indices are zero. Thus
Hence the Bézier derivative control polygon has points , and
In particular the endpoint tangent vectors are and . For the curve is constant and its derivative is zero.
A parametric curve interrogation interface first supplies the parameter domain and the point . At regular parameters, it also supplies and, when needed, higher derivatives. The unit tangent vector, speed and curvature are then obtained from
in three dimensions. The formulas require ; a Frenet normal additionally requires nonzero curvature. A practical interface can restrict the curve to a parameter interval, provide endpoints, and give a certified bounding volume or a derivative-range bound. Arc length, closest-point and intersection queries are higher-level operations built from these elementary enquiries rather than consequences of point evaluation alone.
For a plane with , define
This reduces certified curve-plane intersection to scalar root isolation. A subdivision curve can expose the parametric enquiries by evaluating its limit at a parameter address: refine the corresponding piece until its certified positional enclosure reaches the requested accuracy, or use its exact local spline representation. Derivative evaluation similarly needs the derivative refinement rule and its error bound. A finite control vertex is not automatically a point of the limit curve.
One reliable algorithm is range-based isolation followed by safeguarded Newton iteration:
  • Split the domain at representation breaks. For each interval , enclose by projecting its certified curve bound onto . Reject if this interval excludes zero.
  • If the derivative enclosure excludes zero and the endpoint values have opposite signs, there is exactly one intersection in . Record any endpoint zero separately and avoid counting it twice.
  • Within such a bracket, propose using the Newton root-finding iteration. Accept only a well-conditioned step inside a suitably smaller portion of the bracket; otherwise use the bisection method. Update the sign bracket and stop when its parameter width and the curve's positional error meet the tolerances.
  • Subdivide every other undecided interval. Use representation-supported tests for tangent roots and coplanar pieces; do not reject an interval merely because its endpoint signs agree.
For a transverse root, the derivative is nonzero nearby, so sufficiently fine intervals have monotone and the sign bracket isolates it. Bisection provides a global error bound; near a simple root Newton iteration gives quadratic convergence. Good enclosures discard most of the curve before expensive limit evaluation, and the method does not require a specific subdivision mask.
The weaknesses are equally important. Near tangency is small and Newton steps are ill-conditioned; same-sign endpoints may conceal a tangent root or two crossings. An arc lying in the plane has infinitely many intersections and should be returned as an interval, not a point. Finite-precision evaluations require error enclosures before a sign is certified. For an arbitrary smooth point-evaluation oracle, no finite sampling scheme can certify all intersections: a smooth bump between sampled parameters can create extra crossings without changing any sampled values or derivatives. With finitely many isolated transverse intersections and convergent certified enclosures, the algorithm terminates to any prescribed tolerance. For tangencies it either uses stronger representation tests or reports unresolved possible-contact intervals, rather than silently omitting them.
A subdivision curve interrogation interface provides its control/topology data, a parameter interval or address, and a refinement operation returning restricted child pieces with their parameter correspondence. It also provides a certified enclosing bounding volume, endpoints or limit-point enclosures, and an error estimate for replacing a sufficiently small piece by its chord. Positional and derivative limit queries may be implemented by refinement or by conversion to the appropriate spline. Nonnegative masks often imply a control-point convex hull bound; a generic scheme with negative weights needs a separate bound.
These enquiries can be applied to a parametric curve by using interval restriction as the subdivision operation and constructing its enclosure from its representation. For example, a Bézier curve is split by De Casteljau's algorithm, and each child's control-point convex hull encloses exactly that child arc. More generally, if a restricted curve has a certified bound , the midpoint supplies
This ball gives a signed plane-range enclosure. Such an upper derivative bound must be supplied or proved; taking the largest derivative seen in a few samples is not a certificate.
The recursive intersection algorithm is as follows. Start with the whole domain. For each piece with enclosure , compute
If or , discard that piece. Otherwise split it and process the children, unless a root has already been uniquely isolated and can be polished as in Question 3. For a convex hull bound, the extrema of this affine plane function are attained among its control points, so only dot products are required. For an axis-aligned bounding box, choose the low or high coordinate in each term according to the sign of .
At a small flat piece, the chord-plane parameter is
when the denominator is nonzero. It supplies an initial estimate, which is corrected on the actual curve. A chord of a piece with geometric error gives plane-function error at most ; a transverse root additionally needs a positive derivative lower bound to convert that into a parameter error. A chord hit is not by itself a proof of the exact crossing count. Keep unresolved tangent contacts, merge shared-endpoint hits, and return any certified coplanar parameter intervals separately.
Good speed comes from a bounding volume hierarchy, conservative cheap rejection before accurate evaluation, caching shared subdivision work, local rather than uniform refinement, and fast root polishing only after isolation. Convex-hull or box extrema cost far less than solving every potential intersection. Tight bounds shrink rapidly with subdivision and reduce the active search to neighborhoods of actual crossings. Derivative information can prove monotonicity, accelerate with the Newton root-finding iteration, or tighten range bounds using interval arithmetic. There is no universal fixed speed guarantee when the curve is nearly coplanar or has arbitrarily many intersections: those are genuinely difficult inputs. The representation must provide meaningful bounds and restriction operations; point/derivative enquiries alone do not imply such capabilities.
In a convenient cardinal parameter normalization, take the unit -cube and project by the sum of its coordinates. Its pushforward density is the unit-direction univariate box spline
Equivalently, with at its discontinuity points,
Here there are convolution factors; some conventions instead index the spline by its degree . The half-open convention for assigns knot values consistently and does not change the pushforward measure.
Support and positivity. A sum of numbers in lies in , so the closed support is finite. For , the interval of with has positive length. Induction in the convolution recurrence therefore gives in the interior. For , : strict positivity includes the open support interval, not its endpoints.
Partition of unity. The translates of cover the line exactly once under the half-open convention. Nonnegativity permits interchange of sum and integral, and induction gives
Thus , a locally finite sum. Each also has integral one, although partition of unity does not mean its maximum value is one.
For , repeated integration gives the explicit truncated-power form
On each unit knot interval this is a polynomial of degree at most , and on it is , so the degree is attained. Each truncated power has continuous derivatives; the derivative of order jumps at the first knot. Therefore the dependence on the projected box dimension is
For the pieces are constants and the function is discontinuous at the knots. If geometric width is measured under orthogonal projection onto the unit diagonal instead, the projected coordinate is , so the physical support width is ; its unit-mass density is . These are different scalings of the same cardinal spline, not different continuity or degree claims.
For a bivariate box spline, choose a spanning direction matrix in the plane and project the unit cube by . Define its normalization by
The support is the zonotope , and the polynomial pieces generally have total degree . The grid comes from the chosen direction families and their lattice translates. Two independent directions, with repetitions, give tensor-product B-splines on a parallelogram grid. Three families such as give a three-direction triangular grid; an affine change of basis can make it the usual equilateral triangular grid. The four families give the criss-cross square grid and the quadratic four-direction box spline. Changing the direction matrix and repeating directions therefore changes the grid, support and smoothness while retaining the box-projection construction.
This is mid-edge subdivision, rather than a vertex-retaining refinement. Use the usual closed two-manifold mesh setting: each edge has two incident facets and each vertex has a cyclic fan. For boundary meshes, a boundary refinement rule has to be specified separately. The relevant generic-position condition excludes collapsed local tangent directions and singular regular patches.
Topology and the manifold property. Regard the abstract mesh as a cell decomposition of a surface. Join the edge midpoints in each facet. The inner polygon is the new face associated with that facet; the corner regions around an old vertex assemble into the face associated with that vertex. At an old edge midpoint, the four adjacent corner connections form a cyclic link. Thus every new interior vertex has valence four, every new edge has two incident faces, and the refined cell complex is homeomorphic to the original surface. If the original counts are , the new counts are , preserving . The cyclic-link argument, rather than Euler characteristic alone, verifies the local manifold condition. Convergence and local regularity, justified below, transfer this abstract surface structure to the limit.
Convex hull. Each newly created point is an average of two previous points. By induction it is a convex combination of original vertices. The same is true of points of any triangulation of the refined facets, and taking limits keeps them in the closed convex hull. Hence the entire limit stays in that hull, not necessarily inside the original nonconvex enclosed solid.
Facet centroids. Follow the descendant inner face of an original -sided facet, with cyclic vertices . Its vertices satisfy . Summing proves mid-edge facet centroid invariance:
For a cyclic Fourier mode the multiplier is , whose modulus is for . Every mean-zero mode therefore decays, so all descendant face vertices converge to . Consequently the original vertex centroid belongs to the limit surface. No planarity assumption is needed.
Quadratic triangular pieces. On a regular quadrilateral mesh, apply two midpoint steps. Each new point combines three old neighboring controls with weights . For example, around a face with cyclic corners , the four new points are
This is the binary refinement mask obtained by expanding
with the translation chosen to place the refined grid at quarter offsets. The limit is therefore represented by shifts of the quadratic four-direction box spline with directions . Projection of a four-cube onto the plane has piecewise total degree , and its knot grid is triangular. Coordinatewise linear combinations preserve that degree, giving parametric quadratic triangle patches. Around a nonregular center there are infinitely many shrinking rings of such patches; the isolated center is their limit, not generally part of a finite polynomial patch representation.
Only finitely many initially possible smoothness exceptions. Every vertex has valence four after the first step. Only the descendants of original facets and the faces created around original vertices can remain nonquadrilateral. All subsequently created faces around four-valent vertices are quadrilaterals. Thus every point except the limiting centers of those persistent nonquadrilateral faces eventually lies in a regular patch neighborhood. The number of possible exceptional centers is at most . For the regular box spline, any three distinct directions still span the plane, so three directions must be removed to make the remainder nonspanning. The box spline continuity criterion gives across its triangle boundaries. This proves continuity away from at most those finitely many centers.
Removing the apparent exceptions. Center a finite neighborhood of an -sided exceptional face, and analyze a full two-step subdivision matrix so the mesh orientation is restored. Cyclic Fourier basis modes diagonalize its sector symmetry. The face mode has eigenvalue
The local ring blocks also contribute eigenvalues and zero. For , the constant mode is the single eigenvalue one, and the two first-frequency tangent modes dominate all nonconstant remaining modes. Construct their characteristic map of a subdivision surface; its quadratic derivative pieces must have a nonzero consistently oriented Jacobian, and its fundamental sector must be injective. These checks, not the eigenvalue ordering alone, give a regular chart and a continuously limiting tangent plane for generic data.
The case needs a separate Jordan analysis: is eightfold, so the usual semisimple double-eigenvalue test does not apply. Its first-frequency Jordan chains supply the leading tangent behavior, while the other contributions become relatively negligible. Regularity and injectivity of that generalized characteristic map complete the argument. These concrete spectral and characteristic-map checks are established for this scheme in Peters and Reif, Sections 3 and Appendix. Thus the generic limit is geometrically also at the exceptional centers; compatible local charts need not preserve the original uniform refinement parameterization.
The manifold statement concerns the abstract limit surface and its regular local parametrizations. It does not, from combinatorics and generic tangent data alone, prove global injectivity of the image in three-dimensional space. A particular model may require an additional global self-intersection test before claiming that its image is an embedded manifold.

Articles by others on the same topic (0)

There are currently no matching articles.