digeo.MeshPointBatch#
- class digeo.MeshPointBatch(faces, uvs)[source]#
Bases:
objectInitialize a batch of MeshPoints.
- Parameters:
faces (Tensor)
uvs (Tensor)
- classmethod from_points(points)[source]#
Create a MeshPointBatch from an iterable of MeshPoint objects.
- Parameters:
points (Iterable[MeshPoint])
- Return type:
- get_barycentric_coords()[source]#
Get the barycentric coordinates of the mesh points in the batch.
- Returns:
A tensor of shape (N, 3) containing the barycentric coordinates of each point in the batch.
- Return type:
Tensor
- interpolate(mesh, return_batch=False)[source]#
Interpolate the positions of the mesh points in the batch.
- Parameters:
mesh (Mesh) – The mesh on which the points lie. The face indices in self.faces should correspond to the faces of this mesh.
return_batch (bool (default=False)) – If True, return the interpolated positions as a batch of shape (B, N, 3), where B is the number of meshes in the batch (if mesh is a MeshBatch) and N is the number of points in the batch. If False, return a tensor of shape (N, 3) containing the interpolated positions of the points.
- Returns:
The interpolated positions of the mesh points. Shape is (N, 3) if return_batch is False, or (B, N, 3) if return_batch is True and mesh is a MeshBatch.
- Return type:
Tensor
- to(device: str | device) MeshPointBatch[source]#
- to(dtype: dtype) MeshPointBatch
- to(device: str | device, dtype: dtype) MeshPointBatch
- to(tensor: Tensor) MeshPointBatch
- to(*, device: str | device | None = ..., dtype: dtype | None = ...) MeshPointBatch
Move the mesh to a different device and/or dtype. Supports PyTorch-like overloads: - to(device) - to(dtype) - to(device, dtype) - to(device=…, dtype=…)
- Return type: