Skip to topic
|
Skip to bottom
Jump:
TModeling
TModeling Web
TModeling Web Home
Changes
Notify
Index
Search
Webs
BioGeometry
Main
TModeling
TWiki
Edit
Attach
Printable
TModeling.Spfinalize
r1.1 - 18 Jun 2008 - 13:32 - Main.guest
topic end
Start of topic |
Skip to actions
*spfinalize* This spatial finalizer makes three passes over a point cloud. In the first pass it merely computes a bounding box. If this bounding box is known in advance this pass can be omitted. In the second pass it creates a "spatial histogram" of the point cloud in the form of a grid of counters, which it uses in the third pass to inject finalization tags into the point stream. The program creates 2D as well as 3D finalizations. I expect it will mostly be used for 2D finalization of large terrain point sets. 2D finalization is the default. You can request 2D with (-terrain, -2d) and 3D with (-space, -3d). Another important flag is (-grid 8, -level 8, -depth 8). It sets the resolution of the finalization grid as a power of two. The default is 6 and that works well for point sets up to, say 10 million. If you have a billion points you should probably set it to 10. If you have a hundred million then 8 or 9 will usually be okay. However, the accuracy does not matter too much. For detailed info: read the code! Some parts may seem rather unreadable because it was optimized for efficient memory use. Memory fields often get re-used for different purposes without that making much sense in terms of variable names. But I tried to add as much documentation as possible to help you understand what is going on. ---------- Example usage: <pre> spfinalize -i ..\data\lidar_band.txt.gz -o ..\data\lidar_band.spb </pre> Finalizes the terrain points stored in a standard ASCII format with a 64 by 64 finalization grid. It also adds the sprinkle points that are useful to destroy long edges when Delaunay triangulating. Look at the different options like this: <pre> spfinalize -i ..\data\lidar_band.txt.gz -ospb | sp_viewer -ispb -every 10 spfinalize -i ..\data\lidar_band.txt.gz -level 4 -ospb | sp_viewer -ispb -every 10 spfinalize -i ..\data\lidar_band.txt.gz -level 8 -ospb | sp_viewer -ispb -every 10 spfinalize -i ..\data\lidar_band.txt.gz -level 8 -nosprinkle -ospb | sp_viewer -ispb -every 10 spfinalize -i ..\data\lidar_band.txt.gz -level 8 -minimum_points 200 -ospb | sp_viewer -ispb -every 10 </pre> The point set is finalized with different grid resolutions, without sprinkle points, and with merging finalization grid children into their parent if their sum of points is below the minimum. Add the -del2 option to see the effects this has on subsequently Delaunay triangulating the points. <pre> spfinalize -i ..\data\lidar_band.txt.gz -ospb | sp_viewer -ispb -every 10 -del2 spfinalize -i ..\data\lidar_band.txt.gz -level 4 -ospb | sp_viewer -ispb -every 10 -del2 spfinalize -i ..\data\lidar_band.txt.gz -level 8 -ospb | sp_viewer -ispb -every 10 -del2 spfinalize -i ..\data\lidar_band.txt.gz -level 8 -nosprinkle -ospb | sp_viewer -ispb -every 10 -del2 spfinalize -i ..\data\lidar_band.txt.gz -level 8 -minimum_points 200 -ospb | sp_viewer -ispb -every 10 -del2 </pre> Let's look at some other data sets: <verbatim> spfinalize -i ..\data\pt0366.txyzar.gz -itxt -parse sxyz -o ..\data\pt0366.spb sp_viewer -i ..\data\pt0366.spb (press <p>) sp_viewer -i ..\data\pt0366.spb -del2 (press <p>) </verbatim> The -itxt tells spfinalize that it should expect to read text. The -parse sxyz tells it to skip the first number and use the next three numbers as x y z coordinate. <pre> spfinalize -i pt.files -itxt -listoffiles -parse sxyz -o ..\data\pt.spb sp_viewer -i ..\data\pt.spb </pre> The -listoffiles tag tells spfinalize that pt.files contains a list of file names. The -itxt tells spfinalize that it should expect to read text. The -parse sxyz tells it to skip the first number and use the next three numbers as x y z coordinate. Now let's create a triangulation: <verbatim> spdelaunay2d -i ..\data\pt.spb -o ..\data\pt.smb sm_viewer -i ..\data\pt.smb (press <p>) </verbatim> Or in pipelined mode: <pre> spfinalize -i pt.files -itxt -list_of_files -parse sxyz -ospb | spdelaunay2d -ispb -o pt.smb </pre> And a longer pipe: <pre> spfinalize -i pt.files -itxt -lof -parse sxyz -ospb | spdelaunay2d -ispb -osmb | sm_viewer -ismb -every 1000 </pre> And much faster (fewer redisplay calls to !OpenGL): <pre> spfinalize -i pt.files -itxt -lof -parse sxyz -ospb | spdelaunay2d -ispb -osmb | sm_viewer -ismb -every 100000 </pre> Finally, let's look at some LIDAR points that are stored in multiple files in LAS format: <pre> sp_viewer -i gilmer.files -ilas -lof </pre> Now let's finalize & triangulate the points and pipe the TIN into a mesh viewer: <pre> spfinalize -i gilmer.files -ilas -lof -ospb | spdelaunay2d -ispb -osmb | sm_viewer -ismb -every 10000 </pre> Now go and try your own data ... ----- Some more info on the command line options: * -parse sxsysz: only used for text files (points.txt or -itxt). Here x y and z are expected to be the 2nd, 4th, and 6th entry of each line. Look into spreader_txt.cpp for some other options that can be specified in the parse string. * -double or -force_double: force the scanning of text file input (such as *.txt or *.node) to produce double-precision points. * -tiles2d 2 2: will tile the specified input to produce a larger point cloud. Try <pre> sp_viewer -i ..\data\lidar_band.txt.gz -tiles2d 3 2 -every 100 spfinalize -i ..\data\lidar_band.txt.gz -tiles2d 3 2 -level 8 -ospb | sp_viewer -ispb -every 100 </pre> * -tiles3d 2 2 2: same in 3D. Try <pre> sp_viewer -i ..\data\spx_z.txt.gz -tiles3d 3 2 2 -every 100 </pre> * -random 100: adds 100 random points per element if the input file (-i) is a streaming triangle mesh (e.g. *.sma *.smb) or a streaming tetrahedral mesh (e.g. *.sva *.svb). * -verbose: more output * -terrain or -2d or -nospace: finalization will be with a 2d grid * <verbatim>-space</verbatim> or <verbatim>-3d</verbatim> or <verbatim>-noterrain</verbatim>: finalization will be with a 3d grid. Try <pre> spfinalize -i ..\data\spx_z.txt.gz -ospb -space -level 4 | sp_viewer -ispb -every 2 spfinalize -i ..\data\spx_z.txt.gz -ospb -space -level 4 | sp_viewer -ispb -every 2 -del3 </pre> * -empty 3: pre-finalizes all completely empty grid cells of all levels down to 3 at the beginning of the stream. * -hist: print out histogram over the cell occupancy to stderr. * -hist_full : print out even more histogram info. For more info: <pre> spfinalize -h </pre>Usage:<pre> spfinalize -i terrain.txt -o terrain_finalized.spb spfinalize -i lidar.txyzar -itxt -parse sxyz -o lidar_finalized.spb spfinalize -i lidar.raw_f -hi lidar.hdr_f -o lidar_finalized.spb spfinalize -i cloud.spa -o cloud_finalized.spa spfinalize -i terrain.spb -o terrain_finalized.spb -terrain spfinalize -i mesh.obj.gz -ispa -o cloud_finalized.spa -level 2 -empty 1 spfinalize -i mesh.ply -o cloud_finalized.spa -preserve spfinalize -i terrain.txt.gz -o terrain_finalized.spb -sprinkle -level 5 -empty 4 spfinalize -h </pre> --------------- If you find bugs let us know. -- Main.JackSnoeyink - 01 Jun 2008
to top
End of topic
Skip to action links
|
Back to top
Edit
|
Attach image or document
|
Printable version
|
Raw text
|
More topic actions
Revisions: | r1.1
|
Total page history
|
Backlinks
You are here:
TModeling
>
Spfinalize
to top
Copyright © 1999-2024 by the contributing authors. All material on this collaboration platform is the property of the contributing authors.
Ideas, requests, problems regarding TWiki?
Send feedback