Skip to content
JOURNAL / INDEXPFXAMD — ENGINEERING NOTEBOOK

Geometry before the editor

Inside the geometry kernel: source-native Bézier curves, derivatives, measurable paths and numerical precision before any editor UI.

A vector editor is a visible layer on top of a much more exact problem. Before drawing handles or selecting objects, a system needs to agree on what a path is, what it means to evaluate a point on a curve, how to measure length, how to compare intersections, and which operations can be reproduced deterministically.

The curve is a mathematical object.

In PFx Vector Core, the Rust CubicBezier type stores four points: two endpoints and two control points. Its point_at(t) method implements the cubic Bernstein polynomial: (1−t)³P0 + 3(1−t)²tP1 + 3(1−t)t²P2 + t³P3. The derivative_at(t) and second_derivative_at(t) methods expose the rate of change and curvature-related information without passing through the renderer.

The curve's endpoints remain fixed when the control points move, but its tangents and shape change. That distinction explains why an editor can offer non-destructive handle editing. The core also implements subdivision: a cubic curve can be split into two curves at a parameter value without approximating it as a collection of straight lines.

A parameter is not a distance.

Moving t from 0.25 to 0.5 does not necessarily travel the same physical distance as moving it from 0.5 to 0.75. Speed varies with the derivative. The core includes arc-length measurement and, for repeated queries, an immutable PathMeasureIndex. It builds adaptive per-segment samples and uses interpolation and bounded inversion to relate source parameters to path distances. An index is a snapshot and must be rebuilt when its source geometry changes.

Numerical edge cases belong to the core.

Geometry operations must handle degenerate and nearly overlapping paths, high coordinate magnitudes and tolerance decisions. The repository goes beyond curve evaluation: it includes intersections, Boolean operations, offsets, tessellation, spatial indexing and SVG path normalization. A geometry kernel can validate its own properties even when the visual editor does not yet exist.

Scope of the release.

The repository labels version 1.0.0 as a stable geometry API with a bounded verification scope, not a guarantee that every numerical edge case has been eliminated. Rust is the core language and a WebAssembly integration exists; renderer, scene graph, editor interaction and browser end-to-end behavior are outside its verification boundary. The interactive drawing below evaluates the same documented cubic equation in the browser as an illustration. It does not load the Rust or WebAssembly build.

INTERACTIVE NOTE / 01REFERENCE STUDY

Explore the principle.

P0P3P1P2

Direct evaluation of the documented cubic equation in the browser; not the Rust/WASM runtime. The parameter t is not arc length.

REFERENCE / SOURCEPFx Vector Core — source Cubic Bézier implementation