Skip to content

Commit

Permalink
Don't normalize normal vector when finding trianglar face normal
Browse files Browse the repository at this point in the history
Since the method we use to find the triangular is an approximation,
an additional normalizarion could fail. This is also stated in OBJ
and STL file specs.
  • Loading branch information
Onur R. Bingol committed Feb 9, 2018
1 parent dd648f3 commit a3bef0b
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion geomdl/exchange_helpers.py
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,8 @@ def normal(self):
if not self._normal:
vec1 = utils.vector_generate(self._vertices[0].data, self._vertices[1].data)
vec2 = utils.vector_generate(self._vertices[1].data, self._vertices[2].data)
self._normal = utils.vector_normalize(utils.vector_cross(vec1, vec2))
# self._normal = utils.vector_normalize(utils.vector_cross(vec1, vec2))
self._normal = utils.vector_cross(vec1, vec2)
return self._normal

def add_vertex(self, vertex=None):
Expand Down

0 comments on commit a3bef0b

Please sign in to comment.