Fixed regression preventing split from working. #395

degen-loop-screen
Alessandro Ranellucci 2012-07-30 09:59:41 +02:00
parent 8cca3a6b28
commit 0e39a89d01
1 changed files with 3 additions and 3 deletions

View File

@ -183,7 +183,7 @@ sub _write_binary {
foreach my $facet (@{$mesh->facets}) { foreach my $facet (@{$mesh->facets}) {
print $fh pack '(f<3)4S', print $fh pack '(f<3)4S',
@{_facet_normal($mesh, $facet)}, @{_facet_normal($mesh, $facet)},
(map @{$mesh->vertices->[$_]}, @$facet[1,2,3]), (map @{$mesh->vertices->[$_]}, @$facet[-3..-1]),
0; 0;
} }
} }
@ -195,7 +195,7 @@ sub _write_ascii {
foreach my $facet (@{$mesh->facets}) { foreach my $facet (@{$mesh->facets}) {
printf $fh " facet normal %f %f %f\n", @{_facet_normal($mesh, $facet)}; printf $fh " facet normal %f %f %f\n", @{_facet_normal($mesh, $facet)};
printf $fh " outer loop\n"; printf $fh " outer loop\n";
printf $fh " vertex %f %f %f\n", @{$mesh->vertices->[$_]} for @$facet[1,2,3]; printf $fh " vertex %f %f %f\n", @{$mesh->vertices->[$_]} for @$facet[-3..-1];
printf $fh " endloop\n"; printf $fh " endloop\n";
printf $fh " endfacet\n"; printf $fh " endfacet\n";
} }
@ -204,7 +204,7 @@ sub _write_ascii {
sub _facet_normal { sub _facet_normal {
my ($mesh, $facet) = @_; my ($mesh, $facet) = @_;
return triangle_normal(map $mesh->vertices->[$_], @$facet[1,2,3]); return triangle_normal(map $mesh->vertices->[$_], @$facet[-3..-1]);
} }
1; 1;