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

generateFindEdgeDistanceForShapes

generateFindEdgeDistanceForShapes(shapes, shapeGlobalIds?): object

Defined in: packages/sigma/src/rendering/glsl.ts:201

Generates the findEdgeDistance(vec2 direction, float size) GLSL used to place labels at a shape’s boundary, handling both single- and multi-shape programs. For multi-shape it also emits queryShapeSDF and the int g_shapeId; global the caller must set (from the node’s shape id).

The caller must include the shapes’ SDF functions (getShapeGLSLForShapes) before the returned code. Shared by the label-background and attachment shaders so they query the boundary exactly like the label program.

Parameters

shapes

SDFShape[]

shapeGlobalIds?

number[]

Returns

object

code

code: string

multiShape

multiShape: boolean