osresearch / plotter-vision

Hidden Wireframe removal demo in p5.js
GNU General Public License v2.0
83 stars 17 forks source link

Extra lines on coplanar surfaces #4

Closed osresearch closed 3 years ago

osresearch commented 3 years ago

Something is messing up coplanar surfaces and adding occasional line segments.

osresearch commented 3 years ago

image

Sample from https://plotterfiles.com/profile/files/3cfb9fa0-46ba-431f-a620-0cb5ce9c7364

osresearch commented 3 years ago

image

It's not just coplanar surfaces. Appears to be caused by splits.

osresearch commented 3 years ago

Due to floating point roundings, occasionally the barycentric coordinates would be just slightly negative, and inside() would reject them since it was strictly testing for positive values. Relaxing that seems to have fixed it.