Page MenuHome

Curve Decimate
AbandonedPublic

Authored by Campbell Barton (campbellbarton) on Jun 26 2016, 1:22 PM.

Details

Reviewers
None
Summary

Curve decimate, since we have curve fitting calculation,
its not so much extra work to support decimating.

This patch also has an option for freehand drawing.

This generally works, but theres some todo's still.

Todo:

  • Option to keep 'free' knots (don't remove corners).
  • Option to decimate based on error threshold (currently is a factor of the number of points per nurbs curve).
  • Possibly use this for FCurves too.

Diff Detail

Branch
TEMP-CURVE-DECIMATE

Event Timeline

Campbell Barton (campbellbarton) retitled this revision from to Curve Decimate.
  • Accidentally included cmake change
  • WIP cyclic support (working but some minor glitch to iron out)
  • Move curve coord calculation into curve.c

Cyclic curves now work properly

This generally works fine now, (besides a temp flag that should be moved to a define).

This could be made into an alternate fitting method in extern/curve_fit_nd/.

Since this generally works better the existing divide and conquer method used to fit points to cubic splines.

Though this task isn't very high priority, so I'll finish it in my spare time.

would it be possible to make the dissolve vertex option use this to keep the curve shape intact when removing knots?

would it be possible to make the dissolve vertex option use this to keep the curve shape intact when removing knots?

This was added rB143f6c4bb24a88f76fe9823d6ad461896f3a76af (delete menu, as with mesh)

Tested this option already, but the shape is really changed.


In the image above:

  • the first line is the original one
  • the 2nd, grey, in edit mode, is the best I could manually get by editing the same curve with one knot dissolved, keeping all handle types to aligned.
  • the 3 one is the result of just dissolving one point (result is about 1.5m away from the original one).

File used for screenshot:

  • Store length of the handle instead of the final handle location.

With a ration of 0.9 with the file above https://developer.blender.org/F320650 I get inverted knots (like 180 degree rotated for one of the handle, see on left in the picture) and other artifacts:

@mathieu menuet (bliblubli), are you testing curve decimate or the dissolve option?

(Please report any issues with daily builds to the tracker directly).

@Campbell Barton (campbellbarton) I used Curve decimate. I just mentioned dissolve in the post from Jul 9. because you proposed to use dissolve and I wanted to show the shortcomings. I can make a report for it on the tracker if you want.

Committed rB80465ba35a163c9832a4666fac74465561b7c6c5 with some edits (support handle type conversion).