foreach my $ix (0..2) {
my $jx = ($ix+1) % 3;
my $kx = ($ix+2) % 3;
- if ($edge_need_subdivide_fn->($t[$ix], $t[$jx])) {
+ if ($edge_need_subdivide_fn->($t->[$ix], $t->[$jx])) {
+ my @midp;
foreach my $ci (0..2) {
push @midp, 0.5 * ($t->[$ix][$ci] + $t->[$jx][$ci]);
}
# triangle i-j-k, splitting edge i-m
# gives i-m-k, k-m-j
push @$changed,
- [ $t[$ix], \@midp, $t[kx] ],
- [ $t[$kx], \@midp, $t[jx] ];
+ [ $t->[$ix], \@midp, $t->[$kx] ],
+ [ $t->[$kx], \@midp, $t->[$jx] ];
return;
}
}
$project_cylinder_radius = shift_arg;
$project_cylinder_max_d_theta = $fa * TAU/360;
- maybe_subdivide \&project_cylinder_triangle_need_subdivide;
+ maybe_subdivide \&project_cylinder_edge_need_subdivide;
$output = [];
foreach my $t (@$triangles) {