-
Notifications
You must be signed in to change notification settings - Fork 22
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(face): Fix issue with duplicate Face3D vertices and tolerance
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.
- Loading branch information
1 parent
8c2281a
commit e4a3d10
Showing
3 changed files
with
114 additions
and
7 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,90 @@ | ||
{ | ||
"type": "Face3D", | ||
"boundary": [ | ||
[ | ||
-32.921611201331253, | ||
-412.66628343081106, | ||
1.5082130414885986 | ||
], | ||
[ | ||
-32.92161450752139, | ||
-412.66628142228097, | ||
0.79654637483244661 | ||
], | ||
[ | ||
-33.537845196710784, | ||
-413.8757310807286, | ||
0.79654582428383403 | ||
], | ||
[ | ||
-33.537842348260362, | ||
-413.8757221976216, | ||
-0.0047076652449124547 | ||
], | ||
[ | ||
-22.359531583272815, | ||
-391.95842979489032, | ||
-0.0044249400893101778 | ||
], | ||
[ | ||
-22.359554793487792, | ||
-391.95850217769248, | ||
6.5244813094684488 | ||
], | ||
[ | ||
-33.537865558475346, | ||
-413.87579458042376, | ||
6.5241985843128463 | ||
], | ||
[ | ||
-33.537858287046141, | ||
-413.8757719039246, | ||
4.4787854075706282 | ||
], | ||
[ | ||
-32.921597400939412, | ||
-412.66629181463094, | ||
4.4787859581113754 | ||
], | ||
[ | ||
-32.921600013420004, | ||
-412.66629022753347, | ||
3.9164422081196832 | ||
], | ||
[ | ||
-33.537856287918139, | ||
-413.87576566949343, | ||
3.9164416575777357 | ||
], | ||
[ | ||
-33.537858044533692, | ||
-413.87576395490083, | ||
3.8528999909160246 | ||
], | ||
[ | ||
-32.921600308615552, | ||
-412.66629004820044, | ||
3.8529005414539577 | ||
], | ||
[ | ||
-32.921610906135705, | ||
-412.66628361014409, | ||
1.5717547081543268 | ||
], | ||
[ | ||
-32.921610906135712, | ||
-412.66628361014409, | ||
1.5717547081543268 | ||
], | ||
[ | ||
-33.537857160655768, | ||
-413.87573498333205, | ||
1.5717541576266509 | ||
], | ||
[ | ||
-33.537847726680695, | ||
-413.87573897063021, | ||
1.5082124909415064 | ||
] | ||
] | ||
} |