Permalink
Browse files

Replace Nubs.Evaluate with a version based on the Nubs.MakePolynomial…

… code.
  • Loading branch information...
1 parent 566ffd0 commit 4095a739a309cafb3fa8608d17ce5e59404ae09d SF committed Oct 20, 2009
Showing with 3 additions and 15 deletions.
  1. +3 −15 lib/Nurbs.pm
View
@@ -21,23 +21,11 @@ class Nubs
multi method Evaluate($t)
{
- my @N = $.knot_vector.N($.degree, $t);
- return [+] (@N >>*<< @.control_points);
+ my $n0 = $.knot_vector.N0_index($.degree, $t);
+ return [+] ($.knot_vector.N_local($n0, $.degree, $t)
+ >>*<< @.control_points[$n0 .. ($n0 + $.degree)]);
}
- # multi method Evaluate($t)
- # {
- # say "Nubs.Evaluate";
- # my $n0 = $.knot_vector.N0_index($t);
- # say $n0;
- # say $.knot_vector.N(1, $t).perl;
- # say ($.knot_vector.N_local($n0, $.degree, $t)).perl;
- # say (@.control_points[($n0 - ($.degree + 1)) .. ($n0 - 1)]).perl;
- # return [+] ($.knot_vector.N_local($n0, $.degree, $t)
- # >>*<< @.control_points[($n0 - ($.degree + 1)) .. ($n0 - 1)]);
- # }
-
-
multi method MakePolynomial($t)
{
my $n0 = $.knot_vector.N0_index($.degree, $t);

0 comments on commit 4095a73

Please sign in to comment.