Path
Module Geometry.Paths
In ixfx, a Type Paths.Path is an object typically derived from some other shape. It describes a directed path.
The basic functions are:
- bbox - calculate enclosing rectangle
- distanceToPoint - calculate distance to some point
- interpolate - interpolate along path
- length - compute length
- nearest - nearest point on path to given point
- relativePosition - compute ‘progress’ along path at point ‘a’
Create with:
- Lines.toPath which returns a Type Lines.LinePath
- Arcs.toPath
- Circles.toPath
Importing
Section titled “Importing”// Sub moduleimport { Paths } from "@ixfx/geometry.js"// Eg: Paths.nearest();
// Whole moduleimport * as Geometry from "@ixfx/geometry.js"// Eg: Geometry.Paths.nearest();
// From bundleimport { Geometry } from "@ixfx"// Eg: Geometry.Paths.nearest();
// And within your HTML's <HEAD> </HEAD> block:<script type="importmap">{ "imports": { "@ixfx":"/ixfx/index.js", "@ixfx/": "/ixfx/" } }</script>
// Sub module from parentimport { Paths } from "@ixfx/geometry.js"// Eg: Paths.nearest();
// Whole parent moduleimport * as Geometry from "@ixfx/geometry.js"// Eg: Geometry.Paths.nearest();
// From the bundleimport { Geometry } from "@ixfx/bundle.js"// Eg: Geometry.Paths.nearest();
// Sub module from parentimport { Paths } from "https://unpkg.com/@ixfx/geometry/bundle"// Eg: Paths.nearest();
// Whole parent moduleimport * as Geometry from "https://unpkg.com/@ixfx/geometry/bundle"// Eg: Geometry.Paths.nearest();
// Single module from the bundleimport { Geometry } from "https://unpkg.com/@ixfx/bundle"// Eg: Geometry.Paths.nearest();