import * as typegpu6 from "typegpu"; import * as typegpu_data0 from "typegpu/data"; //#region src/2d.d.ts /** * Signed distance function for a disk (filled circle) * @param point Point to evaluate * @param radius Radius of the disk */ declare const sdDisk: typegpu6.TgpuFn<(point: typegpu_data0.Vec2f, radius: typegpu_data0.F32) => typegpu_data0.F32>; /** * Signed distance function for a 2d box (rectangle) * @param point Point to evaluate * @param size Half-dimensions of the box */ declare const sdBox2d: typegpu6.TgpuFn<(point: typegpu_data0.Vec2f, size: typegpu_data0.Vec2f) => typegpu_data0.F32>; /** * Signed distance function for a rounded 2d box * @param point Point to evaluate * @param size Half-dimensions of the box * @param cornerRadius Box corner radius */ declare const sdRoundedBox2d: typegpu6.TgpuFn<(point: typegpu_data0.Vec2f, size: typegpu_data0.Vec2f, cornerRadius: typegpu_data0.F32) => typegpu_data0.F32>; /** * Signed distance function for a line segment * @param point Point to evaluate * @param A First endpoint of the line * @param B Second endpoint of the line */ declare const sdLine: typegpu6.TgpuFn<(point: typegpu_data0.Vec2f, A: typegpu_data0.Vec2f, B: typegpu_data0.Vec2f) => typegpu_data0.F32>; /** * Signed distance function for a quadratic Bezier curve * @param point Point to evaluate * @param A First control point of the Bezier curve * @param B Second control point of the Bezier curve * @param C Third control point of the Bezier curve */ declare const sdBezier: typegpu6.TgpuFn<(point: typegpu_data0.Vec2f, A: typegpu_data0.Vec2f, B: typegpu_data0.Vec2f, C: typegpu_data0.Vec2f) => typegpu_data0.F32>; /** * A fast approximation of the signed distance function for a quadratic Bezier curve * @param point Point to evaluate * @param A First control point of the Bezier curve * @param B Second control point of the Bezier curve * @param C Third control point of the Bezier curve */ declare const sdBezierApprox: typegpu6.TgpuFn<(point: typegpu_data0.Vec2f, A: typegpu_data0.Vec2f, B: typegpu_data0.Vec2f, C: typegpu_data0.Vec2f) => typegpu_data0.F32>; /** * Computes the signed distance field for a pie shape (circular sector). * * @param point - The point to evaluate, in 2D space * @param sc - The sine/cosine of the pie's half-angle (`d.vec2f(std.sin(angle/2), std.cos(angle/2))`) * @param radius - The radius of the pie */ declare const sdPie: typegpu6.TgpuFn<(point: typegpu_data0.Vec2f, sc: typegpu_data0.Vec2f, radius: typegpu_data0.F32) => typegpu_data0.F32>; /** * Distance function for a zero-width circular arc. * The circle is centered at the origin. The arc's midpoint is at `(0, radius)`, and it extends * by `angle / 2` to each side of it, so it opens towards negative Y. * Since the arc has no width, no point is ever inside it; subtract a stroke half-width from * the result to get a solid shape (e.g. `sdArc(p, sc, radius) - thickness`). * * @param position Point to evaluate, relative to the circle's center * @param sc Sine and cosine of the arc's half-angle: `vec2f(sin(angle / 2), cos(angle / 2))`, * where `angle` is the full sweep in radians, from 0 to 2 * PI * @param radius Radius of the arc's centerline (non-negative) * @returns Unsigned distance to the arc (non-negative), zero only on the arc itself */ declare const sdArc: typegpu6.TgpuFn<(position: typegpu_data0.Vec2f, sc: typegpu_data0.Vec2f, radius: typegpu_data0.F32) => typegpu_data0.F32>; /** * Signed distance function for a regular hexagon with flat edges at the top and bottom. * * @param point Point to evaluate, relative to the hexagon's center * @param radius Inradius: distance from the center to the middle of each edge (non-negative) * @returns Negative inside the hexagon, zero on its edge, positive outside */ declare const sdHexagon2d: typegpu6.TgpuFn<(point: typegpu_data0.Vec2f, radius: typegpu_data0.F32) => typegpu_data0.F32>; /** * Signed distance function for a regular hexagon, together with its gradient. * Same shape as {@link sdHexagon2d}. * * @param point Point to evaluate, relative to the hexagon's center * @param radius Inradius: distance from the center to the middle of each edge (non-negative) * @returns vec3f(distance, gradient.x, gradient.y), where the gradient is the unit vector * pointing in the direction of increasing signed distance. The gradient is undefined * at points exactly on the edge. */ declare const sdgHexagon2d: typegpu6.TgpuFn<(point: typegpu_data0.Vec2f, radius: typegpu_data0.F32) => typegpu_data0.Vec3f>; //#endregion export { sdArc, sdBezier, sdBezierApprox, sdBox2d, sdDisk, sdHexagon2d, sdLine, sdPie, sdRoundedBox2d, sdgHexagon2d };