liveBook · Manning

Parametric cubic

As explained in Geometry for Programmers

A cubic polynomial curve is a curve whose coordinate functions are polynomials of degree at most three.

A parametric cubic represents a planar curve with separate cubic coordinate functions, x(t) and y(t). In contour reconstruction, it replaces a straight segment with a smooth path guided by endpoint positions and tangent information. section 11.4.1 section 12.4.5

Build a smooth contour in three practical stages:

  • Find an initial border where neighboring grid or pixel samples have opposite signed-distance values. section 11.4.3 section 12.4.5
  • Fit each border vertex toward the target isoline by moving along the inverted gradient according to the function value. section 11.4.1 section 12.4.5
  • Solve two four-equation systems per segment, using endpoint coordinates and partial derivatives to determine the x and y cubic coefficients. section 11.4.1 section 11.4.3

Image contour reconstruction

A smooth interpolated pixel function supplies a quasi-SDF. After fitting an initial pixel-border contour to its threshold isoline, tangent vectors define cubic replacements for the segments; splitting each curve into 16 short line segments makes plotting convenient. section 12.4.5

Figure 12.28 Smooth contour made of cubic polynomials
12-28

Inspect the resulting smooth contour made from cubic polynomial pieces. section 12.4.5

How Geometry for Programmers covers it

How deep it goes
Derives endpoint-and-derivative coefficient systems and implements tangent-based smoothing, while treating curve plotting as linear approximation.
Examples
Uses SDF contours, interpolated pixel images, fitted vertices, tangent vectors, and plotted cubic segments.
What it assumes
Assumes grids, segments, gradients, partial derivatives, and SDFs while introducing their coordination through contour reconstruction.
What you can do after
Build smooth contour segments from endpoints and derivatives, then approximate them with line segments for rendering.
How it connects
Connects grids, line segments, partial derivatives, signed distance functions, and parametric polynomials.

Related concepts

This explainer was generated by Manning's knowledge graph from the text of Geometry for Programmers. The section links point to the parts of the book it draws on.