File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -207,8 +207,8 @@ use base qw(PDL::Graphics::TriD::Object);
207207use fields qw( LatticeObj) ;
208208sub add_lattice_axis {
209209 my ($this ) = @_ ;
210- my (@nadd ,@nc ,@ns );
211210 my @widths = $this -> {Scale }-> slice(' 0:1' )-> t-> diff2-> list;
211+ my @nadd ;
212212 for my $dim (0..1) {
213213 my $width = $widths [$dim ];
214214 if ($width > 100) {
@@ -220,9 +220,9 @@ sub add_lattice_axis {
220220 } else {
221221 $nadd [$dim ] = 1;
222222 }
223- $nc [$dim ] = int ($this -> {Scale }-> slice(" $dim ,0" )-> sclr/$nadd [$dim ])*$nadd [$dim ];
224- $ns [$dim ] = int ($width /$nadd [$dim ])+1;
225223 }
224+ my @nc = map int ($this -> {Scale }-> slice(" $_ ,0" )-> sclr/$nadd [$_ ])*$nadd [$_ ], 0,1;
225+ my @ns = map int ($widths [$_ ]/$nadd [$_ ])+1, 0,1;
226226 # can be changed to topo heights?
227227 my $verts = PDL-> zeroes(PDL::float(),3,$ns [0],$ns [1]);
228228 $verts -> slice(" 2" ) .= 1012.5;
You can’t perform that action at this time.
0 commit comments