ddg.optimize.ifs.functionals module
Module for functionals defined on IndexedFaceSets.
The general form of a functional f is f(ifs, *attributes), where ifs is the IndexedFaceSet and attributes are the names of the attributes to be used.
It is assumed that a functional ‘knows’ on what kind of cell it is defined.
Note that we also call vector-valued maps functionals.
- ddg.optimize.ifs.functionals.flat_cubic_quad(ifs, attr_name)[source]
Flatness energy of 4-gonal indexed face set calculated on each face as the distance of its diagonals.
- Parameters:
- ifsddg.indexedfaceset.IndexedFaceSet
4-gonal indexed face set to calculate the energy on
- attr_namestr
Name of the 3-dim. vertex attribute to use
- Returns:
- numpy.ndarray
- ddg.optimize.ifs.functionals.g_flat_cubic_quad(ifs, attr_name)[source]
Jacobian for flat_cubic_quad.
- Parameters:
- ifsddg.indexedfaceset.IndexedFaceSet
4-gonal indexed face set to calculate the energy on
- attr_namestr
Name of the 3-dim. vertex attribute to use
- Returns:
- scipy.sparse.csr_matrix
- ddg.optimize.ifs.functionals.flat_cubic_n_quad(ifs, attr_name)[source]
Flatness energy of 4-gonal indexed face set calculated on each face as the distance of its diagonals divided by the average lengths of the diagonals.
- Parameters:
- ifsddg.indexedfaceset.IndexedFaceSet
4-gonal indexed face set to calculate the energy on
- attr_namestr
Name of the 3-dim. vertex attribute to use
- Returns:
- numpy.ndarray
- ddg.optimize.ifs.functionals.g_flat_cubic_n_quad(ifs, attr_name)[source]
Jacobian for flat_cubic_n_quad.
- Parameters:
- ifsddg.indexedfaceset.IndexedFaceSet
4-gonal indexed face set to calculate the energy on
- attr_namestr
Name of the 3-dim. vertex attribute to use
- Returns:
- scipy.sparse.csr_matrix
- ddg.optimize.ifs.functionals.flat_cubic_n2_quad(ifs, attr_name)[source]
Flatness energy of 4-gonal indexed face set calculated on each face as the distance of its diagonals d1, d2 mutliplied by (1/d1**2+1/d2**2).
- Parameters:
- ifsddg.indexedfaceset.IndexedFaceSet
4-gonal indexed face set to calculate the energy on
- attr_namestr
Name of the 3-dim. vertex attribute to use
- Returns:
- numpy.ndarray
- ddg.optimize.ifs.functionals.g_flat_cubic_n2_quad(ifs, attr_name)[source]
Jacobian for flat_cubic_n2_quad.
- Parameters:
- ifsddg.indexedfaceset.IndexedFaceSet
4-gonal indexed face set to calculate the energy on
- attr_namestr
Name of the 3-dim. vertex attribute to use
- Returns:
- scipy.sparse.csr_matrix
- ddg.optimize.ifs.functionals.flat_det_quad(ifs, attr_name)[source]
Flatness energy of 4-gonal indexed face set calculated on each face as the determinant of the matrix given by its horizontal, vertical and the corresponding diagonal vector.
- Parameters:
- ifsddg.indexedfaceset.IndexedFaceSet
4-gonal indexed face set to calculate the energy on
- attr_namestr
Name of the 3-dim. vertex attribute to use
- Returns:
- numpy.ndarray
- ddg.optimize.ifs.functionals.g_flat_det_quad(ifs, attr_name)[source]
Jacobian for flat_det_quad.
- Parameters:
- ifsddg.indexedfaceset.IndexedFaceSet
4-gonal indexed face set to calculate the energy on
- attr_namestr
Name of the 3-dim. vertex attribute to use
- Returns:
- scipy.sparse.csr_matrix
- ddg.optimize.ifs.functionals.circ_angle_quad(ifs, attr_name)[source]
Circularity energy of 4-gonal indexed face set calculated by the angles of its faces.
- Parameters:
- ifsddg.indexedfaceset.IndexedFaceSet
4-gonal indexed face set to calculate the energy on
- attr_namestr
Name of the 3-dim. vertex attribute to use
- Returns:
- numpy.ndarray