shapeField.svgExtruded

An SVG outline given depth: the outline's distance texture, extruded in z by params.halfDepth.

shapeField.svgExtruded(
  layout: {readonly $: {readonly params: {readonly halfDepth: number}}},
  svgLayout: {readonly $: {readonly sdfSource: d.Infer<d.WgslTexture2d<d.F32>>}},
  cfg: {size: number},
): ShapeField3

Import sim from shaders/std and use sim.shapeFields.shapeField.svgExtruded.

size is the texture's side in texels.

Parameters

NameTypeNotes
layout{readonly $: {readonly params: {readonly halfDepth: number}}}
svgLayout{readonly $: {readonly sdfSource: d.Infer<d.WgslTexture2d<d.F32>>}}
cfg{size: number}

Example

shapeField.svgExtruded(simLayout, svgSdfLayout, {size: 512})

Tip. Outside the texture's footprint the distance keeps growing, so strays still find their way back.

See also