Skip to content

Commit dfb9985

Browse files
committed
add test script
1 parent aef27d8 commit dfb9985

File tree

1 file changed

+21
-0
lines changed

1 file changed

+21
-0
lines changed

tests/test_all.py

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -600,3 +600,24 @@ def udf_sphere(Q):
600600
unique_ijk, J, unique_corners = igl.unique_sparse_voxel_corners(origin,h0,max_depth,ijk)
601601
unique_S = sdf_sphere(unique_corners)
602602
V,F = igl.marching_cubes(unique_S,unique_corners,J,0.0)
603+
604+
605+
def test_boundary_conditions():
606+
V, F, T = single_tet()
607+
C = V[[0, 1, 2]]
608+
P = np.array([0, 1, 2], dtype=int)
609+
BE = np.array([[0, 1]], dtype=int)
610+
CE = np.array([[0, 1], [1, 2], [2, 0]], dtype=int)
611+
CF = np.array([[0, 1, 2]], dtype=int)
612+
613+
b1, bc1 = igl.boundary_conditions(V, F, C, P, BE, CE, CF)
614+
assert b1.shape[0] == bc1.shape[0]
615+
assert bc1.shape[1] == P.shape[0] + BE.shape[0]
616+
617+
b2, bc2 = igl.boundary_conditions(V, F, C, P)
618+
assert b2.shape[0] == bc2.shape[0]
619+
assert bc2.shape[1] == P.shape[0]
620+
621+
b3, bc3 = igl.boundary_conditions(V, F, C, BE=BE)
622+
assert b3.shape[0] == bc3.shape[0]
623+
assert bc3.shape[1] == BE.shape[0]

0 commit comments

Comments
 (0)