deadsy / sdfx

A simple CAD package using signed distance functions
MIT License
541 stars 52 forks source link

STL to SDF evaluation #72

Open Megidd opened 1 year ago

Megidd commented 1 year ago

At the point {X: -0.8164382918936324, Y: 2.542909114087213, Z: 5.006102143191411}, the SDF value for the teapot model is returned as a positive number. It means the point is outside the teapot. But we are sure that the point is definitely inside the teapot.

Reproduce

The bug is reproduced by PR #73.

Side effects

The bug has side effects observed here: https://github.com/deadsy/sdfx/pull/68#issuecomment-1597156034

Megidd commented 1 year ago

The approximate coordinates for the neighbor points around the problematic {X: -0.8164382918936324, Y: 2.542909114087213, Z: 5.006102143191411} point are shown below. They all have negative SDF values, that is expected.

Screenshot_20230726_105842

Screenshot_20230726_105949