Skip to content

Commit

Permalink
Formatting
Browse files Browse the repository at this point in the history
  • Loading branch information
ErnstRoell committed Aug 30, 2024
1 parent 0696f34 commit 69fee14
Showing 1 changed file with 11 additions and 10 deletions.
21 changes: 11 additions & 10 deletions code/datasets/transforms.py
Original file line number Diff line number Diff line change
Expand Up @@ -214,16 +214,17 @@ class TransformType(Enum):


class TriangulationToFaceTransform:
'''
Transforms tetrahedra to faces.
Expects a triangulation of shape [4,N] and
"""
Transforms tetrahedra to faces.
Expects a triangulation of shape [4,N] and
returns the faces of shape [3,M].
NOTE: It will contain duplicate triangles with different ordering.
Hence the result is not a "minimal" triangulation. When subsequently
converting the triangles to edges, this will not pose a problem as
the FaceToEdge transform by default creates undirected edges.
'''
NOTE: It will contain duplicate triangles with different ordering.
Hence the result is not a "minimal" triangulation. When subsequently
converting the triangles to edges, this will not pose a problem as
the FaceToEdge transform by default creates undirected edges.
"""

def __init__(self, remove_triangulation: bool = True) -> None:
self.remove_triangulation = remove_triangulation

Expand All @@ -233,8 +234,8 @@ def __call__(self, data):
assert data.triangulation is not None
face = torch.cat([data.triangulation[i] for i in idx], dim=1)

# Remove duplicate triangles in
data.face = torch.unique(face,dim=1)
# Remove duplicate triangles in
data.face = torch.unique(face, dim=1)

if self.remove_triangulation:
data.triangulation = None
Expand Down

0 comments on commit 69fee14

Please sign in to comment.