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

sdfTriangle

sdfTriangle(options?): SDFShape

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

Creates an equilateral triangle SDF shape.

Parameters

options?

TriangleOptions

Configuration options for the triangle

Returns

SDFShape

Triangle SDF shape definition

Example

// Sharp triangle pointing up
const triangle = sdfTriangle();
// Rounded triangle
const rounded = sdfTriangle({ cornerRadius: 0.1 });
// Triangle pointing down
const inverted = sdfTriangle({ rotation: Math.PI });