We process large point sets and meshes with
StreamingModules.
The documentation there has lots of example scripts for demos.
This page will include some of the best examples and pictures of step-by-step.
--
JackSnoeyink - 01 Jun 2008
Processing Data
This is a step-by-step demo on implementing the main modules we have developed so far. We will simplify the points, create a mesh, clean up the noise, and calculate shortest paths. Using a smaller file -- i.e., a single tile -- would run much faster on your computer.
A simplified view of the point stream of the 5x5 tile "square":
Noise Reduction
If we convert the file to a mesh right now:
spdelaunay2d -i original_file.spb -osmb | sm_viewer -ismb
the file that comes out is still a little noisy, as you can see below:
So instead we start out by filtering the points, which will reduce a lot of unnecessary noise.
spfilter -i original_file.spb -o filtered_file.spb -ottawa -cellsize 1.0 1.0 1.0 -orig 0.0 0.0 0.0
Running this program will unfinalize the data, so it is necessary to run
spfinalize to refinalize the file.
spfinalize -i filtered_file.spb -o finalized_file.spb
The data is now refinalized. Next we run
spdelaunay2d to create a delaunay triangulation mesh of the filtered and finalized data points.
spdelaunay2d -i finalized_file.spb -o triangulated_file.smb
A view of the filtered mesh we have right now:
To make it even cleaner, we can simplify it using
smsimp. We will use 1% (0.01) of the original data, which we enact with the
-t
parameter:
smsimp -t 0.01 -m 16 -n 10000000 -i triangulated_file.smb -osmb -o simplified_file.smc
(This should take a relatively long time, depending on your computer and the file used)
Now we can view the simplified, filtered mesh:
Shortest Paths
Note: Shortest paths modules are currently not fully functional when working with actual Ottawa data. They will run fine on the mesh file in the ShortestPathsDemo.
To calculate shortest paths, we first need to convert the file back into a usable format:
sm2sm -i compressed_file.smc -o shortpathfile.sma
Now we can calculate the shortest paths, starting by rearranging all the points:
order.exe -i shortpathfile.sma -o reordered_file.sma -s 0 0 0
Next we'll run the file through
fm , which will compute the shortest path gradient for each individual triangle in the mesh:
fm -i reordered_file.sma -o gradient_file.sma -s 0 0 0
As the final step, we run the file through reverse_reader, which will compute the shortest path, and output the path into a file as a string of points. Use the
-s
flag to select your destination point (x y z).
reverse_reader -i gradient_file.sma -o shortest_path.txt -n 200 -s 100 100 100
For more information, visit
ShortestPathsDemo.
CPU Usages
Program | Peak Memory Usage | I/O Read | I/O Write | Time |
sm2sm (smc to sma) | 1.13 MB | 2.00 MB | 30.42 MB | x |
spdelaunay2d | 12.68 MB | 583.29 MB | 1.63 GB | x |
sm_viewer | 154.84 MB | 1.64 GB | N/A | x |
spfinalize | 19.27 MB | 287.22 KB | 140.74 KB | x |
spfilter | 251.40 MB | 1.69 GB | 575.60 MB | x |
sm_viewer(0.01) | 60.64 MB | 3.01 MB | N/A | x |
smsimp(0.01) | 671 MB* | 683 MB* | 2.36 MB | x |
* approximate values
Time is coming soon. I can't use the computer clock and I don't have a watch, so I'll have to get this tomorrow.
Computer Specifications: 32-bit, 2.66 GHz processor, 2 GB of RAM
Original File Specifications: 869.98 MB, "square.spb"
*****************************************************notes******************************************************
And now I have run out of information. Other ideas - have a section that has the whole paragraph combined into just a few command lines, like this:
spfilter -i original_file.spb -o filtered_file.spb -ottawa -cellsize 1.0 1.0 1.0 -orig 0.0 0.0 0.0 | spfinalize -i filtered_file.spb -ospb | spdelaunay2d -ispb -osmb | smsimp -t 0.01 -m 16 -n 10000000 -ismb -osmb | sm2sm -ismb -o finalfile.sma
which gets you all the way to shortest paths. (For some reason that line isn't working... do you see something wrong with it?
shortest paths line would be:
order -i finalfile.sma -osma -s 0 0 0 | fm -isma -osma -s 0 0 0 | reverse_reader -isma -o shortest_path.txt -n 200 -s 100 100 100
And compress the file for ease of use:
sm2sm -i simplified_file.smb -o compressed_file.smc
Program | Peak Memory Usage | I/O Read | I/O Write |
spfilter | 259 MB | 1.7 GB | 573 MB |
spfinalize | 20 MB | 1.13 GB | 573 MB |
spdelaunay2d | 2.97 MB | 44.6 MB | 111.1 MB |
sm_viewer (unsimplified data) | 35.2 MB | 1.64 GB | 116 bytes |
smsimp (0.01)* | 671 MB | 683 MB | 1.64 GB |
to top