Skip to content

Commit

Permalink
fix in Wire.surface()
Browse files Browse the repository at this point in the history
  • Loading branch information
jimy-byerley committed Nov 5, 2022
1 parent a2a78f3 commit 3ef10df
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions madcad/mesh/wire.py
Original file line number Diff line number Diff line change
Expand Up @@ -222,11 +222,11 @@ def length(self) -> float:

def surface(self) -> float:
''' return the surface enclosed by the web if planar and is a loop (else it has no meaning) '''
s = vec3(0)
o = self.barycenter()
s = vec3(0)
for i in range(1, len(self)):
area += cross(self[i-1]-o, self[i]-o)
return length(area)
s += cross(self[i-1]-o, self[i]-o)
return length(s)

def barycenter(self) -> vec3:
''' curve barycenter '''
Expand Down

0 comments on commit 3ef10df

Please sign in to comment.