Builtin Library
README.md
pathNetwork.geometry
The shape of a path network, as pure functions over plain tables: the
centreline of an edge through its control points (a Catmull-Rom curve whose
end tangents are shared with the next edge across a node), the cross-sections
along it (position, heading, bank, the surface's right and up), and the meshes
pathNetwork stands on entities: an edge's surface with side walls and end
caps, and a junction's surface fanned out to the ends of the edges meeting
there, sharing their vertices.
| Function | |
|---|---|
centreline(control, before, after, step) | Sample a curve through the control points finely enough to measure it. |
at(line, d) | The point a distance along a sampled centreline. |
sections(line, spec) | Cross-sections between two distances, each with its surface frame; an end tips onto a plane (startPlane / endPlane) with its cross slope turning no faster than maxTwist per metre, and a twisting stretch gets sections added until the drawn triangles stand within tolerance of the surface. |
smooth(ys, window, opts) | A moving-average elevation profile, its window full and centred on each sample (lead and trail samples of ground past the ends), each held end meeting the height and grade given through a cubic ease that adds no more than maxGrade and bends the grade no faster than maxBend per metre. |
edgeMesh(sections, opts) / junctionMesh(centre, ends, opts) | Geometry for renderer.mesh.create. |
project(a, b, x, z) / surfaceHeight(a, b, t, lateral) | Where a point lies against a segment, and the surface's height there. |
fanHeight(centre, ring, x, z) / fanDistance(centre, ring, x, z) | A junction surface's height over a point, and how far outside its outline the point stands. |
corner(section, side) | A surface edge of a cross-section (side -1 left, 1 right). |