boytchev / suica

Mobile 3D made simple
https://boytchev.github.io/suica/
GNU General Public License v3.0
26 stars 2 forks source link

Artifacts in transparent tube #105

Closed boytchev closed 1 year ago

boytchev commented 1 year ago

A transparent spline-curved tube makes strange artifacts, especially if the end is closed with a small radius.

boytchev commented 1 year ago

Not a bug. This happens when Frenet frames are calculated and there are duplicated points on a spline. These points lead to zero vectors:

[0,0,20, 1],
[0,0,20, 25],
[0,0,20, 25],
[0,0,-20, 25],
[0,0,-20, 25],
[0,0,-20, 1],

The resolution is to make slight offset:

[0,0,20.02, 1],
[0,0,20.01, 25],
[0,0,20, 25],
[0,0,-20, 25],
[0,0,-20.01, 25],
[0,0,-20.02, 1],