UNPKG

@thi.ng/geom

Version:

Functional, polymorphic API for 2D geometry types & SVG generation

42 lines 1.23 kB
import type { Fn } from "@thi.ng/api"; import type { ReadonlyVec, Vec, VecPair } from "@thi.ng/vectors"; import type { Attribs, IHiccupShape2 } from "../api.js"; import { APC } from "./apc.js"; /** * nD Cubic bezier patch defined by array of 4x4 control points in this * order: * * ```text * 7 11 * 3 +---+---+---+ 15 (UV = 1,1) * | | | | * 2 +---+---+---+ 14 * | | | | * 1 +---+---+---+ 13 * v | | | | * ^ 0 +---+---+---+ 12 * | 4 8 * | * +----> u * ``` * * The class implements a `unmapPoint()` method to transform a 2D UV coordinate * into the worldspace position on the patch surface. * * The `toHiccup()` impl is only suitable for 2D patches. * * Ported from toxiclibs. * */ export declare class BPatch extends APC implements IHiccupShape2<BPatch> { readonly type = "bpatch"; readonly dim = 2; constructor(points: Iterable<Vec>, attribs?: Attribs); copy(): BPatch; copyTransformed(fn: Fn<ReadonlyVec[], Vec[]>): BPatch; withAttribs(attribs: Attribs): BPatch; edges(): VecPair[]; unmapPoint(uv: ReadonlyVec, out?: Vec): Vec<number>; toHiccup(): any[]; } //# sourceMappingURL=bpatch.d.ts.map