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
| Name | Type | Notes |
|---|---|---|
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
shapeField.analyticExtruded— A flat shape given depth: the 2D distance of a circle, polygon or star, extruded in z byparams.halfDepth.shapeField.svgLifted3d— An SVG outline lifted into a 3D solid, rotated by the shape's live rotation.