Changeset View
Changeset View
Standalone View
Standalone View
libs/flake/KoPathSegment.cpp
Show First 20 Lines • Show All 819 Lines • ▼ Show 20 Line(s) | 761 | { | |||
---|---|---|---|---|---|
820 | our chord line is of the form: | 820 | our chord line is of the form: | ||
821 | (2) ax + by + c = 0 | 821 | (2) ax + by + c = 0 | ||
822 | we can determine the distance d(t) from any point P(t) to our chord | 822 | we can determine the distance d(t) from any point P(t) to our chord | ||
823 | by substituting formula (1) into formula (2): | 823 | by substituting formula (1) into formula (2): | ||
824 | d(t) = sum_i d_i B_{n,i}(t), where d_i = a*x_i + b*y_i + c | 824 | d(t) = sum_i d_i B_{n,i}(t), where d_i = a*x_i + b*y_i + c | ||
825 | which forms another explicit bezier curve | 825 | which forms another explicit bezier curve | ||
826 | D(t) = (t,d(t)) = sum_i D_i B_{n,i}(t) | 826 | D(t) = (t,d(t)) = sum_i D_i B_{n,i}(t) | ||
827 | now values of t for which P(t) lies outside of our fat line L | 827 | now values of t for which P(t) lies outside of our fat line L | ||
828 | corrsponds to values of t for which D(t) lies above d = dmax or | 828 | corresponds to values of t for which D(t) lies above d = dmax or | ||
829 | below d = dmin | 829 | below d = dmin | ||
830 | we can determine parameter ranges of t for which P(t) is guaranteed | 830 | we can determine parameter ranges of t for which P(t) is guaranteed | ||
831 | to lie outside of L by identifying ranges of t which the convex hull | 831 | to lie outside of L by identifying ranges of t which the convex hull | ||
832 | of D(t) lies above dmax or below dmin | 832 | of D(t) lies above dmax or below dmin | ||
833 | */ | 833 | */ | ||
834 | // now calculate the control points of D(t) by using the signed | 834 | // now calculate the control points of D(t) by using the signed | ||
835 | // distances of P_i to our chord | 835 | // distances of P_i to our chord | ||
836 | KoPathSegment dt; | 836 | KoPathSegment dt; | ||
▲ Show 20 Lines • Show All 643 Lines • Show Last 20 Lines |