Skip to content
sigma.js sigma.js
v4.0.6 Docs Examples GitHub 12.3K

generateFindEdgeDistanceForShapes

generateFindEdgeDistanceForShapes(shapes, shapeGlobalIds?): object

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

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.

SDFShape[]

number[]

object

code: string

multiShape: boolean