Skip to main content

Module discretize

Module discretize 

Source
Expand description

Turning a curve into a polyline within a stated deflection.

The first half of tessellation, and the half that decides whether the second half can succeed: a face’s triangulation is built from the polylines of its boundary edges, so two faces meeting along an edge produce a watertight join only if they discretize that edge to the same points. That is why discretization is a property of the edge rather than of the face, and why it is a separate step from triangulating the face itself.

§What deflection means

The chord deflection is the greatest distance between the polyline and the curve it approximates. It is a length, so it scales with the model, and it is the number a caller actually has an opinion about: “no visible error at this zoom”, “within machining tolerance”.

The angular deflection bounds how far the tangent may turn across one segment. Without it a nearly straight curve gets two points and a near-circular one gets far too few near its flattest part; chord error alone does not notice a long, gently curving span.

Structs§

Deflection
How finely to approximate a curve.
Polyline
A curve approximated by points, with the parameters they came from.

Functions§

discretize
Approximate curve over range within deflection.
discretize_on_surface
Discretize a pcurve with its chord tolerance measured in space, through the surface that gives its chart a metric.
discretize_planar
Approximate a planar curve in a surface’s parameter space.
is_straight
Whether a curve is a straight line, seeing through any trimming.
is_straight_planar
Whether a planar curve is a straight line in parameter space.