scenerygraphics / scenery

Flexible VR Visualisation for Volumetric and Geometric Data on the Java VM, powered by Kotlin and Vulkan.
https://scenery.graphics
GNU Lesser General Public License v3.0
131 stars 32 forks source link

Fixing the visual kinks in the curve geometry #560

Closed Domino2357 closed 1 year ago

Domino2357 commented 1 year ago

This pull request fixes the visual kinks sometimes shown when rendering curves.

What was the problem? Splines are defined to be continuous (even differentiable) at the transitions between sections. So, one can define (mathematically) the parameter t piecewise in open intervals (0 <= t <= 1, 1 <= t <= 2, ...). However, in the implementation, we need to make sure that the transition points won't be added twice. We did not do this so far, leading to the computing of two identical base shapes overlapping.

What was the solution? In principle very simple, compute the splines s.t. the transition points belong to either of two consecutive sub-splines.

What has been done concretely?

Domino2357 commented 1 year ago

@skalarproduktraum this is ready for review :)

Domino2357 commented 1 year ago

@skalarproduktraum this looks good to me. If you find my answer in the open conversation above satisfying, it should be done.