Page MenuHome

Fix T49850: Extruded curve getting decimated with high U resolution
Needs ReviewPublic

Authored by Luca Rood (LucaRood) on Jan 7 2017, 8:38 PM.

Details

Summary

After the curve has been computed, a decimation algorithm was being performed in BKE_curve_bevelList_make.

This decimation is simply computed by eliminating points that are closer to each other than a certain threshold, but doesn't take into account the already removed points, thus if there was an array of many consecutive points very close to each other, they would all be removed.

Curiously, for some strange reason, this decimation was made to only be executed if extrusion or bevel depth was higher than 0.0.

Seeing as the decimation algorithm being used is inherently poor, and as it was already not being executed on non-extruded curves anyway, I have fixed the issue by simply disabling the decimation altogether.

It would of course be possible to implement a decimation algorithm that actually works (using relative point angles as well as distances, and taking care of already removed points), but that is much more work than it is worth for now... Besides, I don't think it is really necessary, and actually think that better than a decimation algorithm, would be the implementation of adaptive U resolution, based on segment length and curvature, which is also much more trivial.

Diff Detail

Repository
rB Blender

Event Timeline

Luca Rood (LucaRood) retitled this revision from to Fix T49850: Extruded curve getting decimated with high U resolution.
Luca Rood (LucaRood) updated this object.
Luca Rood (LucaRood) set the repository for this revision to rB Blender.

I had forgotten to add a little comment explaining why the code was disabled. Added that now...

Might make sense, but… curves are really not my area, let’s let @Sergey Sharybin (sergey) decide here