ladybug-tools / ladybug-geometry

🐞 📦 A library with geometry objects used throughout the Ladybug Tools core libraries
https://www.ladybug.tools/ladybug-geometry/docs/
GNU Affero General Public License v3.0
25 stars 23 forks source link

fix(face): Fix issue with duplicate Face3D vertices and tolerance #244

Closed chriswmackey closed 3 years ago

chriswmackey commented 3 years ago

It seems that duplicate vertices with coordinate differences very close to Python floating point tolerance can cause the normal calculation to go haywire. I am changing the normal calculation to ignore any vertices that are closer than a value that's a bit larger than floating point tolerance (1e-9) rather than using a ZeroDivisionError indicating a perfectly duplicate vertex.

I also realized that the remove_colinear_vertices method can accidentally remove both versions of a duplicate vertex, which is usually not the desired behavior as we want to leave one of them. I'm tweaking the method so that it corrects itself whenever it has already removed colinear vertices.

github-actions[bot] commented 3 years ago

:tada: This PR is included in version 1.23.1 :tada:

The release is available on:

Your semantic-release bot :package::rocket: