skshapes.morphing.intrinsic_deformation.IntrinsicDeformation
- class skshapes.morphing.intrinsic_deformation.IntrinsicDeformation(n_steps=1, metric='as_isometric_as_possible', endpoints=None, use_stiff_edges=True, **kwargs)
Bases:
BaseModel
Vector field deformation model.
- Parameters:
n_steps (
int
) – Number of integration steps.metric (
Union
[Literal
['as_isometric_as_possible'
,'shell_energy'
],Callable
]) – Riemannian metric used to regularize the morphing.endpoints (
None
|Float32[Tensor, '_ 2']
|Float32[Tensor, '_ 3']
) – The endpoints of the morphing. If None, the endpoints are not fixed and the morphed shape is free to move. If not None, the morphed shape is constrained to be at the endpoints and the only free steps are the intermediate steps. Providing endpoints is useful to minimize the energy of the morphing while keeping the endpoints fixed.use_stiff_edges (
bool
) – If the source PolyData has a stiff_edges property and this argument is True, the stiff_edges are passed to the metric. If the source PolyData has no stiff_edges, edges are passed by default.**kwargs – Additional keyword arguments.
- __init__(n_steps=1, metric='as_isometric_as_possible', endpoints=None, use_stiff_edges=True, **kwargs)
Methods
__init__
([n_steps, metric, endpoints, ...])copy
()Return a copy of the model.
inital_parameter
(shape)Return the initial parameters of the model.
morph
(shape, parameter[, return_path, ...])Morph a shape.
parameter_shape
(shape)Return the shape of the parameter.
Attributes
Number of integration steps.
- morph(shape, parameter, return_path=False, return_regularization=False)
Morph a shape.
- Parameters:
shape (
polydata_type
) – The shape to morph.parameter (
Float32[Tensor, '_ _ _']
) – Sequence of velocity vectors.return_path (
bool
) – True if you want to have access to the morphing’s sequence of polydatas.return_regularization (
bool
) – True to have access to the regularization.
- Returns:
A named tuple containing the morphed shape, the regularization and the path if requested.
- Return type:
- property n_free_steps: int
Number of integration steps.
If the endpoints are fixed, the number of free steps is n_steps - 1 as the last step is fixed by the endpoints. Otherwise, the number of free steps is n_steps.
- parameter_shape(shape)
Return the shape of the parameter.
- Parameters:
shape (
polydata_type
) – The shape to morph.- Return type:
tuple
[int
,int
,int
]- Returns:
The shape of the parameter.