Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

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

… code.
  • Loading branch information...
commit 4095a739a309cafb3fa8608d17ce5e59404ae09d 1 parent 566ffd0
SF authored
Showing with 3 additions and 15 deletions.
  1. +3 −15 lib/Nurbs.pm
View
18 lib/Nurbs.pm
@@ -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);
Please sign in to comment.
Something went wrong with that request. Please try again.