/usr/share/dx/samples/scripts/CollectMultiGrid is in dxsamples 4.2.0-1.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 | // The following two grids are non-overlapping
grid1 = Construct([0 0], [1 1], [4 4], {1 .. 16});
grid2 = Construct([3 3], [1 1], [4 4], {33 .. 48});
// Collect is used to create a generic group. When colored using AutoColor,
// each will be colored independently.
group = Collect(grid1,NULL, grid2);
colored = AutoColor(group);
camera = AutoCamera(group);
Display(colored, camera);
KeyIn();
// CollectMultiGrid is used to create a multigrid group. When colored using
// AutoColor, the multigrid will be colored as a single entity.
multigrid = CollectMultiGrid(grid1,NULL, grid2);
colored = AutoColor(multigrid);
camera = AutoCamera(multigrid);
Display(colored, camera);
KeyIn();
// The following two grids are overlapping
grid1 = Construct([0 0], [1 1], [4 4], {1 .. 16});
grid2 = Construct([2 2], [1 1], [4 4], {33 .. 48});
// In this case, the one position of grid1 completely within the
// overlapping region is labeled invalid.
invalid = {0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1};
invalid = Compute("byte($0)", invalid);
invalid = Options(invalid,"dep", "positions");
grid1inv = Replace(invalid, grid1, NULL, "invalid positions");
multigrid = CollectMultiGrid(grid1inv,NULL, grid2);
colored = AutoColor(multigrid);
camera = AutoCamera(multigrid);
Display(colored, camera);
KeyIn();
// In this case, the one position of grid2 completely within the
// overlapping region is labeled invalid.
invalid = {1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0};
invalid = Compute("byte($0)", invalid);
invalid = Options(invalid,"dep", "positions");
grid2inv = Replace(invalid, grid2, NULL, "invalid positions");
multigrid = CollectMultiGrid(grid1,NULL, grid2inv);
colored = AutoColor(multigrid);
camera = AutoCamera(multigrid);
Display(colored, camera);
|