"Fossies" - the Fresh Open Source Software Archive  

Source code changes of the file "Demos/TriD/test5.p" between
PDL-2.077.tar.gz and PDL-2.078.tar.gz

About: PDL (Perl Data Language) aims to turn perl into an efficient numerical language for scientific computing (similar to IDL and MatLab).

test5.p  (PDL-2.077):test5.p  (PDL-2.078)
use strict;
use blib; use warnings;
use Carp;
$SIG{__DIE__} = sub {die Carp::longmess(@_);};
use PDL; use PDL;
use PDL::Graphics::TriD; use PDL::Graphics::TriD;
use PDL::Graphics::TriD::Image;
use PDL::IO::Pic;
use PDL::Graphics::TriD::Graph; use PDL::Graphics::TriD::Graph;
use PDL::Graphics::OpenGL;
$g = new PDL::Graphics::TriD::Graph();
$g->default_axes();
$x = PDL->zeroes(3,1000);
random($x->inplace);
$g->add_dataseries(new PDL::Graphics::TriD::Points($x,$x),"pts");
$g->bind_default("pts");
$y = PDL->zeroes(3,30,30);
axisvalues($b->slice("(0)"));
axisvalues($b->slice("(1)")->transpose);
$y /= 30;
my $size = 30;
my $y = PDL->zeroes(3,$size,$size);
axisvalues($y->slice("(0)")->inplace);
axisvalues($y->slice("(1)")->transpose->inplace);
$y /= $size;
random($y->slice("(2)")->inplace); random($y->slice("(2)")->inplace);
(my $tmp = $y->slice("(2)")) /= 5;
($tmp = $y->slice("(2)")) /= 5; $tmp += 2; my $c = PDL->zeroes(3,$size,$size);
$c = PDL->zeroes(3,30,30);
random($c->inplace); random($c->inplace);
$g->add_dataseries(new PDL::Graphics::TriD::SLattice($y,$c),"slat"); my @objs = (
$g->bind_default("slat"); ['Lattice'],
['SCLattice'],
# $g->add_dataseries(new PDL::Graphics::TriD::Lattice($y,(PDL->pdl(0,0,0)->dummy ['SLattice'],
(1)->dummy(1))), ['SLattice_S', {Smooth=>0}],
# "blat"); ['SLattice_S'],
# $g->bind_default("blat"); );
my $i = 0;
$g->add_dataseries(new PDL::Graphics::TriD::SCLattice($y+1,$c->slice(":,0:-2,0:- @objs = map [$i++, @$_], @objs;
2")), my ($below_obj, $above_obj) = map [$_, 'Lines'], -1, 0+@objs;
"slat2");
$g->bind_default("slat2"); sub mk_trid { "PDL::Graphics::TriD::$_[1]"->new($y+pdl(0,0,$_[0]),$c,$_[2]) }
$g->scalethings(); my $win = PDL::Graphics::TriD::get_current_window();
my $g = PDL::Graphics::TriD::Graph->new;
$win = PDL::Graphics::TriD::get_current_window(); my @all = [map mk_trid(@$_), $below_obj, @objs, $above_obj];
$win->clear_objects(); push @all, map [map mk_trid(@$_), $below_obj, $_, $above_obj], @objs;
$win->add_object($g); for my $these (@all) {
$g->clear_data;
$win->twiddle(); $win->clear_viewport;
$g->default_axes;
$g->add_dataseries($_) for @$these;
$g->scalethings;
$win->clear_objects;
$win->add_object($g);
$win->twiddle;
}
 End of changes. 6 change blocks. 
29 lines changed or deleted 9 lines changed or added

Home  |  About  |  Features  |  All  |  Newest  |  Dox  |  Diffs  |  RSS Feeds  |  Screenshots  |  Comments  |  Imprint  |  Privacy  |  HTTP(S)