Progress Report (6/23/08) by Shawn Brown
This Past Week:
Wrote Initial Framework for spfilter tool/app
- Note: adapted from sp2sp
- SPfilter base class
- uses virtual methods for standard behavior
- derived classes over-ride virtual methods for filtering behavior
- good idea in principle...
- each filter so far has at least one or more gotcha(s) that required writing more code than desired...
- rewrote original sp2sp behaviors as not so simple filters
- Perturb Filter
- Clamp Filter
- Default Filter (read commands in, write commands out)
- Sub-sample filter
Wrote NEW Ottawa Bin Count filter
Note: This is a 2 pass solution
Algorithm
- Initializes spwriter header from spreader's header
- Creates 3D Grid from min/max bounds and cellsizes
- optional, grid lines centered on specified origin point
- Allocates and zeros out grid cells (counts & valid marker)
- total count = W x H x L (IE 100x100x100 = 1 million cells)
- Currently 8 bytes per cell, could be reduced to 4 bytes per cell
- Get Bin Counts (1st Pass thru file)
- Bin each point into correct grid cell
- Increment cell count
- Restart stream
- Note: Had to write a new restart() virtual method for spreader, spreader_spa, spreader_spb
- BUG: counts, bounds not properly preserved by spreadopener::reopen()
- IE compute_stats() followed by reopen() overwrites computed bounds with stored bounds from file.
- Restart() method works as follows
- validates that file is not 'stdin', can't restart that pipe.
- save file handle, counts, bounds away
- call spreader->close(), cleans up reader state, doesn't actually close file handle.
- call seek() to reset file pos at start of file
- call spreader->open() on saved file handle
- restore saved counts, and bounds
- Find largest z-cell in each xy column in grid
- Mark that cell as valid, leave other cells invalid
- Determine whether to write out each point (2nd pass thru file)
- Bin each point into correct grid cell
- if cell is marked as valid, write point out
- otherwise, do nothing (IE drop point)
Misc Issues
- The usual debugging / rewriting until it worked correctly
- Results are good at removing a lot of the distractions
- however, some building sides have aliasing problems
- buildings have noticeable divots along grid cell boundaries
- SMSIMP Compressed files have greatly reduced spike problems
- aliasing artifacts are preserved by simplification.
TModeling Wiki Work...
Note: Based on the book "Code Complete 2.0" by Steve McConnell
- Environment / Tools guide
- Design goals
- Layout guide
- Naming conventions guide
- Comments guide
- Writing Self Documenting code guide
- Improvements to TMV SVN guide
Note: As a result, I realized that I have lots of bad habits myself that need to be worked on (hungarian, ornate comments, etc.)
Answering questions for Christian Stith
- sp_viewer command line params, keyboard short cuts, GUI, menu items
- sm_viewer
- sp2sp command line params
- etc.
Misc
- Received new books
- "Curve and Surface Reconstruction" by Tamal Dey
- "How to think about Algorithms" by Jeff Edmonds
This Week:
- Will check in current spfilter code to SVN
- Will return to working on SP(+AUX) file formats
- Design Decision: will use a byte per command instead of bit per command, will increase file size by up to 7%, but will result in greater flexibility in adding new command types and data structure objects (edges, planes, etc.) for the future.
- Designing towards merged file format that allows points, vertices, triangles, planes, etc. all in one file format
- Start reading my new books (see above)
- Learn more about Cocones, Crust algorithm, and DelPSC by Tamal's group.
- Re-read a few papers from conference that seemed useful
Next Week:
- Probably still be working on SP(+AUX) file formats
--
ShawnDB - 24 Jun 2008
to top