Page MenuHome

Diff for T45229 - Select shortest path
AbandonedPublic

Authored by Campbell Barton (campbellbarton) on Jul 5 2015, 7:21 PM.

Details

Summary

Adds an operator to select the shortest path between two control points.

Uses dijkstra shortest path for surfaces like the related mesh operator does.
Calculates the shortest path for curves directly.

Diff Detail

Repository
rB Blender

Event Timeline

Gyro Gearloose (pink.vertex) retitled this revision from to T45229 - Select shortest path.
Gyro Gearloose (pink.vertex) updated this object.
Gyro Gearloose (pink.vertex) set the repository for this revision to rB Blender.
Gyro Gearloose (pink.vertex) retitled this revision from T45229 - Select shortest path to Diff for T45229 - Select shortest path.Jul 5 2015, 7:28 PM
Sergey Sharybin (sergey) added inline comments.
source/blender/editors/curve/editcurve.c
6282

Use SWAP().

6331

Guess it could be FLT_MAX?

6399

XXX is for really bad hacks, here it's more a TODO.

Campbell Barton (campbellbarton) requested changes to this revision.Jul 8 2015, 11:04 AM
Campbell Barton (campbellbarton) edited edge metadata.
Campbell Barton (campbellbarton) added inline comments.
source/blender/editors/curve/editcurve.c
6263–6272

wouldn't bother splitting args to multiple lines here.

6281–6284

can use macro SWAP(int, vert_from, vert_to)

6339

style - while (

6362

Would prefer to replace 0 <= nb[i] with (nb[i] != -1)

Applies to other checks in this file too.

6393

style, brace on newline.

This revision now requires changes to proceed.Jul 8 2015, 11:04 AM

Patch seems generally quite good, will apply this week,

note: no need to make changes, partly done, will commit soon.

Campbell Barton (campbellbarton) edited edge metadata.

Committed, rBcdbb60b0a38fa54d58b9ebcf29bd060c0f1b885c

Note that getting adjacent verts wasn't working right in my tests (with cyclic u/v surfaces), added utility functions to handle this less confusingly.

This revision is now accepted and ready to land.Jul 9 2015, 9:12 AM
This revision now requires review to proceed.Jul 9 2015, 9:12 AM
source/blender/editors/curve/editcurve.c
6362

I think this will break the code since nb[3] may take values down to -u.

source/blender/editors/curve/editcurve.c
6362

You're right, I ended up redoing this part so wrapping to adjacent values is done in a function, which is less error prone.