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

sdfDiamond

sdfDiamond(options?): SDFShape

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

Creates a diamond (rhombus) SDF shape.

Parameters

options?

DiamondOptions

Configuration options for the diamond

Returns

SDFShape

Diamond SDF shape definition

Example

// Sharp diamond
const diamond = sdfDiamond();
// Rounded diamond
const rounded = sdfDiamond({ cornerRadius: 0.1 });
// Rotated diamond
const rotated = sdfDiamond({ rotation: Math.PI / 4 });