Use closest points on two line segments as a small constrained convex optimization problem. Write the two line segments as
and put . Minimize the squared Euclidean distance ; minimizing its square also minimizes the distance. Compute the dot products
For nonzero, nonparallel directions, an interior minimum must satisfy the two derivative equations
Their determinant is , so the stationary candidate is
Retain this candidate only when both parameters lie in the unit interval.
The other possibilities are on the boundary. Define . Minimizing the same quadratic on each of the four edges gives these candidates by orthogonal projection onto a line segment:
Evaluate at every retained candidate and choose the smallest. The resulting are the required closest points. The quadratic is convex because it is the squared norm of an affine map. A minimum in the interior is stationary, and a minimum on the boundary minimizes one of these edge restrictions, so the list is exhaustive. Ties correspond to multiple equally valid answers.
Handle degenerate line segments before dividing: if and , set and ; if and , set and ; if both vanish, use the two endpoints. For exactly parallel directions, . The distance depends on a single linear combination of ; any interior minimizing level line reaches the boundary, so the four edge candidates still include a minimum.
For nearly parallel directions, compare with the scale , and solve the interior least-squares problem using QR decomposition or singular value decomposition if necessary. A small determinant should trigger a stable solve, not arbitrary rejection of a possibly valid interior solution. In particular, do not merely clip both coordinates of the infinite-line solution: the dot product couples the two parameters, and changing one changes the optimum for the other.
Work first in the parameter rectangle of the parametric surface. Set . With linearly independent, the chain rule gives
The intersection is transversal precisely when the implicit normal vector and the parametric normal vector are not parallel. Consequently , and the implicit function theorem makes a locally regular parameter curve. This is the setting for transversal surface intersection tracing by a predictor-corrector continuation method.
Find one seed on the required component. Subdivide parameter patches, enclosing their images by bounding volumes and testing whether a certified range of excludes zero. For a positive-weight NURBS, the active control-point convex hull supplies a convenient enclosure; interval arithmetic can tighten the range of the composed function. Search the surviving patches for a bracketed root or a local corrected seed. Merely checking signs at four corners is inadequate: a small closed intersection can lie wholly inside a patch with the same corner signs. An adaptive or certified patch search, or a supplied seed, avoids this failure. For a sphere centered at , use and ; for a torus, use its implicit polynomial and its differentiated polynomial in the same algorithm.
At a corrected seed , an unnormalized parameter tangent vector and a unit spatial tangent vector are
Choose the sign consistently with the previous tangent vector. Normalize and predict , so is approximately a physical arc length step. Correct the predictor by Newton method applied to
The Jacobian has rows and . At the starting point its first row vanishes along , whereas its second row applied to is one. The two rows are therefore independent. The transverse-plane condition prevents the corrector from sliding arbitrarily along the intersection. Restrict correction to a neighborhood of the predictor, use damping, and reduce when correction fails or its displacement becomes excessive; this prevents jumps to another nearby branch.
To obtain a sufficiently dense sequence, impose a physical point-spacing bound, a bound on tangent turning, and a chord-error estimate. For local curvature , the small-step sagitta is approximately ; estimate curvature from successive tangent vectors and reduce until this and the desired spacing are acceptable. The correction residual should be small relative to the drawing tolerance. Uniform steps in or alone do not ensure spatial density because the surface metric can vary considerably.
For an open component, trace in both tangent directions from the seed. On reaching a parameter boundary, locate the endpoint by solving together with that boundary's parameter equation, rather than accepting an overshoot. For a closed component, stop only after nontrivial travel and return to the initial parameter location with compatible tangent orientation; near-coincidence in three-dimensional space alone can mistake a self-intersection or neighboring branch for closure. Cross periodic seams using the appropriate chart identification. Adaptive physical stepping, local correction, and component-aware termination give the required point sequence. A vanishing parameter gradient signals a tangency or singularity outside the transversal hypothesis and must be reported rather than passed through by this regular algorithm.
Use the prescribed-speed time parametrization of a curve. On a regular part traversed in increasing , let and assume the prescribed speed is positive. The chain rule for velocity gives
Integrate this scalar ordinary differential equation with an adaptive Runge-Kutta method, arranging output at the exact times . Evaluate . Internal integration steps may be shorter than ; output interpolation must meet the same error tolerance, so variable numerical steps do not create variable frame times.
An equivalent implementation precomputes
by adaptive numerical integration. This function is strictly increasing. Bracket each in the table and invert using safeguarded Newton method or interval bisection; monotonicity makes each solution unique. Stop at , with a shorter final time interval if the total travel time is not a multiple of . This accounts for changes in both the curve's parameter speed and the physical speed, unlike equal increments in .
If the specified speed vanishes, examine the reciprocal-speed integral at that event. It may diverge, giving asymptotic approach, or be integrable, giving arrival in finite time. A scalar speed does not determine whether motion reverses or how it resumes after stopping; such behavior needs the physical dynamics or a chosen continuation. The positive-speed formula applies between these events, with the direction changed if the traversal reverses.
Use the equal-time points to estimate velocity and acceleration with centered finite differences:
At the endpoints use one-sided formulas of the desired order. A differentiated path and its time parametrization can instead supply these quantities. Let denote the gravitational acceleration, directed downwards. In the accelerating camera, the effective downward vector is , so the locally felt upward vector is . For a stationary camera this gives , fixing the sign.
The apparent-gravity camera frame is obtained by orthogonal projection and a cross product:
When , are perpendicular unit vectors, and completes a right-handed orthonormal basis: . Also , so the felt-up vector lies in the plane, with its transverse component pointing towards positive .
The stated exclusion of ensures , but it does not ensure . If felt-up is parallel to travel, the roll angle is undetermined rather than the construction being impossible. Every transverse orthonormal basis then has the required plane property. For continuity, project the previous into and normalize it, using . If this projection is also too small, choose a coordinate unit vector least aligned with and project that vector instead. Switch to this transported choice near the parallel case to avoid numerical amplification. A stopped vehicle likewise needs a chosen limiting travel tangent vector, since its zero velocity itself has no direction. None of this requires a Frenet frame, which can fail where curvature vanishes.
A subdivision curve should support subdivision curve interrogation rather than merely supply successively larger control polygons. Its interface should provide the parameter interval, orientation and open/closed status; endpoint and limit-point evaluation to a prescribed accuracy; and tangent vector or derivative evaluation where defined. It should be possible to split a parameter interval, commonly at its midpoint, into equivalent restricted curve definitions while retaining all neighboring controls needed by the refinement rule.
For geometric algorithms, request a certified bounding volume for each restricted curve, such as a convex hull or an axis-aligned bounding box, and the minimum and maximum of a plane's linear function over that bound. Request also a certified flatness bound: the maximum distance of the restricted limit curve from its endpoint chord, together with its spatial extent. These allow safe rejection, adaptive drawing and accuracy control. A positive, constant-reproducing subdivision mask often makes a control-point convex hull a valid bound. With negative mask coefficients this must be proved separately or replaced by a padded bound; it cannot simply be assumed.
Further useful enquiries include roots of a scalar function along the curve, closest-point searches, arc length, and inversion of an arc-length parametrization. They can be implemented through evaluation, differentiation, certified bounds and recursive subdivision. Evaluation, restriction, enclosure and error bounds are the essential primitives needed for reliable clipping and rendering; an unqualified control-polygon approximation is insufficient.
Orient the plane relative to the eye. For its affine function , assume and put . The desired closed half-space is . If the eye is on the plane, the notion of its side is undefined and a side convention must be supplied.
Apply recursive half-space clipping of a subdivision curve to each initial curve piece. Obtain a certified bounding volume , and calculate , . For a control-point convex hull, these extrema occur at its vertices, so this test is inexpensive. If , discard the piece. If , retain the whole piece and draw its chord only when its certified flatness is within the screen-space tolerance; otherwise subdivide and draw the children in parameter order. If , subdivide and repeat the classification.
At a sufficiently flat and sufficiently short terminal piece, clip the approximating chord from to against . If both endpoints are nonnegative retain the chord; if both are negative discard the chord; for opposite signs split it at
Retain the portion with nonnegative . Handle an endpoint exactly on the plane without dividing by zero, and retain a coplanar chord under the closed-half-space convention. The recursion yields an ordered polyline rather than connecting endpoints of disconnected retained pieces.
Crucially, do not reject an unresolved whole curve merely because its endpoints have negative signs: it can cross the plane twice and have a visible interior excursion. The preceding terminal chord rule is a rendering approximation at an explicitly chosen spatial tolerance. A flatness bound and a diameter bound make any missed leaf-sized excursion spatially small; they do not prove exact crossing topology, especially for a near-tangent contact or an unfavorable projection. Use the actual viewing projection to enforce a screen-space tolerance, with special handling near a perspective singularity.
If exact clipping intervals are required for a spline representation, isolate all roots of , split at them and classify each intervening interval. Bernstein basis coefficient bounds, derivative bounds and recursive subdivision can isolate roots on polynomial spans, including even-multiplicity tangencies. Treat identically coplanar spans separately. For a general subdivision curve, keep unresolved straddling pieces flagged or refine to the chosen tolerance instead of claiming that a finite endpoint-sign test is exact. Certified half-space rejection combined with adaptive subdivision is the recursive drawing algorithm; exact boundary topology needs additional root isolation.
The printed diagram is a propagation subdivision mask: it shows the influence of one old vertex on several new vertices. Its entries do not all belong to a single averaging stencil. The old vertex is retained, and a new vertex is inserted at each incident face centre. Reading the contributions arriving at a target gives
Thus each new vertex-vertex averages its old value and its four edge neighbors, while each new face-vertex is the centroid of its four old corners. Both stencils are convex combinations, reproduce constants and commute with affine maps. The neighboring contributions go to old vertices; the diagonal contributions go to face centres. The propagation coefficients sum to two because one refinement doubles the number of lattice vertices, not because either stencil fails to sum to one.
For calculations, describe this quincunx subdivision using
The refined square lattice is rotated by and its spacing is reduced by . In its integer coordinates, the one-step mask is
Indeed, a unit step in these new coordinates is an old face-centre displacement, whereas a diagonal step reaches an old edge neighbor. The even parity class contains the central and four diagonal coefficients and sums to one; the odd class contains the four axial coefficients and also sums to one. This checks the two target stencils independently.
Write the Laurent generating function of the one-step subdivision mask as
For quincunx subdivision, . A second step gives . Setting and , its fine-grid offset is , since . Hence the binary mask is the convolution of with its -transformed copy:
Expanding gives the centered binary propagation subdivision mask, with row and column offsets running from to :
The numerator entries sum to , so , appropriate for a binary surface refinement. More specifically, each of the four parity classes sums to one after division by , checking constant reproduction at every type of new lattice point.
In a regular region, moving one control point adds its displacement multiplied by a translate of the twice-smoothed four-direction box spline. Measure parameter distances in original grid-edge units, with the affected control point at the origin. The convex hull of the binary mask offsets is
After successive binary refinements the physical displacements are scaled by . Their possible accumulated offsets therefore form . The box spline description confirms that this zonotope is the actual support, not merely a loose enclosure. Equivalently,
It is an octagon with vertices . Its enclosing square is six original grid intervals wide in each direction. Cutting four right triangles of area two from this square gives area parameter-square units. Outside this octagon the control-point displacement has no effect; its closure is the support, although the basis function can vanish on its boundary.
The regular influence footprint is this width-six, area-28 parameter octagon. For a nonplanar control mesh, the affected part of the spatial surface is the image of the octagon, not necessarily a planar octagon of the same metric size. Near an extraordinary subdivision vertex, use the actual refinement neighborhood instead of assuming a globally regular lattice footprint.
The factorization of the binary subdivision mask identifies eight box spline directions. Apart from the monomial that centers the support, it is
The four normalized factors correspond respectively to averaging in the directions , each with multiplicity two. The factor four is the determinant of the binary dilation in two dimensions. The centering monomial translates the resulting box spline and changes neither its polynomial degree nor its smoothness. Thus this is the twice-smoothed four-direction box spline, rather than a tensor-product bicubic B-spline.
A two-dimensional box spline built from spanning directions is piecewise polynomial of total degree at most . Here there are eight directions, counting multiplicities, so the regular pieces have total degree six. This is total degree, not separate degree six in each parameter.
For the box spline smoothness criterion, let be the smallest number of directions whose removal leaves a set that does not span the plane. In this direction multiset, a line can contain at most two of the eight vectors, since each of the four distinct directions appears twice. At least six vectors must therefore be removed, and removing the six outside one chosen direction does achieve loss of rank. Hence , giving
In particular all fourth partial derivatives are continuous across the piece boundaries; generic fifth derivatives need not be. The box spline criterion and this degree-six four-direction example are documented in the primary paper 4–8 Subdivision. The factor count also explains the large support: the extra smoothing comes from repeating all four directional averaging factors. This regular-grid calculation does not establish at an extraordinary subdivision vertex.
Choose coefficients using the local subdivision matrix, not just by copying a pleasant-looking regular stencil. Because the grids alternate, form the matrix for a complete two-step cycle around the valence- extraordinary subdivision vertex, retaining a large enough neighborhood that it maps into itself. The three local coefficients enter this matrix through the specified vertex and face rules.
First require constant reproduction and commutation with affine maps: every target stencil must sum to one, and the valence-four rules must reduce to the regular ones already found. A propagation mask need not itself sum to one. For example, with an old-vertex target rule , normalization requires ; a face-centroid target rule separately has corner weights summing to one. If face weights depend on incident valences, impose their sum on each actual face, rather than incorrectly using a propagation-column normalization. Rotational and reflection symmetry around the vertex should preserve an isotropic treatment of its sectors. Nonnegative coefficients are desirable for convex hull bounds and stability, although they are not by themselves a smoothness proof.
For convergence, seek a simple eigenvalue one corresponding to the constant eigenvector, with all remaining eigenvalues of modulus below one. For a well-defined tangent plane, seek two independent, semisimple tangent modes with a common positive subdominant eigenvalue:
The angular modes should be the first sine and cosine modes around the ring. On the regular lattice the full two-step tangent scale is , which provides a useful consistency check. These requirements suppress persistent unwanted modes and ensure that generic first-order geometry is dominated by a two-dimensional tangent space.
Then check that the characteristic map of a subdivision surface built from those tangent eigenvectors is regular and injective on the punctured neighborhood. A dominant tangent pair together with a regular, nonfolding characteristic map is the crucial target; eigenvalues alone are insufficient. This check rules out folds or vanishing tangent area that a spectrum cannot detect. For reasonable curvature behavior, also try to keep second-order modes at or below in modulus, with equality and appropriate mode structure when nonzero finite curvature is desired. Avoid negative or complex modes that produce visible alternating ripples, excessive shrinkage and strongly anisotropic shape response.
These are selection criteria, not a uniquely determined triple of coefficients. The disappearance of extraordinary faces after one step simplifies the subsequent local matrix, but the extraordinary vertex remains and its smoothness still needs these tests. In particular, the regular result cannot simply be assigned to arbitrary valence.
Choose the knot origin so the span most influenced by is , and use its local parameter . The three active uniform quadratic B-spline basis functions give
The central coefficient reaches its maximum at , so this is indeed the span centered on the strongest influence of . Express it in the quadratic Bernstein basis:
Matching constant, linear and quadratic coefficients gives the quadratic Bézier curve controls
For example, and , checking the endpoint derivatives and the joins of neighboring spans.
Use degree elevation of Bernstein coefficients. If are degree- Bézier curve controls, the identical curve has degree- controls
This follows by multiplying each degree- Bernstein basis polynomial by and collecting the degree- terms, so the operation changes the representation, not the curve.
For the quadratic controls in part (a), the cubic controls are
Raise these cubic Bézier curve controls once more. Then
Thus the requested quartic Bézier curve controls, expressed in the original polygon, are
Each expression is an affine combination whose coefficients sum to one. Endpoint positions and derivatives are preserved at each degree-raising step, as is every point of the span.
Use the quartic treble-knot representation of a quadratic B-spline. Specify the indexing as well as the controls: for the interior of the long curve, take the quartic spline knot sequence
With the standard B-spline convention that control multiplies supported on , the answer is
In other words, keep the three interior quartic Bézier curve controls for each span in that order. The offset matters for the stated knot indexing; shifting all indices together gives an equivalent convention.
To prove the representation, insert each integer interior knot once, changing multiplicity three to four. A degree-four knot of multiplicity four separates Bézier curve spans while leaving their shared endpoint common. The three interior controls remain, and knot insertion constructs the shared endpoint from its neighboring controls with weights , since adjacent knot intervals have equal length. In fact,
The right endpoint is obtained in the same way. Hence every extracted quartic span has exactly the five controls proved in part (b). Knot insertion leaves the curve unchanged, so the assembled quartic B-spline is identical to the original quadratic one on every span.
There is also a derivative check at each join:
This is why treble knots are appropriate: degree four with interior knot multiplicity three permits continuity, exactly the generic continuity of the uniform quadratic B-spline. For a finite clamped curve, include its endpoint controls and endpoint knot multiplicities using the same degree elevation of Bernstein coefficients and knot insertion; the displayed formulas describe the long interior requested here, without imposing an unstated end condition.

Articles by others on the same topic (0)

There are currently no matching articles.