Skip to content

Commit 13be750

Browse files
committed
::Lattice colors must be 3,x,y
1 parent 7869762 commit 13be750

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

lib/PDL/Graphics/TriD/Objects.pm

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -262,6 +262,8 @@ sub new {
262262
my $indadd = PDL->sequence($x,$y,@extradims)->slice('*1,:-2,:-2');
263263
my $faceidx = ($inds + $indadd)->splitdim(0,3)->clump(1..3+@extradims);
264264
my %less = %$options; delete @less{qw(Lines)};
265+
my @colordims = $colors->dims;
266+
PDL::barf "Colours must be 3,x,y: got (@colordims)" if @colordims != 3 or $colordims[0] != 3;
265267
$this->add_object(PDL::Graphics::TriD::Triangles->new($points->clump(1..2+@extradims), $faceidx, $colors->clump(1..$colors->ndims-1), \%less));
266268
}
267269
if ($shading == 0 or $options->{Lines}) {

0 commit comments

Comments
 (0)