arap_precompute#

iskra.deformation.arap.arap_precompute(verts: Tensor, faces: Tensor, handle_idx: Tensor, lap_clamp: float | None = 1e-05) tuple[Tensor, Tensor, Tensor, Callable[[Tensor], Tensor]][SOURCE]#

Precomputes data necessary to run ARAP deformations.

Important

It is necessary to clamp the ARAP weights to be positive. Otherwise, the SVD procedure is not guaranteed to lead to the closest rotation. We allow setting it to None to match the libigl implementation, but this is likely to break your gradients in the backward pass.

Parameters:
  • verts (Tensor[V, 3]) – Mesh vertex positions.

  • faces (Tensor[F, 3]) – Mesh face indices.

  • handle_idx (Tensor[H]) – Indices signifying which vertices are control handles.

  • lap_clamp (float | None) – Clamp minimum for cotan weights. Defaults to 1e-5.

Returns:
  • (Tensor[V, 2]) – Vertex-to-vertex adjacency from vertex_adjacency.

  • ​​ (Tensor[2:abbr:V (Number of vertices)]) – Cotan weights per vertex-vertex relationship.

  • ​​​ (SparseTensor[V, V]) – Cotan (integrated) Laplacian matrix.

  • ​​​​ (spla.SolverT) – Factorized Laplacian solver.