mariuszhermansdorfer / SandWorm

Augmented Reality Sandbox for Grasshopper & Rhino
MIT License
20 stars 11 forks source link

Change meshing algorithm #2

Closed mariuszhermansdorfer closed 4 years ago

mariuszhermansdorfer commented 5 years ago

Replace the current triangulation method: Mesh.CreateFromTessellation with Mesh.Faces.AddFace as suggested in this discussion thread

mariuszhermansdorfer commented 5 years ago

Adopt the method from this paper: https://gispoint.de/fileadmin/user_upload/paper_gis_open/DLA_2019/537663024.pdf https://github.com/dbt-ethz/docofossor/blob/master/DOCUMENTATION.md

A common layout of points in a DTM is a rectangular grid, where it is sufficient to specify the bottom left corner, cell size and number of columns and rows, followed by a one-dimensional list of z-values (elevation above sea level). To keep the memory footprint low, we adopt this data structure for the exchange between the components. However, most of the modification operations would just as well work on any arbitrary point distribution as only their z-values are affected, and the surface mesh topology does not change. Therefore, Docofossor's data structure is based on a single list that defines a regular spaced quad grid from topographic data. The Docofossor list (df) consist of a header part (dimension list) that defines the properties of the grid such as the cell size, the number of rows and columns, and the coordinates of the local and global origin of the grid. The header information is followed by z-values coming from a Digital Terrain Model (DTM) in column-major order starting bottom left. It is roughly based on the ESRI ASCII raster format (ESRI 2019). All the operations are done consecutively after another, which can be visualized in the end by making a quad-grid mesh (BRep) or 3D points of the cell value data. This has the advantage that the boundary representation only needs to be made once, thus increasing performance. The order of the operations becomes important when using cut and fill operations in sequence, or when operations change the location, cell size, crop or resolution of the grid.

mariuszhermansdorfer commented 4 years ago

Partially implemented in the latest commit. Current meshing algorithm operates on a grid of quad pixels. XY spacing of individual pixels jitters due to Kinect's inaccuracy, which results in a non-orthogonal result.

Should be fixed.

mariuszhermansdorfer commented 4 years ago

Fixed unwanted jittering on the XY axis. Now, the meshing algorithm is much more robust. Arbitrary distance in the XY axis needs to be fixed, though.