sdf

package
v0.7.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Aug 8, 2025 License: MIT Imports: 3 Imported by: 0

Documentation

Overview

Package sdf defines signed distance functions

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Box

func Box(x, y, bx, by, bw, bh float64) float64

Box computes the signed distance to an axis-aligned box.

func Circle

func Circle(x, y, cx, cy, radius float64) float64

Circle computes the signed distance to a circle.

func Hline

func Hline(x, y, pos float64) float64

func Max

func Max(shapes ...float64) float64

Max returns the maximum of a variable number of args.

func Min

func Min(shapes ...float64) float64

Min returns the minimum of a variable number of args.

func Repeat

func Repeat(val, dist float64) float64

func RoundBox

func RoundBox(x, y, bx, by, bw, bh, r float64) float64

RoundBox computes the signed distance to an axis-aligned rounded box.

func Segment

func Segment(x, y, ax, ay, bx, by float64) float64

func Vline

func Vline(x, y, pos float64) float64

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL