Skip to content
This is the alpha v4 version website. Looking for the v3 documentation?

sdfSquare

sdfSquare(options?): SDFShape

Defined in: packages/sigma/src/rendering/nodes/shapes/square.ts:45

Creates a square/rounded rectangle SDF shape.

Parameters

options?

SquareOptions

Configuration options for the square

Returns

SDFShape

Square SDF shape definition

Example

// Sharp square
const square = sdfSquare();
// Rounded square
const rounded = sdfSquare({ cornerRadius: 0.2 });
// Rotated square (45 degrees)
const diamond = sdfSquare({ rotation: Math.PI / 4 });