Skip to content

Attribute Interpolation

average_corners_to_faces(mesh, cattr, fattr, weight='uniform')

Given an attribute on corners, computes a face attribute that is the average per face

Parameters:

Name Type Description Default
mesh SurfaceMesh

the mesh

required
cattr Attribute

input corner attribute

required
fattr Attribute

output face attribute

required
weight str

the way attributes are weighted in the sum. three possibilities: - uniform: every corner will have weight 1/n - angle: corners contribute to a fae depending on the interior angle - sum: do not consider weights and just add the value at corners

'uniform'

Returns:

Name Type Description
Attribute Attribute

modified fattr

Raises:

Type Description
Exception

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

average_corners_to_vertices(mesh, cattr, vattr, weight='uniform')

Given an attribute on corners, computes a vertex attribute that is the average per vertex

Parameters:

Name Type Description Default
mesh SurfaceMesh

the mesh

required
cattr Attribute

input corner attribute

required
vattr Attribute

output vertex attribute

required
weight str

the way attributes are weighted in the sum. three possibilities: - uniform: every corner will have weight 1/n - angle: corners contribute to a vertex depending on the interior angle at this vertex - sum: do not consider weights and just add the value at corners

'uniform'

Returns:

Name Type Description
Attribute Attribute

modified vattr

Raises:

Type Description
Exception

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

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

Given an attribute on faces, interpolates its value onto vertices

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. four 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

  • sum : like uniform but does not divide

'uniform'

Returns:

Name Type Description
Attribute Attribute

modified vattr

Raises:

Type Description
Exception

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

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:

Name Type Description
Attribute Attribute

fattr

scatter_faces_to_corners(mesh, fattr, cattr)

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

Parameters:

Name Type Description Default
mesh Mesh

the input mesh

required
fattr Attribute

input face attribute

required
cattr Attribute

output face corner attribute

required

Returns:

Name Type Description
Attribute Attribute

cattr

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