Problemcore
Point projection onto a parametric surface
Also called point inversion, foot point problem, closest point on a surface.
Given a point and a parametric curve or surface, find the parameters of the nearest point on it, or of the point itself when it lies on the surface.
Point projection asks for the point of a parametric surface that is nearest to a given point , and for its parameters . When lies on the surface the problem is called point inversion: find the parameters of a known point of the surface. The same problem for a curve is the one dimensional case. Every CAD system solves it many times a second, to pick a point on a face, to measure how far a scanned point is from the model, and to map points of space into the parameter domain of a patch, and the hard part is to find the nearest point and not only a nearby one.
In plain words
You have a curved sheet in space, drawn by a formula that turns two numbers into a point. You also have a point in space. You want the spot on the sheet that is closest to your point, and you want the two numbers that give that spot.
At the closest spot, the straight line from your point to the sheet meets the sheet at a right angle. This gives two equations. But they also hold at spots that are not the closest: at the farthest spot, at saddle spots, and at spots that are closest only in a small region.
So the problem has two parts. The easy part is to make a guess precise. The hard part is to be sure that no other spot is closer. If the point is on the sheet, you only want its two numbers.
Definition
Input. A regular parametric surface of class on a closed parameter box , usually a Bézier patch, a B-spline or a NURBS surface. A point . A tolerance .
Output. Parameters that minimize the squared distance
and the foot point and the distance . In the numerical version the output distance is within of the true minimum. When more than one point attains the minimum, the problem asks for one of them, or for all of them in the variant below.
Regular. The patch is regular where . There the unit normal is . This page uses the fundamental forms with , , , , , , written as the matrices and . With this sign of , a principal curvature , a root of , is positive when the surface bends towards . See fundamental forms and surface curvature.
First order conditions. At an interior minimum the gradient of vanishes:
Proof. is differentiable and , by the product rule. At an interior minimum of a differentiable function both partial derivatives vanish, because for all small of both signs.
At a regular point the two conditions say that is perpendicular to the tangent plane, so for one real , the signed distance: the point lies on the normal line of its foot point. On the boundary of the conditions change. On the edge a minimum needs and , since must not decrease as moves into the box. At the corner it needs and . These are the KKT conditions of the box constraint.
Second order test. Let be an interior point at which is regular and , with . Then the Hessian of is
Proof. Differentiate once more: , and in the same way and . Put : then , and the same for the other two.
Since is positive definite, has the same inertia as , where the symmetric matrix has the principal curvatures as its eigenvalues. So the signs of the eigenvalues of the Hessian are the signs of and . The stationary point is a strict local minimum when both are positive, it is not a minimum when one is negative, and the Hessian is singular exactly when , that is, when is a center of principal curvature of the foot point. These centers form the focal surface of . The Jacobian of the system is , so Newton's method on has a regular solution exactly when is not on the focal surface.
Variants
- Point inversion. The point is known to lie on the surface, up to rounding. The minimum distance is and the task is to find the parameters. Piegl and Tiller treat inversion and projection with one method.
- Curves. For a curve the one condition is . If is a polynomial curve of degree , the left side is a polynomial of degree at most , so there are at most stationary parameters unless it vanishes identically. For a rational curve of degree , the numerator of the condition is , of degree at most , because the terms of degree in cancel.
- All foot points. Return every global minimizer, or every stationary point. This is needed when is on the medial axis of a closed surface, where two or more foot points tie, and for the distance function of Patrikalakis and Maekawa, Chapter 7.
- Local projection. Return the stationary point nearest to a given start parameter. This is what a Newton method computes, and it is what a tracking task needs: a point that moves a little should get parameters that move a little.
- Directional projection. Project along a given direction instead of along the normal. This is the intersection of the line with the surface, a case of curve surface intersection.
- Trimmed surfaces. The minimum is over the trimmed region of a trimmed surface, so the boundary of the domain is the trimming loop, not a box.
Examples
- Sphere. For the sphere of radius about the origin and , the foot point is and the distance is . For every point of the sphere is a foot point, at distance : the center of the sphere is its focal point, with for .
- Paraboloid, one foot point. Let and . Then with , and . For this is positive for all , so the only minimum is the origin, at distance .
- Paraboloid, a circle of foot points. For the minimum is at , a whole circle of foot points, at distance . For the circle has radius and the distance is . The origin is still a stationary point, but now a local maximum of along every line through it. The second order test agrees: at the origin is the identity, with , and , so , which changes sign at the focal point .
- Saddle, a quintic. Let , a hyperbolic paraboloid, and . The conditions are and . The first gives , and the second then becomes after the denominators are cleared. It has one real root, , with and distance . The other four roots are complex, so this is the only stationary point on the whole plane. Since grows without bound, has a minimum on the plane, so this point is the global minimum.
- The nearest point is on an edge. Let on and . The minimum is at , on the edge , at distance . There but , so the interior conditions fail, and the edge condition, on the edge , holds.
- Singular parametrization. For the sphere and , the foot point is the pole at , where . Both conditions hold for every , the Jacobian is singular, and the answer for is arbitrary.
Known algorithms
- Newton point inversion. Sample the patch on a coarse grid, take the best sample as the start, and solve with Newton's method, with the steps clamped to the box. This is the method of Piegl and Tiller. It is fast, and it converges quadratically near a solution off the focal surface, but the global answer depends on the density of the start grid.
- Subdivision with exclusion. Split the control net with the de Casteljau algorithm or knot insertion. A piece whose control points are all farther from than the best distance found so far cannot hold the nearest point, by the convex hull property, and is discarded. Newton then runs on the pieces that remain. Ma and Hewitt (2003) give such a method for NURBS curves and surfaces. Pieces that are excluded by a proved bound make the answer global up to the tolerance.
- Algebraic. Eliminate one parameter from with a resultant, as in the quintic example, and isolate the real roots of the result with real root isolation. This finds all stationary points, at a cost that grows quickly with the degree. Patrikalakis and Maekawa, Section 5.5, list it with implicitization for point inversion.
- Certified solvers. The interval projected polyhedron method and the interval Newton method find all roots of in the box with proofs, and the minimum is then chosen from a finite list.
| Algorithm | Time | Space | Properties | Code |
|---|---|---|---|---|
| Newton point inversion | O((n^2 + k) m) worst | O(m) extra | deterministicnot exactiterative | 1 language |
Bounds
Existence. is continuous on the compact box , so a minimum exists. It need not be unique, as the sphere and the paraboloid show.
The number of stationary points. For a curve the count is at most or , proved above. For a polynomial tensor product patch of bidegree , the polynomial has bidegree and has bidegree . Bézout's theorem on , which this page does not prove, then bounds the number of isolated complex solutions by . This is for a bilinear patch, the degree of the quintic in the saddle example, and for a bicubic patch. A local method can converge to any of them.
Stability. Off the focal surface and away from ties, the foot point depends smoothly on : the Jacobian of is nonsingular there, by the second order test, and the implicit function theorem applies. At a tie the foot point jumps, as for the paraboloid on its axis above the focal point. A small move of off the axis selects one point of the circle. So no method can return a foot point that is continuous in for all .
The first order conditions, the second order test, the curve bounds, existence and stability are proved on this page. The bound for patches is cited. The speed of the methods on real models is measured, not proved.
Reductions
- To a square system. Interior stationary points are the solutions of the two equations in two unknowns, a case of systems of nonlinear equations. Edges add one equation in one unknown each, and corners are evaluated directly.
- To a plane curve. If the surface has an implicit equation, which implicitization gives for rational patches, point inversion reduces to evaluating that equation and solving for the parameters along it.
- From the problem to minimum distance. A point is a surface of dimension zero, so point projection is the case of minimum distance between surfaces in which one surface is a single point.
- To curves. Fixing turns the problem into projection onto the curve . Alternating between the two curve problems never increases , a coordinate descent that is slower than Newton.
Applications
- Picking and snapping. A user clicks near a face, and the system projects the 3D point onto the face to get its parameters.
- Inspection. The deviation of a measured point from the CAD model is its distance to the nearest face, the core of CAD based inspection.
- Registration. Each step of iterative closest point projects every scanned point onto the model.
- Surface fitting. Parameter correction projects each data point onto the current fit to update its parameter.
- Trimming and Booleans. Points of an intersection curve, found in space, are projected into the parameter domain of each face to form the trimming curves of a trimmed surface.
- Distance and offsets. The Hausdorff distance between a surface and a point set, and the test whether a point lies within a distance of an offset surface, both need the nearest point.
References
- Les Piegl and Wayne Tiller, The NURBS Book, second edition, Springer, 1997, Chapter 6, Section 6.1, Point inversion and projection for curves and surfaces, pages 229 to 234 (the two first order equations, the start point from a coarse sample and the stopping tests)
- Nicholas M. Patrikalakis and Takashi Maekawa, Shape Interrogation for Computer Aided Design and Manufacturing, Springer, 2002, Chapter 5, Section 5.5, Point/surface intersection (implicitization, Newton's method, bounding boxes with subdivision and the distance function method), and Chapter 7, Sections 7.2 and 7.3, on distance functions and their stationary points
- Ying Liang Ma and W. T. Hewitt, Point inversion and projection for NURBS curve and surface, control polygon approach, Computer Aided Geometric Design 20(2), 79 to 99, 2003, the whole paper (the subdivision of the control net, the exclusion of pieces that cannot hold the nearest point, and the Newton step on the remaining piece)
Where this leads
About this page
The build computes these levels from the evidence in the repository. Each row says what the next level needs. Read what the levels mean.
| Ladder | Level | What the next level needs |
|---|---|---|
| Human proof | H0 no proof |
|
| Lean | L0 no Lean part |
|
| Visual | V0 none |
|
| Writing | W2 basic |
|
Tag AAS8GF Edit this page History Report an error Markdown