Skip to content

Commit 3895ec1

Browse files
CopilotLicini
andcommitted
Apply code formatting with ruff and black
Co-authored-by: Licini <17893605+Licini@users.noreply.github.com>
1 parent 0ebac33 commit 3895ec1

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

src/compas/datastructures/mesh/mesh.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -39,10 +39,10 @@
3939
from compas.geometry import centroid_points
4040
from compas.geometry import centroid_polygon
4141
from compas.geometry import cross_vectors
42-
from compas.geometry import dot_vectors
4342
from compas.geometry import distance_line_line
4443
from compas.geometry import distance_point_plane
4544
from compas.geometry import distance_point_point
45+
from compas.geometry import dot_vectors
4646
from compas.geometry import length_vector
4747
from compas.geometry import midpoint_line
4848
from compas.geometry import normal_polygon
@@ -3917,7 +3917,7 @@ def volume(self):
39173917
vertices = self.face_vertices(fkey)
39183918
# Get coordinates for all vertices of the face
39193919
coords = [self.vertex_coordinates(v) for v in vertices]
3920-
3920+
39213921
# Triangulate the face if it has more than 3 vertices
39223922
if len(coords) == 3:
39233923
triangles = [coords]
@@ -3926,7 +3926,7 @@ def volume(self):
39263926
triangles = []
39273927
for i in range(1, len(coords) - 1):
39283928
triangles.append([coords[0], coords[i], coords[i + 1]])
3929-
3929+
39303930
# Calculate signed volume contribution from each triangle
39313931
for triangle in triangles:
39323932
# Signed volume of tetrahedron formed by triangle and origin

tests/compas/datastructures/test_mesh.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1071,7 +1071,7 @@ def test_normal():
10711071

10721072
def test_volume():
10731073
import math
1074-
1074+
10751075
# Test with a cube
10761076
mesh = Mesh.from_stl(compas.get("cube_binary.stl"))
10771077
volume = mesh.volume()
@@ -1095,7 +1095,7 @@ def test_volume():
10951095
sphere_mesh = Mesh.from_shape(Sphere(radius=1.0), u=32, v=32)
10961096
volume = sphere_mesh.volume()
10971097
assert volume is not None
1098-
expected_sphere_volume = (4.0/3.0) * math.pi * (1.0 ** 3)
1098+
expected_sphere_volume = (4.0 / 3.0) * math.pi * (1.0**3)
10991099
# Allow for ~1% error due to discretization
11001100
assert TOL.is_close(volume, expected_sphere_volume, rtol=0.02)
11011101

0 commit comments

Comments
 (0)