liveBook · Manning

Polyline

As explained in Geometry for Programmers

A polyline is an ordered sequence of connected line segments represented by their successive points.

A polyline is an ordered chain of connected line segments, represented compactly by its successive points. In two-dimensional geometry, an array of points preserves which segments share endpoints without redundant data, making the representation useful for storage and processing. section 11.2

Approximating a curve

A smooth curve can be replaced by a sequence of straight segments. The result is less exact but easier to store and process, making a polyline a practical approximation for graphics and geometric modeling. section 11.2

Polylines make several geometric operations uniform:

  • Triangle meshes turn intersections that would otherwise be circles, conic sections, or polynomial curves into polylines of straight segments. section 11.2.2
  • A common segment-based representation lets the same intersection code handle many modeled shapes. section 11.2.2
  • Approximation quality is an engineering trade-off: too few segments lose useful shape, while too many make processing implausibly expensive. section 11.2.2
Figure 7.19 A first-degree NURBS is a polyline.
07-19

A first-degree NURBS is a continuous but nonsmooth polyline; N control points form N−1 segments. section 7.3.1

How Geometry for Programmers covers it

How deep it goes
Explains point-array representation, mesh intersections, approximation trade-offs, and the degree-one NURBS relationship.
Examples
Uses point arrays, approximated curves, triangle-mesh intersections, and first-degree NURBS with N control points.
What you can do after
Apply it via point arrays when storing or processing connected planar segments and approximating curves.
How it connects
Connects polylines to line segments, boundary representations, triangle meshes, curve approximation, and NURBS.

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.