Skip to content

Attribute Interpolation

interpolate_faces_to_vertices(mesh, fattr, vattr, weight='uniform')

Given an attribute on vertices, interpolates its value onto faces

Parameters:

Name Type Description Default
mesh SurfaceMesh

the mesh

required
fattr Attribute

input face attribute

required
vattr Attribute

output face attribute

required
weight str

the way attributes are weighted in the sum. three possibilities :

  • uniform: every face will have weight 1

  • area: face have a weight proportionnal to their area

  • angle: face contribute to a vertex depending on the interior angle at this vertex

'uniform'

Returns: Attribute: modified vattr

Raises:

Type Description
Exception

fails if 'weight' is not in {'uniform', 'area', 'angle'}

interpolate_vertices_to_faces(mesh, vattr, fattr)

Given an attribute on vertices, interpolates its value onto faces

Parameters:

Name Type Description Default
mesh Union[SurfaceMesh, VolumeMesh]

the input mesh

required
vattr Attribute

input vertex attribute

required
fattr Attribute

output face attribute

required

Returns: Attribute: fattr

scatter_vertices_to_corners(mesh, vattr, cattr)

Given an attribute on vertices, distributes its values onto corresponding corners.

Parameters:

Name Type Description Default
mesh Mesh

the input mesh

required
vattr Attribute

input vertex attribute

required
cattr Attribute

output face corner attribute

required

Returns:

Name Type Description
Attribute Attribute

cattr